Discovering Conservation Laws using Optimal Transport and Manifold Learning

Peter Y. Lu lup@uchicago.edu Data Science Institute, University of Chicago, Chicago, IL 60637, USA Department of Physics, Massachusetts Institute of Technology, Cambridge, MA 02139, USA    Rumen Dangovski Department of Electrical Engineering and Computer Science, Massachusetts Institute of Technology, Cambridge, MA 02139, USA    Marin Soljačić Department of Physics, Massachusetts Institute of Technology, Cambridge, MA 02139, USA
September 1, 2022
Abstract

Conservation laws are key theoretical and practical tools for understanding, characterizing, and modeling nonlinear dynamical systems. However, for many complex dynamical systems, the corresponding conserved quantities are difficult to identify, making it hard to analyze their dynamics and build efficient, stable predictive models. Current approaches for discovering conservation laws often depend on detailed dynamical information, such as the equation of motion or fine-grained time measurements, with many recent proposals also relying on black box parametric deep learning methods. We instead reformulate this task as a manifold learning problem and propose a non-parametric approach, combining the Wasserstein metric from optimal transport with diffusion maps, to discover conserved quantities that vary across trajectories sampled from a dynamical system. We test this new approach on a variety of physical systems—including conservative Hamiltonian systems, dissipative systems, and spatiotemporal systems—and demonstrate that our manifold learning method is able to both identify the number of conserved quantities and extract their values. Using tools from optimal transport theory and manifold learning, our proposed method provides a direct geometric approach to identifying conservation laws that is both robust and interpretable without requiring an explicit model of the system nor accurate time information.

I Introduction

Conservation laws are powerful constraints on the dynamics of many physical systems in nature, and the corresponding conserved quantities are essential features for characterizing the behavior of these systems. Through Noether’s theorem, conservation laws are closely tied with the symmetries of a physical system and play a key role in our understanding of physics. Conservation laws also help stabilize and enhance the performance of predictive models for complex nonlinear dynamics, e.g. symplectic integrators for Hamiltonian systems [Hairer2006] and pressure projection for incompressible fluid flow [GUERMOND20066011]. In fact, for chaotic dynamical systems, conserved quantities are often the only features that can be successfully predicted far into the future. Discovering conservation laws helps us characterize the long term behavior of complex dynamical systems and understand the underlying physics.

While the conservation laws of many physical systems are well-known and often derived from known symmetries, there are still many instances where it is difficult to even determine the number of conservation laws, let alone explicitly extract the conserved quantities. As a historical example, consider the Korteweg–De Vries (KdV) equation modeling shallow water waves. The KdV equation, despite its apparent complexity, has infinitely many conserved quantities [doi:10.1063/1.1664701] and is, in fact, fully solvable via an inverse scattering transform [PhysRevLett.19.1095]—a discovery made after significant theoretical and computational effort. Developing better general methods for identifying conserved quantities will allow us to improve our understanding of new or understudied physical systems and build more efficient and stable predictive models.

