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

Curated vs generated notebooks

The five curated notebooks above are hand-written SciPy walkthroughs of the physics: they show the DSL specification for each system but integrate their own equations of motion. Notebooks generated by this package go through mechanicsdsl-core end to end: the DSL is compiled, the equations of motion are derived symbolically, and the system is integrated by core.

Generate notebooks from any DSL spec

pip install mechanicsdsl-notebooks
mechanicsdsl-notebooks generate double_pendulum -o notebooks/
mechanicsdsl-notebooks generate double_pendulum --sections all --execute -o notebooks/
mechanicsdsl-notebooks generate my_system.msl --sections phase,energy,sweep --sweep k
mechanicsdsl-notebooks build-all --sections all --execute -o gallery/
mechanicsdsl-notebooks check notebooks/*.ipynb
Section Contents
overview (always) DSL, derived equations of motion, core integration, trajectory plot
phase phase portraits (q vs q̇) for every coordinate
energy E = Σ q̇ ∂L/∂q̇ − L derived symbolically, energy and relative-drift plots
sweep one parameter scaled 0.5×–1.5×, trajectories overlaid
integrators core's RK45 / RK23 / DOP853 / LSODA against a tight reference: error and wall time

--execute runs the notebook headlessly (no Jupyter needed) and stores text and figure outputs, so the .ipynb renders with results on GitHub. check executes existing notebooks the same way and reports any cell errors. build-all writes one notebook per core preset plus a README.md index.


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 -e ".[dev]"
mechanicsdsl-notebooks check notebooks/*.ipynb   # execute all curated notebooks headlessly
pytest tests/ -v                                 # structure + every generated section executed

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.2.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.2.0
File Size Uploaded Provenance Actions
mechanicsdsl_notebooks-0.2.0.tar.gz 38.7 kB With provenance Details for mechanicsdsl_notebooks-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 60.0 kB

Release files / mechanicsdsl_notebooks-0.2.0.tar.gz

Download URL mechanicsdsl_notebooks-0.2.0.tar.gz
Size 38.7 kB
Tags Source
SHA-256 checksum
How to use checksums
242694e70d454d494e16e254de6402d16ace2fd200d95a4ca0818c0d7dc310d8
BLAKE2b-256 checksum
How to use checksums
4148a9c4ae7e200537e90fca3be5755f1e211a5d57883d92be92b23421d589f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

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

Download URL mechanicsdsl_notebooks-0.2.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5864887c819236d71795b1874051cbe86ee423104636a399af9a2354d9c80404
BLAKE2b-256 checksum
How to use checksums
2b4e7f0ff25a8d5e91293359ec098ad82b1ede0972257dd6a64ea4981c82cb70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 14, 2026.

Transparency log

Security for mechanicsdsl-notebooks 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mechanicsdsl_notebooks-0.2.0.tar.gz

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 Nov 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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