Laplace Inverse Transform Error
조회 수: 5 (최근 30일)
이전 댓글 표시
In a script I've got this code:
syms s t
X1 = 1/s;
syms K p Kp taud taui
num = (Kp*K*taud)*(s^2 + s/taud + 1/(taud*taui));
den =s^2 *(s+p) + K*Kp*taud * (s^2 + s/taud+ 1/(taud*taui));
H = num/den;
Y1 = H* X1;
yaux=ilaplace(Y1);
y = matlabFunction(yaux);
It returned an error in the last line that I couldn't solve. When I use a H system less complex it works, but with this H the error it returns is the following:
Error using symengine
Code generation failed due to unexpected object of type 'RootOf'.
Error in sym/matlabFunction>mup2mat (line 404)
res = mupadmex('symobj::generateMATLAB',r.s,ano,spa,0);
Error in sym/matlabFunction>mup2matcell (line 374)
r = mup2mat(c{1},true,sparseMat);
Error in sym/matlabFunction (line 188)
body = mup2matcell(funs, opts.Sparse);
Error in Untitled (line 285)
y = matlabFunction(yaux);
Please, Could someone give me a hand?
I used matlabFunction() because I need to plot the y(t) funtion and without using it, it doesn't work.
댓글 수: 2
Asvin Kumar
2020년 4월 29일
I am unsure of the exact cause of your error but I might be able to provide an alternate approach. Try using subs to substitute the values of all constants in 'yaux' and then plotting it using fplot, fsurf or other related functions.
채택된 답변
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!