Classical Runge-Kutta 4th Order Integration

I’ve been using the “rk4” solver, with luck, to solve the system of ODE’s translated from Stella. The original authors of the translation script used this setting, though I’m not entirely sure what it does. Is this the same type of solver that Stella uses? Looking back at the doc, I have flashbacks to my undergrad differential equations course (which was admittedly my favorite math class I ever took). It is a fixed step solver “with less overhead and less functionality (e.g. no interpolation and no events),” i.e. seemingly exactly what I want (deSolve vignette). It is also actually its own function, meaning it can be used outside of ode(), so I’m not sure what the advantage is to calling it within the ODE function.

In any case, using the dede() function with lsoda hasn’t been working out for me, even without any lag. I just wanted to run it to see if it would run, and it’s not producing anything. Now, I’m going to try running ode() w/lsoda (or the default solver) to see if the solver is indeed the problem.

I’m also curious about changing the model to “a compiled function in a dynamically loaded shared library” to potentially speed things up (rk4 section in deSolve vignette). First, perhaps, though, I’ll look around to get to know the model better and simplify it as I see fit.

Leave a Reply

Your email address will not be published. Required fields are marked *