C-PHAST: Compositional Port-Hamiltonian World Models for Structured Dynamics Transfer

Shubham Bhardwaj, Chandrajit BajajarXiv 2026

TL;DR

Imagine you need to wire a new generator into a power grid or swap a leg onto a different robot, and you want to know if it will overload or fall before you flip the switch. C-PHAST is a physics-based world model that learns how individual components store and lose energy, then snaps them together into brand-new configurations without retraining. Not only does it predict unseen systems accurately, it also passes causal physics sanity checks—like slowing down when motors turn off—where massive black-box models fail.

What Problem Does This Paper Address?

When you change the structure of a physical system—like plugging a new distributed generation unit (DGU) into a DC microgrid—you have no training data for the new setup, and testing it in the real world risks blowing a fuse or overloading a line. Furthermore, real-world sensors rarely show everything: a grid might measure voltages while currents remain hidden.

Figure 1. How attachment location governs overload risk under fixed component laws. In this saved simulation starting from supplied states, wiring, and line laws, connecting unit 5 at bus A overloads the highlighted line while connecting it at bus B stays within the synthetic current and voltage limits, and C-PHAST’s forecast tracks the independent physical reference closely in both cases. The equipment drawings are schematic while the current traces are simulated data. Appendix J defines the peak-current screening rule and explains how this illustrative scenario is separate from the headline voltage-error benchmark.

Existing machine learning models either treat the whole system as one rigid black box (which breaks when the wiring or robot body changes) or struggle to infer hidden starting states from partial, noisy measurements. The authors ask: Can we learn reusable, component-level physical laws once, infer hidden states from partial history, and reliably predict—and even rank—proposed new configurations before intervening?

Methods

C-PHAST (Compositional Port-Hamiltonian Architecture for Structured Temporal Dynamics) builds on port-Hamiltonian (pH) mechanics. Instead of learning a monolithic black box, it separates what a component does from how it connects:

  • Reusable Local Laws: Components of the same type (e.g., all DGUs in a grid, or all four legs of a quadruped robot) share a single learned law describing their energy storage (Hamiltonian) and dissipation (friction/resistance).
  • Power-Preserving Interconnections: Components interact through "ports"—conjugate pairs of variables whose product is power (like voltage and current, or force and velocity). By wiring these ports with a skew-symmetric matrix, C-PHAST guarantees that the connections themselves neither create nor destroy energy; they only route it.
  • History-Based State Inference: At query time, C-PHAST freezes the learned component laws and optimizes an earlier starting state to match recent partial measurements (like voltage-only histories), advancing it to the present.
  • External Decision Making: C-PHAST acts strictly as a physical simulator, returning predicted trajectories, energy losses, and operating-limit checks so an external operator or controller can choose the best action.
Figure 3. Separating physical prediction from external decision making. Given measurement histories and known inputs, C-PHAST forecasts how proposed configurations and input sequences will evolve, while a human operator or external controller compares those physical consequences and executes the chosen action. Dashed arrows carry hypothetical queries and predictions, and solid arrows carry measurements or executed commands.

Datasets

The authors evaluate C-PHAST across simulated and real-world benchmarks:

  • Electrical Microgrids (Simulated): Isolated nonlinear-capacitor DGU trajectories (32 trajectories for training) tested on unseen 5-unit grids, 3-unit chains with 0.02 V Gaussian voltage noise, and 60 proposed attachment scenarios near a 400 mA limit.
  • Quadruped Locomotion (Simulated): Training on ANYmal-D trajectories with zero-shot transfer to Unitree Go2 (50-step / 1 s rollouts), plus 20 lateral-push recovery scenarios on Go2.
  • Real Boston Dynamics Spot Hardware: 82 overlapping 20-second inspection walks from five real recordings, using shared 22-D physical inputs (body wrenches, motor torques, and foot stance flags) paired with a registered lab scan for virtual camera coverage and clearance checks.

