I need help plotting this inverse Laplace Transform
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Caleb Truscott
el 12 de En. de 2022
Editada: Caleb Truscott
el 13 de En. de 2022
I am trying to plot an inverse Laplace transform of a function but I keep getting the error "Error using plot. Data must be numeric, datetime, duration or an array convertible to double."
Below is my code:
m=1;
c=6;
k=6;
G = 100.*65.*9.81;
syms s pi t
f1=(1/((s^2+4*pi^2)*(m*s^2+c*s+k))); %first term
pf1=partfrac(f1,s);
f2=(1/(3*(s^2+(6*pi)^2)*(m*s^2+c*s+k))); %second term
pf2=partfrac(f2,s);
f3=(1/(5*(s^2+(10*pi)^2)*(m*s^2+c*s+k))); %third term
pf3=partfrac(f3,s);
f4=(1/(7*(s^2+(14*pi)^2)*(m*s^2+c*s+k))); %fourth term
pf4=partfrac(f4,s);
LF1=ilaplace(f1) %inverse laplace transform of first term
LF2=ilaplace(f2) %inverse laplace transform of second term
LF3=ilaplace(f3) %inverse laplace transform of third term
LF4=ilaplace(f4) %inverse laplace transform of fourth term
t = [0;0.1;10];
Xss = LF1 - LF2 + LF3 - LF4;
plot(t,Xss)
3 comentarios
Caleb Truscott
el 12 de En. de 2022
Editada: Caleb Truscott
el 12 de En. de 2022
Respuesta aceptada
Paul
el 12 de En. de 2022
Replace all instances of pi with Pi, defined as
Pi = sym(pi);
which is a good habit to get into regardless.
Then you can stay in the sym world if you want and use fplot()
fplot(Xss,[0 10])
1 comentario
Caleb Truscott
el 13 de En. de 2022
Editada: Caleb Truscott
el 13 de En. de 2022
Más respuestas (0)
Ver también
Categorías
Más información sobre Assumptions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!