Skip to main content

MechanicsDSL Logo

mechanicsdsl-notebooks

Curated Jupyter notebooks spanning all eight MechanicsDSL physics domains.

Active 5 Notebooks Launch Binder MIT License Core Package


Available Notebooks

# Notebook Topics Level
01 Double Pendulum Chaos, Lyapunov exponents, phase portraits, energy conservation Intermediate
02 Coupled Oscillators Normal modes, beating, modal decomposition, FFT verification Intermediate
03 Constraints Lagrange multipliers, Baumgarte stabilization, parameter study Intermediate
04 Central Forces Kepler problem, orbital types, dual Noether conservation Advanced
05 Hamiltonian Mechanics Phase space, separatrix, symplectic vs RK4 over 500 s Advanced

More notebooks in development — see docs/index.md for the full planned curriculum.


Launch

Binder (no install required):

Launch Binder

Local:

pip install mechanicsdsl-core[jupyter]
git clone https://github.com/MechanicsDSL/mechanicsdsl-notebooks
cd mechanicsdsl-notebooks
jupyter lab

Repository Structure

mechanicsdsl-notebooks/
├── notebooks/              # Jupyter notebooks (numbered sequentially)
│   ├── 01_double_pendulum.ipynb
│   ├── 02_coupled_oscillators.ipynb
│   ├── 03_constraints.ipynb
│   ├── 04_central_forces.ipynb
│   └── 05_hamiltonian.ipynb
├── binder/                 # Binder environment configuration
│   ├── environment.yml
│   └── postBuild
├── docs/                   # Documentation
│   ├── index.md            # Full curriculum index
│   └── notation.md         # DSL notation reference
├── scripts/
│   ├── check_notebooks.py  # Execute and validate all notebooks
│   └── generate_index.py   # Auto-regenerate docs/index.md
└── tests/
    └── test_notebooks_run.py

What MechanicsDSL Does in Each Notebook

Every notebook includes the DSL specification that the MechanicsDSL compiler uses to automatically:

  • Derive equations of motion via the Euler-Lagrange equations symbolically
  • Identify conserved quantities via Noether's theorem
  • Generate NumPy, JAX, or other backend simulation code

Example from Notebook 05:

\system{pendulum_hamiltonian}
\parameter{m}{1.0}{kg}
\parameter{l}{1.0}{m}
\lagrangian{0.5*m*l^2*\dot{theta}^2 - m*g*l*(1-cos(theta))}
\target{python_numpy}

MechanicsDSL derives: $H = p_\theta^2/(2ml^2) + mgl(1-\cos\theta)$ and generates Hamilton's equations automatically.


For Instructors

Notebooks are designed for direct classroom use — no prior DSL knowledge assumed. Each opens with physics motivation, introduces DSL syntax progressively, and includes interactive parameter exploration. If you use these notebooks in a course, open an issue to be acknowledged in the documentation.


Testing

pip install pytest nbconvert
python scripts/check_notebooks.py       # execute all notebooks
pytest tests/ -v                        # validate structure

Contributing

See CONTRIBUTING.md. Domain coverage especially needed: rigid body, perturbation theory, quantum tunneling, electromagnetism, general relativity.

Citation

@software{mechanicsdsl2026,
  author = {Parsons, Noah},
  title  = {{MechanicsDSL Notebooks}},
  year   = {2026},
  doi    = {10.5281/zenodo.17771040},
  url    = {https://github.com/MechanicsDSL/mechanicsdsl-notebooks}
}

License

MIT License — see LICENSE.

Metadata

Release files for mechanicsdsl-notebooks 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mechanicsdsl-notebooks 0.1.0
File Size Uploaded
mechanicsdsl_notebooks-0.1.0.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mechanicsdsl-notebooks 0.1.0
File Interpreter ABI Platform
mechanicsdsl_notebooks-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.3 kB

Release files / mechanicsdsl_notebooks-0.1.0.tar.gz

Download URL mechanicsdsl_notebooks-0.1.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8f775fa89049383f57c77a3e8e4e6df28e40054eebf18d0f36b0428716e3effe
BLAKE2b-256 checksum
How to use checksums
ce2b21511cc92024a9462f98c1c27d648d5c11795b59ce1e2f50d2607fa0ad99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release files / mechanicsdsl_notebooks-0.1.0-py3-none-any.whl

Download URL mechanicsdsl_notebooks-0.1.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53cc1ec25f90e626cbae3b1cf9c689fd784893eb597cf0042fffc6fc12741f1b
BLAKE2b-256 checksum
How to use checksums
58b7b0c79c6963ddfe291a0aeb0c070d7e0d80ae7201af443dac0dea86416120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page