port-hamiltonian neural networks

**Port-Hamiltonian Neural Networks (PHNNs)** are a **physics-informed neural architecture that encodes the structure of port-Hamiltonian systems directly into the network design** — ensuring that learned dynamics conserve or dissipate energy according to thermodynamic laws by construction, rather than learning to approximate these constraints from data, providing guaranteed long-horizon stability, interpretable energy functions, and the ability to model open systems with external inputs (ports) that exchange energy with the environment, with applications in robotics, power systems, and chemical process control. **Port-Hamiltonian Systems: The Mathematical Foundation** Classical Hamiltonian mechanics describes closed (energy-conserving) systems. Port-Hamiltonian (pH) systems extend this to open systems with energy exchange: dx/dt = [J(x) - R(x)] ∇_x H(x) + B(x) u y = B(x)^T ∇_x H(x) where: - **x**: state vector (positions, momenta, charges, etc.) - **H(x)**: Hamiltonian — the total energy function (kinetic + potential) - **J(x)**: skew-symmetric interconnection matrix (J = -J^T): encodes conservative energy exchange between subsystem components - **R(x)**: positive semi-definite resistive matrix (R = R^T, R ≥ 0): encodes energy dissipation (friction, resistance) - **B(x)**: port matrix: maps external inputs u to state dynamics - **y**: output conjugate to input u (power port: power = u^T y) **Energy Properties by Construction** The pH structure enforces the power balance inequality: dH/dt = u^T y - ∇_x H^T R(x) ∇_x H ≤ u^T y The term u^T y is the external power input; ∇_x H^T R ∇_x H ≥ 0 is the internal dissipation. This means: - If u = 0 (no external input): dH/dt ≤ 0 — energy can only decrease (dissipate) or stay constant - With input: total energy change equals external power minus dissipation - No unphysical energy creation — passivity is guaranteed by the matrix structure This structural guarantee makes long-horizon predictions stable (energy is bounded), unlike black-box neural networks that may produce trajectories with unbounded energy growth. **PHNN Architecture** Port-Hamiltonian Neural Networks learn the components {H, J, R, B} parameterically: - **H_θ(x)**: neural network modeling the Hamiltonian (energy function). Constrained H_θ ≥ 0 via squashing (ensures energy is non-negative). - **J_θ(x)**: learned skew-symmetric matrix. Enforced by parametrizing as J = A - A^T for any matrix A. - **R_θ(x)**: learned positive semi-definite matrix. Enforced by parametrizing as R = L L^T for any matrix L. - **B_θ(x)**: input coupling matrix (optional, for systems with external inputs). The network outputs the dynamics dx/dt = [J_θ - R_θ] ∇_x H_θ + B_θ u, which automatically satisfies the power balance inequality regardless of parameter values — the structural constraints are baked into the parametrization, not enforced as soft penalties. **Comparison to Hamiltonian Neural Networks** | Feature | Hamiltonian Neural Networks (HNN) | Port-Hamiltonian NNs (PHNN) | |---------|----------------------------------|---------------------------| | **Dissipation** | No — energy perfectly conserved | Yes — models friction, resistance | | **External inputs** | No | Yes — ports for control inputs | | **Coupling systems** | Manual | Compositional — pH systems compose naturally | | **Use case** | Conservative systems (planetary orbits, ideal pendulum) | Real engineering systems (robot joints with friction) | **Applications** **Robotic manipulation**: Robot joint dynamics include inertia (Hamiltonian), friction (resistive matrix), and motor torque (port/input). PHNN provides physically valid dynamics models for model-predictive control — long-horizon rollouts remain stable for trajectory planning. **Power grid dynamics**: Generator swing equations follow pH structure with resistive network losses and external power injection. PHNNs learn grid stability margins and transient response without violating power flow constraints. **Chemical reactors**: CSTR (continuous stirred tank reactor) dynamics conserve mass and energy with dissipation from reaction exothermicity. PHNN learns reaction kinetics while guaranteeing thermodynamic consistency. **Fluid mechanics**: Incompressible Navier-Stokes has a pH formulation. PHNNs trained on fluid simulation data produce conservative reduced-order models for real-time flow control. Port-Hamiltonian Neural Networks represent the most principled approach to physics-informed machine learning for dynamical systems — not by adding physics as a loss penalty, but by designing the architecture so that physics is automatically satisfied.

Go deeper with CFSGPT

Get AI-powered deep-dives, save terms, and run advanced simulations — free account.

Create Free Account