A bug im simplify in the new Symbolic Toolbox?
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
Star Strider
2017-8-17
If I remember correctly, until 2010, the symbolic math engine was Maple. Beginning in 2010 and for later releases, MuPad is the symbolic engine.
回答(2 个)
Jan
2017-8-18
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 个评论
John BG
2017-8-17
编辑:John BG
2017-8-17
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 个评论
Jan
2017-8-18
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Special Values 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!