简体   繁体   中英

Multiple events for solve_ivp

I currently have the IVP solver working with an event, which looks like this:

sol = solve_ivp(fun3, (0, tend), V, method='LSODA', events= event, args=(r_s,), t_eval=t)

However I want the solver to check two event, not one. So I want something like this:

sol = solve_ivp(fun3, (0, tend), V, method='LSODA', events= (event, event2), args=(r_s,), t_eval=t)

However that doesn't work.

Does anybody know how to check for multiple events?

It works! PyCharm showed a warning, but it actually works

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