equation-discovery
Skill0 starsChanged 4 days agoMITView on GitHub
Discover governing equations from data with DataDrivenDiffEq.jl: library construction, sparse regression, thresholding, and checks on held-out trajectories. Use when the model form is unknown.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- BaratiLab/mechanical-engineering-skillstheir own version, first seen Nov 15, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- BaratiLab/mechanical-engineering-skills★ 16same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository55 other files it gives its agents.
- advanced-optimizationSkill
- bayesian-inferenceSkill
- bayesian-pinnSkill
- bayesian-ude-workflowSkill
- catalyst-reactionsSkill
- continuum-mechanics-and-rheologySkill
- control-theorySkill
- creating-julia-appSkill
- debugging-toolkitSkill
- differential-equationsSkill
- differentiationSkill
- experiment-trackingSkill
- fem-feaSkill
- julia-graph-neural-networksSkill
- julia-languageSkill
- julia-ml-and-dlSkill
- julia-model-deploymentSkill
- julia-paper-implementationSkill
- julia-pro-helpSkill
- julia-pro-modeSkill
- julia-reinforcement-learningSkill
- modeling-toolkitSkill
- neural-pdeSkill
- nonlinear-dynamicsSkill
- numerical-methods-implementationSkill
- package-development-workflowSkill
- performance-tuningSkill
- physical-learning-systemsSkill
- playbook-debugSkill
- playbook-model-validateSkill
- playbook-package-releaseSkill
- playbook-paper-implementSkill
- playbook-perfSkill
- playbook-test-specSkill
- principle-both-sidesSkill
- principle-breakingSkill
- principle-file-is-truthSkill
- principle-gateSkill
- principle-limitsSkill
- principle-loud-failureSkill
- principle-one-stepSkill
- principle-proof-listSkill
- principle-rebuttalSkill
- principle-runtime-surfaceSkill
- principle-three-boundsSkill
- principle-three-clocksSkill
- scientific-visualizationSkill
- sciml-and-diffeqSkill
- setup-julia-proSkill
- signal-processingSkill
- simulation-and-hpcSkill
- statistical-physicsSkill
- symbolic-mathSkill
- web-development-juliaSkill
- zarr-cloud-arraysSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 55
After training a Universal Differential Equation (UDE), use SINDy on the trained neural network to extract symbolic equations -- the …
- Very specific: line 64
When the coefficients need credible intervals or an inclusion probability per library term, the Turing horseshoe route wraps a …
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Equation Discovery
Discover governing equations directly from trajectory data using sparse regression (SINDy) and symbolic regression.
SINDy Overview
SINDy (Sparse Identification of Nonlinear Dynamics) recovers governing equations from data:
dX/dt = Theta(X) * Xi- X: State matrix (n_samples x n_states)
- dX/dt: Time derivative matrix (measured or numerically estimated)
- Theta(X): Library matrix of candidate nonlinear functions (polynomials, trig, etc.)
- Xi: Sparse coefficient matrix — nonzero entries reveal the active terms
The key insight: most dynamical systems have sparse representations in a suitable function basis. Sparsity-promoting regression recovers the few active terms.
Thresholding Strategies
| Algorithm | Best For | Key Parameter | Notes |
| STLSQ | Clean data, default choice | threshold (0.01-0.3) | Sequential thresholded least squares; fast, interpretable |
| SR3 | Noisy data, relaxed sparsity | threshold, relaxation | Sparse relaxed regularized regression; more robust to noise |
| ADMM | Constrained problems | threshold, rho | Alternating direction method of multipliers; enforces constraints |
Full solver calls for each algorithm are in references/julia-datadriven-diffeq.md.
Validation Strategies
- Cross-prediction on held-out data: Split trajectories into train/test; fit on train, predict on test
- Pareto front sweep: Vary the sparsity threshold and plot model complexity vs prediction error
- Multi-trajectory validation: Fit on one trajectory, validate on independent initial conditions
- Long-time stability: Simulate discovered equations well beyond the training time horizon
Rule: Always validate on held-out data not used in the SINDy fit. In-sample error is misleading for sparse models. The threshold-sweep script lives in
references/julia-datadriven-diffeq.md.
Handling Noisy Data
| Noise Level | Strategy | Details |
| Clean (SNR > 100) | Direct STLSQ | Use raw derivatives; threshold=0.05-0.1 |
| Moderate (SNR 10-100) | Smoothed derivatives + SR3 | Apply Savitzky-Golay or total variation smoothing before SINDy; use SR3 for robustness |
| High (SNR < 10) | Integral SINDy or ensemble | Use weak-form / integral formulation to avoid derivative estimation; ensemble averaging over subsampled data |
Rule: Never use finite differences on noisy data. Use smoothed or integral formulations.
Connection to UDE
After training a Universal Differential Equation (UDE), use SINDy on the trained neural network to extract symbolic equations -- the UDE+SINDy pipeline:
- Train the UDE with a neural closure, as in bayesian-ude-workflow
- Generate synthetic data from the trained UDE
- Apply SINDy to the neural network output to recover interpretable equations
- Validate the symbolic model against the original data
Bayesian SINDy
When the coefficients need credible intervals or an inclusion probability per library term, the Turing horseshoe route wraps a DataDrivenDiffEq library in a Turing.@model.
Depth
| Page | Open when |
| julia-datadriven-diffeq | basis construction, the three solver calls, implicit SINDy, the discover-simulate-validate loop, the threshold sweep |
| symbolic-regression | the basis is too small and SymbolicRegression.jl should search for the expression |
Traps
| Pitfall | Symptom | Fix |
| Library too small | High residual, poor fit | Add domain-specific terms (trig, exp, cross terms) |
| Library too large | Overfitting, spurious terms | Increase sparsity threshold; use information criteria (AIC/BIC) |
| Noisy derivatives | Unstable coefficients across thresholds | Smooth data or use integral SINDy formulation |
| Insufficient data | Underdetermined system | Collect longer trajectories or multiple initial conditions |
| Wrong coordinate system | Complex equations with many terms | Transform to physically meaningful coordinates before SINDy |
| Threshold too aggressive | Missing true dynamics terms | Sweep thresholds and inspect Pareto front for elbow |
Done when
The derivative estimate matches the noise level of the data (finite differences on clean data, smoothed or integral formulations on noisy data), the candidate library holds the basis functions the physics admits, and the sparsity threshold was chosen at the elbow of the complexity-versus-error Pareto front rather than by convention. The discovered equations reproduce held-out trajectories and stay bounded well past the training horizon; comparing STLSQ, SR3, and ADMM shows the same terms surviving.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

