core.equations¶
machwave.core.equations
¶
This module groups pure functions that return the right-hand side of differential equations (DEs) used throughout Machwave.
They are intentionally stateless and side-effect-free so that any numerical integrator (RK4, RK45, implicit Euler, JAX-based solvers, etc.) can consume them without modification.
Variable names may not be according to PEP8, since the common notation in academic literature is preferred for readability.
compute_chamber_pressure_mass_balance_lre(P0, R, T0, V0, At, k, m_dot_ox, m_dot_fuel)
¶
Calculates the chamber pressure by solving the mass balance equation for liquid rocket engines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
P0
|
float
|
Chamber pressure [Pa]. |
required |
R
|
float
|
Gas constant per molecular weight [J/(kg·K)]. |
required |
T0
|
float
|
Flame temperature [K]. |
required |
V0
|
float
|
Chamber free volume [m^3]. |
required |
At
|
float
|
Nozzle throat area [m^2]. |
required |
k
|
float
|
Isentropic exponent of the mix. |
required |
m_dot_ox
|
float
|
Instantaneous oxidizer mass flow rate [kg/s]. |
required |
m_dot_fuel
|
float
|
Instantaneous fuel mass flow rate [kg/s]. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Derivative of chamber pressure with respect to time. |
Source code in machwave/core/equations/lre_mass_balance.py
compute_chamber_pressure_mass_balance_srm(P0, Pe, Ab, V0, At, pp, k, R, T0, r, Cd=1.0)
¶
Calculates the chamber pressure by solving Hans Seidel's differential equation.
This differential equation was presented in Seidel's paper named "Transient Chamber Pressure and Thrust in Solid Rocket Motors", published in March, 1965.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
P0
|
float
|
Chamber pressure [Pa]. |
required |
Pe
|
float
|
External pressure [Pa]. |
required |
Ab
|
float
|
Burn area [m^2]. |
required |
V0
|
float
|
Chamber free volume [m^3]. |
required |
At
|
float
|
Nozzle throat area [m^2]. |
required |
pp
|
float
|
Propellant density [kg/m^3]. |
required |
k
|
float
|
Isentropic exponent of the mix. |
required |
R
|
float
|
Gas constant per molecular weight [J/(kg·K)]. |
required |
T0
|
float
|
Flame temperature [K]. |
required |
r
|
float
|
Propellant burn rate [m/s]. |
required |
Cd
|
float
|
Discharge coefficient, default is 1.0. |
1.0
|
Returns:
| Type | Description |
|---|---|
tuple[float]
|
Derivative of chamber pressure with respect to time. |
Source code in machwave/core/equations/srm_mass_balance.py
compute_point_mass_trajectory(y, v, T, D, M, g)
¶
Returns the derivatives of elevation and velocity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y
|
float
|
Instant elevation [m]. |
required |
v
|
float
|
Instant velocity [m/s]. |
required |
T
|
float
|
Instant thrust [N]. |
required |
D
|
float
|
Instant drag constant (Cd * A * rho / 2) [kg/m]. |
required |
M
|
float
|
Instant total mass [kg]. |
required |
g
|
float
|
Instant acceleration of gravity [m/s^2]. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Derivatives of elevation and velocity. |