runge_kutta
rk45_step(f: Callable[[jnp.ndarray, jnp.ndarray, Any], jnp.ndarray], t: jnp.ndarray, y: jnp.ndarray, h: float, *args: Any) -> jnp.ndarray
¶
Perform a single RK45 (Runge-Kutta-Fehlberg) integration step.
This implements the classic Dorman-Prince coefficients for an explicit 4(5) method, returning the fourth-order estimate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
Callable[[ndarray, ndarray, Any], ndarray]
|
ODE right-hand side; signature f(t, y, *args) -> dy/dt. |
required |
t
|
ndarray
|
Current time. |
required |
y
|
ndarray
|
Current state vector. |
required |
h
|
float
|
Step size. |
required |
*args
|
Any
|
Additional arguments passed to |
()
|
Returns:
| Type | Description |
|---|---|
ndarray
|
jnp.ndarray: Next state estimate at t + h. |
Source code in openscvx/integrators/runge_kutta.py
solve_ivp_rk45(f: Callable[[jnp.ndarray, jnp.ndarray, Any], jnp.ndarray], tau_final: float, y_0: jnp.ndarray, args: tuple, tau_0: float = 0.0, num_substeps: int = 50, is_not_compiled: bool = False) -> jnp.ndarray
¶
Solve an initial-value ODE problem using fixed-step RK45 integration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
Callable[[ndarray, ndarray, Any], ndarray]
|
ODE right-hand side; signature f(t, y, *args) -> dy/dt. |
required |
tau_final
|
float
|
Final integration time. |
required |
y_0
|
ndarray
|
Initial state at tau_0. |
required |
args
|
tuple
|
Extra arguments to pass to |
required |
tau_0
|
float
|
Initial time. Defaults to 0.0. |
0.0
|
num_substeps
|
int
|
Number of output time points. Defaults to 50. |
50
|
is_not_compiled
|
bool
|
If True, use Python loop instead of
JAX |
False
|
Returns:
| Type | Description |
|---|---|
ndarray
|
jnp.ndarray: Array of shape (num_substeps, state_dim) with solution at each time. |