Python library for rocket engine internal ballistics simulation
Machwave is a Python library for chemical propulsion simulation. The library makes it easy to model solid or biliquid rocket engines, analyse performance and integrate the results into trajectory simulations.
Install Machwave using pip:
pip install machwave
The core install depends only on NumPy and SciPy. It runs a complete solid rocket motor simulation with BATES grains, any of the eight bundled solid propellant formulations and the full Solid Performance Program 1975 nozzle loss set. Those formulations carry pre-computed thermochemical properties, so no thermochemistry solver is needed to burn them.
Everything heavier is an optional extra:
| Extra | Unlocks |
|---|---|
cea | Thermochemistry computed from propellant composition, needed for biliquid engines and for custom solid mixtures |
liquid | Propellant tanks and the injector's homogeneous-equilibrium mass flux |
fmm | Every grain geometry other than BATES, including grains defined by an STL mesh |
plots | The built-in figures and the Monte Carlo plots |
rocketpy | The RocketPy adapter for trajectory simulation |
all | All of the above |
Install one or several by name, for example:
pip install machwave[fmm,plots]
Using a feature without its extra raises an ImportError naming the install command
that provides it.
cea extra: gfortranOnly needed if you install the cea extra, directly or through all.
rocketcea does not publish macOS wheels on
PyPI. On macOS, pip therefore builds rocketcea from source and needs a Fortran
compiler. Homebrew's gcc formula installs only versioned binaries (e.g.
gfortran-15), so an unversioned gfortran symlink must be added to PATH
beforehand:
brew install gcc
ln -sf "$(ls "$(brew --prefix)"/bin/gfortran-* | sort -V | tail -n 1)" "$(brew --prefix)/bin/gfortran"
Linux and Windows users do not need this step — rocketcea ships prebuilt wheels for those platforms.
The full documentation is available at felipebogaertsm.github.io/machwave.
If you're contributing to Machwave, you'll need uv for dependency management.
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
For more details, visit the official uv installation guide.
Clone the repository and install dependencies:
git clone https://github.com/felipebogaertsm/machwave.git
cd machwave
make install-dev
make install-dev installs every extra alongside the development tooling, which is
what the test suite and the type checker need. make install-dev-core installs the
tooling without the extras, the environment make test-core runs against.
Create a release on GitHub with a tag matching vX.Y.Z (e.g. v1.2.0).
The version is derived automatically from the git tag.
The publish workflow builds the package and publishes it to PyPI via trusted publishing (OIDC).
Energy-balance tank stops the run when its state sits on the dew line
https://github.com/felipebogaertsm/machwave/issues/682
Labels: bug
Biliquid burnout time depends on where the step crossing the liquid boundary falls
https://github.com/felipebogaertsm/machwave/issues/680
Labels: bug
CEA frozen specific impulse silently equals the shifting one
https://github.com/felipebogaertsm/machwave/issues/678
Labels: bug
Monte Carlo never samples a tank behind a propellant line
https://github.com/felipebogaertsm/machwave/issues/677
Labels: bug
Sampled tank temperature leaves the saturation pressure stale
https://github.com/felipebogaertsm/machwave/issues/676
Labels: bug
Nozzle loss parameter paths checked before a run
https://github.com/felipebogaertsm/machwave/issues/675
Labels: question, tech-debt
Tank fluid state resolved once per query
https://github.com/felipebogaertsm/machwave/issues/674
Labels: question, tech-debt
One thrust chamber step with a propellant supply strategy
https://github.com/felipebogaertsm/machwave/issues/673
Labels: question, tech-debt
No CONTRIBUTING document was found. Please check the README and open issues.