1. Introduction
Some important physical problems, ranging from celestial mechanics to magnetized plasmas, naturally exhibit rich conservative invariants. These problems are often described using geometric structures, which have attracted increasing interest in recent studies [
1,
2,
3]. Examples of such structures include Hamiltonian, volume-preserving, Poisson, contact, and integral-preserving systems. Among these, variational structures play a central role in modelling systems in various applications. The inverse problem of mechanics has a long history. It can be traced back to Helmholtz’s foundational work [
4] in 1887. This work was pursued further in 1941 by Douglas, who solved the two-dimensional case [
5]. Vainberg later extended the framework to operator-theoretic settings applicable to partial differential equations [
6]. We refer the reader to [
7] for a more comprehensive review.
In the variational framework, variational integrators are constructed by discretizing the Lagrangian. Numerical methods are then derived via the discrete Euler–Lagrange equations. Through discrete Legendre transformations, variational integrators connect to symplectic methods in the Hamiltonian framework. Further details can be found in [
8] and related references. For discrete Lagrangian systems, conservative numerical methods can be developed by studying variational symmetries and constructing a discrete Noether’s theorem [
9,
10]. Variational integrators have been successfully applied to simulate various physical problems, including soliton wave equations [
11,
12], charged particle dynamics in electromagnetic fields [
13,
14,
15,
16], and kinetic models in plasma physics [
17,
18]. Additionally, the construction and analysis of variational integrators have recently been applied to develop accelerated optimization methods [
19,
20].
In the theory of backward error analysis (or modified equations theory), a numerical method is interpreted as the exact solution of a nearby ’modified’ system. Structure-preserving numerical methods satisfy modified equations that retain the same structure as the original system, explaining their superior long-term behavior [
21,
22,
23]. The concept has been extended to variational equations [
24], adaptive time-step variational integrators [
25], and Hamiltonian partial differential equations [
26,
27].
This paper focuses on second-order ordinary differential systems that model important physical problems. We establish necessary and sufficient conditions for variational formulations of this class of systems. The framework applies to classical/relativistic dynamics and charged particle motion under Lorentz forces. We introduce new variational integrators via Lagrangian splitting and prove their equivalence to composition methods through Legendre transformations. As a key example, we consider the Kepler problem—a super-integrable system modelling gravitational motion [
28] with conserved energy, angular momentum, and the Laplace–Runge–Lenz (LRL) vector. The LRL vector [
29] governs orbital geometry as a hidden conserved quantity. Due to its rich conservative properties, geometric integrators play a vital role in long-term Kepler simulations [
30]. Using Levi–Civita transforms, exact schemes preserving all conserved quantities were constructed in [
31,
32]. We investigate our variational integrators’ performance on the Kepler problem. Using Noether’s theorem [
33], we demonstrate variational symmetries for energy, momentum, and LRL vector. By developing modified equations and Lagrangians, we interpret numerical solutions as exact solutions of perturbed systems. Analysis shows the modified Kepler equation remains integrable but loses super-integrability, resulting in quasi-periodic orbits. We explicitly derive modified Lagrangians for symplectic Euler, Störmer–Verlet, and our new integrators. Perturbation theory reveals super-convergence in preserving the LRL vector, verifying the numerical performance.
The paper is organized as follows.
Section 2 establishes the necessary and sufficient conditions for describing second-order systems within a variational framework.
Section 3 constructs variational discretizations by splitting the Lagrangian. The resulting numerical discretization is shown to be equivalent to the composition method. Using classical and relativistic Kepler systems as examples, we illustrate the numerical methods and present variational symmetries for energy, momentum, and the LRL vector.
Section 4 develops the theory of modified equations and modified Lagrangians. The recursive expressions for the Nyström methods are provided. For the Kepler problem, we also analyze the errors of the newly proposed variational integrators in conserving quantities. In
Section 5, we apply the newly derived variational integrators to solve the Kepler problem. The numerical results demonstrate the superior performance of these methods. We further analyze the numerical performance using the modified Lagrangian theory. Additionally, we apply the variational integrators to solve the relativistic Kepler system. Finally,
Section 6 concludes the paper.
2. Variational Principle in Lagrangian Formalism
We begin this section by introducing the inverse variational methods presented in [
4,
6,
7,
34]. Let
be a real Hilbert space with inner product
. Let
be an operator. The operator
N is called
symmetric if
, where
is the adjoint operator defined by
for
. The
Fréchet derivative of
N at
, denoted
, is the linear operator satisfying
Theorem 1 (Vainberg’s theorem [
6]).
Let N be a operator defined on . If and only if the Fréchet derivative of N is symmetric, i.e. , then there exists a functional S on , constructed assuch that , where the variational derivative is defined by , . Remark 1. In Theorem 1, setting yields the Helmholtz conditions [4]. This establishes that a second-order differential system of the form admits a variational description if and only if it is self-adjoint. Further details are provided in [7]. In this paper, we consider the systems governed by
where
is an
symmetric matrix.
Theorem 2. System (1) admits a variational formulation if and only ifhold for all . Proof. Define
. The variational calculus gives
The adjoint of
is defined as
Using integration by parts, we obtain
This derivation relies on the following identities:
Therefore,
According to Theorem 1, the system is variational if and only if (
5) and (
6) are identical. Comparing (
5) and (
6) leads to
The above equality holds for arbitrary
. Thus, the coefficients in terms
,
and
vanish. Since
M is symmetric, this implies exactly that
This completes the proof of the theorem. □
Assuming and that f is linear in , we can rewrite the above theorem as follows:
Theorem 3. For and , system (1) is variational if and only ifwhere . Proof. Since
M depends only on
, (
3) simplifies to (
7). The condition (
4) reduces to
In the above equality, the term on the right-hand side does not depend on
, so the coefficients of
vanish. □
Remark 2. Define a differential two-form by . If (7) and (8) hold, then . By Poincaré’s lemma, there exists a one-form such that . This implies . Condition (9) means that ϕ can be generated from a potential ϕ by . In more classical applications, M is typically a constant matrix. In this case, for the system to be variational, we only need the conditions for the vector field f.
Theorem 4. For constant symmetric M, system (1) is variational ifholds for . Many important physical problems, including some relativistic models, can take the form of Theorem 3. Consider the relativistic dynamics (such as a charged particle in a Coulomb potential)
where
is the Lorentz factor, and
c is the speed of light. In the non-relativistic limit (
), this reduces to Newtonian mechanics
. It is evident that the velocity-dependent terms satisfy the symmetry conditions (
2) and (
9). This system admits the variational formulation with Lagrangian
.
It is well known that from a Lagrangian framework it is more convenient to investigate the connections between conservation laws and symmetry properties of dynamical systems based on Noether’s theorem. The foundational framework requires introducing generalized vector fields and their action on variational principles [
34].
A
generalized vector field is given by
where
contains x, and all the derivatives of
x and
denote its characteristic. The
infinite prolongation of
is defined as
where
denotes
j-th order time derivatives.
Definition 1 ([
34], Chapter 5).
A generalized vector field is called a variational symmetry for the functional if there exists a function such that Given a differential system
, if there exists
satisfying
then
Q is called the characteristic of the nontrivial conservation law
.
Theorem 5 (Noether’s theorem, see [
34], Chapter 5).
A generalized vector field is a variational symmetry if and only if its characteristic Q is also the characteristic of a conservation law along the solution of Euler–Lagrange equations. When the system is perturbed, the following proposition holds:
Proposition 1. Given a Lagrangian L, let and P denote its variational symmetry and the corresponding conserved quantity, respectively. Under the perturbed Lagrangian , P along solutions of satisfieswhere is the the Euler operator. Proof. By Theorem 5, it gives
. For the solution of the perturbed system
, we have
Substitution yields
. □
3. Discrete Lagrangian Mechanics
Variational integrators preserve geometric structures by discretizing Hamilton’s principle. For foundational theory, see [
8]. Consider a uniform time grid
with coordinates
. The discrete Hamilton’s principle is to find the trajectories
extremizing the discrete action functional
Here,
is the discretization of
L, given by
. Its adjoint, denoted by
, is defined as
. The discrete solution
satisfies the discrete Euler–Lagrange equations
Consider the system
with Lagrangian
. We discretize the Lagrangian to obtain the variational integrators. By splitting the potential
as
, we present the following discrete Lagrangian, a first-order variational integrator uses the discrete Lagrangian:
where
,
is the
N-dimensional vector with the
j-th element being 1.
Theorem 6. The discrete Lagrangian is of order 1. Moreover, the discrete Euler–Lagrange equations for (15) generateThis coincides with the composition methodwhere represents the subsystem, and is the corresponding numerical discretization, given by Proof. Using the Taylor expansion at an arbitrary
, we have
Substituting these into (
15), it is easy to see that the discrete Lagrangian has first-order accuracy.
Introduce the discrete Legendre transformation
The discrete Euler–Lagrange equation gives
From (
16) and (
17), we can derive
This is exactly the composition method
. □
The discrete Lagrangian of higher-order variational integrators can be constructed by combining
and its adjoint
By the discrete Euler–Lagrange equation, these provide the higher-order variational integrators.
Theorem 7. The variational integrators from (20) and (21) are equivalent to and , respectively. Proof. The corresponding discrete Euler–Lagrange equation for (
20) gives
Introduce the discrete Legendre transformation,
From (
23), we know
Combine (
24)–(
26) and (
27), we can prove that
. □
As follows, we take the Kepler problem as an example to illustrate the newly derived variational methods of first and second order.
Kepler problem. The Kepler problem describes the motion of two bodies attracting each other. We focus on the 2-dimensional Kepler problem in the following text. If one body is placed at the origin, and
x represents the position of the other body, then their dynamics are governed by the following system:
where
. It is obvious that the Kepler problem (
28) satisfies Theorem 4, and its Lagrangian is given by
The Kepler problem (
28) has three conserved quantities: energy, angular momentum, and the Laplace–Runge–Lenz (LRL) vector. With the initial energy
, the solution orbit of the Kepler problem is elliptic, such as the motion of one astronomical body moving around another. In this case, the LRL vector determines the orientation and shape of the elliptical orbit. The magnitude
equals the orbital eccentricity
e, and the vector
points along the major axis of the orbit.
Proposition 2 ([
29], Chapter 6).
For the 2D Kepler system (28), the following quantities are conserved:Energy
,
Angular Momentum
,
LRL Vector
.
Based on Noether’s theorem, for the two-dimensional Kepler problem (
28), we derive the variational symmetries corresponding to the three conservative quantities expressed in Proposition 2.
Proposition 3. The variational symmetries associated with the energy, angular momentum, and the LRL vector are as follows:
,
,
, .
Proof. Taking
gives the following equality for energy conservation:
Suppose the generalized vector field . According to Theorem 5, is exactly the variational symmetry of the energy. The other variational symmetries follow analogously from their conservation laws. □
Splitting
as
, we construct the first-order and second-order discrete Lagrangians. The first-order Lagrangian (
15) yields the variational integrator through the discrete Euler–Lagrange equations
The second-order Lagrangians (
21) generate the numerical methods
Relativistic Kepler Problems. Considering the relativistic Kepler systems in (
12) with the potential
. With the proper time
and relativistic momentum
, we reformulate system (
12) as
where
. Let
and
, where ’·’ denotes differentiation with respect to
. From Theorem 4, we learn that the system (
32) admits a variational formulation with Lagrangian
where
and
. The system (
32) has two Hamiltonian formulations. Defining
, the system (
32) admits the standard Hamiltonian form
where
and the Hamiltonian
is non-separable. Introducing
transforms the system into a
K-symplectic [
1,
3] formulation:
where
with
. In the formulation (
34), the Hamiltonian becomes separable:
By decomposing this Hamiltonian into
parts, we derive the
K-symplectic subsystems.
The subsystem
has an exact solution, which is
For
,
, the solution of
i-th subsystem is
We obtain the
K-symplectic method by composing the exact solution of the subsystem.
Theorem 8. The discrete Lagrangian for (32)generates the variational integratorThis is equivalent to the K-symplectic method (35). Proof. Introducing the transformations
with
yields
Reformulating (
37) leads to
which are exactly the
K-symplectic methods (
35). □
4. Modified Equations for Variational Integrator
We begin this section by introducing the concept of modified equations for second-order systems
Definition 2 ([
24]).
For system (39), denote the method by . Its modified equation is a formal second-order differential equationsatisfying for all n. Expanding the difference equation
around
gives
Introducing
, it follows from (
40) that
Taking the derivative of the above equality with respect to
t gives
Substituting the higher derivatives
into the terms
in (
41), we obtain the following theorem by comparing the coefficients of
h on both sides of (
41):
Theorem 9. The coefficients in the modified Equation (40) are uniquely determined recursively by f, , …, , , …, , and their derivatives. Theorem 9 provides a recursive relation for calculating the coefficients of modified equations. We illustrate this by applying the Nyström methods [
2] to (
39), which results in
Theorem 10. For the Nyström methods (44)–(46), the coefficients of modified equation can be achieved bywhere is an elementary differential, as described in [2]. Proof. Using (
44) and (
45) to eliminate the intermediate variable
v yields the scheme
From (
44) and (
46), we derive
Expanding the left-hand side of (
47) about
gives
Similarly,
and
on the right term can be expanded about
up to
, as
Substituting (
49)–(
50) and the higher derivatives (
42)–(
43) into the right-hand side of (
47) and comparing the coefficients of the term
yields recursive formulas.
thus completing the proof. □
Remark 3. Generally, the system of modified equations represents a formal divergent series. However, for linear second-order systems, we are able to obtain a convergent modified series. Further details can be found in Appendix A. It is well-known that the system (
14) has a variational description. However, not all numerical discretizations of this system are variational. A method is variational if and only if its modified Equation (
40) maintains variational structure. By Theorem 4, this requires the coefficients
to satisfy
This implies the existence of formal Lagrangian referred to as the
modified Lagrangian denoted by
.
Definition 3. The modified Lagrangian is a formal serieswhose Euler–Lagrange equationshave the solution matching the variational integrator . An alternative definition of the modified Lagrangian can be found in [
24], that is
where
. Differentiating (
52) w.r.t. to
yields
where boundary terms vanish.
Expand the discrete Lagrangian
at
, and it reads
where
x denotes
,
contains
x and its derivatives. By Lemma 1 in [
24], the discrete action functional over the interval
can be expressed as
where
are Bernoulli numbers with
,
and
. From (
52), it follows that
Solving
implicitly from the modified Euler–Lagrange Equation (
51) and substituting it into (
54), we can eliminate
and its higher-order derivatives in the right-hand side of (
54). According to Proposition 6 in [
24], the term
only depends on
x and its
j order derivatives
. Comparing the coefficients of the term
on both sides of (
54), we obtain
Recursively, we can derive the modified Lagrangian as a formal series corresponding to the time step
h.
For the system (
14), the Störmer–Verlet method originates from the discrete Lagrangian
As presented in [
24], its second-order modified Lagrangian
yields the following modified Euler–Lagrange equation:
The symplectic Euler method corresponds to the first-order discrete Lagrangian
The discrete Lagrangians (
55) and (
58) are weak equivalence [
8], as their corresponding variational integrators are the same as
Theorem 11. For the discrete Lagrangian (58), its third-order modified Lagrangian iswith the corresponding modified equation Proof. Expanding (
58) around
, we obtain
Applying the modified Lagrangian construction (
54)
It is evident that
which implies that the terms in
vanish. Substituting
into (
60) yields (
59). The Euler–Lagrange equation follows from
□
We illustrate the solutions of truncated modified equations using the pendulum problem. For this, let
in (
39). The modified Lagrangian gives the corresponding modified Hamiltonian via the Legendre transformation. Denote the
k-th order truncated Lagrangian by
and the corresponding Hamiltonian by
. For
, the modified Hamiltonian corresponding to
is given by
which matches the result in [
2]. In
Figure 1, we show the numerical solution using the symplectic Euler method from (
58), along with the exact flow of the pendulum problem, represented by the contour plot of the Hamiltonian. The contour plot of (
62) shows the exact flow of the modified pendulum problem at first order. The initial conditions are
. In
Figure 1, the solid line represents the exact solution of the pendulum, while the dotted lines correspond to the symplectic Euler method and the exact solution of the modified pendulum. The results show that the modified pendulum problem provides better agreement between the numerical solution and the exact solution. As we include more terms in the truncation, we expect further improvement. However, since the modified equations are not convergent, there is an optimal truncation level based on asymptotic expansion theory.
For the newly presented variational integrators from (
15) and (
21), the modified Lagrangians are established in the following theorem:
Theorem 12. For the first-order discrete Lagrangian (15), its modified Lagrangian truncated to order 2 can be formulated as The corresponding modified equation takes the following form:For the second-order discrete Lagrangian (21), the second truncation of the modified Lagrangian is given byThe corresponding modified equation can be expressed aswhere Proof. Without loss of generality, we compute the modified Lagrangian of second truncation for the discrete Lagrangian (
21). Expand (
21) about
, we derive
Substitute
into (
54), we obtain
We apply
to eliminate term
in (
67), this leads to (
65). With the modified Lagrangian (
65), the direct calculation provides the modified Equation (
66). □
As discussed earlier, the variational integrator can be interpreted as the exact solution to the modified equations. Consequently, the conservative properties of numerical methods are linked to their modified Lagrangian. Through backward error analysis [
2], it is expected that variational integrators can preserve bounded error in the conservation of energy and angular momentum over long-term integration. For the Kepler problem, known as super-integrable, we present the following theorem to characterize the preservation of the LRL vector.
Theorem 13. For the perturbed Kepler problem, let its Lagrangian be . Assume the initial orbits are aligned with the -axis to ; then, the variation of the LRL vector over one period satisfiesand the change in the angle ω relative to the x-axis is given byHere, are the LRL characteristics shown in Proposition 3, T is the orbital period, and denotes the T-period average. Proof. Under the assumption of the proposition, we have
and
. According to Proposition 1, it follows that
where
and
x are the solutions of the perturbed and unperturbed Euler-–Lagrange systems, respectively. Differentiating
and
yields
Therefore, we obtain
Integrating both sides of the above equalities w.r.t.
t over one period proves the theorem. □
By the theory of modified Lagrangian, the variational integrators yield the perturbed Lagrangian. In the following, we present the error estimates of the LRL vector for the Störmer–Verlet methods, the symplectic Euler methods, and the variational integrators in (
30) and (
31). Moreover, we prove that the eccentricity of the Störmer–Verlet method shows super-convergence, extending the precession analysis of angle from [
35].
Theorem 14. Under the condition of Theorem 13, for the Störmer–Verlet from (55), the eccentricity error satisfies Proof. In Theorem 13, setting
and
leads to
As verified in [
35], we know that
Due to the periodicity of the Kepler solution, the term
vanishes. In polar coordinates, where
and
, we compute the time average of
over one period, which vanishes for
. Specifically, according to Kepler’s law in [
36], we have
Consequently, it follows from (
71) that
which completes the proof. □
Theorem 15. Under the condition of Theorem 13, for the symplectic Euler method from (58), the errors in eccentricity and the angle of the LRL vector over one period are of order 2. Proof. For the discrete Lagrangian (
58), its modified Lagrangian is given in Theorem 11. Setting
and
, the modified Lagrangian can be written as
From Theorem 13, we have
Noting that
, it follows that
□
For the newly constructed discrete Lagrangians (
15), we set
and
with
. The following theorem establishes that the corresponding variational integrators (
30) derived from (
15) exhibit super-convergence both in preserving the eccentricity and the angle of the LRL vector.
Theorem 16. Under the condition of Theorem 13, for the first-order discrete Lagrangian (15) with and , , the errors of the variational integrator (30) in eccentricity and the angle of the LRL vector are both of order 2. Proof. For the discrete Lagrangian (
15), the modified Lagrangian is given in Theorem 12 as
Define
Since
, it follows that
By Theorem 13, the error in eccentricity is given by
Similarly, the error in the angle of the LRL vector is
In polar coordinates, where
and
with
corresponding to the positive
axis, we apply Kepler’s laws. The integral average of
over one period is computed as
Similarly, we find
Combining the above results, we conclude
□
5. Numerical Experiments
In this section, we present numerical experiments to evaluate the results obtained using the newly constructed variational integrators introduced in
Section 2. We compute the classical and relativistic Kepler systems.
Kepler problem. This is an important dynamical system that is super-integrable with three conserved quantities. As shown in
Section 2, the system is variational, and its variational integrators can be constructed by splitting the potential
. In this section, we implement the first-order variational integrator (
30) (VI-1) and the second-order variational integrator (
31) (VI-2) by taking
.
Using the initial conditions
with
, and a time step of
, we perform numerical computations over
. For comparison, we also show results from the symplectic Euler method and Störmer–Verlet method. The numerical orbits computed by the four variational integrators are shown in
Figure 2. The orbit in the top-left corner is generated using the symplectic Euler method, while the top-right orbit is computed using the Störmer–Verlet method. The bottom-left and bottom-right orbits are simulated by the first- and second-order variational integrators (VI-1) and (VI-2), respectively. The background dotted line represents the exact orbit. It is clear that the numerical orbits on the top show a pronounced clockwise drift, while the two variational integrators provide better simulation results. Among the four methods, the orbit computed by the second-order variational integrator (VI-2) exhibits the least numerical error.
Table 1 compares solution errors. The variational integrators show smaller errors than classical methods of the same order.
We now show the preservation of conservative quantities by the variational integrators. The initial conditions are
, and the step size is
. From
Figure 3, we observe that the numerical errors in energy can be bounded by all four variational integrators over the long term. For the Kepler system, the LRL vector defines the orientation and shape of the orbit. We present the numerical results for both the norm of the vector (eccentricity) and the angle (which governs the orientation and shape of the elliptical orbit). As discussed in
Section 4, the solution of the variational integrator corresponds to the exact solution of the modified second-order differential equation. While the original Kepler system is super-integrable, the modified system is not. However, through backward error analysis [
21,
23], we show that the modified system remains integrable under symplectic methods. Thus, all four numerical methods bound the energy and momentum. The energy errors for the four variational integrators are plotted in
Figure 3.
In
Figure 4 and
Figure 5, we compute the LRL vector using all four variational integrators. These figures show that the eccentricity error is bounded by all four methods, with the new variational integrators producing significantly smaller errors in both eccentricity and rotation angle.
We also present the convergence rates for the eccentricity and angle of the LRL vector, illustrated in
Figure 6. To estimate the convergence order, we begin with
and compute results for time steps
, for
. The results are shown in a log–log plot. For the eccentricity error in
Figure 6a, both the symplectic Euler method and the first-order variational integrator exhibit second-order convergence. Their error curves are nearly identical. The Störmer–Verlet method shows super-convergence of order 4, while the second-order variational integrator also demonstrates super-convergence and produces smaller errors compared to the Störmer–Verlet method. In
Figure 6b, we show the convergence rate for the angle error. All four methods exhibit a second-order convergence rate, consistent with the theoretical estimates in
Section 4. The error curves for the symplectic Euler and Störmer–Verlet methods are nearly identical, but both the first- and second-order variational integrators show smaller errors in preserving the angle of the LRL vector. Among all four methods, the second-order variational integrator achieves the smallest errors, demonstrating superior performance.
Relativistic Kepler system. This describes the motion of particles or bodies whose velocities are close to the speed of light. This system can be formulated by introducing proper time, with the Lagrangian given by
. With scaled light speed
, initial conditions
, and time step
over
,
Figure 7 shows orbits computed by variational integrators (
36) and (
21). The mass shell
is the key conserved quantity.
Figure 8 presents its error over 2500 steps. Both orbital trajectories and mass shell errors demonstrate good qualitative agreement, confirming the structure-preserving properties of the proposed methods in relativistic spacetime.