Borrar filtros
Borrar filtros

How to print the solution of ODE solved by using dsolve along with a plot.

3 visualizaciones (últimos 30 días)
Madhav
Madhav el 8 de Sept. de 2022
Editada: Torsten el 8 de Sept. de 2022
Use "subs" to substitute values for c,m,k,x0 and v0. Then you will be able to plot.
If you have problems, consult the dsolve documentation.
syms x(t) c m k x0 v0
Dx = diff(x);
ode = diff(x,t,2) == (-c/m)*diff(x,t)+(-k/m)*x;
initialcond1 = x(0) == x0;
initialcond2 = Dx(0) == v0;
conditions = [initialcond1 initialcond2];
xSol(t) = dsolve(ode,conditions);
xSol = simplify(xSol)
xSol(t) = 

Respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by