Symplectic ODE-Net: Learning Hamiltonian Dynamics with Control

Yaofeng Desmond Zhong, Biswadip Dey, Amit Chakraborty

Introduction

Symplectic ODE-Net (SymODEN) is a deep learning framework that bakes the laws of Hamiltonian mechanics directly into a neural network's architecture. By learning interpretable physical components like mass and potential energy from raw data, it achieves superior generalization and enables the synthesis of robust, energy-based controllers for complex mechanical systems.

The Challenge with Black-Box Models

Standard "black-box" neural networks are notoriously poor at modeling physical systems. They often fail to conserve energy, require massive amounts of training data, and struggle to generalize to states outside their training set. While previous "physics-informed" models attempted to solve this, they faced three major hurdles:

  1. Lack of Control: Most models only handled autonomous (unforced) systems, making them useless for robotics or engineering tasks requiring external inputs.
  2. Hidden States: They often required "generalized momentum" data, which is rarely available in real-world sensors (we usually only have velocity).
  3. Coordinate Issues: Standard networks struggle with angular data (like a pendulum's position), often failing to recognize that $-\pi$ and $+\pi$ are the same point.

Methods: The SymODEN Architecture

The authors introduce SymODEN, which builds upon the Neural ODE framework. Instead of asking a network to learn a generic transition function $\dot{x} = f(x)$, they force the network to learn the specific components of a generalized Hamiltonian system.

SymODEN Architecture

Specifically, the architecture learns:

  • Mass Matrix ($M$): Parametrized to be symmetric and positive definite, ensuring kinetic energy is always positive.
  • Potential Energy ($V$): A scalar-valued network representing the system's energy landscape.
  • Control Matrix ($g$): A network that determines how external forces (torques/thrusts) affect the system.

Key Innovations: * Angle-Awareness: The model uses a $(\cos q, \sin q)$ embedding to handle angular coordinates properly on a manifold ($S^1$), avoiding the "jump" discontinuity at $\pm \pi$. * Differentiable ODE Solvers: By using an ODE solver (like RK4) within the training loop, the model can learn from state trajectories directly without needing to estimate noisy second-order derivatives (acceleration). * Augmented Dynamics: To handle control, the authors augment the state space, allowing the network to learn how constant control inputs influence the trajectory over a short time horizon.

Experimental Insights and Results

The model was evaluated on simulated physical benchmarks, including a standard pendulum, a CartPole, and an Acrobot. Data was generated using high-precision simulators to ensure the "ground truth" respected energy conservation.

Trajectory Prediction and Learned Physics
  • Physics as a Regularizer: By enforcing Hamiltonian structure, the search space for the neural network is drastically reduced. This acts as a powerful inductive bias, leading to much higher sample efficiency. SymODEN models with fewer parameters (e.g., 0.13M) consistently outperformed naive baselines with nearly triple the parameters (0.36M).
  • Interpretability is Free: Because the network learns $M(q)$ and $V(q)$ separately, you can extract and plot the learned potential energy and mass matrices. This transforms the model from a black box into an inspectable representation of the underlying physics.
  • Energy Conservation & Extrapolation: In unforced scenarios, SymODEN naturally conserves the total energy of the system. Baseline models showed "energy drift," causing their predictions to spiral out of control over time. Furthermore, SymODEN can predict behavior far outside the range of velocities seen during training.
  • Control Synthesis: Once the model learns the energy landscape, "Energy Shaping" control techniques can be used to design controllers with provable stability. The authors demonstrated that a controller designed using the learned parameters of a SymODEN could successfully swing up and balance a pendulum, even when the required control force was three times larger than anything seen in the training data.

Limitations and Future Work

  • Underactuation: While the model learns the dynamics of underactuated systems (like the Acrobot), synthesizing controllers for these systems remains a complex future challenge.
  • Dimensionality: The current work focuses on 1D and 2D angular manifolds. Extending this to 3D orientations (SO(3)) for complex drone or satellite maneuvers is a suggested next step.
  • Port-Hamiltonian Systems: The authors aim to incorporate a broader class of physics priors, such as port-Hamiltonian formulations, to model systems with dissipation (friction) and more complex energy exchanges.

Summary updated

BibTeX
@inproceedings{zhong2020symplectic,
  author = {Yaofeng Desmond Zhong and Biswadip Dey and Amit Chakraborty},
  title = {{Symplectic ODE-Net: Learning Hamiltonian Dynamics with Control}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure