Skip to main content

MechanicsDSL Logo

mechanicsdsl-datasets

Reference datasets for physics parameter estimation and inverse problem benchmarking.

PyPI 3 Datasets Formats MIT License Core Package

Install

pip install mechanicsdsl-datasets

Or clone for direct access to raw CSV/HDF5 files:

git clone https://github.com/MechanicsDSL/mechanicsdsl-datasets

Available Datasets

Dataset System Observations Rate Noise σ Ground Truth
pendulum_synthetic Simple pendulum 1,001 100 Hz 0.010 rad m=1.0, l=0.5, g=9.81
double_pendulum_synthetic Double pendulum (near-periodic) 501 100 Hz 0.005 rad m=1.0, l=1.0, g=9.81
coupled_oscillators_synthetic Coupled pendulums (3 beat periods) 2,001 100 Hz 0.005 rad m=1.0, l=1.0, k=0.5
damped_oscillator_synthetic (new) Damped mass-spring (non-conservative) 801 100 Hz 0.005 m m=1.0, k=10.0, b=0.5
double_pendulum_chaotic_synthetic (new) Double pendulum, large angles (chaotic) 301 100 Hz 0.002 rad m₁=m₂=1, l₁=l₂=1, g=9.81

All datasets include clean trajectories, Gaussian-noisy observations, the .msl spec they come from, and a metadata.json with integrator, tolerances and seed. The original three also ship HDF5 files and per-dataset estimation/validation scripts. Four of the five reproduce from their .msl through mechanicsdsl-core; double_pendulum_synthetic does not (see datasets/PROVENANCE.md).


Quick Start (pip install)

import mechanicsdsl_datasets as mds

# Load a dataset
dataset = mds.load("pendulum_synthetic")
print(dataset.ground_truth)    # {'m': 1.0, 'l': 0.5, 'g': 9.81}
print(dataset.t.shape)         # (1001,)
print(dataset.theta_rad_noisy[:5])  # noisy observations

# Re-derive the clean data from the bundled .msl through mechanicsdsl-core
result = dataset.validate()    # truthy ValidationResult with per-column max error

# Variants for robustness studies
loud = dataset.with_noise(0.05, seed=1)   # re-drawn noise, same clean signal
coarse = dataset.subsample(5)             # 20 Hz instead of 100 Hz
train, test = dataset.split(0.8)          # chronological split for forecasting
dataset.export("pendulum.npz")            # also .csv / .json

Benchmarking an estimator

# Grade your estimates against ground truth
print(mds.score("pendulum_synthetic", {"g": 9.79}).table())

# Reference baseline: least squares through the dataset's own DSL model
r = mds.baseline_estimate("damped_oscillator_synthetic")
r.estimates, r.standard_errors      # {'k': 9.999, 'b': 0.4996}, {'k': 1.3e-3, 'b': 4.1e-4}

ds.estimable lists the parameters identifiable from the observations (for a pendulum only g/l is, so l is held at truth and g fitted). The baseline fits in log space, warm-starts on a short prefix of the record to avoid wrong-frequency local minima, and reports standard errors from the Jacobian. On every reproducible dataset it recovers the truth within four standard errors, with residual RMS at the noise level.

The same tools from the shell:

mechanicsdsl-datasets list
mechanicsdsl-datasets validate --all
mechanicsdsl-datasets baseline pendulum_synthetic
mechanicsdsl-datasets score pendulum_synthetic g=9.79
mechanicsdsl-datasets export pendulum_synthetic noisy.csv --noise 0.02 --seed 3
mechanicsdsl-datasets regenerate damped_oscillator_synthetic

Quick Start (raw files)

import pandas as pd
import json

data = pd.read_csv("datasets/pendulum_synthetic/data.csv")
meta = json.load(open("datasets/pendulum_synthetic/metadata.json"))

t         = data["t_s"].values
theta_obs = data["theta_rad_noisy"].values
truth     = meta["ground_truth"]   # {'m': 1.0, 'l': 0.5, 'g': 9.81}

Repository Structure

mechanicsdsl-datasets/
├── datasets/
│   ├── pendulum_synthetic/
│   │   ├── README.md, data.csv, data.hdf5, metadata.json
│   │   └── examples/  estimate_scipy.py, validate_forward.py
│   ├── double_pendulum_synthetic/
│   │   ├── README.md, data.csv, data.hdf5, metadata.json
│   │   └── examples/  estimate_scipy.py, validate_forward.py
│   └── coupled_oscillators_synthetic/
│       ├── README.md, data.csv, data.hdf5, metadata.json
│       └── examples/  estimate_normal_modes.py, validate_forward.py
├── docs/
│   ├── schema.md           # metadata.json schema reference
│   └── estimation_guide.md # least-squares, MCMC, FFT methods
├── scripts/
│   ├── generate_all.py     # regenerate all synthetic datasets
│   └── validate_all.py     # run all validate_forward.py scripts
└── tests/
    └── test_datasets.py    # schema, row count, NaN, noise std checks

Estimation Examples

Each dataset ships with working estimation scripts:

# Estimate pendulum length from noisy observations
cd datasets/pendulum_synthetic
python examples/estimate_scipy.py
# Estimated: l = 0.4998 m  (ground truth: 0.5000 m)

# Identify normal mode frequencies via FFT
cd datasets/coupled_oscillators_synthetic
python examples/estimate_normal_modes.py
# omega1 = 3.1321 rad/s, omega2 = 3.2636 rad/s, k = 0.500 N/m

Testing

pip install pytest h5py numpy scipy pandas
pytest tests/ -v

Contributing

See CONTRIBUTING.md. Experimental datasets with real sensor data especially welcome.

Citation

@dataset{mechanicsdsl_datasets2026,
  author = {Parsons, Noah},
  title  = {{MechanicsDSL Physics Datasets}},
  year   = {2026},
  doi    = {10.5281/zenodo.17771040},
  url    = {https://github.com/MechanicsDSL/mechanicsdsl-datasets}
}

License

MIT License; see LICENSE.

Metadata

Release files for mechanicsdsl-datasets 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-datasets 0.2.0
File Size Uploaded Provenance Actions
mechanicsdsl_datasets-0.2.0.tar.gz 301.6 kB With provenance Details for mechanicsdsl_datasets-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 610.9 kB

Release files / mechanicsdsl_datasets-0.2.0.tar.gz

Download URL mechanicsdsl_datasets-0.2.0.tar.gz
Size 301.6 kB
Tags Source
SHA-256 checksum
How to use checksums
77e7297a4b575936d4ccb395357dbdad6a65d05db48bb39cdee101bc74c61063
BLAKE2b-256 checksum
How to use checksums
8f7fff07e242c33557d561a83bcce40febc2ed3ec62207aae45c778dd5cbae7b
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_datasets-0.2.0-py3-none-any.whl

Download URL mechanicsdsl_datasets-0.2.0-py3-none-any.whl
Size 309.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0842adc2cca3733bd447c65262180e5738ba3fe77fbc88f2cd6adacfb223a56
BLAKE2b-256 checksum
How to use checksums
beab91536cb1f978f93e3b11b44a4d13d42b33b814858c008e882ae8f5fcb25b
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-datasets 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_datasets-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