why cannot I get the figure by ezplot?
古いコメントを表示
Dear all,
I wrote a program to plot the inverse laplace transform of a function wks, matlab can calculate it fast. But it is always busy and cannot give me the figure. Please help me with the problem! Thank you very much! The following is my code.
syms s
expositive=(s+sqrt(s^2+1))^2;
exnegative=1/expositive;
zt=1/(2*s); z2=1/(2*s);
n2=(zt-z2*(expositive-exnegative)/2)/(zt+z2*(expositive-exnegative)/2);
wks=2*(1-exnegative)/(expositive-exnegative)*(exnegative^4+n2*exnegative^5)/(1+n2*exnegative^10);
wkt=ilaplace(sym('wks'));
display('calculation finished')
ezplot(wkt,[0,100])
回答 (2 件)
Walter Roberson
2012 年 1 月 26 日
wkt = ilaplace(wks);
Otherwise the calculated wks value from the previous expression will not be used.
3 件のコメント
Shuang
2012 年 1 月 26 日
Walter Roberson
2012 年 1 月 26 日
"Error in inline expression" is not very specific unfortunately.
When I ask Maple to ilaplace wks, it complains of a division by 0. The reason for that is not clear to me. It could be, though, that your expression is running in to the equivalent of that division by 0.
Your wks has a lot of sqrt(s^2+1) and thus is not a polynomial or rational function of polynomials. Maple only promises to be able to do the transform for polynomials or rational functions of polynomials, but does know some other selected cases as well. It appears that it is not able to handle your situation.
Shuang
2012 年 1 月 26 日
Shuang
2012 年 1 月 26 日
0 投票
1 件のコメント
Walter Roberson
2012 年 1 月 26 日
I confirm that the simplification is valid.
I do not know why the message about cell elements is produced.
As an experiment try
wtknF = matlabFunction(vpa(wkt));
t = linspace(0,100,250); %250 is number of points you want
plot(t, wtknF(t))
カテゴリ
ヘルプ センター および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!