Source-linked AI summary
On Learning Hamiltonian Systems from Data
Tom Bertalan, Felix Dietrich, Igor Mezić, Ioannis G. Kevrekidis
TL;DR
The paper addresses how to learn dynamical models while incorporating the assumption that the data come from a Hamiltonian system with a conserved energy. It reconstructs a Hamiltonian phase space and approximates its generating Hamiltonian using neural networks or Gaussian processes, including for nonlinear and high-dimensional observations. The resulting data-driven pipeline recovers a symplectic copy of the system, while the original phase space is fundamentally non-unique when only transformed observations are available.
Problem
The paper addresses data-driven dynamical modeling that does not routinely incorporate the assumption that observations arise from an underlying Hamiltonian system.
Method
The approach reconstructs phase space from observations and approximates a possibly nonseparable Hamiltonian using jointly trained neural networks or Gaussian processes.
Results
The pipeline extracts a Hamiltonian phase space and generating Hamiltonian from nonlinear, high-dimensional observations, including pendulum movies.
Takeaways & Limitations
The method produces a symplectic copy of the underlying Hamiltonian system from transformed observations without assuming a particular Hamiltonian form.
Takeaways & Limitations
When only transformed observations are available, the original phase space is recoverable only up to coordinate scaling, an additive Hamiltonian constant, and broader non-uniqueness.
Abstract
from arXiv · showhide
Concise, accurate descriptions of physical systems through their conserved quantities abound in the natural sciences. In data science, however, current research often focuses on regression problems, without routinely incorporating additional assumptions about the system that generated the data. Here, we propose to explore a particular type of underlying structure in the data: Hamiltonian systems, where an "energy" is conserved. Given a collection of observations of such a Hamiltonian system over time, we extract phase space coordinates and a Hamiltonian function of them that acts as the generator of the system dynamics. The approach employs an autoencoder neural network component to estimate the transformation from observations to the phase space of a Hamiltonian system. An additional neural network component is used to approximate the Hamiltonian function on this constructed space, and the two components are trained jointly. As an alternative approach, we also demonstrate the use of Gaussian processes for the estimation of such a Hamiltonian. After two illustrative examples, we extract an underlying phase space as well as the generating Hamiltonian from a collection of movies of a pendulum. The approach is fully data-driven, and does not assume a particular form of the Hamiltonian function.
I. INTRODUCTION
The paper incorporates Hamiltonian structure into data-driven dynamical-system learning by reconstructing phase space and approximating a Hamiltonian from observations. It develops data-driven approaches for nonlinear systems and high-dimensional observations.
- The work addresses dynamical-system modeling that incorporates knowledge that observations arise from an underlying Hamiltonian system.
- The introduction places the approach alongside recent work learning dynamical systems, conservation laws, and physics models directly from observations.
- The paper approximates Hamiltonian functions from time-series data using Gaussian processes and neural networks without requiring separability into kinetic and potential terms.
- The method reconstructs phase space from linear or nonlinear, nonsymplectic transformations and produces a symplectomorphic copy of the original Hamiltonian system.
- The pipeline jointly constructs an appropriate phase space and approximates a Hamiltonian from nonlinear, possibly high-dimensional observations such as movie sequences.
II. GENERAL DESCRIPTION
A Hamiltonian system is represented on phase space by a function whose induced dynamics conserve that function along trajectories. The paper formulates Hamiltonian recovery as solving a partial differential equation from time-derivative data, with one value fixing the additive constant.
- A Hamiltonian function H on Euclidean phase space determines the system dynamics for position and momentum coordinates.
- Hamiltonian dynamics imply that H remains constant along system trajectories.
- The dynamics can be restated as a partial differential equation for H at every phase-space point.
- Because the PDE determines H only up to an additive constant, the method pins its value at one arbitrarily chosen phase-space point.
III. EXAMPLE: THE NONLINEAR PENDULUM
The nonlinear pendulum provides an illustrative Hamiltonian system whose governing Hamiltonian is recovered by solving the associated PDE. The paper compares Gaussian-process and neural-network approximations.
- The example considers the one-dimensional nonlinear pendulum Hamiltonian.
- The Hamiltonian generates pendulum dynamics through q̇ = ∂H(q,p)/∂p = p and ṗ = −∂H(q,p)/∂q = −sin(q).
- The paper numerically solves the Hamiltonian PDE using Gaussian processes and neural networks.
A. Approximation using Gaussian processes
The Gaussian-process approach estimates the Hamiltonian from derivative information implied by observed dynamics, then evaluates the resulting function on new phase-space points. Kernel differentiation and regularization produce a solvable linear system.
- The method models the unknown Hamiltonian as a Gaussian process with a Gaussian covariance kernel over phase-space points.
- The Gaussian-process estimate at new points depends on Hamiltonian values over the observed dataset and is reformulated using derivative information.
- Time derivatives provide the Hamiltonian gradient at observed points, allowing estimates at new points near the data through differentiated kernels.
- An arbitrary pinning term supplies the additional constraint needed to form the linear system for the Hamiltonian estimate.
- The approach evaluates the estimate on a fine grid and uses Tikhonov regularization with σ = 10−5 for the kernel-matrix inverse.
- The resulting approximation is evaluated using mean squared error on 625 training points and 200 independently drawn validation points.
B. Approximation using an artificial neural network
The neural-network approach represents the Hamiltonian with an artificial neural network and trains it using a loss built from Hamiltonian dynamics and automatic differentiation. Ablation results show that data coverage and selected loss terms strongly affect solution quality.
- Network representation: The Hamiltonian surrogate is an artificial neural network whose input is [q,p] and whose output is the learned function H-hat(q,p).The experiments use two hidden layers of width 16, with nonlinear hidden-layer activations and an identity output layer.
- Training procedure: The network parameters are learned by stochastic gradient descent with Adam on batches of simulated states and their time derivatives.Training data consist of sampled initial conditions, short trajectories, and evaluated q-dot and p-dot values.
- Training objective: Automatic differentiation computes derivatives of the learned Hamiltonian for the loss terms used during training.The loss depends on the learned Hamiltonian, and its partial derivatives with respect to p and q are obtained explicitly.
- Ablation: Removing f4 has little visible effect, whereas removing either f1 or f2 produces poor results across the figure.The authors attribute the f4 result to redundancy among the governing equations and note that unequal weighting was used to balance p-dot and q-dot contributions.
- Data coverage: The learned solution is accurate primarily in the central region where the training data are densely sampled.This limitation also appears in the ablation experiment, where the true zero Hamiltonian is approximated only in the densely sampled central box.
IV. ESTIMATING HAMILTONIAN STRUCTURE FROM OBSERVATIONS
The paper estimates a Hamiltonian phase space directly from observations when the original coordinates and observation map are unknown. The recovered system is a symplectomorphic copy, subject to fundamental coordinate and Hamiltonian ambiguities, and the method is sensitive to data quantity.
- Observation model: The method assumes observations are related to a Hamiltonian phase space by a diffeomorphic observation map, which need not preserve the symplectic structure.A learned transformation maps observed variables into a deformed phase space where the dynamics remain Hamiltonian.
- Identifiability: A constant coordinate scaling is indistinguishable from scaling the Hamiltonian, so the recovered system may be an arbitrarily scaled symplectomorphic copy.This ambiguity is presented as a fundamental limitation when no additional information about the original phase space is available.
- Joint reconstruction: An autoencoder learns a map from observed points and their time derivatives into a symplectomorphic copy of the original phase space while jointly estimating its Hamiltonian.The inverse transformation and Hamiltonian are constructed simultaneously from observation-space data.
- Identifiability: Only symplectic transformations of the original coordinates can generally be recovered from observation data, not the original q and p values themselves.Once recovered coordinates are fixed, the Hamiltonian is determined up to an additive constant.
- Data requirements: Using only 331 images for the network in Section IV D produced significantly higher validation loss, consistent with overfitting.The reported comparison indicates that the amount of observational data affects validation performance.
A. A composite loss function for the joint learning of a transformation and a Hamiltonian
The composite objective jointly trains the observation-space transformation and Hamiltonian approximation. Its design prevents collapsed representations, while the reported training and validation losses are generally comparable.
- Joint objective: The loss function trains an autoencoder transformation together with a neural-network approximation of the Hamiltonian.The learned transformations and Hamiltonian jointly determine the loss, with transformed-space time derivatives computed during training.
- Network structure: The network architecture maps observations into Hamiltonian coordinates and reconstructs the observations through the corresponding forward transformation.The figure depicts the inverse map to learned q-hat and p-hat followed by reconstruction through the learned observation map.
- Degenerate solutions: Including f4 during joint transformation learning can create a collapsed representation in which all sampled observations map to one point and the learned Hamiltonian is constant.In that state, the Hamiltonian derivatives vanish and the loss can become zero or small.
- Degenerate solutions: A non-collapse loss component f6 is added to require that the learned transformation not collapse the input.The authors state that only a very small weighting factor is needed for this constraint.
- Reported losses: The Gaussian-process row uses 625 training points and 200 validation points, with training loss 2.2·10^-5 and validation loss 3.5·10^-5.The table compares training and held-out validation losses across the Gaussian-process and neural-network experiments.
B. Example: linear transformation of the pendulum
The linear-transformation experiment learns a phase-space representation and Hamiltonian from transformed pendulum observations. The recovered symplectomorphism preserves q unmixed with p, while the learned Hamiltonian matches the original on old coordinates up to an additive constant.
- Linear transformation: The observations are generated by linearly transforming the pendulum phase space with θ−1(x,y)=A−1[x,y]T=[q,p]T.The underlying pendulum Hamiltonian is H(q,p)=p2/2+(1−cosq).
- Linear transformation: The network learns transformed coordinates ˆq, ˆp and a Hamiltonian ˆH from observations and their time derivatives.The learned transformation is trained jointly with the Hamiltonian representation, using automatic differentiation through the transformation.
- Identifiability: The original phase space cannot be uniquely recovered from transformed observations; the learned map is constrained only to approximate a symplectomorphism.The data do not determine the exact inverse transformation ˆA·A−1=I.
- Recovered phase space: The learned symplectomorphism preserves q unmixed with p in one of the two discovered coordinates.This behavior is consistent with transformations that preserve the Hamiltonian formulation.
- Recovered Hamiltonian: The transformed Hamiltonian is the same as the original Hamiltonian on the old coordinates, modulo an additive constant.The figure compares the true Hamiltonian with the learned function pulled back onto the original q,p space.
C. Example: nonlinear transformation of the pendulum
The nonlinear-transformation experiment applies a nonlinear observation map to the pendulum and learns a flexible inverse representation. The resulting induced symplectomorphism again preserves an approximately monotonic q coordinate.
- Nonlinear transformation: The data are transformed through a specified nonlinear map from (q,p) to (x,y), with an analytical inverse and Jacobian.The analytical Jacobian supplies the time derivatives needed by the network.
- Learned representation: The learned encoder and decoder use small multilayer perceptrons rather than being restricted to linear transformations.This relaxes the linear parameterization used in the preceding experiment.
- Result: The induced symplectomorphism again preserves an approximately monotonically increasing or decreasing q in one learned coordinate.The result is shown in Fig. 4.
D. Example: constructing a Hamiltonian system from nonlinear, high-dimensional observations of q,p
The high-dimensional experiment constructs a Hamiltonian system from rendered pendulum observations. An autoencoder extracts a phase-space representation from images, and the learned Hamiltonian broadly resembles the truth while remaining approximately conserved.
- Image observations: Pendulum trajectories are rendered as images with decaying tails so each frame contains information about position q and velocity p.The tail length encodes velocity, although p is not used directly during rendering.
- Learned phase space: The image manifold is encoded into a four-dimensional phase space split into learned position and momentum coordinates.The encoding uses ˆz=[ˆq1,ˆq2,ˆp1,ˆp2], with the image manifold mapped into this four-dimensional layer.
- Autoencoder: The autoencoder reconstructions preserve only the magnitude of p because the Hamiltonian requires p2 rather than the sign of p.The reconstruction experiment uses a PCA projection followed by a dense autoencoder.
- Training: Training avoids constant or trivial Hamiltonians by encouraging nonzero variation and penalizing both mean and maximum squared errors.A constant Hamiltonian would satisfy the conservation requirements without representing meaningful system structure.
- Learned Hamiltonian: The learned pulled-back Hamiltonian broadly resembles the true Hamiltonian and satisfies dˆH/dt≈0, typically about 10−2.The learned Hamiltonian is evaluated on images associated with known q,p pairs.
V. CONCLUSIONS
The paper presents a completely data-driven pipeline that constructs a phase space and approximates a Hamiltonian from nonlinear, possibly high-dimensional observations. It also identifies fundamental nonuniqueness when only transformations of the original phase space are observed and points to extensions beyond time-independent Hamiltonian systems.
- The pipeline constructs an appropriate phase space and approximates a Hamiltonian function from nonlinear, possibly high-dimensional observations such as movies.
- Observing only transformations of an original Hamiltonian phase space permits recovery of a symplectic copy, with constant coordinate scaling and an additive Hamiltonian constant remaining free.
- The recovered symplectic phase space is not unique when no additional information about the original space is available.
- Extensions to time-dependent Hamiltonians could address certain dissipative systems, while broader normal-form targets could remove the restriction to Hamiltonian systems.