matlab - Why is isequaln(f, simplify(f)) false? -
I have a function f
as defined in this form:
Symfun symfun (c + t - (2 * (t - 2 ^ (1/2) * (a * t) ^ (1/2)) * (a - t / 2)) / ( 2 * A, however, check the similarity with the simplified version yield: isequaln (f, simplify (f)) ans = 0
Is not expected to return the exact equivalent
uneven >>
Probably use to test There is no suitable function for equality. sym / isequaln
:
For help with montage (A, B), iff A and B are equally true of NaNs
As the guideline has been given to @ benoit1.1, the documentation is not completely clear, but, as it is numeric equivalent, the function ("the same" Despite the unfortunate use of the term) seems to be a test for simplified functions There is an identity for the unassumed function, but it is not an analogy, according to the documentation, can keep in mind the sym / isequaln
account and possibly simple relations, but it is a change internally and It does not simplify, it is almost certainly because simplification is a computationally expensive process, so it's probably some well-defined (but well documented) tests Was a design decision to join.
Disadvantages
So, how can you move forward? In addition to sym / isequaln
, parallels and inequalities are tested in a more consistent way in the symbolic math toolbox:
syms catf = symfun (c + t - (2 * (T-2 ^ (1/2) * (one * t) ^ (1/2)) * (a - t / 2)) / (2 * a - t), [cat]) g = Simplified However, in R2014b it returns false
and the following warning: Warning: can not be proved 'c + t - ((2 * t - 2 * 2 ^ (1/2) * (a * t) ^ (1/2)) * (a - t / 2)) / (2 * a - t) == c + 2 ^ (1/2) * (A * t) ^ (1/2) '& gt; / Apps / MTB 2014 b.app/toolbox/symbolic/symbolic/symengine.p>-symengine 56 on sym.is always at 38
You should be aware that the symbolic variable is considered to be complex by default And is always
c
, a
try to prove this connection to all possible combinations Is doing T
. Simplification is also a malicious process - From the documentation:
The simplicity of mathematical expression is not a clearly defined subject, there is no universal idea because any form of expression is simple. The form of a mathematical expression which is the simplest of a problem can be complex or may be unsuitable for another problem.
If you look closely at your basic equation, you will see that a uniqueity has been removed in R2014b in g (1,1,2)
Returns the value of 3
, but evaluates f (1,1,2)
:
in the muppad command Error: Error using Mupdammex: Zero Division [_power] Evaluation: _symans_32_15992 ... Use of assumptions If you know something about your symbolic variable, then avoid this by applying the assumptions , For example
symfun symfun (c + t - (2 * (t - 2 ^ (1/2) * (a * t) ^ (1/2)) * (A - T / 2)) / (2 * a - t), [cat]) g = simplify (f) value (t & 2; a2) elawe (f == g)
Which now returns true
, by using the example of Benoit 1, sys ab; Always returns directly true
((a + b) ^ 2 = a ^ 2 + 2 * a * b + b ^ 2)
.
Comments
Post a Comment