WrappedScipyRungeKutta¶
- class probnum.diffeq.WrappedScipyRungeKutta(solver)[source]¶
Bases:
probnum.diffeq.ODESolver
Wrapper for Runge-Kutta methods from Scipy, implements the stepfunction and dense output.
Methods Summary
Compute the interpolant after each step.
Return t0 and y0 (for the solver, which might be different to ivp.y0) and initialize the solver.
method_callback
(time, current_guess, …)Call dense output after each step and store the interpolants.
postprocess
(odesol)Process the ODESolution object before returning.
rvlist_to_odesol
(times, rvs)Create a ScipyODESolution object which is a subclass of diffeq.ODESolution.
solution_generator
(steprule)Generate ODE solver steps.
solve
(steprule)Solve an IVP.
step
(start, stop, current, **kwargs)Perform one ODE-step from start to stop and set variables to the corresponding values.
Methods Documentation
- dense_output()[source]¶
Compute the interpolant after each step.
- Returns
sol – Interpolant between the last and current location.
- Return type
rk.RkDenseOutput
- initialise()[source]¶
Return t0 and y0 (for the solver, which might be different to ivp.y0) and initialize the solver. Reset the solver when solving the ODE multiple times, i.e. explicitly setting y_old, t, y and f to the respective initial values, otherwise those are wrong when running the solver twice.
- Returns
self.ivp.t0 (float) – initial time point
self.ivp.initrv (randvars.RandomVariable) – initial random variable
- method_callback(time, current_guess, current_error)[source]¶
Call dense output after each step and store the interpolants.
- postprocess(odesol)¶
Process the ODESolution object before returning.
- rvlist_to_odesol(times, rvs)[source]¶
Create a ScipyODESolution object which is a subclass of diffeq.ODESolution.
- solution_generator(steprule)¶
Generate ODE solver steps.
- solve(steprule)¶
Solve an IVP.
- Parameters
steprule (
StepRule
) – Step-size selection rule, e.g. constant steps or adaptive steps.
- step(start, stop, current, **kwargs)[source]¶
Perform one ODE-step from start to stop and set variables to the corresponding values.
To specify start and stop directly, rk_step() and not _step_impl() is used.
- Parameters
- Returns
random_var (randvars.RandomVariable) – Estimated states of the discrete-time solution.
error_estimation (float) – estimated error after having performed the step.