A bug im simplify in the new Symbolic Toolbox?

2 views (last 30 days)
Dingyu Xue
Dingyu Xue on 17 Aug 2017
Commented: Jan on 18 Aug 2017
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
Dingyu Xue
Dingyu Xue on 17 Aug 2017
Also, another problem in simplify function, the new result is not the same as in the R2008a version, which are simpler
if true
syms t; f=t^2*exp(-2*t)*sin(t+pi); F=simplify(laplace(f))
end
In 2008a, the simplified result is -2*(3*s^2+12*s+11)/(s^2+4*s+5)^3
Star Strider
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.

Sign in to comment.

Answers (2)

Jan
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.

John BG
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
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.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!