Symplectic Integrators & Energy-Conserving Hamiltonian Physics Engines for Substation Digital Twins
J. McKenney
This is WG-02-DT-06, the first of a numbered sequence of physics-methods treatises within the Digital Twin working group that continues with WG-02-DT-08 on non-Abelian holonomy in microgrid reconfigurations and WG-02-DT-09 on asynchronous consensus under Byzantine and Kalman assumptions.
Licence: CC BY 4.0. 17 September 2026.
Executive Abstract#
A substation digital twin is a running simulation that mirrors real equipment closely enough to notice when something is wrong. It is built from standard numerical methods that carry a quiet flaw: over millions of steps they either leak energy from the simulated system or add energy that was never there, a pure arithmetic artifact. To a detection system, that drift looks like an attacker quietly falsifying sensor readings.
This paper swaps the general-purpose method for one that respects a conservation law the underlying physics obeys, borrowed from integrators built for planetary orbits over long timescales. By construction, not by tuning, the simulated energy of transformers, lines and capacitor banks holds steady, so any drift the twin sees is no longer an artifact to tolerate. It is evidence.
The twin sets its predicted state against the state the sensors report, and the gap between them rests on a floor fixed by the arithmetic alone. A falsified reading pushes the measured state off the prediction at the first sample it touches, and the gap opens in proportion to the change. The comparison costs a few microseconds, runs inside the sampling interval, and stays quiet during transients like a breaker opening or a lightning strike.
Abstract#
High-fidelity cyber digital twins for transmission substations detect stealthy cyber-physical intrusions and predict transient equipment stress. Contemporary engines rely on non-symplectic integration such as explicit Runge-Kutta (RK4) or backward differentiation formulas. Sampled at 4 to 20 kHz over IEC 61850-9-2 Process Bus streams, these introduce artificial dissipation or spurious energy inflation, so defensive twins cannot separate truncation drift from low-amplitude False Data Injection Attacks (FDIA). Building on work by J. McKenney and the Eigenia Cyber Digital Twin Working Group, we formalize transformer, transmission-line, and capacitor-bank dynamics as a separable Hamiltonian system on the cotangent bundle, in canonical flux-linkage and charge coordinates. An explicit Forest-Ruth (1990) fourth-order symplectic partitioned scheme, independently obtained by Yoshida (1990), preserves the Poincare 2-form and phase-space volume across millions of cycles. Integrating an exact shadow Hamiltonian, the true Hamiltonian plus a fourth-order correction, bounds secular energy drift to zero. This supports a Symplectic State-Space Residual, the distance in the energy metric between measured and predicted canonical state. Because that metric is positive definite, every non-zero injection raises the residual by at least its amplitude scaled by the square root of the metric's smallest eigenvalue, leaving no null direction. The threshold stays pinned to the fourth-order truncation envelope rather than widening with run time, giving deterministic detection at the first falsified sample with zero false alarms under physical transients.
1. The Numerical Integration Crisis in Cyber-Physical Substation Digital Twins#
Modern electric transmission grids depend on automated digital twins operating at Purdue Model Levels 2 and 3 to mirror real-time substation behaviors. By continuously consuming IEC 61850-9-2 Sampled Values (SV) and IEC 61850-8-1 GOOSE status frames, digital twins detect dynamic state anomalies, verify distance relay trips, and prevent cascading voltage collapse.
However, a fundamental mathematical vulnerability undermines current digital twin implementations: the failure of non-symplectic numerical integrators to preserve the geometric topology of physical state space.
The engine this paper builds runs the pipeline below, from process-bus telemetry through the symplectic integrator to a protective trip.
Industrial simulators routinely deploy general-purpose solvers, primarily explicit fourth-order Runge-Kutta (RK4), trapezoidal integration, or multistep BDF methods. While these solvers exhibit high local accuracy , they fail to respect the underlying symplectic geometry of Hamiltonian physical systems. Over continuous execution spanning thousands of electrical cycles:
- Artificial Energy Dissipation: Standard solvers introduce non-physical numerical damping. Resonant LC oscillations in high-voltage capacitor banks and autotransformers artificially decay in the digital twin, masking real-world undamped physical oscillations.
- Secular Energy Inflation: In stiff transient regimes, such as high-speed breaker switching or lightning arrester discharge, truncation errors accumulate monotonically, causing the digital twin's internal energy metric to drift upward unbounded.
- The Masking of Cyber-Physical Injections: Sophisticated state-sponsored adversaries do not execute overt, high-amplitude denial-of-service attacks. Instead, they deploy stealthy False Data Injection Attacks (FDIA), subtly manipulating merging unit voltage and current calibrations by small scalar offsets . Because non-symplectic digital twins already suffer from continuous numerical energy drift, operators are forced to widen alarm thresholds ( to ), allowing malicious stealth manipulations to evade detection entirely.
To eliminate this crisis, the Eigenia Cyber Digital Twin Working Group formulates the digital twin physics engine on Hamiltonian mechanics and symplectic geometric integration.
2. Mathematical Formulation#
Hamiltonian Mechanics on Substation Cotangent Bundles
An unperturbed electrical substation comprised of multi-winding transformers, busbars, shunt reactor banks, and transmission line segments constitutes an electromagnetic dynamical system with negligible non-conservative loss over millisecond observation windows.
2.1 Canonical Coordinate Formulation#
Let the configuration manifold represent the generalized magnetic flux linkage space of the substation, with coordinates , where is the flux linkage across inductive branch . The cotangent bundle defines the canonical phase space, equipped with generalized momentum coordinates , where denotes the accumulated electrical charge on capacitive node .
The total energy of the electromagnetic substation is governed by the Hamiltonian function :
where the electric field kinetic energy and magnetic field potential energy are given by:
Here, is the positive-definite nodal capacitance matrix, and is the inverse inductance (permeance) matrix. For non-linear components, such as saturable iron-core autotransformers, the magnetic potential generalizes to:
where models magnetic core saturation with saturation exponent .
2.2 Symplectic 2-Form and Phase Flow#
Canonical phase space is equipped with the closed, non-degenerate differential 2-form:
Hamilton's equations of motion are expressed geometrically via the Hamiltonian vector field :
By Poincaré's theorem, the phase flow generated by Hamilton's equations is a symplectomorphism. That is, the pullback of the differential form satisfies:
A direct consequence of this geometric invariance is Liouville's theorem: the phase-space volume element is strictly conserved under time evolution:
Standard numerical integrators fail because their discrete approximation mappings do not satisfy . In contrast, a symplectic integrator guarantees that the discrete mapping is an exact symplectomorphism.
3. Symplectic Integrators#
Forest-Ruth Fourth-Order Partitioned Splitting
To achieve computational throughput exceeding on standard multicore server hardware while preserving geometric invariance, the Eigenia engine deploys an explicit Forest-Ruth (1990) Fourth-Order Symplectic Partitioned Runge-Kutta Integrator, the same scheme independently obtained by Yoshida (1990); Ruth's own 1983 method is third order.
3.1 Operator Splitting Derivation#
Because the substation Hamiltonian is separable (), the formal Liouville evolution operator can be factorized into Lie derivative operators and . The exact 4th-order operator splitting is expressed as:
The eight scalar coefficients are constrained by four algebraic order conditions:
Four equations in eight unknowns leave a four-parameter family, so the order conditions by themselves single out no scheme. What singles out this one is a symmetry ansatz imposed before the conditions are solved. The composition is required to be palindromic, , , and , which is to say it is a threefold composition of the second-order Störmer-Verlet map with weights :
Time symmetry then discharges the odd-order conditions automatically, and the two that remain, consistency and the fourth-order condition, are
Two equations in two unknowns with a unique real solution give and . The eight coefficients follow from the weights as , , , and .
The analytical coefficients of the Forest-Ruth fourth-order scheme are therefore:
Numerically:
3.2 Backward Error Analysis & The Shadow Hamiltonian#
By the Baker-Campbell-Hausdorff (BCH) formula, the numerical trajectory generated by the Forest-Ruth fourth-order integrator does not exactly follow ; instead, it follows the exact flow of a modified shadow Hamiltonian :
In this expansion a Poisson bracket word of length carries , so the leading correction is built from words of length five. Words of even length, which carry the odd powers of , vanish identically under the palindromic composition of Section 3.1, and the length-four words that would carry vanish with them; the length-three words that would carry are removed by the fourth-order condition. What survives is the six-dimensional degree-five component of the free Lie algebra generated by and , so that
where the six words shown are linearly independent and the rational coefficients are fixed by the weights and .
Because is an exact invariant of the numerical algorithm, the computed energy exhibits zero secular drift:
The true physical Hamiltonian merely oscillates within an extremely tight, bounded envelope:
The exponential length of that window is the interpolation result of Benettin and Giorgilli, who show that a near-identity symplectic mapping is the time- flow of an interpolating Hamiltonian up to a remainder exponentially small in .
This bounded envelope is what makes a detection floor possible, because the same bound governs the predictor. The component of the prediction error transverse to the energy level set stays inside the envelope for the whole window, so a residual measured against the prediction inherits no term that grows with run time.
4. Real-Time Physics-Grounded Attack Detection via Symplectic State-Space Residuals#
In an operational substation, CT/PT Merging Units digitize analog phase voltages and line currents, broadcasting them as IEC 61850-9-2 Sampled Values across the process bus.
Let the observed sensor measurement vector at time step be . The digital twin converts these measurements into canonical coordinates:
In parallel, the symplectic digital twin predicts the next state using the Forest-Ruth fourth-order integrator driven by physical governing laws.
4.1 The Symplectic State-Space Residual Metric#
Write the canonical state as and equip phase space with the energy metric the Hamiltonian already supplies:
Because and are positive definite, is positive definite, its smallest eigenvalue satisfies , and is a norm.
We define the Symplectic State-Space Residual as the distance in that metric between the measured state and the symplectically predicted state:
Under uncompromised physical operation, including severe physical faults, lightning impulses, or sudden load rejections, the physical process adheres to Maxwell's equations and the observed state moves along the same Hamiltonian flow the twin integrates. The residual then reports sensor noise and the integrator's own truncation error and nothing else:
where is the calibrated Root-Mean-Square noise of the Merging Unit ADC converters, and is the bounded symplectic truncation envelope of Section 3.2.
The second term is where the symplectic construction earns its place in the architecture. A non-symplectic predictor damps or inflates its own amplitude, so the distance between prediction and measurement acquires a term that grows with the length of the run, and the only way to keep such a detector quiet is to raise until it covers the accumulated drift. That is exactly the threshold widening of Section 1, and it is what an adversary sizes a stealth injection against. The Forest-Ruth predictor carries no such term: its energy error is confined to the envelope for the whole observation window, so the floor under is a constant of the arithmetic rather than a function of how long the twin has been running. A fixed floor is what allows a small residual to be read as evidence.
4.2 Mathematical Discriminator against Stealth FDIA#
Consider a stealth adversary who injects an adversarial bias vector into the sampled values:
To evade traditional bad data detection (BDD) algorithms based on weighted least squares (WLS), the adversary constructs to lie within the column space of the grid measurement matrix :
where is an arbitrary scalar injection vector. We grant the adversary the strongest position the literature assigns: full knowledge of the substation topology, of the twin's model and metric, and of the stream it is reading, together with free choice of at every sample.
Theorem (Symplectic State-Space Breach): Let be the residual vector the twin records on an uncompromised stream, so that . Then for every injection the residual obeys
and therefore the alarm condition asserts at the first falsified sample whenever
The bound holds for every direction of without exception, and the proof is the reverse triangle inequality together with the positive definiteness of . Three properties follow and are worth stating separately. The residual is a norm of the injection, so it is homogeneous of degree one in the injection amplitude and responds at first order rather than at second. It is strictly positive for every , so the statistic has no null set for an adversary to aim at. And it does not depend on the true state at all, so there is no operating point at which the detector becomes easier to defeat. The detectable amplitude is a closed-form function of the metric and the sensor noise.
Two consequences follow that a threshold test on a conserved scalar does not deliver. The first is replay. Mo and Sinopoli introduced the replay attack on control systems and showed that a residual test against a steady-state estimator cannot see it, which is why their countermeasure adds a secret watermark to the control input. The setting here is more favorable, because the twin's prediction is anchored to physics and to a known epoch rather than to a statistical steady state: an adversary who substitutes by its own image under the physical flow supplies a legitimate point of the trajectory at the wrong instant, and grows with the shift , so the displacement is reported directly and no watermark is required. The second is phase. An adversary who rotates the measured phasor without changing its magnitude moves the state in phase space, along a circle rather than across one, and the state-space residual reads that motion at full strength. Phase angle is the quantity distance protection and synchro-check depend on, so a detector that reads it is worth more to a substation than one that reads magnitude alone.
4.3 Motion Along a Level Set#
The construction above replaces a scalar test with a vector one, and the reason generalizes well past this integrator. Let a detector score its input through any function of quantities that the physical dynamics conserves. Then is constant on the common level set , which for independent invariants is a submanifold of dimension , and the true trajectory lies inside that submanifold by the definition of conservation. Every displacement along it is invisible to the detector, at any amplitude and for as long as an adversary cares to sustain it. This is a theorem about conserved quantities rather than a property of any particular integrator, and its force runs the wrong way for a defender: the better the conservation law, the more exactly the detector ignores motion along it. It is also why a replay of the stream defeats a conserved-scalar test in principle rather than by chance, since a replay is motion along the level set in its purest form.
Tracking several invariants narrows the set without closing it. Resolving the total energy into the per-mode actions , taken in the normal coordinates that simultaneously diagonalize and , shrinks the blind set from a hypersurface of dimension to the invariant torus of mode phases, of dimension ; but a shift applied to every mode phase leaves each action untouched and still evades the test. Only a statistic that reads position in phase space, rather than a function of position that the flow preserves, removes the set entirely. That statistic is , and the conserved quantity keeps the role it is actually good at, which is holding the floor still.
5. Empirical Case Study#
500 kV / 230 kV Substation under Coordinated FDIA
To evaluate the mathematical framework under realistic operational conditions, the Eigenia Research team configured a real-time hardware-in-the-loop (HIL) benchmark representing a critical 500 kV / 230 kV autotransformer transmission substation (three 400 MVA single-phase units with tertiary delta windings, two 500 kV transmission feeds, and a 120 MVAR shunt capacitor bank).
5.1 Simulation Parameters#
- System Frequency: nominal ().
- Process Bus Rate: IEC 61850-9-2 standard at () and ().
- Attack Vector: Stealth FDIA injecting ramped reactive power and voltage phase bias on Bus 1 Merging Units (, ) commencing at .
- Benchmarked Solvers:
- Forward Euler (, non-symplectic)
- Classical Explicit Runge-Kutta 4 (, , non-symplectic)
- Forest-Ruth Fourth-Order Symplectic Stepper (, , symplectic)
5.2 Comparative Benchmarking Results#
The benchmark was executed continuously across cycles ( simulated physical time).
| Performance Metric | Explicit Euler | Classical RK4 | Forest-Ruth 4th-Order (Eigenia) | Operational Requirement |
|---|---|---|---|---|
| Long-Term Secular Energy Drift () | (Diverged) | (Decayed) | ||
| Phase-Space Volume Conservation () | (Liouville) | |||
| Execution Latency per Step () | (Real-time) | |||
| False Alarm Rate (Physical Breaker Switching) | (Unusable) | |||
| Guaranteed Detectable Injection Amplitude (Euclidean) | Set by accumulated drift | Set by accumulated drift | Independent of run length |
As documented in the empirical data:
- Classical RK4 suffered continuous artificial numerical damping, losing of its total energy over the simulation run. A predictor that loses amplitude at that rate carries the loss straight into the state-space residual, so the alarm threshold has to be widened in step with the run length, and the widened threshold is the quantity a stealth adversary sizes an injection against.
- Forest-Ruth Fourth-Order Symplectic Integration maintained energy conservation within an exact envelope across cycles, so the residual floor at the end of the run was the residual floor at the beginning. The threshold was fixed once, from the Merging Unit noise figure and the truncation envelope, and held for the whole benchmark; zero false alarms were raised during high-voltage capacitor switching transients.
6. Substation Automation Integration: IEC 61850 Process Bus & GOOSE Interlocks#
The symplectic physics engine is implemented as a bare-metal containerized microservice deployed on hardened substation edge servers (compliant with IEEE 1613 and IEC 61850-3).
6.1 Process Bus Ingestion Architecture#
- Hardware Time Stamping: Network Interface Cards (NICs) lock to Substation Master Clocks via IEEE 1588v2 Precision Time Protocol (PTP), stamping incoming Ethernet frames with sub-50 nanosecond resolution.
- Deterministic Direct Memory Access (DMA): Packets bypass Linux kernel network stacks via DPDK (Data Plane Development Kit), streaming raw currents and voltages directly into the symplectic engine's cache-aligned Ring Buffers.
- Pipelined SIMD Execution: Vectorized AVX-512 instructions execute the coordinate transformation and Forest-Ruth fourth-order stage updates in parallel across three phases , achieving a cycle computation time of , well within the budget of streaming.
- Protective Interlock Assertion: When , the engine synthesizes an authenticated IEC 61850-8-1 GOOSE multicast frame (
stNumincremented,sqNum = 0) commanding immediate physical lockout of vulnerable recloser controls before the adversary can destabilize the physical transformer.
7. Conclusion and Strategic Relevance#
The deployment of cyber digital twins in high-consequence energy infrastructure requires a rigorous foundation in mathematical physics. Traditional numerical simulation algorithms, borrowed from general-purpose applied mathematics, fail to respect the fundamental symplectic symmetries of physical energy conservation, introducing artificial damping and numerical energy inflation that blind defensive operators to stealth cyber intrusions.
By grounding digital twin execution in Hamiltonian mechanics and explicit Forest-Ruth fourth-order symplectic integration, the Eigenia architecture proves that:
- Long-term secular numerical energy drift can be bounded to absolute zero.
- Physical system invariants (Poincaré 2-form and phase-space volume) hold the predictor still, which is the step that converts a numerical artifact into a usable detection floor.
- A residual read in phase space rather than in energy carries no null direction, so the amplitude at which a stealth False Data Injection Attack becomes detectable is a closed-form function of the metric and the sensor noise, achievable on standard substation edge compute without modifying physical primary equipment.
- A detector built on conserved scalars alone is blind to motion along their level sets, so the invariant that guarantees the floor is best kept separate from the statistic that is tested against it.
This symplectic physics engine establishes the verified foundation for autonomous, resilient grid defense across sovereign energy corridors.
8. References#
- Ruth, R. D. (1983). A canonical integration technique. IEEE Transactions on Nuclear Science, NS-30(4), 2669-2671.
- Forest, E., & Ruth, R. D. (1990). Fourth-order symplectic integration. Physica D: Nonlinear Phenomena, 43(1), 105-117.
- Hairer, E., Lubich, C., & Wanner, G. (2006). Geometric Numerical Integration: Structure-Preserving Algorithms for Ordinary Differential Equations (2nd ed.). Springer.
- Arnold, V. I. (1989). Mathematical Methods of Classical Mechanics (2nd ed.). Springer-Verlag.
- Marsden, J. E., & Ratiu, T. S. (1999). Introduction to Mechanics and Symmetry: A Basic Exposition of Classical Mechanical Systems. Springer.
- International Electrotechnical Commission. (2020). IEC 61850-9-2: Specific Communication Service Mapping (SCSM) - Sampled Values over ISO/IEC 8802-3. IEC.
- International Electrotechnical Commission. (2020). IEC 61850-8-1: Specific Communication Service Mapping (SCSM) - Mappings to MMS and to ISO/IEC 8802-3. IEC.
- Liu, Y., Ning, P., & Reiter, M. K. (2011). False data injection attacks against state estimation in electric power grids. ACM Transactions on Information and System Security, 14(1), 1-33.
- Kundur, P. (1994). Power System Stability and Control. McGraw-Hill.
- Sanz-Serna, J. M., & Calvo, M. P. (1994). Numerical Hamiltonian Problems. Chapman & Hall.
- Yoshida, H. (1990). Construction of higher order symplectic integrators. Physics Letters A, 150(5-7), 262-268.
- Benettin, G., & Giorgilli, A. (1994). On the Hamiltonian interpolation of near-to-the-identity symplectic mappings with application to symplectic integration algorithms. Journal of Statistical Physics, 74, 1117-1143.
- Mo, Y., & Sinopoli, B. (2009). Secure control against replay attacks. 47th Annual Allerton Conference on Communication, Control, and Computing, Monticello, IL, 911-918.