In real-world applications, an accurate model for the underlying physical system is often unavailable, forcing us to identify conservation laws using only sample trajectories of the system dynamics. One broad approach is to use modern data-driven methods based on the Koopman operator formulation of dynamical systems, which lifts the dynamics into an infinite dimensional operator space [Mauroy2020]. In the Koopman formalism, conserved quantities are just one type of Koopman eigenfunction with eigenvalue zero. Thus, one approach is to first apply a system identification method, such as dynamic mode decomposition [schmid_2010, Williams2015ADA], sparse identification with a library of basis functions [Brunton3932], or even deep learning-based approaches [lusch2018deep, Champion22445, https://doi.org/10.48550/arxiv.2107.10879], to model the system dynamics and then set up and solve the Koopman eigenvalue problem. Alternatively, previous work has also proposed directly setting up the eigenvalue problem by estimating time derivatives from data and then fitting the conserved quantities using a library of possible terms [8618963] or a neural network [https://doi.org/10.48550/arxiv.2203.12610]. These methods can work quite well but require that the measured trajectories have sufficiently low noise and high time resolution in order to accurately estimate time derivatives.

Constructing a model for a dynamical system provides much more information than just the conservation laws. In fact, even estimating time derivatives is usually not necessary if we are only interested in identifying conserved quantities. In this work, we will instead focus on an alternative approach that does not require an explicit model or detailed time information but rather takes advantage of the geometric constraints imposed by conservation laws. Specifically, the presence of conservation laws restricts each trajectory in phase space to lie solely on a lower dimensional isosurface of the conserved quantities. The dimensionality of these isosurfaces can provide information about the number of conserved quantities or constraints [PhysRevLett.126.180604]. Furthermore, since each isosurface corresponds to a particular set of conserved quantities, the variations in shape of the isosurfaces directly correspond to variations in the conserved quantities. In other words, we can identify and extract conserved quantities by examining the varying shapes of the isosurfaces sampled by the trajectories.

In contrast with recent work using black box deep learning methods to fit conserved quantities that are consistent with the sampled isosurfaces [PhysRevResearch.2.033499, PhysRevResearch.3.L042035], we propose and demonstrate a non-parametric manifold learning approach that directly characterizes the variations in the sampled isosurfaces, producing an embedding of the space of conserved quantities. Our method first uses the Wasserstein metric from optimal transport [Villani2009] to compute distances in shape space between pairs of sampled isosurfaces and then extracts a low dimensional embedding for the manifold of isosurfaces using diffusion maps [6789755, Coifman2005]. Each point in this embedding corresponds to a distinct isosurface and therefore to a distinct set of conserved quantities, i.e. the embedding explicitly parameterizes the space of varying conserved quantities. Related methods have been recently suggested for characterizing molecular conformations using the 1-Wasserstein distance together with diffusion maps [9098723] as well as performing system identification by comparing invariant measures using the 2-Wasserstein distance [https://doi.org/10.48550/arxiv.2104.15138].

We provide an analytic analysis of our approach for a simple harmonic oscillator system and numerically test our method on several physical systems: the single and double pendulum, planar gravitational dynamics, the KdV equation for shallow water waves, and a nonlinear reaction–diffusion equation that generates an oscillating Turing pattern. We also demonstrate the robustness of our approach to noise in the measured trajectories as well as missing information in the form of a partially observed phase space.

Ii Proposed Manifold Learning Approach

Proposed non-parametric method for discovering conservation laws illustrated using a simple pendulum example (analyzed further in Sec. 
Figure 1: Proposed non-parametric method for discovering conservation laws illustrated using a simple pendulum example (analyzed further in Sec. IV.2). (a) First, we collect and normalize the trajectory data from the dynamical system. Two example trajectories are highlighted in red and blue. (b) Then, we use the Wasserstein metric from optimal transport to compute the distance between each pair of trajectories and construct a distance matrix. For the two example trajectories, the optimal transport plan is shown as lines connecting pairs of points. The constructed distance matrix is plotted with color representing the computed Wasserstein distance between each pair of trajectories. The computed distance between the two example trajectories is marked (black dots) on the distance matrix plot. (c) An embedding of the shape space manifold is extracted from the distance matrix using diffusion maps. The embedding plot is colored by the conserved energy of the pendulum . The points corresponding to the two example trajectories are marked in red and blue. (d) Finally, a heuristic score (Appendix B) is used to select relevant components. In this case, only component 1 is relevant, corresponding to a single conserved quantity—the energy . Again, the embedding plot is colored by , and the two example trajectories are marked in red and blue.

Our proposed approach uses manifold learning to identify and embed the manifold of phase space isosurfaces sampled by the trajectories of a dynamical system. In particular, we compute a diffusion map (Fig. 1c) over a set of trajectories, each of which samples a particular phase space isosurface (Fig. 1a). The pairwise distances between these trajectories are given by the 2-Wasserstein distance (Fig. 1b), providing the metric structure necessary for applying diffusion maps. The manifold embedding extracted by the diffusion map corresponds directly to the space of conserved quantities (Fig. 1d). Note that this type of analysis does not require knowledge of the equations of motion (Eq. 1) and makes no direct reference to time.

ii.1 Dynamical Systems

Consider a dynamical system with states that live a in -dimensional phase space and evolve in time according to a system of first order ODEs

(1)

with conserved quantities .

ii.1.1 Conserved Quantities and Phase Space Isosurfaces

Along a particular trajectory , the conserved quantities form a set of constraints

(2)

which depend on the values of the conserved quantities . This set of constraint equations restricts the trajectory to lie in a phase space isosurface with dimension . In fact, if any point of a trajectory lies on the isosurface , then all other points from the trajectory will lie on the same isosurface.

By studying the variations in shape of these isosurfaces, we are able to directly characterize the space of conserved quantities. In particular, consider the manifold formed by the isosurfaces in shape space. This manifold is parameterized by the conserved quantities . Therefore, by analyzing using manifold learning, we can extract the conservation laws of the underlying dynamical system.

ii.1.2 Ergodicity and Physical Measures

To uniquely identify the isosurface associated with each trajectory, we must make several additional assumptions that will allow us to treat the set of points making up each trajectory as samples from an ergodic invariant measure on the corresponding isosurface. Specifically, we assume that, for each trajectory with conserved quantities , the dynamical system (Eq. 1) admits a physical measure [medio_lines_2001] that is ergodic on the isosurface and is defined by

(3)

where is the Dirac measure centered on . This ensures that trajectories with the same conserved quantities will sample the same distribution on the same isosurface, allowing us to use the distribution sampled by each trajectory as a proxy for the corresponding isosurface.

In practice, the sampled distribution may be lower dimensional than the corresponding isosurface if some of the conserved quantities do not vary in the dataset and instead correspond to fixed constraints, or if the dynamical system is dissipative. In the former case, this does not affect our ability to uniquely identify a distribution with an isosurface and its corresponding set of conserved quantities, meaning that we are able to apply this approach even if the provided phase space is much larger than the intrinsic phase space of the dynamical system. In the latter case, the dissipative nature of the system may cause information about conservation laws relevant during the transient portion of the dynamics to be lost, but we are still able to use our approach to identify conserved quantities relevant for the long term behavior of the system.

ii.2 Wasserstein Metric

To analyze the isosurface shape space manifold —i.e. the manifold of conserved quantities—using manifold learning methods, we need to place some structure on the points . Having associated each isosurface with a corresponding distribution defined by an ergodic physical measure , we choose to lift the Euclidean metric on the phase space into the space of distributions using the 2-Wasserstein metric from optimal transport

(4)

where the cost function is the squared Euclidean distance, and is a valid transport map between and [Villani2009].

For discrete samples, the 2-Wasserstein distance between two sets of sample points and is defined as

(5)

where the cost matrix , and the transport matrix is subject to the constraints

(6)

To efficiently compute an entropy regularized form of this optimization problem, we use the Sinkhorn algorithm [NIPS2013_af21d0c9] and estimate the Wasserstein distance as a debiased Sinkhorn divergence [pmlr-v119-janati20a].

One important subtlety in this construction is the choice of the ground metric for optimal transport. As previously mentioned, we use a Euclidean metric on the phase space, which implicitly imposes a choice of units to make the phase space dimensionless. In fact, there is no canonical choice for the ground metric, and different choices result in different Wasserstein metrics on the shape space. For example, when multiple conserved quantities are present, the relative effect of each conserved quantity on the computed Wasserstein distances will determine how prominent each conserved quantity is and how easily it is identified using manifold learning. To partially mitigate this issue and improve consistency, we normalize each component of our data to have a maximum absolute value of 1 before computing the pairwise Wasserstein distances.

ii.3 Diffusion Maps

Using the structure provided by the Wasserstein metric, we then use diffusion maps to generate an embedding for . The diffusion map manifold learning method uses a spectral embedding algorithm applied to an affinity matrix to construct a low dimensional embedding of the data manifold [6789755, Coifman2005]. Using the pairwise Wasserstein distances computed from discrete samples provided by the trajectory data (Eq. 5), we first construct a kernel matrix using a Gaussian kernel

(7)

and then scale it to form an affinity matrix for our spectral embedding

(8)

where , and is a hyperparameter. The spectral embedding algorithm then takes this affinity matrix and constructs a normalized graph Laplacian

(9)

where is the identity matrix. The eigenvectors corresponding to the smallest eigenvalues (excluding ) of the Laplacian then provide an approximate low dimensional embedding of the manifold of conserved quantities . In our experiments, we set so that the Laplacian computed by the spectral embedding algorithm approximates the Laplace–Beltrami operator [6789755].

To estimate the dimensionality of and to choose which eigenvectors to include in our embedding, we use a heuristic score that combines a measure of relevance, given by a length scale computed from the Laplacian eigenvalues, with a previously suggested measure of “unpredictability” for minimizing redundancy [pfau2018minimally]. To construct our embedding, we only include the Laplacian eigenvectors with score above a chosen cutoff value and discard the rest as either noise or redundant embedding components. To determine the cutoff, we perform a sweep of the cutoff value looking for robust ranges and find that a cutoff of works well across all of our experiments, which consist of a wide variety of datasets and dynamical systems. See Appendix B for more details.

Iii Analytic Result for the Simple Harmonic Oscillator

In the case of a simple harmonic oscillator (SHO) without measurement noise and in the infinite sample limit, we are able to explicitly derive an analytic result for our proposed procedure. We first compute the pairwise distances provided by the Wasserstein metric and then derive the embedding produced by a diffusion map, which corresponds to the conserved energy of the SHO.

iii.1 Wasserstein Metric: Constructing the Isosurface Shape Space

Consider a SHO with Hamiltonian

(10)

given in terms of position and momentum . The SHO energy isosurfaces form concentric ellipses in a 2D phase space. Choosing units such that and , we obtain concentric circles with uniformly distributed samples (assuming a uniform sampling in time). The 2-Wasserstein distance between a pair of uniformly distributed circular isosurfaces is simply given by the difference in radii . This is because, due to the rotational symmetry of the two distributions, the optimal transport plan for an isotropic cost function is to simply move each point on isosurface 1 radially outward (or inward) to the point on isosurface 2 with the same angle .

This result does not meaningfully change with a different choice of units, which is equivalent to rescaling the phase space coordinates . If we rescale by factors , our cost function simply becomes

(11)

where we label points on the isosurfaces by their angle on the original circular isosurfaces. The SHO optimal transport plan takes on isosurface 1 to the point with the same angle on isosurface 2, and for the SHO is invariant to coordinate rescaling (Appendix F). Therefore, the total transport cost is

(12)

so the 2-Wasserstein distance is

(13)

i.e. the same result modulo a constant factor. While this is not a general result, we find that our approach is often fairly robust to such changes, including the extreme case of scaling some phase space coordinates all the way down to zero resulting in a partially observed phase space (Appendix C).

iii.2 Diffusion Maps: Extracting the Conserved Energy

Once we have pairwise distances in the isosurface shape space, we can use diffusion maps to study the resulting manifold of isosurface shapes. With sufficient samples, the operator constructed by the diffusion map should converge to the Laplace–Beltrami operator on the manifold. For the SHO, the isosurface shape space is isomorphic to with each circular isosurface mapped to its radius. If we sample trajectories with radii for some maximum energy , then the manifold is a real line segment, and the resulting Laplacian operator (with open boundary conditions) has eigenvalues and corresponding eigenvectors . Therefore, the first eigenvector or embedding component

(14)

successfully encodes the conserved energy and is, in fact, a monotonic function of the energy.

Iv Numerical Experiments

To demonstrate the ability of our approach to discover conservation laws, we generate and test our proposed method on datasets from wide range of dynamical systems, each consisting of randomly sampled trajectories with different initial conditions and the corresponding conserved quantities. Note that we use the dimensionless form of each dynamical system to generate our datasets. All of the code necessary for reproducing our results is available at https://github.com/peterparity/conservation-laws-manifold-learning.

iv.1 Simple Harmonic Oscillator

We first numerically test our analytic result for the SHO and obtain good agreement (Fig. 2) using both the default scaling (Figs. 2a–d) as well as the position only scaling , (Figs. 2e–h), which effectively reduces the dimension of the phase space. A linear fit of the first embedding component from the diffusion map with the analytically predicted component (Eq. 14) achieves a correlation coefficient of for the default scaling and for the position only scaling. We also verify that the heuristic score (Appendix B) accurately determines that there is only one relevant embedding component (Figs. 2c, 2g), which corresponds to the conserved energy.

Identifying the conserved energy for (a) the simple harmonic oscillator (SHO). (b) Sample trajectories from the SHO dataset show sample points plotted in the 2D phase space
Figure 2: Identifying the conserved energy for (a) the simple harmonic oscillator (SHO). (b) Sample trajectories from the SHO dataset show sample points plotted in the 2D phase space . (c) The heuristic score (with cutoff 0.6) correctly identifies that the first embedding component extracted by the diffusion map is the only relevant component. (d) The extracted first component closely matches the analytically predicted first component (Eq. 14) for the SHO (). (e) Next, consider the SHO dataset with a partially observed phase space containing position only. (f) For each sample trajectory, the sample points are shown as a histogram. (g) The heuristic score is still able to identify the first component as relevant, and (h) this first component matches the analytic prediction ().

iv.2 Simple Pendulum

Identifying the conserved energy for (a) the simple pendulum. (b) Sample trajectories show sample points plotted in the 2D phase space
Figure 3: Identifying the conserved energy for (a) the simple pendulum. (b) Sample trajectories show sample points plotted in the 2D phase space . (c) The heuristic score (with cutoff 0.6) correctly identifies that the first embedding component extracted from by the diffusion map is the only relevant component, and (d) the extracted first component is monotonically related to the energy (rank correlation ). (e, f) With the addition of Gaussian noise to simulate measurement noise, (g) the heuristic score is still able to identify the first component as relevant, and (h) this first component corresponds well to the energy ().

To demonstrate our method on a simple nonlinear dynamical system, we analyze a simple pendulum that has a 2D phase space consisting of the angle and angular momentum (Fig. 3a). The equations of motion are

(15)

This system has a single scalar conserved quantity

(16)

corresponding to the total energy of the pendulum, so the trajectories form 1D orbits in phase space (Fig. 3b).

Our method is able to correctly determine that there is only a single conserved quantity (Fig. 3c) corresponding to the energy of the pendulum (Fig. 3d). The single extracted embedding component is monotonically related to the energy with Spearman’s rank correlation coefficient . We are also able to achieve similar results () with a high level of Gaussian noise (standard deviation ) added to the raw trajectory data (Figs. 3e–h), showing that our approach is quite robust to measurement noise.

iv.3 Planar Gravitational Dynamics

Identifying conserved quantities for (a) planar gravitational dynamics. (b) Sample trajectories show sample points plotted in 2D slices of the 4D phase space consisting of position
Figure 4: Identifying conserved quantities for (a) planar gravitational dynamics. (b) Sample trajectories show sample points plotted in 2D slices of the 4D phase space consisting of position and momentum . (c) The heuristic score (with cutoff 0.6) identifies three relevant embedding components corresponding to the three independent conserved quantities. (d, e) Components 1 and 2 embed the the semi-major axis vector with magnitude related to the energy and orientation given by the angle . (f) Component 6 corresponds to the angular momentum .

To test our method on a system with multiple conserved quantities, we simulate the gravitational system of a planet orbiting a star with much greater mass (Fig. 4a). We fix the orbits to all lie in a 2D plane, giving us an effectively 4D phase space. The resulting equations of motion are

(17)

This system has one scalar and two vector conserved quantities

(18)

which, in our 4D phase space, reduces to three scalar conserved quantities: the total energy (or equivalently, the semi-major axis ), the angular momentum , and the orbital orientation angle , which is the angle of the LRL vector relative to the -axis. As a result, the trajectories also form 1D orbits in the phase space (Fig. 4b).

Our approach accurately identifies the three conserved quantities (Fig. 4c), and the extracted embedding corresponds most directly to the geometric features of the orbits (Figs. 4d–f). The first two components embed the semi-major axis vector with magnitude given by the semi-major axis , which is related to the energy , and orientation given by the orientation angle of the elliptical orbit (Figs. 4d, 4e). The third relevant component (component 6) embeds the angular momentum (Fig. 4f). See Appendix B.1 for details on choosing a cutoff to identify the relevant components. A linear fit of the identified relevant embedding components with () has () and rank correlation (). A similar linear fit with has and .

This example demonstrates that, for a system with multiple conserved quantities, the ground metric for optimal transport controls the relative scale of each conserved quantity in the extracted embedding. In this case, the geometry of the shape space is dominated by changes in the semi-major axis and orientation angle , whereas changes in the angular momentum , which controls the eccentricity of the orbit, play a more minor role and thus appear in a later embedding component with a lower score (Fig. 4c).

iv.4 Double Pendulum

Identifying conserved quantities for (a) the double pendulum. (b) Sample trajectories show sample points plotted in 2D slices of the 4D phase space consisting of the pendulum angles
Figure 5: Identifying conserved quantities for (a) the double pendulum. (b) Sample trajectories show sample points plotted in 2D slices of the 4D phase space consisting of the pendulum angles and angular velocities . (c) The heuristic score (with cutoff 0.6) identifies one relevant embedding component corresponding to (e) the total energy . (d) However, if we restrict the embedding to trajectories with first component (i.e. low energy trajectories) and renormalize the embedding, we find (f–h) two conserved quantities corresponding to the energies of the two decoupled low energy modes. The gray points in Figures 5f–h correspond to the high energy trajectories (first component ) which are not relevant when considering the low energy non-chaotic phase of the double pendulum.

To test our approach on a non-integrable system with higher dimensional isosurfaces, we study the classic double pendulum system (Fig. 5a) with unit masses and unit length pendulum arms. This system has a 4D phase space, consisting of the angles and the angular velocities of the two pendulums (Fig. 5b), and only has a single scalar conserved quantity

(19)

corresponding to the total energy. However, the double pendulum system has both chaotic and non-chaotic phases. In particular, at high energies, the system is chaotic and only conserves the total energy, while at low energies, the system behaves more like two coupled harmonic oscillators with two independent (approximately) conserved energies

(20)

corresponding to the two modes of the coupled oscillator system. Therefore, we expect to see two distinct phases in our extracted embedding: one with a single conserved quantity at high energy and another with two approximately conserved quantities at low energy, which approximately sum to .

At first glance, it appears as though our method has only identified a single relevant component corresponding to the conserved total energy (Figs. 5c, 5e) with rank correlation . However, if we restrict ourselves to low energy trajectories with first embedding component , we find that there is a region of the shape space which is two-dimensional, corresponding to the two independently conserved energies of the low energy non-chaotic phase where the double pendulum behaves like a coupled oscillator system with two distinct modes. For the low energy trajectories, a linear fit of the now two relevant components with () has rank correlation (). If we restrict ourselves to even lower energy trajectories with , a similar linear fit for () has rank correlation ().

This analysis of the double pendulum shows that our method can still provide significant insight into complex dynamical systems with multiple phases involving varying numbers of conserved quantities. This manifests itself as manifolds of different dimensions in shape space that are stitched together at phase transitions, presenting a significant challenge for most manifold learning methods. In this example, this difficulty is reflected in the performance of the heuristic score, which is designed to identify relevant embedding components for a single manifold.

iv.5 Oscillating Turing Patterns

Identifying the conserved spatial phase for the oscillating Turing pattern system. (a) An example trajectory, with randomly sampled states
Figure 6: Identifying the conserved spatial phase for the oscillating Turing pattern system. (a) An example trajectory, with randomly sampled states and plotted, illustrates the high dimensional nature of the problem. (b) The heuristic score (with cutoff 0.6) identifies two relevant components, but on further examination, (c) we see that there is just a single conserved angle, corresponding to the spatial phase of the Turing pattern, that needs to be embedded in two dimensions due to its topology.

Next, we consider an oscillating Turing pattern system that is both dissipative and has a much higher dimensional phase space than our previous examples. In particular, we study the Barrio–Varea–Aragón–Maini (BVAM) model [BARRIO1999483, PhysRevE.86.026201]

(21)

with , , and , following PhysRevE.86.026201 who showed that this set of parameters results in a spatial Turing pattern that also exhibits chaotic oscillating temporal dynamics, on a periodic domain with size . The phase space of the BVAM system consists of two functions and 111In our method, each trajectory is treated as an unordered set of sample points in phase space, so we refer to the phase space as in a slight abuse of notation. which we discretize on a mesh of size , giving us an effective phase space dimension of . Because this system is dissipative, we will focus on characterizing the long term behavior of the dynamics, i.e. the oscillating Turing pattern, which appears to have a conserved spatial phase for our chosen set of parameters corresponding to the spatial position of the Turing pattern.

Our method successfully identifies the spatial phase but embeds the angle as a circle in a 2D embedding space (Fig. 6)—a result of the periodic topology of . While this shows that the number of relevant components determined by our heuristic score may not always match the true manifold dimensionality, such cases are often easily identified by examining the components directly (Fig. 6c) or by cross checking with an intrinsic dimensionality estimator [https://doi.org/10.48550/arxiv.2106.04018]. A linear fit of the two relevant components with () has () and (). This example both tests our method on a high dimensional phase space and demonstrates how our approach can be applied to dissipative systems to study long term behavior.

iv.6 Korteweg–De Vries Equation

Identifying three local conserved quantities of the Korteweg–De Vries (KdV) equation. (a) An example trajectory from the KdV dataset shows the high dimensional raw sampled states
Figure 7: Identifying three local conserved quantities of the Korteweg–De Vries (KdV) equation. (a) An example trajectory from the KdV dataset shows the high dimensional raw sampled states . (b) To focus on local conserved quantities, we extract a distribution of the local features from the raw states, removing the explicit spatial label. The plot shows the local feature distributions for a few sample states. (c) The heuristic score (with cutoff 0.6) correctly identifies three relevant components corresponding to (d–f) the three local conserved quantities (Eq. 23).

For many spatiotemporal dynamical systems, the conservation laws are local in nature. Locality can significantly simplify the analysis of the conserved quantities and suggests a way to restrict the type of conserved quantities identified by our method. Specifically, we can adapt our approach to focus on local conserved quantities by replacing the raw states (Fig. 7a) by a distribution of local features (Fig. 7b), removing the explicit spatial label and providing a fully translation invariant representation of the state. Then, instead of using the Euclidean metric in the original phase space, we use the energy distance [https://doi.org/10.1002/wics.1375, pmlr-v89-feydy19a] between the distributions of local features as the ground metric for optimal transport.

To demonstrate this method for identifying local conserved quantities, we consider the Korteweg–De Vries (KdV) equation

(22)

The KdV equation is fully integrable [PhysRevLett.19.1095] and has infinitely many conserved quantities [doi:10.1063/1.1664701], the most robust of which are the most local conserved quantities expressible in terms of low order spatial derivatives. To focus on these robust local conserved quantities, we use finite differences (i.e. ) as our local features, allowing us to restrict the spatial derivative order of the identified conserved quantities. In this experiment, we only take and , meaning that the identified local conserved quantities will only contain up to first order spatial derivatives. For the KdV equation, there are three such local conserved quantities:

(23)

which also have direct analogues in generalized KdV-type equations [1937-1632_2018_4_607].

Our method successfully identifies three relevant components (Fig. 7c) corresponding to (d–f) the three local conserved quantities (Eq. 23). Linear fits of these components to , , and have rank correlations , , and , respectively. This result shows how our approach can be adapted to incorporate known structure, such as locality and translation symmetry, in applications to complex high dimensional dynamical systems.

V Conclusion

We have proposed a non-parametric manifold learning method for discovering conservation laws, tested our method on a wide variety of dynamical systems—including complex chaotic systems with multiple phases and high dimensional spatiotemporal dynamics—and also shown how to adapt our approach to incorporate additional structure such as locality and translation symmetry. Our method does not assume or construct an explicit model for the system nor require accurate time information like previous approaches [8618963, https://doi.org/10.48550/arxiv.2203.12610], only relying on the ergodicity of the dynamics modulo the conservation laws (Sec. II.1.2). As a result, our method is also quite robust to measurement noise and can often deal with missing information such as a partially observed phase space (Figs. 2e–h, Figs. 3e–h, Appendix C).

Compared with recently proposed deep learning-based methods [PhysRevResearch.2.033499, PhysRevResearch.3.L042035], our approach is substantially more interpretable since it relies on explicit geometric constructions and well-studied manifold learning methods that directly determine the geometry of the shape space and, therefore, the identified conserved quantities. This is reflected in our ability to explicitly derive the expected result for the simple harmonic oscillator (Sec. III), as well as in the identified conserved quantities in many of our experiments. For example, the embedding of the semi-major axis vector in the planar gravitational dynamics experiment (Sec. IV.3) stems directly from the elliptical geometry of the orbits and their orientation in phase space, which is captured by the Euclidean ground metric and lifted into shape space by optimal transport. Our method also correctly captures the subtleties of the double pendulum system (Sec. IV.4) by providing an embedding that shows both a 1D manifold at high energies and a 2D manifold at low energies—a difficult prospect for deep learning approaches that try to explicitly fit conserved quantities.

Our manifold learning approach to identifying conserved quantities provides a new way to analyze data from complex dynamical systems and uncover useful conservation laws that will ultimately improve our understanding of these systems as well as aid in developing predictive models that accurately capture long term behavior. Our method also serves as a strong non-parametric baseline for future methods that aim to discover conservation laws from data. We also believe that similar combinations of optimal transport and manifold learning have the potential to be applied to a wide variety of other problems that also rely on geometrically characterizing families of distributions, and we hope to investigate such applications in the near future.

Acknowledgements.
We would like to acknowledge useful discussions with Justin Solomon, Ziming Liu, Andrew Ma, Samuel Kim, Charlotte Loh, and Ruba Houssami. This research is supported in part by the U.S. Department of Defense through the National Defense Science & Engineering Graduate Fellowship Program; the National Science Foundation under Cooperative Agreement PHY-2019786 (The NSF AI Institute for Artificial Intelligence and Fundamental Interactions, http://iaifi.org/); the U.S. Army Research Office through the Institute for Soldier Nanotechnologies at MIT under Collaborative Agreement Number W911NF-18-2-0048; the Air Force Office of Scientific Research under the award number FA9550-21-1-0317; and the United States Air Force Research Laboratory and the United States Air Force Artificial Intelligence Accelerator under Cooperative Agreement Number FA8750-19-2-1000. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the United States Air Force or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein.

Appendix A Dataset Details

The SHO dataset contains 200 sample trajectories, each with 200 uniformly sampled states in time.

The simple pendulum dataset contains 200 trajectories with uniformly sampled energies . Each trajectory has 200 sampled states at uniformly sampled times .

The planar gravitational dynamics dataset contains 400 trajectories with uniformly sampled energies , angular momenta , and orbital orientation angles . Each trajectory has 200 sampled states at uniformly sampled times .

The double pendulum dataset contains 1000 trajectories with initial angles and initial angular velocities . Each trajectory contains 500 points uniformly sampled in time . One additional subtlety of applying our approach to the double pendulum comes from the periodicity of the angles describing the positions of the two pendulums. The Euclidean ground metric used for optimal transport must take into account this periodicity, so we choose to leave the data unnormalized and use the shortest Euclidean distance between pairs of points in the periodic phase space.

The oscillating Turing pattern dataset contains 400 trajectories, where we initialize our states and with unit Gaussian noise in Fourier space and take 200 states with uniformly sampled times . By allowing for a transient time of 300, we focus our study on the long term behavior of the oscillating Turing pattern.

Finally, we study the KdV equation on a periodic domain of size and with mesh size (downsampled from a mesh size of used during data generation). The dataset contains 400 trajectories each with 200 states at uniformly sampled times . To produce a reasonable variety of initial conditions, each trajectory is initialized with normally distributed Fourier components scaled by a Gaussian band-limiting envelope with width uniformly sampled in the interval .

Appendix B Heuristic Score for a Minimal Diffusion Maps Embedding

Breakdown of the heuristic score and illustration of redundant embedding components from the planar gravitational dynamics experiment. (a) The relative length scale
Figure 8: Breakdown of the heuristic score and illustration of redundant embedding components from the planar gravitational dynamics experiment. (a) The relative length scale for each embedding component is computed from the corresponding eigenvalue of the Laplacian matrix (Eq. 24). (b) The unpredictability measure for each component is computing using a nearest neighbor estimator [pfau2018minimally]. (c) The combined score is the product of the relative length scale and the unpredictability measure. (d–f) The components 3, 4, and 5 are identified by the unpredictability measure as redundant. If we examine these three components, we find that they together embed a second order angular mode of components 1 and 2 (Figs. 4d, 4e). In particular, the embedding is shaped like the surface of a cone with the height (or radial distance) roughly corresponding to the semi-major axis and the angle around the cone corresponding to , a second order mode of the orientation angle .

Traditionally, diffusion maps [Coifman2005] and Laplacian eigenmaps [6789755] leave the embedding dimension as a hyperparameter and simply use the eigenvectors corresponding to the smallest eigenvalues to construct the embedding. In practice, the embedding dimension is often chosen for convenience (e.g. in visualization applications) or by examining the eigenvalues and looking for a sharp increase in the magnitude of the eigenvalues that would separate the signal from the noise. Because identifying the number of conservation laws is an important step in our approach, we refine this heuristic by directly computing an approximate length scale

(24)

where is the scale factor from the Gaussian kernel used to construct the Laplacian matrix (Eq. 7). We derive this length scale by considering the normalized kernel to be an approximation of the heat kernel , implying that the length scales associated with the Laplace–Beltrami operator are given by

(25)

We then divide by to obtain the relative length scale

(26)

which can be used as a heuristic measure of relevance—components with a small relative length scale are more likely to be noise. Compared with directly using the eigenvalues , we find this heuristic to be less sensitive to the choice of in the kernel.

In addition to noise, there is the common problem of redundant embedding components that stem from the structure of the Laplacian operator: higher order modes of previous eigenvectors often appear before more informative eigenvectors corresponding to new manifold directions. This problem is clearly illustrated in the planar gravitational dynamics experiment (Sec. IV.3), where components 3, 4, and 5 are all redundant with components 1 and 2 but component 6 is a new and relevant conserved quantity (Figs. 8d–f). To address this issue, the key observation is that, while all components of the diffusion map are linearly independent, redundant components are still predictable (via a nonlinear function) from previous components. Therefore, we require a measure of “unpredictablility” that allows us to identify redundancies. We choose the heuristic proposed by pfau2018minimally that uses a nearest neighbor estimator (using 5 nearest neighbors) to determine whether a new embedding component is too predictable and therefore redundant.

To compute our final heurstic score (Fig. 8c), we take the product of the relative length scale (Fig. 8a) with the unpredictability measure (Fig. 8b). We find this simple combined score performs well for identifying relevant embedding components by removing both noise components as well as redundant components.

b.1 Choosing a Score Cutoff

Example from the planar gravitational dynamics experiment of identifying the number of conserved quantities (i.e. the embedding size). (a) Sweeping the cutoff value from 0 to 1, we find plateaus indicating robustness at embedding size 2 and 3. Note that there is a spurious plateau at the maximum embedding size 20. (b) A histogram of the embedding sizes confirms that the number of conserved quantities is likely to be 3.
Figure 9: Example from the planar gravitational dynamics experiment of identifying the number of conserved quantities (i.e. the embedding size). (a) Sweeping the cutoff value from 0 to 1, we find plateaus indicating robustness at embedding size 2 and 3. Note that there is a spurious plateau at the maximum embedding size 20. (b) A histogram of the embedding sizes confirms that the number of conserved quantities is likely to be 3.

To use the heuristic score to identify the number of conserved quantities and construct a minimal embedding, we require a score cutoff to separate relevant components that we keep in our embedding from irrelevant components that we discard. To choose this cutoff, we sweep cutoff values in the interval , compute the embedding size (i.e. the number of relevant components) based on the chosen cutoff, and then examine the result to identify a robust value for the cutoff (Fig. 9). Specifically, we look for wide plateaus in the embedding size that indicate robustness to the value of the cutoff and find that a cutoff of 0.6 works well in all of our experiments.

Appendix C Additional Experiments

To further demonstrate the robustness of our approach, we show several additional experiments on the simple pendulum and planar gravitational dynamics datasets. For the simple pendulum, our method still performs well when using only angle measurements, i.e. a partially observed phase space (Fig. 10a). In fact, even if we add Gaussian noise (standard deviation ) to the raw trajectory data in addition to using a partially observed phase space, we still obtain a similar result (Fig. 10b). Similarly, for planar gravitational dynamics with only position data or with added Gaussian noise (), our method is still able to identify the three conserved quantities (Figs. 10c, 10d). The corresponding rank correlations with the ground truth conserved quantities are given in Table 1.

Dataset Conserved Quantity
Simple Pendulum: Position Only 0.998
Simple Pendulum: Position Only + Noise 0.996
Planar Gravitational Dynamics:
Position Only
0.994
0.993
0.968
Planar Gravitational Dynamics:
Noise
0.994
0.992
0.945
Table 1: Rank correlations of linear fits with ground truth conserved quantities for the additional experiments.
Additional experiments illustrating the robustness of our approach. (a) For the simple pendulum system, even when provided only angle
Figure 10: Additional experiments illustrating the robustness of our approach. (a) For the simple pendulum system, even when provided only angle measurement data (without angular velocity ), our method is able to identify a single relevant component corresponding to the energy the pendulum (). (b) If we then also add Gaussian noise, we can still achieve a similar result (). For planar gravitational dynamics, our method also performs well given (c) only position data or (d) with Gaussian noise, correctly identifying the three conserved quantities.

Appendix D Nonlinear Periodic Orbit of the Double Pendulum

Nonlinear periodic orbit of the double pendulum. (a) The four red highlighted points in the extracted embedding correspond to (b, c) a periodic orbit of the double pendulum that is connected to but well outside of the linear coupled oscillator regime.
Figure 11: Nonlinear periodic orbit of the double pendulum. (a) The four red highlighted points in the extracted embedding correspond to (b, c) a periodic orbit of the double pendulum that is connected to but well outside of the linear coupled oscillator regime.

In addition to the chaotic and linear non-chaotic phases, the double pendulum can also exhibit other kinds of complex behavior, including highly nonlinear periodic orbits. In our extracted embedding (Fig. 11a), we see an example of such a nonlinear periodic orbit (Figs. 11b, 11c). The placement of this periodic orbit in the embedding also meaningfully connects it with the low energy in-phase mode from the linear coupled oscillator regime (Fig. 5g), i.e. this periodic orbit can be thought of as a nonlinear high energy extension of the low energy in-phase mode.

Appendix E Additional Method Details

All of the code necessary for generating our datasets, applying our method, and reproducing our results is available at https://github.com/peterparity/conservation-laws-manifold-learning.

e.1 Sinkhorn Algorithm

To estimate the 2-Wasserstein distance using the Sinkhorn algorithm [NIPS2013_af21d0c9], we use a convergence threshold of and a decaying entropy regularization parameter that starts at and decays by at each step until it reaches a target of . This computation of pairwise Wasserstein distances between the trajectories is currently the performance bottleneck of our approach but is easily parallelized over multiple GPUs using the OTT-JAX library [https://doi.org/10.48550/arxiv.2201.12324]. One option to speed up convergence, which we hope to investigate in the future, is to allow for a significantly larger target regularization parameter. The result would remain a valid distance metric that, in fact, interpolates between the Wasserstein metric and a maximum mean discrepancy (MMD) metric [pmlr-v89-feydy19a].

e.2 Diffusion Maps

To improve the noise robustness of our diffusion map, we follow 10.1214/14-AOS1275 and replace the diagonal of the affinity matrix (Eq. 8) with zeros, i.e.

(27)

before constructing the Laplacian matrix . Because this induces an overall shift in the eigenvalues of the Laplacian that interacts poorly with our length scale heuristic (Eq. 24), we correct for this by subtracting off the normalized mean shift

(28)

from the Laplacian matrix to obtain the corrected Laplacian

(29)

which we use to generate our embeddings.

Appendix F Proof of Optimal Transport for the Simple Harmonic Oscillator

Let the transport cost between a pair of points be

(30)

Then, for the proposed optimal transport plan with support containing all points , we will show that is -cyclically monotone, and therefore is optimal. See medio_lines_2001 for further details.

To demonstrate this fact, consider a finite set of pairs . Restricted to this finite set, the total cost given the transport plan is

(31)
(32)

Now, consider an alternative transport plan with support forming a cycle. The total cost is given by

(33)
(34)

where we let . Then, the difference

(35)

since

(36)
and
(37)

by the AM–GM inequality (and trivially true if the right hand side is negative). Therefore, any such cycle will result in an equal or higher transport cost (strictly higher if at least one pair are distinct), implying that is -cyclically monotone.

References