{ } Raw JSON

bundles / scipy 1.18.0 / scipy / integrate / _ivp / rk / rk_step

function

scipy.integrate._ivp.rk:rk_step

source: /scipy/integrate/_ivp/rk.py:14

Signature

def rk_step(fun, t, y, f, h, A, B, C, K)

Summary

Perform a single Runge-Kutta step.

Extended Summary

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 [1].

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).

Aliases

  • scipy.integrate._ivp.rk.rk_step