A compiler-based framework for computational physics — describe it once, simulate it anywhere.
MechanicsDSL is a domain-specific language and compiler for physical systems. You write a Lagrangian or Hamiltonian in a LaTeX-inspired syntax; the symbolic engine (built on SymPy) derives the equations of motion automatically, and the compiler generates simulation code in your choice of thirteen target languages.
The project is developed and maintained by Noah Parsons.
| Repository | Description |
|---|---|
| mechanicsdsl | Core DSL compiler, symbolic engine, eight physics domains, thirteen code generation backends, JAX/GPU support, LSP server, Jupyter magic commands, FastAPI server. |
| Repository | Description |
|---|---|
| mechanicsdsl-embedded | Embedded and edge deployment for Arduino, Raspberry Pi, and ARM platforms. Pendulum and double pendulum examples, ARM cross-compilation via Docker, POSIX real-time scheduling, IMU integration. |
| mechanicsdsl-ros2 | ROS2 integration. Generated C++ nodes, custom messages, launch files, parameter configs, and integration tests. |
| mechanicsdsl-unity | Unity and Unreal Engine plugin packages. Pendulum and coupled-pendulum components, conservation monitors, phase-space trails, custom Inspectors, runtime test suite. |
| Repository | Description |
|---|---|
| mechanicsdsl-notebooks | Jupyter notebooks across all eight MechanicsDSL physics domains. Double pendulum (chaos, Lyapunov), coupled oscillators (normal modes, beating), constraints (Baumgarte), central forces (Kepler), Hamiltonian mechanics (phase space, symplectic integration). Binder-launchable. |
| mechanicsdsl-datasets | Reference datasets for physics parameter estimation and inverse problem benchmarking. Includes synthetic trajectories for pendulum, double pendulum, and coupled oscillators, with CSV, HDF5, metadata, and validation scripts. |
Since release on PyPI, MechanicsDSL has accumulated 13,000+ downloads across 67 countries, with institutional mirrors (bandersnatch, Nexus, devpi) observed in multiple national research computing environments. The package is published with a Zenodo DOI (10.5281/zenodo.17771040).
pip install mechanicsdsl-core # core compiler
pip install mechanicsdsl-core[jax] # + GPU acceleration
pip install mechanicsdsl-datasets # physics datasets
pip install mechanicsdsl-core[all] # everythingDocker:
docker pull ghcr.io/mechanicsdsl/mechanicsdsl:latest
docker run -it ghcr.io/mechanicsdsl/mechanicsdsl:latestFull documentation: mechanicsdsl.readthedocs.io
@software{mechanicsdsl2026,
author = {Parsons, Noah},
title = {{MechanicsDSL}: A Domain-Specific Language for Computational Physics Simulation},
year = {2026},
doi = {10.5281/zenodo.17771040},
url = {https://github.com/MechanicsDSL/mechanicsdsl},
license = {MIT}
}All MechanicsDSL repositories are released under the MIT License unless otherwise noted.
Docs · Core repo · Zenodo · PyPI · Datasets on PyPI
