USE CASE

The AI doesn't just fit the data — it discovers the equation.

Real models are partly known: you have the physics for most of a system and a gap where the physics is wrong or missing. A black-box neural network fits the training window, extrapolates badly, and tells you nothing. A Universal Differential Equation keeps every term you know, drops a neural network into only the unknown channel, trains the hybrid model through the ODE solver, and then reads the learned gap back as a symbolic equation by sparse regression. This program runs that loop end to end on the Julia SciML stack — and signs it off.

A discovered model tracking the true predator-prey oscillation three times past its training window while a black-box neural ODE drifts away
0.0%
symbolic-recovery coefficient error
0.926
learned-term correlation
extrapolation past the training window
0.065
hybrid-model fit RMSE
10
design notebooks
5 / 5
requirements PASS
THE GAP

You rarely know all the physics — and rarely none.

The hero system is Lotka-Volterra predator-prey, with the bilinear interaction term treated as the unknown physics: the linear birth and death rates are known, the coupling that makes the populations oscillate is not. That's the realistic case — a mechanistic skeleton with a hole in it. Drop the interaction and the model collapses (prey explode, predators die out); the closed-orbit data is what a learner has to reconstruct the missing closure from.

Predator and prey populations over the training window — the clean oscillating data the model learns from
The data: prey and predator populations over a three-unit training window. The known model has the linear terms right but is missing the interaction that couples the two — the program's job is to recover that missing term from this trajectory alone.
WHY NOT JUST A NEURAL NET

A black box fits the window and fails the moment it leaves it.

The obvious move is to learn the whole right-hand side with a neural network — a neural ODE. It works inside the training window (fit RMSE 0.053) and is completely useless outside it: extrapolation error jumps 52× and the trajectory drifts off the data manifold entirely. It also can't tell you anything — there's no equation to read, no physics to check. That failure is the whole reason to keep the physics you already have.

A black-box neural ODE matching the data inside the training window then diverging monotonically past it
The black-box foil: the neural ODE (dashed) sits on the truth (solid) until the end-of-training line, then diverges — prey climbing away instead of crashing back, predators drifting. It memorized the window; it learned no dynamics.
THE UDE

Keep the physics, learn only the gap — through the solver.

The Universal Differential Equation writes the right-hand side as the known linear terms plus a neural network in only the unknown interaction channel, and trains it through the ODE solver itself — continuous adjoint sensitivities (InterpolatingAdjoint + a Zygote vector-Jacobian product), the Lux parameters flattened to a plain vector so the adjoint sees them. The trajectory loss falls from 2.4 to 0.0085 over 1500 steps; the hybrid model fits to RMSE 0.065. And because the network sits in a known place, you can look at what it learned: the learned interaction surface matches the true −b·xy term with correlation 0.926 / 0.958.

The learned neural-network interaction surface overlaid on the true bilinear term, matching across the operating region
Interpretability: the learned missing-term surface (purple) laid over the true interaction (green). Across the region the trajectory actually visits they coincide — the network didn't just fit the output, it recovered the shape of the missing physics. The corners drift only where there's no data to constrain it.
THE PAYOFF

Read the learned term back as an equation.

The learned term is a smooth function in a known channel — so it can be turned back into symbols. Sampling the dynamic residual (measured derivative minus the known part) across a small ensemble of orbits and sparse-regressing it onto a polynomial library with sequential thresholded least-squares recovers exactly the terms that belong: −0.9·xy for the prey, +0.8·xy for the predator, every other candidate driven to zero — 0.0% coefficient error. That's not a fit; it's the governing equation, discovered from data.

Recovered interaction coefficients exactly matching the true coefficients for both equations
The equation, discovered: recovered coefficients (purple) against the truth (green) for both interaction terms. They land on top of each other — the sparse regression picked out the right two terms from the candidate library and got their magnitudes exactly right.
WHY IT MATTERS

A discovered law generalizes; a fit does not.

Because the UDE recovered the actual missing physics, the discovered symbolic model forecasts three times past the training window with zero error while the black-box neural ODE diverges — the difference between memorizing a window and learning a dynamics. The same pipeline recovers a damped Duffing oscillator's cubic stiffness term exactly, and the x·y recovery stays under 1% error through 10% measurement noise. Different systems, same workflow: keep what you know, learn the gap, read it back.

VALIDATION

Every number re-derived from scratch at sign-off.

The V&V notebook retrains the UDE, re-runs the symbolic recovery, trains a fresh black-box baseline for the contrast, and re-runs the noisy recovery — then prints a PASS/FAIL board.

ResultRequirement
UDE hybrid-model fit RMSE0.065R-01 < 0.10
Learned-term correlation0.926R-02 > 0.9
Symbolic recovery error0.0%R-03 < 10%
Extrapolation vs black boxratio 0.0R-04 < 1/3
Noisy recovery (2% noise)0.2%R-05 < 25%
HONEST SCOPE

A method showcase on textbook systems.

The deliverable is ten notebooks and the dossier — no custom blocks or canvases, because UDE discovery is a data-driven workflow, not an acausal network. The systems are deliberately small and didactic (2-state Lotka-Volterra, a Duffing oscillator) so the discovery payoff is legible; real closures — turbulent fluxes, reaction networks, constitutive laws — are higher-dimensional and need larger libraries and more data. The headline recovery is exact on clean data; the noise notebook shows graceful, not magical, degradation. The polynomial library is a fixed, small basis chosen a priori, and training is single-shooting. All of this is in the dossier's Honest Scope — and the whole thing runs on the Julia SciML stack (OrdinaryDiffEq · SciMLSensitivity · Lux · Zygote), a concrete reason to reach for it over MATLAB here.

Discover the missing physics in your own model.

Book a walkthrough and we'll set up your known model, the unknown channel, and run the UDE training and symbolic recovery on your data live.

DjiniousLabOne engineering notebook for model-based design — model, simulate, and generate on a living digital replica.