I would like to integrate a vector ODE in python with fixed time-step (and also a fixed amount of fuction-evaluations per time step). As far as I know this is not possible with scipy.odeint (when I put hmin=x=hmax, it still does more evaluations at certain times). How can I do this?
Asked
Active
Viewed 981 times
0
-
`odeint` uses an implicit method (or multiple by situation?). The step update is only implicitly given what may require multiple passes of the corrector step. Another source of additional function evaluations could be that periodically an approximation to the Jacobian is computed to solve the step update with a simplified Newton method. An implementation of fixed-step RK4 you can find in https://stackoverflow.com/a/29386582/3088138 and surely many other posts. Note that it is not very memory efficient, arrays are almost always treated as immutable and overwritten with newly allocated objects. – Lutz Lehmann Oct 24 '18 at 18:02
-
thanks for the clarification! – Wouter Devos Oct 25 '18 at 13:14
-
Please elaborate on the aims of your demands. With the automatic step size adaptation in all the solvers, they only take as much function evaluations as necessary to get into the range of the error tolerances. The demanded values are interpolated if necessary. – Lutz Lehmann Oct 25 '18 at 13:21