![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/318781/image.png)
Matlab Symbolic Maths - How to insert ¨y(t) +˙y(t) +y(t)= f(t) equation in symbolic Maths?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sushil
el 18 de Jun. de 2020
Comentada: Ameer Hamza
el 19 de Jun. de 2020
I have the above equation which is y''(t) + y'(t) + y(t) =f(t). How can I find the impulse response of this LTI system using symbolic maths? My main concern is how I can put in derviates using syms keyword. Also after I put in this equation ¨y(t) +˙y(t) +y(t)= f(t), I need to find the Laplace transform for the same.
Thanks in advance.
0 comentarios
Respuesta aceptada
Ameer Hamza
el 19 de Jun. de 2020
Although there are easier ways to solve this equation in MATLAB (e.g., using dsolve()), you mentioned Laplace transform in your question. The following code shows how to use it Laplace, and inverse Laplace transform to find the impulse response.
syms y(t) f(t) Ly
dy = diff(y, 1);
ddy = diff(y, 2);
ic = [0 0]; % initial condition: y(0)=0, y'(0)=0
eq = ddy + dy + y == f; % differential equation
eq_impulse = subs(eq, f(t), dirac(t)); % substitude f(t)=dirac(t) i.e., impulse input
eq_laplace = laplace(eq_impulse); % laplace transform of equation
eq_laplace = subs(eq_laplace, [y(0) dy(0) laplace(y)], [ic Ly]); % substituting initial conditions
Ly = solve(eq_laplace, Ly); % seperating the laplace(y) term
y(t) = ilaplace(Ly); % inverse laplace transform
fplot(y, [0 10]); % plot from t=0 to t=10
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/318781/image.png)
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Symbolic Math Toolbox 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!