A bug im simplify in the new Symbolic Toolbox?
3 views (last 30 days)
Show older comments
Dear developpers Recently I run my codes in my book in the new versions of MATLAB
if true
A=[-7,2,0,-1; 1,-4,2,1; 2,-1,-6,-1; -1,-1,0,-4];
syms t, A1=(expm(A*1j*t)-expm(-A*1j*t))/(2*1j);
A2=(expm(A*1j*t)+expm(-A*1j*t))/2;
simplify(A1), simplify(A2)
end
I found that the results are not the same as the ones in the earlier versions such as R2011a, R2008a, which yield the saame results as funm(A*t,'sin'). Obviously the simplify function in the new Symbolic Math Toolbox did not apply Euler's formula.
2 Comments
Star Strider
on 17 Aug 2017
If I remember correctly, until 2010, the symbolic math engine was Maple. Beginning in 2010 and for later releases, MuPad is the symbolic engine.
Answers (2)
Jan
on 18 Aug 2017
You do not reach "the developers" here, because this is the public forum of all Matlab users. Please use the "Contact Us" link on this page for an official enhancement request of bug report.
0 Comments
John BG
on 17 Aug 2017
Edited: John BG
on 17 Aug 2017
Hi Dingyu Xue
Both expressions are the same
t=[-10:.1:10];
y1=2./((t + 2).^2 + 1).^2 - (2*(2*t + 4).^2)./((t + 2).^2 + 1).^3;
y2=-2*(3*t.^2+12*t+11)./(t.^2+4*t+5).^3;
.
Despite the logical evaluation returns null
isequal(y1,y2)
ans =
logical
0
but it's because of really small decimals discrepancy
when plotting
plot(t,y1,t,y2)
both curves fall right on same place, y1 is same as y2.
MATLAB help for simplify suggests
Simplification of mathematical expression is not a clearly defined subject. There is no universal idea as to which form of an expression is simplest. The form of a mathematical expression that is simplest for one problem might be complicated or even unsuitable for another problem.
Kind of, the function has probably undergone some kind of improvement, the resulting simplification is now split into different fractions, perhaps helping spot poles and zeros, yet the comment clearly remarks that symbolic simplification is not like finding zeros.
if you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance
John BG
1 Comment
Jan
on 18 Aug 2017
The problem concerned the symbolic simplification. Of course both expressions reply the same values except for rounding errors, but the symbolic expressions have changed with the Matlab version. See Star Strider's comment.
See Also
Categories
Find more on Special Values in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!