Variational integrator explained

Variational integrators are numerical integrators for Hamiltonian systems derived from the Euler–Lagrange equations of a discretized Hamilton's principle. Variational integrators are momentum-preserving and symplectic.

Derivation of a simple variational integrator

Consider a mechanical system with a single particle degree of freedom described by the Lagrangian

L(t,q,v)=

1
2

mv2-V(q),

where

m

is the mass of the particle, and

V

is a potential. To construct a variational integrator for this system, we begin by forming the discrete Lagrangian. The discrete Lagrangian approximates the action for the system over a short time interval:

\begin{align} Ld(t0,t1,q0,q1)&=

t1-t0
2

\left[L\left(t0,q0,

q1-q0
t1-t0

\right)+L\left(t1,q1,

q1-q0
t1-t0

\right)\right]\\ &

t1
\int
t0

dtL(t,q(t),v(t)). \end{align}

Here we have chosen to approximate the time integral using the trapezoid method, and we use a linear approximation to the trajectory,

q(t)

q1-q0
t1-t0

(t-t0)+q0

between

t0

and

t1

, resulting in a constant velocity

v\left(q1-q0\right)/\left(t1-t0\right)

. Different choices for the approximation to the trajectory and the time integral give different variational integrators. The order of accuracy of the integrator is controlled by the accuracy of our approximation to the action; since

Ld(t0,t1,q0,q1)=

t1
\int
t0

dtL(t,q(t),v(t))+l{O}(t1-

2,
t
0)

our integrator will be second-order accurate.

Evolution equations for the discrete system can be derived from a stationary-action principle. The discrete action over an extended time interval is a sum of discrete Lagrangians over many sub-intervals:

Sd=Ld(t0,t1,q0,q1)+Ld(t1,t2,q1,q2)+.

The principle of stationary action states that the action is stationary with respect to variations of coordinates that leave the endpoints of the trajectory fixed. So, varying the coordinate

q1

, we have
\partialSd
\partialq1

=0=

\partial
\partialq1

Ld\left(t0,t1,q0,q1\right)+

\partial
\partialq1

Ld\left(t1,t2,q1,q2\right).

Given an initial condition

(q0,q1)

, and a sequence of times

(t0,t1,t2)

this provides a relation that can be solved for

q2

. The solution is

q2=q1+

t2-t1
t1-t0

(q1-q0)-

(t2-t0)(t2-t1)
2m
d
dq1

V(q1).

We can write this in a simpler form if we define the discrete momenta,

p0\equiv-

\partial
\partialq0

Ld(t0,t1,q0,q1)

and

p1\equiv

\partial
\partialq1

Ld(t0,t1,q0,q1).

Given an initial condition

(q0,p0)

, the stationary action condition is equivalent to solving the first of these equations for

q1

, and then determining

p1

using the second equation. This evolution scheme gives

q1=q0+

t1-t0
m

p0-

(t-
2
t
0)
1
2m
d
dq0

V(q0)

and

p1=m

q1-q0
t1-t0

-

t1-t0
2
d
dq1

V(q1).

This is a leapfrog integration scheme for the system; two steps of this evolution are equivalent to the formula above for

q2

See also

References