Speeding up non-stiff models
Default PEtabODEProblem options are tuned for stiff biological ODE models based on [1]. For non-stiff models, the default gradient method is often still a good choice (it mainly depends on the number of estimated parameters), but changing the ODE solver can substantially reduce runtime.
Explicit solvers are typically fastest for non-stiff models since they avoid solving a nonlinear system at each solver step. However, often during parameter estimation the optimizer explores parameter regions where an otherwise non-stiff model becomes stiff [1]. A robust compromise is therefore to use a composite solver that automatically switches between non-stiff and stiff methods, for example:
petab_prob = PEtabODEProblem(model;
odesolver = ODESolver(AutoVern7(Rodas5P())),
)For more details on explicit and composite solvers, see the OrdinaryDiffEq.jl solver documentation.
References
- S. Persson, F. Fröhlich, S. Grein, T. Loman, D. Ognissanti, V. Hasselgren, J. Hasenauer and M. Cvijovic. PEtab. jl: advancing the efficiency and utility of dynamic modelling. Bioinformatics 41, btaf497 (2025).