简体   繁体   中英

How to control the maximum number of iterations in scipy's solve_ivp?

I am wondering how I can limit the number of iterations that solve_ivp takes for an integration step or set a minimum step size. I am running a calibration and I want to prevent the solver from taking very long if my parameters lead to a system where integration is difficult.

There is as min_step argument but this only applies to the LSODA solver and I am using BDF (since my system is stiff). For the old odeint I could also choose a maximum number of integration steps, but that does not seem to exist in solve_ivp . Does anyone know how the solver actually decides when to interrupt the integration because it is not successful?

Have you tried the parameter

rtol, atol : float and array_like, optional

I assume setting a larger tolerance might also speed up the process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM