Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB Get the derivative with MATLAB ode45

  1. Jul 30, 2011 #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 to do this? Or what I can do is just to compute y in many point and use diff? Thank you very much!
  2. jcsd
  3. Aug 1, 2011 #2
    Well, you do have the function for y' already. You define it to use with MATLAB's ode45. You could just plug in values for t and y. You could also use the diff command to get your specific y' from y, but that somehow seems like a waste to do the integration and then differentiate again.
  4. Aug 1, 2011 #3
    Thanks and I get your idea. For I need to do integral with y, I'm concerned that whether computing y in many data points would slow down the computation.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook