ODE45 speed up and for loops

I have a coupled first order ODE to solve of the form

dy = f(t, x)
dx = d(f, x)

which depend on a common parameter which I have to solve for over some range. I can solve the system using ODE45 and a for loops which increments the parameter of interest at each loop, however, this is very slow. Can I avoid solving this problem in loops? Or what is best practice with problems of this type.


Wanted to post a comment but I can't until I get 50 reputation. What do you need to solve the parameter in each range? Can't you create a function for solving the parameter and put the function handle in the second argument for ode45?

Need Your Help

Open new window when you click play in jwplayer 5

javascript html jwplayer

Old example is megavideo.com.....when you click play button once, it will open a new window to a sponsor site. then it will play the video.

Pedantic gcc warning: type qualifiers on function return type

c++ const gcc-warning

When I compiled my C++ code with GCC 4.3 for the first time, (after having compiled it successfully with no warnings on 4.1, 4.0, 3.4 with the -Wall -Wextra options) I suddenly got a bunch of error...