get the derivative with ode45

2 visualizaciones (últimos 30 días)
Albert
Albert el 1 de Ag. de 2011
Hello every one! I'm trying to solve a differential equation y' = f(t,y) with MATLAB ode45. Besides the original y, y' is also very useful to me. But I simply don't know how to get it. Is there any convenient method? Or what I can do is just to compute y in many point and use diff? Thank you very much!

Respuestas (1)

Jan
Jan el 1 de Ag. de 2011
ODE45 replies the arrays y(t_i) and t_i. You have defined the function y'=f(t, y). If f is defined such that it accepts vectors as input, getting y' should be trivial:
[t, y] = ode45(@f, ...)
yd = f(t, y)
  1 comentario
Albert
Albert el 2 de Ag. de 2011
Thanks Simon. I need y and y' to compute some functions and even do integral.I'm just afraid that if I ask ode45 to compute y in too many data points it would be very slow and the accuracy of following computations might be poor. If MATLAB can directly support this it'll be cool.

Iniciar sesión para comentar.

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