core.solvers¶
Numerical ODE solvers used by the simulation engine.
Provides a classical 4th-order Runge-Kutta integrator (rk4th_ode_solver) that advances the internal ballistics state at each time step. Accepts a generic equation callable and a dictionary of state variables, returning updated values after one step of size d_t.
Only the entries in the state-variable dictionary are advanced through the four stages; any other keyword arguments are held constant for the whole step. A source term that depends on an integrated variable (such as the pressure-dependent chamber inflow) must therefore be supplied through the equation callable — for example, as a callable evaluated at each stage pressure — rather than as a precomputed constant.
machwave.core.solvers
¶
Numerical methods for differential equations, optimization, and similar.
rk4th_ode_solver(variables, equation, d_t, **kwargs)
¶
Advance a system of ODEs by one step using the 4th-order Runge-Kutta method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
variables
|
dict[str, float]
|
Mapping of variable name to current value. |
required |
equation
|
Callable
|
Callable returning the derivatives of the variables. |
required |
d_t
|
float
|
Time step [s]. |
required |
**kwargs
|
Any
|
Additional keyword arguments forwarded to |
{}
|
Returns:
| Type | Description |
|---|---|
float
|
Tuple containing the new values of the variables followed by the |
...
|
averaged auxiliary term; length equals |