get the derivative with ode45

조회 수: 2 (최근 30일)
Albert
Albert 2011년 8월 1일
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!

답변 (1개)

Jan
Jan 2011년 8월 1일
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
Albert
Albert 2011년 8월 2일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by