Borrar filtros
Borrar filtros

how to take the derivative for the retained value from ode45?

2 visualizaciones (últimos 30 días)
Nawal
Nawal el 31 de Jul. de 2013
I'm using the ode45 to find the velocity, now I need to find the acceleration how can I take the derivative of the retained value.
My ode45 is:
[ts,xs]= ode45(@my_function,[0,10],[5,0])
Thanks in advance!

Respuestas (2)

Walter Roberson
Walter Roberson el 31 de Jul. de 2013
gradient(xs(1,:), ts(:))
  6 comentarios
Richard Brown
Richard Brown el 1 de Ag. de 2013
I stand corrected, good to know!
Jan
Jan el 1 de Ag. de 2013
gradient uses a first order method when the spacing is not equidistant. You can use the faster method FEX: DGradient and some other equivalent tools from the FEX, which apply a 2nd order method to get more accurate results for the derivatives.

Iniciar sesión para comentar.


Nawal
Nawal el 1 de Ag. de 2013
Can I do something like
diff [ts,xs]

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by