Key Insights and Ideas

  • Connections create emergent behavior: Even without adding new resistors or sensors, a lossless connection can route a component's disturbance energy to another component's damper, or make a hidden state visible on another component's sensor. The authors prove exact linear-system conditions for when this happens.
  • Replay accuracy hides broken physics: On real Spot recordings, an unconstrained MLP fits 20-second mechanical work tighter than C-PHAST (40.3 J vs. 64.5 J error). Yet when probed without retraining, the MLP and a 1.38M-parameter Robotic World Model (RWM) are over 1,490×–5,060× too weak under direct knee torque pulses, keep "phantom" motion when motors are cut off, and cannot adapt to a +50 kg torso payload. They memorized gait correlations rather than learning Newtonian mechanics.
  • Factorization prevents numerical collapse: Separating Spot's heavy body ($\approx 39\text{ kg}$) from its light knee joints ($\approx 0.017\text{ kg m}^2$) into coupled blocks avoids ill-conditioned matrix solves that cause a parameter-matched monolithic PHAST model to fail on 4/82 walks.
Figure 2. Reusing one shared leg law across Spot to compare whole-motion battery cost. Four instances of a single learned leg law (dashed leaders) are coupled through the body and driven by recorded body wrenches, raw motor torques, and binary stance flags through the shared contact port, restarting every second while recorded arm work enters the electrical readout. Across these two held-out recordings that both satisfy the virtual lab-scan coverage and clearance requirements, C-PHAST’s retrospective energy estimates and Spot’s battery meter agree that movement B draws 1.25 kJ less (14%) in this held-out comparison rather than a command-only plan, with each recording scored by its own leave-one-recording-out fit. The robot rendering illustrates the model, and the bottom-right panel previews the zero-refit physical-consistency checks detailed alongside the unified five-model benchmark in Section 4.6 and Tables 9–10 (pair selection in Appendix O; linked camera and map views in Figure 10).

Key Results

  • Microgrid Reconfiguration & Screening: Trained only on isolated DGUs, C-PHAST predicts unseen 5-unit grids with 65× lower mean voltage RMSE (0.181 mV vs. 11.78 mV) than compositional pHNNs, and screens 60/60 proposed attachments without error (vs. 55/60 for compositional pHNN and 18/60 for N-PHDAE).
  • Partial-Sensing Forecasting: From noisy voltage-only histories, C-PHAST cuts hidden-current RMSE by 67.6% compared to CT-SUBNET (27.98 mA vs. 86.25 mA).
  • Zero-Shot Robot Transfer: Trained only on ANYmal-D, C-PHAST achieves the lowest zero-shot 1-second rollout error on Unitree Go2 (0.073 rad²), beating a fixed-dimension GRU (0.112 rad²) that fit the source robot 9× tighter.
  • Real Spot Battery Selection & Stress Tests: With just 35.5k parameters, C-PHAST selects near-best battery-cost movements 90.47% of the time across 4,152 comparisons—matching an 88.6k MLP (90.58%) and beating a 6.73M DreamerV3 RSSM (86.52%). Crucially, only C-PHAST passes all five zero-refit physical stress tests (causal torque response, strict unforced passivity $\Delta H \le 0$, left–right symmetry, and +50 kg payload scaling).

Limitations and Future Work

The authors note that component reuse, voltage-only state initialization, and attachment screening were validated in separate studies; combining them into one end-to-end pipeline and extending certified error bounds from known linear systems to learned nonlinear models remain open steps. On Spot, the hardware benchmark evaluates input-conditioned replay using recorded body wrenches rather than closed-loop command execution. Future work aims to propagate joint uncertainty over states and learned laws, and to move from choosing where a unit attaches to designing the entire interconnection topology.

Summary updated

BibTeX
@misc{bhardwaj2026c,
  author = {Shubham Bhardwaj and Chandrajit Bajaj},
  title = {{C-PHAST: Compositional Port-Hamiltonian World Models for Structured Dynamics Transfer}},
  year = {2026},
  eprint = {2612.03677},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2612.03677},
}
Figure