pymgipsim.ODESolvers.ode_solvers.rk4_single_step¶
- rk4_single_step(f, h, initial, time, parameters, inputs)[source]¶
Performs a single step of the Runge-Kutta 4th order (RK4) method for solving ordinary differential equations.
Parameters: - f: callable
Function representing the ODE system. Should take (state, time, parameters, inputs) as arguments.
- h: float
Step size for the RK4 method.
- initial: np.ndarray
Initial state vector of the system.
- time: float
Current time.
- parameters: tuple or dict
Parameters needed for the ODE system.
- inputs: tuple or dict
External inputs to the ODE system.
Returns: - np.ndarray
Updated state vector after a single RK4 step.