Get the derivative with MATLAB ode45

  • MATLAB
  • Thread starter albertshx
  • Start date
  • #1
13
0
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!
 

Answers and Replies

  • #2
479
32
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.
 
  • #3
13
0
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.
 

Related Threads on Get the derivative with MATLAB ode45

  • Last Post
Replies
4
Views
6K
  • Last Post
Replies
7
Views
6K
Replies
0
Views
5K
  • Last Post
Replies
1
Views
3K
Replies
4
Views
6K
  • Last Post
Replies
4
Views
7K
  • Last Post
Replies
0
Views
2K
Replies
0
Views
2K
Replies
0
Views
3K
Top