Proper rational check with symbols
조회 수: 2 (최근 30일)
이전 댓글 표시
How can I check whether a rational is proper or not? 'isproper' does not work when the expression has symbols too.
댓글 수: 0
답변 (2개)
madhan ravi
2018년 11월 2일
syms x
assume(x,'real')
q= x/(x+1)
[n,d]=numden(q)
if subs(n,x,10)<subs(d,x,10) %substitute any number for symbolic variable to use logical condition
disp('proper fraction')
else
disp('not proper buddy')
end
댓글 수: 0
John D'Errico
2018년 11월 2일
Hard to say, because your question is not at all clear.
A proper fraction is one that is less than 1 in absolute value. Thus the numerator is less than the denominator in terms of absolute value.
But a symbolic parameter (until you resolve it into an actual number) has no value. That is, is the symbolic expression represented by y a proper fraction?
syms x
y = x - 1
You can't say a thing. The value of y depends completely upon x.
Of course, in some circumstances, you could prove that a number is less than 1.
y = 1/(x^2 + 1.5)
If x is ANY real number at all, then y is ALWAYS less than 1. But there is a caveat. What if x is complex? That is, suppose we could have x=sqrt(-1)? Then clearly, x is not a proper fraction, because y would be 2 in that case.
In general, if an expression has symbols in it, so there are parameters in the expression which are not resolved into a numeric value, then there will be regions where the expression represents a proper fraction, or not. If you have multiple unknown parameters, then those domains may be quite complex, or there may be infinitely many such domains. For example, suppose you have the expression
y = sin(x) + 0.5
There are infinitely many subdomains where y is a proper fraction.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!