Curated Jupyter notebooks for MechanicsDSL — classical mechanics, quantum, electromagnetism, relativity, statistical mechanics
Project description
mechanicsdsl-notebooks
Curated Jupyter notebooks spanning all eight MechanicsDSL physics domains.
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):
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mechanicsdsl_notebooks-0.1.0.tar.gz.
File metadata
- Download URL: mechanicsdsl_notebooks-0.1.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f775fa89049383f57c77a3e8e4e6df28e40054eebf18d0f36b0428716e3effe
|
|
| MD5 |
fca862fe6f0acc25ed8a5e369cf21976
|
|
| BLAKE2b-256 |
ce2b21511cc92024a9462f98c1c27d648d5c11795b59ce1e2f50d2607fa0ad99
|
Provenance
The following attestation bundles were made for mechanicsdsl_notebooks-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on MechanicsDSL/mechanicsdsl-notebooks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mechanicsdsl_notebooks-0.1.0.tar.gz -
Subject digest:
8f775fa89049383f57c77a3e8e4e6df28e40054eebf18d0f36b0428716e3effe - Sigstore transparency entry: 1118491645
- Sigstore integration time:
-
Permalink:
MechanicsDSL/mechanicsdsl-notebooks@0fcf078299c5348736808d74b9771247de674786 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MechanicsDSL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0fcf078299c5348736808d74b9771247de674786 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mechanicsdsl_notebooks-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mechanicsdsl_notebooks-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53cc1ec25f90e626cbae3b1cf9c689fd784893eb597cf0042fffc6fc12741f1b
|
|
| MD5 |
0d34af9ee051545c4241fe058dd54a97
|
|
| BLAKE2b-256 |
58b7b0c79c6963ddfe291a0aeb0c070d7e0d80ae7201af443dac0dea86416120
|
Provenance
The following attestation bundles were made for mechanicsdsl_notebooks-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on MechanicsDSL/mechanicsdsl-notebooks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mechanicsdsl_notebooks-0.1.0-py3-none-any.whl -
Subject digest:
53cc1ec25f90e626cbae3b1cf9c689fd784893eb597cf0042fffc6fc12741f1b - Sigstore transparency entry: 1118491677
- Sigstore integration time:
-
Permalink:
MechanicsDSL/mechanicsdsl-notebooks@0fcf078299c5348736808d74b9771247de674786 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/MechanicsDSL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@0fcf078299c5348736808d74b9771247de674786 -
Trigger Event:
push
-
Statement type: