performance - Would it be more efficient to switch to a different ODE solver? -
warning, i'm not if question belongs on here or math stack exchange. it's question of performance, heavily involves differential equation solver.
anyway, in matlab, using following code syntax solve differential equation:
f0 = [tot;zeros(size-1,1)]; options=odeset('reltol',1e-7, 'abstol', 1e-10); [t,s] = ode15s(@myfunc, [t0,tf], f0, options, k1, k2, k3, n, size, r); %rest of code, including function myfunc now, issue follows: "size" variable needs set numbers on order of 10000 system of differential equations. in addition, i'm using ode15s because reusing code: found it's designed stiff differential equations, , differential equations i'm using have stable gross behavior regardless of step size. right now, takes code on week (close two, in fact) run on processing machine.
so question is: faster me switch nonstiff ode solver ode45 or ode23? googling did on subject gave me that, if equation stiff, faster use stiff differential equation solver.
exactly ode45!
it's because ode45 uses 4th orderrunge-kutta method (which explicit), ode15s uses gear's method (which implicit). that's why if system not stiff better choose ode45.
and ode23 (which bogacki shampine method), sure better ode15s, still choose ode45 matlab suggest way.
Comments
Post a Comment