scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersReturns
rk_step(fun, t, y, f, h, A, B, C, K)

This function computes a prediction of an explicit Runge-Kutta method and also estimates the error of a less accurate method.

Notation for Butcher tableau is as in .

Parameters

fun : callable

Right-hand side of the system.

t : float

Current time.

y : ndarray, shape (n,)

Current state.

f : ndarray, shape (n,)

Current value of the derivative, i.e., fun(x, y) .

h : float

Step to use.

A : ndarray, shape (n_stages, n_stages)

Coefficients for combining previous RK stages to compute the next stage. For explicit methods the coefficients at and above the main diagonal are zeros.

B : ndarray, shape (n_stages,)

Coefficients for combining RK stages for computing the final prediction.

C : ndarray, shape (n_stages,)

Coefficients for incrementing time for consecutive RK stages. The value for the first stage is always zero.

K : ndarray, shape (n_stages + 1, n)

Storage array for putting RK stages here. Stages are stored in rows. The last row is a linear combination of the previous rows with coefficients

Returns

y_new : ndarray, shape (n,)

Solution at t + h computed with a higher accuracy.

f_new : ndarray, shape (n,)

Derivative fun(t + h, y_new) .

Perform a single Runge-Kutta step.

Examples

See :

Local connectivity graph

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


GitHub : /scipy/integrate/_ivp/rk.py#14
type: <class 'function'>
Commit: