pub fn lsoda_method<F, Func>(
f: Func,
t_span: [F; 2],
y0: Array1<F>,
opts: ODEOptions<F>,
) -> IntegrateResult<ODEResult<F>>Expand description
Solve ODE using LSODA method (Livermore Solver for Ordinary Differential Equations with Automatic method switching)
LSODA automatically switches between Adams methods (non-stiff) and Bdf methods (stiff) based on the detected stiffness of the problem during integration. This makes it especially suitable for problems that change character during the integration process.
§Features
This implementation includes:
- Automatic stiffness detection and method switching
- Variable-order Adams methods (1-12) for non-stiff regions
- Variable-order Bdf methods (1-5) for stiff regions
- Adaptive step size control based on error estimation
- Jacobian approximation via finite differences
§Method Details
- For non-stiff regions: Uses Adams-Moulton predictor-corrector methods (orders 1-12)
- For stiff regions: Uses Backward Differentiation Formula (Bdf) methods (orders 1-5)
- Automatic switching based on step size efficiency and convergence behavior
- Comprehensive error control with relative and absolute tolerance
§Usage Tips
- Increasing
rtolandatolcan improve performance for less demanding accuracy - For problems known to be stiff, consider specifying a larger initial step size
- The solver automatically detects when to switch methods, but benefits from good initial settings