Interesting mathematical titbits

The Riemannian pullback, in first-year engineering maths.

The geometry behind the Modak–Walawalkar (MW) engine, one derivative rule at a time. Play with the sliders: every number here is computed live.

The big idea

Every physical system has a hidden knob and things we can measure.

A pendulum’s knob is its angle θ. A battery’s knob is how much usable lithium is left (z: 1 = new, 0 = dead). We rarely see the knob directly. We see its effects: a position, a voltage, a resistance.

If I turn the hidden knob a tiny bit, how much do my measurements move?

The answer is one number, the metric G. General Relativity uses exactly this maths (Riemann’s geometry) to describe curved spacetime. MW borrows it for all physics, not just gravity.

Only three derivative rules needed

d/dθ sin θ = cos θd/dθ cos θ = −sin θd/dz ln z = 1/zd/dz zⁿ = n·zⁿ⁻¹

And one matrix step: row × column = multiply the pairs, then add.

Example 1 · A pendulum

Knob = angle θ. Measurement = where the bob is.

Write the physics. x = L sin θ, y = −L cos θ
Differentiate. dx/dθ = L cos θ, dy/dθ = L sin θ. Stack them: that column is the Jacobian J.
Build the metric. G = Jᵀ W J. Both x and y are metres, so W = 1.
G = L²cos²θ + L²sin²θ = L²(cos²θ + sin²θ) = L²

With L = 2 m: G = 4 and √G = 2. Turn the knob 0.01 rad and the bob moves 0.02 m, at every angle.

Twist · measure only the height

Same pendulum, poorer sensor. Now G changes with angle.

h = L − L cos θ → dh/dθ = L sin θ → G = L² sin²θ
G (x and y sensor)4.00
G (height only)1.00
Height change per 0.01 rad0.010 m
The lesson. G tells you how loudly the hidden knob shows up in your data. Small G: the knob is hard to see. Large G: every tiny turn is obvious. At the bottom (θ = 0), a height sensor is blind to small swings.

Example 2 · A battery cell

Knob = z, the usable lithium left. Two measurements: open-circuit voltage x₁ and SEI film resistance x₂.

x₁ = U₀ − α ln z   x₂ = R₀ + β z−½
dx₁/dz = −α/z   dx₂/dz = −β / (2 z3/2)

Volts and ohms are different units, so W gives each its own weight (wV, wR).

G(z) = wV·α²/z² + wR·β²/(4z³)
G at this z0.0282
vs a new cell (z = 0.9)2.3×
Reading moves per 0.01 lithium0.0017
Cell statezG
New0.90.0125
Mid-life0.60.0282
Near the knee0.30.1148

From new to the knee G grows 9.2×: the same 0.01 of lithium lost moves the readings about 3× more. The nearer the end, the louder the ageing.

MW does not solve these equations

The examples show the meaning. Here is what actually runs.

The real battery model reads 16 measurements with about 15 uncertain physics parameters: SEI growth, plating, swelling, cracking, temperature sensitivity. Ten values each gives 10¹⁵ combinations, and each would need its own solver run.

Physics enters as priors. Each parameter gets a likely range, not a fixed number. No PDE is solved.
A Bayesian VAE learns by Monte Carlo. The priors cut away what physics forbids, so it explores only the physically possible region.
Physics is tied to the manifold. The SoH the decoder produces must agree with the physics, so the learned surface x(z) obeys it.
The pullback, in practice. MW distance compares decoded states with weights W. For tiny steps this is exactly G = Jᵀ W J.
Solvers fight the PDEs every time. MW never solves them. Priors cut the search; the geometry is measured on a CPU.

From one formula to an early warning

G(z) is flat and calm for a new cell, then climbs fast as the cell ages. The curve bends up before the cell falls off its capacity cliff (the knee). That bend is lead time: replace, re-rate or re-price the warranty before failure.

The recipe, for any physics

Pick what you measure and what physics allows (the priors).
Generate data: solver runs (COMSOL / Ansys) and field telemetry.
Train the Bayesian VAE: Monte Carlo cut by priors learns x(z).
Measure MW distance, G = Jᵀ W J. No PDE solved.
Watch how G changes. The geometry tells the story.

With more knobs, G becomes a small table (a matrix). The idea is the same.

Why not LLMs? This works because physics obeys rules written as PDEs. English grammar has no PDEs, so this geometry won’t help a chatbot. This is physics AI, not language AI.

Proven on public data

95 LFP cells, two open datasets, held-out testing.

Sandia (Preger 2020)HUST (Ma 2022)
Cells1877
Temperature15, 25, 35 °C30 °C
Fadesteady, near-linearslow, then a knee

Task: from one measurement at 100 cycles, forecast the whole SoH path. Median RMSE of the SoH forecast on held-out HUST cells, in percentage points (lower is better):

MW, monotone2.44
MW, non-monotone3.38
Physics alone18.2

Where the geometry earns its keep

The monotone model carries one strong prior: SoH can only fall. That keeps its forecast physically possible even on unfamiliar inputs (Sandia: 3.0 vs 20.4 unconstrained). Near the knee the unconstrained model dates end of life better, so the engine runs both and flags a pack when they disagree by more than about 5 points.

The COMSOL / Ansys bottleneck

Keep the solvers. Use them differently.

Solver alone
Each new question needs a full re-solve, on a workstation, HPC or GPU, with licence time every query. Real-time fleet use is impractical.
Solver + MW
A few hundred validated runs teach the manifold once. Then any new data is scored on an ordinary CPU in real time, and off-manifold or faked data is flagged.
Honest limit. The manifold knows only what the solver showed it. New regimes need new runs.

Go deeper

Differential geometry (O’Neill, do Carmo) and probabilistic programming (Pyro). The full framework is open source at github.com/RahulModak74/MW_Geometric_Intelligence.

Why a short log works (Kennedy–O’Hagan)

Open the original PDF (8 pages)

Use whatever little maths we know to democratise, not to build moats.