Another Bug in Matlab 2018b: iLaplace cannot compute a valid system

3 vues (au cours des 30 derniers jours)
S H
S H le 6 Fév 2019
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)))

Réponses (1)

Raghav Singhal
Raghav Singhal le 21 Fév 2019
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

Community Treasure Hunt

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

Start Hunting!

Translated by