Number of equations.
Current status of the solver: 'running', 'finished' or 'failed'.
Boundary time.
Integration direction: +1 or -1.
Current time.
Current state.
Previous time. None if no steps were made yet.
Size of the last successful step. None if no steps were made yet.
Number of the system's rhs evaluations.
Number of the Jacobian evaluations.
Number of LU decompositions.
In order to implement a new solver you need to follow the guidelines:
A constructor must accept parameters presented in the base class (listed below) along with any other parameters specific to a solver.
A constructor must accept arbitrary extraneous arguments
**extraneous
, but warn that these arguments are irrelevant usingcommon.warn_extraneous
function. Do not pass these arguments to the base class.A solver must implement a private method
:None:None:`_step_impl(self)`
which propagates a solver one step further. It must return tuple(success, message)
, wheresuccess
is a boolean indicating whether a step was successful, andmessage
is a string containing description of a failure if a step failed or None otherwise.A solver must implement a private method
:None:None:`_dense_output_impl(self)`
, which returns aDenseOutput
object covering the last successful step.A solver must have attributes listed below in Attributes section. Note that
t_old
andstep_size
are updated automatically.Use
:None:None:`fun(self, t, y)`
method for the system rhs evaluation, this way the number of function evaluations (:None:None:`nfev`
) will be tracked automatically.For convenience, a base class provides
:None:None:`fun_single(self, t, y)`
and:None:None:`fun_vectorized(self, t, y)`
for evaluating the rhs in non-vectorized and vectorized fashions respectively (regardless of how:None:None:`fun`
from the constructor is implemented). These calls don't increment:None:None:`nfev`
.If a solver uses a Jacobian matrix and LU decompositions, it should track the number of Jacobian evaluations (
:None:None:`njev`
) and the number of LU decompositions (:None:None:`nlu`
).By convention, the function evaluations used to compute a finite difference approximation of the Jacobian should not be counted in
:None:None:`nfev`
, thus use:None:None:`fun_single(self, t, y)`
or:None:None:`fun_vectorized(self, t, y)`
when computing a finite difference approximation of the Jacobian.
Right-hand side of the system. The calling signature is fun(t, y)
. Here t
is a scalar and there are two options for ndarray y
. It can either have shape (n,), then fun
must return array_like with shape (n,). Or, alternatively, it can have shape (n, n_points), then fun
must return array_like with shape (n, n_points) (each column corresponds to a single column in y
). The choice between the two options is determined by :None:None:`vectorized`
argument (see below).
Initial time.
Initial state.
Boundary time --- the integration won't continue beyond it. It also determines the direction of the integration.
Whether :None:None:`fun`
is implemented in a vectorized fashion.
Whether integration in a complex domain should be supported. Generally determined by a derived solver class capabilities. Default is False.
Base class for ODE solvers.
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.integrate._ivp.ivp.solve_ivp
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them