pymgipsim.ODESolvers.ode_solvers.euler_single_step

euler_single_step(f, h, initial, time, parameters, inputs)[source]

Performs a single step of the Euler 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 Euler step.