TL;DR
This paper introduces geometric numerical integrators for contact flows based on a discretized variational principle, demonstrating their properties and comparing their performance to symplectic integrators using a damped harmonic oscillator example.
Contribution
It develops contact variational integrators, proving they are contact transformations and establishing their backward error analysis, extending variational methods to contact geometry.
Findings
The integrators are contact transformations.
They can be derived from a variational principle.
Performance comparison shows advantages over symplectic integrators.
Abstract
We present geometric numerical integrators for contact flows that stem from a discretization of Herglotz' variational principle. First we show that the resulting discrete map is a contact transformation and that any contact map can be derived from a variational principle. Then we discuss the backward error analysis of our variational integrators, including the construction of a modified Lagrangian. Throughout the paper we use the damped harmonic oscillator as a benchmark example to compare our integrators to their symplectic analogues.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Contact variational integrators
Mats Vermeeren
Technische Universität Berlin, Germany,
Alessandro Bravetti
Centro de Investigación en Matemáticas (CIMAT), Guanajuato, Mexico,
Marcello Seri
Bernoulli Institute for Mathematics, Computer Science and Artificial Intelligence,
Groningen, The Netherlands,
Abstract
We present geometric numerical integrators for contact flows that stem from a discretization of Herglotz’ variational principle. First we show that the resulting discrete map is a contact transformation and that any contact map can be derived from a variational principle. Then we discuss the backward error analysis of our variational integrators, including the construction of a modified Lagrangian. Throughout the paper we use the damped harmonic oscillator as a benchmark example to compare our integrators to their symplectic analogues.
Keywords: contact geometry, geometric integrators, Herglotz’ variational principle
MSC2010: 65D30, 34K28, 34A26
1 Introduction
The last few years have seen a rise in importance of the field of contact geometry. As the theory gets more relevant to scientific applications, there is an increasing demand for the development of numerical integrators preserving the contact structure.
Contact geometry appears in fluid dynamics [19, 38, 47], thermodynamics [7, 28, 29, 43, 53], statistical physics [9], statistics [5, 27], quantum mechanics [11, 14, 21, 33, 46], gravity [40], information geometry [3, 4, 26], shape dynamics [52], biology [8, 30], optimal control [37, 45], and integrable systems [6, 35, 36, 49, 50]. One of the applications that has recently attracted a lot of attention is the classical mechanics of dissipative systems [1, 2, 10, 17, 18, 23, 41], on which we will focus in this paper.
Contact geometry can be thought of as an odd-dimensional analogue of symplectic geometry. A contact manifold is a pair where is an -dimensional manifold and is a contact structure, that is, a maximally non-integrable distribution of hyperplanes. Locally, such distribution is given by the kernel of a one form satisfying (see e.g. [24] for more details). The 1-form is called the contact form. Note that if we multiply by a non-vanishing function we obtain another 1-form giving rise to the same contact structure . This means that in order to preserve we can act on the 1-form by conformal transformations. Thus we must keep in mind that is just a representative element in an equivalence class of 1-forms describing the same .
Once we fix , Darboux’s theorem for contact manifolds states that for any point on there exists a neighbourhood with local coordinates such that the contact 1-form can be written as
[TABLE]
Throughout the paper we will write as a short form for .
Moreover, given , to any smooth function we can associate a contact Hamiltonian vector field , defined by
[TABLE]
where is the Lie derivative, and is the Reeb vector field corresponding to [24]. In Darboux coordinates the flow of is given by
[TABLE]
where , and the standard scalar product is assumed where two vectors are multiplied. The flow of a contact Hamiltonian system preserves the contact structure, but it does not preserve the Hamiltonian. Instead we have
[TABLE]
For example a Hamiltonian of the form leads to the equations of motion of a damped mechanical system:
[TABLE]
Another remarkable similarity with standard symplectic Hamiltonian systems is the fact that contact Hamiltonian systems have an associated variational principle, which is due to Herglotz [25, 34] (see also [13, 55]), and a corresponding theory of generating functions [10].
Geometric integrators for contact Hamiltonian systems have been studied in [20] by exploiting their symplectification and the corresponding generating functions. However, a variational approach is missing. So far, [20] has received little attention, most likely because the authors did not discuss any physically relevant examples.
In this paper we present a natural way to develop numerical integrators for contact systems by exploiting Herglotz’ variational principle. Our result furnishes a variational scheme to integrate contact Hamiltonian systems in such a way that the contact structure is preserved. Furthermore, in analogy with the theory of symplectic numerical integrators, we find that modified equations for our method are again contact systems. This suggests that the numerical results will remain very close to a “nearby” contact system for very long times.
The purpose of this paper is to lay the theoretical groundwork of contact integrators and to show their promise with some simple numerical experiments. To keep the discussion direct and self-contained, the main results will be presented only for contact systems without an explicit time dependence, with a section showing how the method is easily extended to general contact systems by means of an explanatory example. Furthermore, some interesting discussions and developments are postponed to future works. These include the extension to a more general sub-Riemannian setting and the comparison with [20] and other known approaches to some physically relevant examples.
It is important to remark at this point that not every kind of dissipative system can be written with a contact Hamiltonian of the form above, as the geometry underlying the construction will enforce some structure. For more details on this, we refer the readers to the thorough investigation in [14, 18, 23]. Nevertheless, the contact Hamiltonian structure allows to describe a large number of physically relevant systems, including most of the ones from the literature cited at the beginning of this introduction.
The paper is structured as follows. In section 2 we set the stage introducing Herglotz’ variational principle and some of its relevant properties. In section 3 we develop the central idea of the paper defining a contact integrator obtained from a discretization of Herglotz’ variational principle. In section 4 we study the modified equations for the contact integrators introduced in section 3, showing that up to truncation errors, the numerical solutions are interpolated by contact systems. In section 5 we present an example to show how the ideas can be extended in a straightforward fashion to systems with an explicit time dependence. Finally, in section 6 we illustrate by numerical examples how our integrators perform on contact systems in comparison to symplectic integrators.
2 Herglotz’ variational principle
The usual variational principle in mechanics looks for a curve in configuration space , such that the action integral
[TABLE]
is critical with respect to variations of that vanish at the endpoints, where is a given Lagrange function. Herglotz [34] generalized this variational principle by defining the action in terms of a differential equation instead of an integral.
Definition 1**.**
Let . Given a curve , define the function by an initial condition and the differential equation
[TABLE]
The curve is a solution to Herglotz’ variational principle with initial condition if every variation of that vanishes at the boundary of leaves the action invariant.
If does not depend on , then the differential equation (2) is solved by the integral (1) and Herglotz’ variational principle reduces to the classical variational principle. A modern discussion of Herglotz’ variational principle can be found for example in [25].
Proposition 1**.**
A (sufficiently regular) curve is a solution to Herglotz’ variational principle if and only if it satisfies the generalized Euler-Lagrange equations
[TABLE]
where is given in terms of by Equation (2).
Note that the Euler-Lagrange equations are not linear in , hence they are not invariant under scaling of the Lagrangian .
Proof of Proposition 1.
Consider an arbitrary variation of , vanishing at the endpoints, and the corresponding induced variation of . Since the initial condition is independent of we have . From Equation (2) it follows that
[TABLE]
If we set
[TABLE]
this differential equation reads
[TABLE]
and its solution is
[TABLE]
Plugging in the expression for and noting that we find
[TABLE]
The boundary terms vanish because . Since is otherwise arbitrary, the action is critical if and only if Equation (3) holds. ∎
If the classical variational principle is satisfied on the interval it is automatically satisfied on any subinterval. For the Herglotz variational principle this property is not obvious from the definition, but it still follows from the generalized Euler-Lagrange equations.
Proposition 2**.**
If solves the Herglotz variational principle with initial condition , then for any interval , the restriction solves the Herglotz variational principle with initial condition .
Proof.
If is critical on then the generalized Euler-Lagrange equations are satisfied everywhere on this interval. In particular, they hold on , hence is critical on . ∎
In the following we will assume that the Lagrangian is regular, i.e. . Then the generalized Euler-Lagrange equations can be written explicitly as a second order ODE. Together with the evolution of we find the system of ODEs
[TABLE]
An important aspect of the Herglotz variational principle is that the energy is not conserved (unless the Lagrangian is independent of ). Instead we find a differential equation governing its evolution.
Proposition 3**.**
If the Lagrangian does not explicitly depend on time, then the energy satisfies the differential equation
[TABLE]
Proof.
Consider a uniform time-shift of the critical curve and the function . Then and . If the Lagrangian does not explicitly depend on time, it follows from Equation (4) that
[TABLE]
for any because criticality on implies criticality on the subinterval . It follows that satisfies Equation (5). ∎
The usual argument that Lagrangian flows are symplectic, as presented for example in [42, Section 1.2], can be extended to show that flows of Herglotz’ variational principle are contact transformations.
Proposition 4**.**
Let with local coordinates . The flow of the generalized Euler-Lagrange equations consists of contact transformations with respect to the 1-form
[TABLE]
where .
Proof.
On solutions of the generalized Euler-Lagrange equations, the value of is uniquely defined by the initial values , , and . Any variation
[TABLE]
of the initial data induces a variation
[TABLE]
at the endpoint, where denotes the pushforward of .
Since we are working on solutions of the generalized Euler-Lagrange equations, the integrand in Equation (4) vanishes and only the boundary terms remain. They can be written as
[TABLE]
where . It follows that
[TABLE]
where denotes the pullback of . Hence the flow consists of contact transformations with respect to the 1-form with conformal factor
[TABLE]
∎
To close this section, let us briefly state the link of the Herglotz variational principle to the more common Hamiltonian formulation of contact dynamics. The contact Hamiltonian is defined by Legendre transformation
[TABLE]
where is eliminated from the right hand side by . Taking the partial derivative with respect to gives
[TABLE]
hence from Equation (5) it follows that
[TABLE]
Differentiating instead with respect to and gives us the contact Hamiltonian equations:
[TABLE]
3 Discrete Herglotz variational principle
As is standard in discrete mechanics, in what follows we replace by (see e.g. [42]).
Definition 2**.**
Let and . Given a discrete curve , we define by and
[TABLE]
The discrete curve is a solution to the discrete Herglotz variational principle if
[TABLE]
for all .
Note that Equation (7) is a discrete version of Equation (2), and that Equation (8) means that for a critical discrete curve , a variation of can affect but none of the other . In particular, this implies that is critical with respect to variations of . Most of the time we will consider a fixed step size and omit it from the notation of the discrete Lagrangian .
Theorem 1**.**
For a sufficiently small step size , the discrete curve is a solution of the discrete Herglotz variational principle, with defined by Equation (7), if and only if it satisfies the discrete generalized Euler-Lagrange equations
[TABLE]
where denotes the partial derivative with respect to the -th entry.
Note that while in general the have several components, the are always scalar, hence and are vectors but and are scalars.
Equation (9) is equivalent to
[TABLE]
In the first line one recognizes the usual discrete Euler-Lagrange equations. The term in the second line is a discretization of .
Proof of Theorem 1.
From Equation (7) it follows that
[TABLE]
On solutions we have
[TABLE]
where the derivative is omitted because . It follows that
[TABLE]
hence for sufficiently small , is equivalent to Equation (9). ∎
In analogy to the continuous case, we will always assume the non-degeneracy condition
[TABLE]
which guarantees that for sufficiently small , Equation (9) can be solved for .
Theorem 2**.**
The map given by the generalized discrete Euler-Lagrange equations, induces a map
[TABLE]
where
[TABLE]
and
[TABLE]
The map is a contact transformation with respect to the 1-form .
Equations (12) and (13) define the discrete Legendre transforms for contact systems, compare [42, Section 1.5].
Proof.
First note that the second equality in Equation (11) follows from Equation (9) and the definitions (12) and (13).
To prove that is a contact transformation, we consider the case . The general statement is obtained by shifting all indices by the same integer.
From
[TABLE]
it follows that
[TABLE]
hence, on solutions of the generalized Euler-Lagrange equations,
[TABLE]
It follows that
[TABLE]
Note that the conformal factor
[TABLE]
is consistent with the continuous , cf. Equation (6). We stress that Theorems 1 and 2 also apply to the case where does not depend on , i.e. .
A natural question to ask at this point is whether every contact transformation comes from a variational principle. Just like the symplectic counterpart to this question, it is answered in the affirmative using generating functions.
Remarkably, the following result is stronger than the literal inverse to Theorem 2, which said that any discrete Lagrangian yields a contact transformation. We will show that every contact transformation can be obtained from a discrete Lagrangian that does not depend on the second instance of .
We stress the importance of this result, since it implies that every contact integrator is variational.
Theorem 3**.**
Iterations of any contact transformation yield a discrete curve that solves the discrete Herglotz variational principle for some discrete Lagrangian .
Note that does not depend on in the statement of Theorem 3. Hence without loss of generality we can restrict our attention to Lagrangians depending only on the first of the -coordinates, as we will do e.g. in Example 1.
Proof of Theorem 3.
As pointed out in [10], the coordinate of a contact transformation can be considered as a generating function. We have
[TABLE]
Writing we find
[TABLE]
It follows that and
[TABLE]
Note that does not depend on or , hence from now on we will write . Setting
[TABLE]
iterations of the contact map satisfy
[TABLE]
Furthermore, using Equation (14) we calculate that
[TABLE]
so the discrete curve obtained by iteration of the contact map satisfies the discrete Herglotz variational principle for . ∎
Example 1**.**
The Lagrangian describes a mechanical system with Rayleigh dissipation (i.e. a friction force linear in the velocity). The generalized Euler-Lagrange equation is
[TABLE]
Note that need not be a scalar: the Lagrangian yields the analogous multi-component equation. This contrasts many other variational descriptions of the damped harmonic oscillator, which only apply to the scalar case [44, 15]. The same comment applies to the following discretization, which we write down for scalar but can easily be adapted to higher dimensions.
A discretization of the Lagrangian is
[TABLE]
Note that this Lagrangian depends only on , not on . Its discrete generalized Euler-Lagrange equations read
[TABLE]
The discrete momentum can be calculated as
[TABLE]
or
[TABLE]
We can implement the integrator explicitly in position-momentum formulation as
[TABLE]
Let us consider the damped harmonic oscillator, . Its equation of motion is
[TABLE]
The above discrete Lagrangian then becomes
[TABLE]
and it discrete generalized Euler-Lagrange equations read
[TABLE]
The position-momentum formulation of the integrator gives
[TABLE]
Example 2**.**
For the theory of discrete contact systems by itself, it is sufficient to have the Lagrangian depend on but not on , as we saw in Theorem 3. For the sake of a good numerical approximation, however, it is beneficial to relax this condition. Continuing the example of a damped mechanical system, we can take the discrete Lagrangian
[TABLE]
Note the difference with Example 1: now depends also on . Its discrete generalized Euler-Lagrange equations read
[TABLE]
Equations (16) and (20) are related by a simple change in the parameter . This minor difference should not be dismissed, though, as the discrete Lagrangian (19) is a second order approximation of the continuous Lagrangian, compared to the first order approximation of Equation (15). What we mean by this will be clarified in the next section: see Example 4 and Example 5.
The discrete momentum for the Lagrangian (19) can be calculated as
[TABLE]
or
[TABLE]
The generalized Euler-Lagrange equations state that both formulas for the discrete momentum agree. On solutions, we have that
[TABLE]
We can implement the integrator explicitly in position-momentum formulation as
[TABLE]
Equation (20) is also the second order difference equation corresponding to the leapfrog (Störmer-Verlet) method
[TABLE]
Indeed, eliminating the momentum from this system we find
[TABLE]
hence
[TABLE]
which is equivalent to Equation (20).
The momenta at integer steps can be included in the leapfrog method by adding one internal stage:
[TABLE]
We find that
[TABLE]
hence when initialized with the same momentum, the difference between the result of our contact method and the leapfrog solution will be of order . Whether or is a better approximation for the true initial momentum depends on the initial conditions.
Example 3**.**
For a more general contact system, motivated by [52], consider the Lagrangian
[TABLE]
The equations of motion are
[TABLE]
or, in position-momentum formulation,
[TABLE]
Note that the Euler-Lagrange equation explicitly involves in this case, so it is not possible to solve the equations for and separately. This means that symplectic integrators cannot be applied (unless one adds a dummy variable to the systems in order to obtain an even-dimensional system once again). In comparison, in Examples 1 and 2 a symplectic integrator could be applied, but it would not respect the contact structure.
Consider the discrete Lagrangian
[TABLE]
The discrete momenta are
[TABLE]
and
[TABLE]
Hence we find an implicit contact integrator
[TABLE]
4 Backward error analysis
A central idea to explain the long-time behavior of symplectic integrators is the study of modified differential equations whose solutions interpolate the discrete solutions of a discrete system of equations. This idea, looking for a perturbed continuous system that exactly corresponds to the discretization, is an example of backward error analysis. It is a well-known and essential fact that if a symplectic integrator is applied to a Hamiltonian equation, then the resulting modified equation is Hamiltonian as well. Similarly, when a classical variational integrator is applied to a Lagrangian system, the resulting modified equation is Lagrangian [54]. Below we establish that an analogous result holds for contact variational integrators.
First let us have a look at the general form of the discrete generalized Euler-Lagrange equations.
Proposition 5**.**
Consider a continuous non-degenerate Lagrangian with generalized Euler-Lagrange equation and a consistent discretization of , by which we mean that for any smooth and there holds
[TABLE]
Then the discrete generalized Euler-Lagrange equation is a consistent discretization of the continuous generalized Euler-Lagrange equation, i.e. it takes the form
[TABLE]
where for any smooth and
[TABLE]
We give a formal proof. A rigorous version of this argument is obtained by generalizing the corresponding proof in [54] to the case of the Herglotz variational principle. A different proof strategy can be found in [42, Section 2.3].
Proof of Proposition 5.
Let be a smooth curve interpolating solutions of the discrete generalized Euler-Lagrange equation (10). Then , where
[TABLE]
[TABLE]
and
[TABLE]
We start by showing that is a consistent discretization of the classical Euler-Lagrange equation. In terms of the Taylor expansions of the shifted variables, it becomes
[TABLE]
Since the Lagrangian is assumed to be a consistent discretization, we have
[TABLE]
hence
[TABLE]
In other words
[TABLE]
where each is evaluated at . We can simplify this expression using the fact that
[TABLE]
and obtain
[TABLE]
A perfectly analogous computation yields that
[TABLE]
Finally, we compute
[TABLE]
It follows that
[TABLE]
The claimed result follows by isolating the term in the right hand side of this equation and the term in the left hand side. ∎
Now we turn our attention to the modified equations of the system
[TABLE]
That is, we look for differential equations whose solutions interpolate solutions of the difference equations. The precise definition of a modified equation is a bit more involved because of convergence issues.
Definition 3**.**
The system of modified equations for the difference system (22) is defined by the formal expressions
[TABLE]
such that for any , every solution of the truncated differential equations
[TABLE]
satisfies the difference equations with a defect of order , in the sense that
[TABLE]
Given a difference equation of the form (21) one can recursively compute the coefficients and of the system of modified equations. Examples of such calculations can be found for example in [32, Chapter IX] and [54]. Note that in the leading order of the modified equations we recover the original differential equations. This is because we are dealing with consistent discretizations. The additional terms of the power series contain information about the integrator. In particular, the order of an integrator is the smallest such that the -term in Equation (23) is non-zero.
If we look at the difference equation for by itself, i.e. with an arbitrary smooth curve instead of one interpolating a discrete solution, we get a different modified equation, depending on higher derivatives of :
[TABLE]
such that for any and any smooth curve , every solution of the truncated differential equation
[TABLE]
satisfies
[TABLE]
In the system of modified equations (23), is the Herglotz Lagrangian for in the following sense:
Theorem 4**.**
A truncation after order of the power series yields as its generalized Euler-Lagrange equations .
Sketch of proof.
Let be any solution to the truncated system of modified equations (24). By definition of a modified equation, the discrete curve defined by and satisfies the discrete system (22) with a defect of order .
Now consider the action where is a solution of the higher order Equation (26), with as before. The discrete Herglotz variational principle implies that is critical with respect to variations of , supported on the interval , again up to a defect of order . This means that solves the continuous Herglotz problem for with the same defect.
We want to prove the same property with instead of . If we define by Equation (24), independent of second or higher derivatives of , then it will only interpolate a discrete solution if solves the modified equation . Hence we do not have the freedom to take variations of as needed in the argument above.
To show that is nevertheless a Lagrangian for the modified equation, we need to show that replacing higher derivatives of in using the modified equation does not change its generalized Euler-Lagrange equations. Sufficient conditions for this are that
[TABLE]
where denotes the -th derivative of . These conditions can be obtained from the so-called meshed variational problem, as explained in [54]. Then it follows that satisfies the Herglotz variational principle for the first order Lagrangian . ∎
Example 4** (Example 1 continued).**
Let us calculate the first order approximation of the modified equations for our first discretization of the damped harmonic oscillator. Assume that is a solution to the modified equation. Then it satisfies Equation (18) when we replace by and by :
[TABLE]
A Taylor expansion gives
[TABLE]
where all instances of and its derivatives are evaluated at . Since in the leading order of the modified equation we recover the original equation, we know that , which we can use to simplify the right hand side. We obtain
[TABLE]
Using the same procedure we calculate the modified equation for , with given by (17). In terms of the interpolating functions, the difference equation reads
[TABLE]
and its Taylor expansion is
[TABLE]
Solving this for we find
[TABLE]
In the right hand side we replace using the leading order equation
[TABLE]
to find
[TABLE]
The right hand side of this modified equation should give us the modified Lagrangian. A simple calculation shows that the generalized Euler-Lagrange equation for
[TABLE]
is indeed Equation (27). Note that up to the error term, the modified Lagrangian is a rescaling of the original Lagrangian . Unlike for the classical variational principle, this does not imply that both Lagrangians have the same generalized Euler-Lagrange equations.
The second order term of the modified equations can be calculated by including one more term in the Taylor expansions and simplifying the right hand sides using the first order modified equations (27)–(28) instead of the leading order equations. We find
[TABLE]
and
[TABLE]
This process can be continued to recursively find the modified equations to any order.
Example 5** (Example 2 continued).**
We can repeat the above calculation to obtain a modified equation for the second order integrator too. We find
[TABLE]
which shows that the discretization of Example 2 is indeed a second order method. This is a consequence of the symmetry of the discretization:
[TABLE]
5 On the explicit time dependence
Even though in the previous sections we focused on Lagrangians that do not explicitly depend on time, going through the previous proofs and examples one can observe that there is no obstruction to considering explicitly time-dependent systems. In fact, when the system depends explicitly on time, the resulting flow yields a time-dependent contact transformation, in compete analogy to what happens with time-dependent canonical transformations in the symplectic case. We refer to [10] for more on the theory of time-dependent contact transformations and their generating functions. Therefore, with some efforts and modulo a slight complication of the notation in few instances, it is possible to extend all the previous results to such systems in a straightforward way, so that the resulting maps are discretizations of the corresponding time-dependent contact transformations.
How the explicitly time-dependent terms appear in the discrete Lagrangian and the resulting difference equation depend both on the choice of discretization and on the form of time-dependent terms in the continuous Lagrangian. In many cases, such as for external forcing, the time-dependence can be separated neatly and the final result will be elegant and readable. To illustrate the time-dependent case, we build upon the Lagrangian presented in Example 1 and Example 2, and consider a forced damped harmonic oscillator.
Example 6**.**
In general, the Lagrangian of a mechanical system with Raileigh dissipation and external forcing looks like
[TABLE]
Indeed, the generalized Euler-Lagrange equation in this case is
[TABLE]
Here and in what follows, we emphasize the difference with the equations from Example 2 in boxes.
Let , then a natural discretization of the Lagrangian above is
[TABLE]
and the discrete generalized Euler-Lagrange equation reads
[TABLE]
The position-momentum formulation of the integrator is
[TABLE]
6 Numerical results
In this section we discuss the behaviour of our contact variational integrators in comparison with some classical fixed step methods. In what follows we consider the damped harmonic oscillator with and without forcing, integrated using:
- •
our contact variational integrators of both first and second order as presented in the previous examples Example 1 and Example 2 (respectively denoted “Contact (1st)” and “Contact (2nd)”),
- •
the symplectic second order Leapfrog (also known as Störmer-Verlet) [31, 32],
- •
the third order Ruth3 integrator [12, 48],
- •
a second order variational but non-contact (VNC) method for forced Lagrangian systems [16] obtained by a Verlet discretization of a Lagrangian in duplicated phase space [22],
[TABLE]
and
- •
the fourth order Runge-Kutta integrator (RK4) [39].
For the comparison with the damped oscillator with forcing, the symplectic methods are extended in a natural way by additionally adding the forcing term when evaluating the acceleration component in each step.
The error plots in Figures 1–6 show a regularised relative error computed as follows: if denotes the value of the exact solution at time and is the corresponding value of the approximate solution, .
The simulations have been performed in python, with support from the scipy, numpy and matplotlib libraries. The plots have been generated using matplotlib, with a style imported from the seaborn library. All code is released with an MIT license and available from GitHub and Zenodo [51].
In our numerical experiments the fourth order Runge-Kutta method shows an impressive level of accuracy, and at least for this example. The main reason for choosing our method over it is when guarantees of the geometric invariants are more important than the solution accuracy. In all cases under consideration, regardless of the size of the error, our first and second order contact integrators guarantee the conservation of the contact structure, unlike any of the other methods.
As already shown in Example 2, the leapfrog method and our second order contact method are equivalent, except for the initialization of the momentum. If for some smooth interpolating curve , then we have
[TABLE]
hence if and have the same sign, then it is best to initialize with , i.e. use the contact method. If they are of opposite sign, which is very likely for overdamped systems, the leapfrog method will be better.
Furthermore, in the limit , i.e. in the limit of the system becoming symplectic, both the integrators presented in Example 1 and 2 converge to the same symplectic leapfrog scheme. The same is true for the time-dependent case of Example 6. Thus for small values of we a priori expect our integrator to be on par with the leapfrog integrator, and in general perform worse than the third order Ruth3 integrator. As can be seen from Figures 1 and 4, for this is indeed the case: the contact integrators are performing very similarly and Ruth3 performs much better.
One interesting fact, however, is that already for our method outperforms the third order Ruth3 method. We believe that the reason for this is that the Ruth3 method is only symplectic for separable Hamiltonians, i.e. if and , whereas with damping, the acceleration depends also on .
Similarly, even though the contact integrator is outperforming the VNC integrator in all the simulations, we see that for the VNC integrator and our contact integrators have similar performances, but the contact integrator is performing much better when increases. In this case, the lack of separability does not explain the difference in performance, and we are left to believe that it is the preservation of the contact structure that makes the difference.
7 Conclusions
In this work we have begun a thorough investigation of geometric numerical integrators for contact flows. Contrary to [20], our approach is variational: we discretize Herglotz’ variational principle and obtain the discrete version of the generalized Euler-Lagrange equations (see Theorem 1). Furthermore, in Theorems 2 and 3 we have proved that the discrete map thus obtained is contact and that any geometric integrator for contact flows must be of this (variational) type.
In Theorem 4 we presented a formal backward error analysis for contact variational integrators, showing that the numerical solutions are interpolated by contact flows.
Finally, we have considered the implementation of the first and second order contact integrators for the benchmark example of a damped harmonic oscillator, both with and without external forcing. Our numerical experiments show that contact variational integrators in general are comparable with both symplectic and variational but non-contact (VNC) methods for forced Lagrangian systems of the same order, but that in situations where the contact structure is more relevant (for instance, when the damping increases), they usually outperform them.
Motivated by the results of this work, we expect to extend our analysis in multiple directions. On the one hand, we plan to derive higher order analogues of the first and second order contact methods presented here. On the other hand, we would like to compare our approach with the purely Hamiltonian integrators put forward in [20] in a number of systems. With this future work in mind, we expect that the implementation of contact integrators will be beneficial for the study of a wide range of applications where dissipation plays a central role.
Acknowledgements
The authors would like to thank the organizers of the VI Iberoamerican Meeting on Geometry, Mechanics and Control, during which part of this work was initiated, and the NWO Visitor Travel Grant 040.11.698 that sponsored the visit of AB at the Bernoulli Institute. MV is funded by the SFB Transregio 109 “Discretization in Geometry and Dynamics”. AB acknowledges FORDECYT (project number 265667) for financial support. MS research is supported by the NWO project 613.009.10. The authors would also like to thank the anonymous referees for useful comments that improved the final version of this paper.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Abraham and Marsden [1978] Abraham R. & Marsden J. E. Foundations of mechanics . Benjamin/Cummings Publishing Company Reading, Massachusetts, 1978.
- 2Arnold [1989] Arnold V. I. Mathematical methods of classical mechanics . Volume 60 of Graduate Texts in Mathematics . Springer-Verlag, New York, 1989.
- 3Barbaresco [2013] Barbaresco F. Information/contact geometries and koszul entropy . In Nielsen F. & Barbaresco F., editors, Geometric Science of Information , pages 604–611 . Springer, 2013. · doi ↗
- 4Barbaresco [2016] Barbaresco F. Geometric theory of heat from Souriau Lie groups thermodynamics and Koszul Hessian geometry: Applications in information geometry for exponential families . Entropy, 18 : 386 , 2016. · doi ↗
- 5Betancourt [2014] Betancourt M. Adiabatic Monte Carlo . ar Xiv:1405.3489 , 2014.
- 6Boyer [2011] Boyer C. P. Completely integrable contact Hamiltonian systems and toric contact structures on s 2 × s 3 superscript 𝑠 2 superscript 𝑠 3 s^{2}\times s^{3} . SIGMA, Symmetry Integr. Geom., 7 : 058 , 2011. · doi ↗
- 7Bravetti [2018] Bravetti A. Contact geometry and thermodynamics . International Journal of Geometric Methods in Modern Physics, 16 : 1940003 , 2018. · doi ↗
- 8Bravetti and Padilla [2019] Bravetti A. & Padilla P. Thermodynamics and evolutionary biology through optimal control . Automatica, 106 : 201–206 , 2019. · doi ↗
