Skip to content
@MechanicsDSL

MechanicsDSL

Open-source DSL & compiler for computational mechanics

MechanicsDSL Logo

MechanicsDSL

A compiler-based framework for computational physics — describe it once, simulate it anywhere.

CI PyPI Downloads Python 3.9+ MIT License DOI Docs Binder

Who's Using MechanicsDSL?

We can see from our download analytics that MechanicsDSL is being used across 54+ countries and mirrored by institutions worldwide — but PyPI doesn't tell us who you are.

If you're using MechanicsDSL in research, education, industry, or a personal project, we'd love to hear from you. It takes 60 seconds and helps guide the project's direction.

→ Tell us about your use case

All responses are voluntary and confidential. We will not contact you without permission.


What Is MechanicsDSL?

MechanicsDSL is an open-source computational physics organization building a full compiler toolchain for physical simulation. Our flagship package lets researchers, engineers, and educators define physical systems in natural, LaTeX-inspired notation — and automatically derives equations of motion, handles constraints, identifies conservation laws, and generates high-performance simulation code for 12+ target platforms.

We are not a wrapper around existing tools. We are a compiler. The user writes physics; we write the code.

\system{double_pendulum}
\parameter{m}{1.0}{kg}
\parameter{l}{1.0}{m}
\lagrangian{
    0.5*m*l^2*(\dot{theta1}^2 + \dot{theta2}^2 + 2*\dot{theta1}*\dot{theta2}*cos(theta1-theta2))
    - m*g*l*(2*cos(theta1) + cos(theta2))
}
\initial{theta1: 1.0, theta2: 0.5}
\target{python_jax}
\solve{t_span: [0, 30], dt: 0.005}

That's it. The compiler handles symbolic derivation, conservation law detection, GPU-accelerated integration, and phase space visualization.


Organization Repositories

Core

Repository Description Status
mechanicsdsl Core DSL compiler, symbolic engine, 8 physics domains, 17+ classical mechanics modules, 12+ code generation backends, JAX/GPU support, LSP server, Jupyter magic commands, FastAPI server v2.0 stable

Deployment & Integration

Repository Description Status
mechanicsdsl-embedded Embedded and edge deployment for Arduino, Raspberry Pi, and ARM platforms. Arduino and RPi pendulum/double pendulum examples, ARM cross-compilation via Docker, POSIX real-time scheduling, IMU integration, serial monitor tooling. active
mechanicsdsl-ros2 Dedicated ROS2 integration layer. Complete mechanicsdsl_pendulum package with generated C++ nodes, custom messages (PendulumState, SystemState), launch files, parameter configs, GTest physics tests, and ROS2 integration tests. active
mechanicsdsl-unity Unity and Unreal Engine plugin packages. PendulumComponent, DoublePendulumComponent, CoupledPendulumsComponent MonoBehaviours; ConservationMonitor, PhaseSpaceTrail, MechanicsDSLMath utilities; custom Inspectors; UPM manifest; runtime test suite. active

Data & Education

Repository Description Status
mechanicsdsl-notebooks Curated Jupyter notebooks spanning all eight MechanicsDSL physics domains. Currently: double pendulum (chaos, Lyapunov), coupled oscillators (normal modes, beating), constraints (Baumgarte), central forces (Kepler), Hamiltonian mechanics (phase space, symplectic integration). Binder-launchable. active
mechanicsdsl-datasets Reference datasets for physics parameter estimation and inverse problem benchmarking. Currently: pendulum_synthetic, double_pendulum_synthetic, coupled_oscillators_synthetic — each with CSV, HDF5, metadata, and estimation/validation scripts. active

Adoption

Since release on PyPI, MechanicsDSL has accumulated 8,300+ downloads across 54 countries, with institutional mirrors (bandersnatch, Nexus, devpi) confirmed in multiple national research computing environments. The package is published with a formal Zenodo DOI (10.5281/zenodo.17771040) and is the subject of ongoing peer-reviewed research:

Parsons, N. Decoupling Programming from Physics: A Compiler-Based Approach to Teaching Lagrangian Mechanics. Under review at American Journal of Physics (submitted January 2026).

Parsons, N. MechanicsDSL: A Compiler-Based Domain-Specific Language for Automated Physics Simulation in Python. In preparation, PEARC26 RSE Track (deadline March 30, 2026).


Quick Start

pip install mechanicsdsl-core          # core compiler
pip install mechanicsdsl-core[jax]     # + GPU acceleration
pip install mechanicsdsl-datasets      # physics datasets
pip install mechanicsdsl-core[all]     # everything

Docker:

docker pull ghcr.io/mechanicsdsl/mechanicsdsl:latest
docker run -it ghcr.io/mechanicsdsl/mechanicsdsl:latest

Full documentation: mechanicsdsl.readthedocs.io


Research & Citation

@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}
}

License

All MechanicsDSL repositories are released under the MIT License unless otherwise noted.


Built for physicists, engineers, and curious minds.
Docs · Core Repo · Zenodo · PyPI · Datasets on PyPI

Popular repositories Loading

  1. mechanicsdsl mechanicsdsl Public

    MechanicsDSL is a production-ready, enterprise-grade computational physics framework that enables physicists, researchers, and educators to define physical systems using a LaTeX-inspired syntax and…

    Python 3

  2. .github .github Public

    MechanicsDSL organization profile.

  3. mechanicsdsl-datasets mechanicsdsl-datasets Public

    Reference datasets for physics parameter estimation and inverse problem benchmarking. Includes synthetic datasets with known ground truth, experimentally collected trajectories, and paired MCMC and…

    Python

  4. mechanicsdsl-embedded mechanicsdsl-embedded Public

    Deploy MechanicsDSL simulations to Arduino, Raspberry Pi, and ARM edge devices. Generates optimized C++ and no_std Rust for real-time closed-loop control, IMU sensor fusion, and on-device physics —…

    Python

  5. mechanicsdsl-ros2 mechanicsdsl-ros2 Public

    Compile MechanicsDSL physical systems directly to complete ROS2 packages. Auto-generates CMakeLists.txt, message definitions, topic architecture, and launch files for manipulator dynamics, mobile r…

    C++

  6. mechanicsdsl-unity mechanicsdsl-unity Public

    Physically accurate simulation components for Unity (C#) and Unreal Engine (C++), compiled from DSL notation. Targets accurate game mechanics, interactive science exhibits, engineering digital twin…

    C#

Repositories

Showing 7 of 7 repositories

Top languages

Loading…

Most used topics

Loading…