Another Bug in Matlab 2018b: iLaplace cannot compute a valid system
显示 更早的评论
The following line of codes show that the system ys and the input xs are valid and the lsimplot shows the output response properly. Why the ilaplace in the last plot doesn't work and generates junk results?
syms s t
time=linspace(0,4e-09,201).';
xs=(0.5/s)*(1-exp(-5e-10*s))/(1+exp(-5e-10*s));
xt=double(subs(ilaplace(xs,s,t),t,time));
ys=(1.3e12*s^3+2.5e28*s^2+2.3e41*s+5.3e53)/(s^4+4e16*s^3+4.1e29*s^2+1.3e42*s+1.2e54);
[num,den]=numden(ys);
figure
lsimplot(tf(sym2poly(num),sym2poly(den)),xt,time)
figure
plot(time,double(subs(ilaplace(xs*ys,s,t),t,time)))
回答(1 个)
Raghav Singhal
2019-2-21
0 个投票
In the last line of your code, when you try to convert the data into type “double”, it returns an error because you are trying to convert a symbolic data where your symbolic function variable ‘s’ is not defined.
Since the ‘ilaplace’ function takes in 's' as an argument (where s is a symbolic variable), the output of the ‘subs()’ function is still a symbolic matrix. So, it is not possible to convert it to a double
You can try to avoid the use of symbolic data type as a workaround to this issue
类别
在 帮助中心 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!