简体   繁体   中英

What is events for in solve_ivp in scipy

I'm trying to understand what the events parameter is doing in solve_ivp and what this function that takes in time and another function as its parameters.

Also, would there be any changes in the number and size of the internal steps at those times when the function is 0?

An event is the combination of a location and an action at that location. The location in most cases can be specified as the root of a function of time and state.

The events parameter gets a list of root functions (or just the root function if there is only one). In the time loop of the solver, it is checked if there is a sign change in any of the root functions and then the apparent root is refined using the "dense output" interpolation of the stepper method.

The default action is to register the roots found in the t_events and y_events fields of the output object. Per decoration the action can be modified to terminate . There is no provision for other actions, such as state or parameter changes.

No internal nodes and steps get modified, in the case of the terminate action the event location is appended as final node to the standard output fields t,y .

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