Variational integrator

Method of numerical integration

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 m v 2 V ( q ) , {\displaystyle L(t,q,v)={\frac {1}{2}}mv^{2}-V(q),}

where m {\displaystyle m} is the mass of the particle, and V {\displaystyle 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:

L d ( t 0 , t 1 , q 0 , q 1 ) = t 1 t 0 2 [ L ( t 0 , q 0 , q 1 q 0 t 1 t 0 ) + L ( t 1 , q 1 , q 1 q 0 t 1 t 0 ) ] t 0 t 1 d t L ( t , q ( t ) , v ( t ) ) . {\displaystyle {\begin{aligned}L_{d}(t_{0},t_{1},q_{0},q_{1})&={\frac {t_{1}-t_{0}}{2}}\left[L\left(t_{0},q_{0},{\frac {q_{1}-q_{0}}{t_{1}-t_{0}}}\right)+L\left(t_{1},q_{1},{\frac {q_{1}-q_{0}}{t_{1}-t_{0}}}\right)\right]\\&\approx \int _{t_{0}}^{t_{1}}\,dt\,L(t,q(t),v(t)).\end{aligned}}}

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

q ( t ) q 1 q 0 t 1 t 0 ( t t 0 ) + q 0 {\displaystyle q(t)\approx {\frac {q_{1}-q_{0}}{t_{1}-t_{0}}}(t-t_{0})+q_{0}}

between t 0 {\displaystyle t_{0}} and t 1 {\displaystyle t_{1}} , resulting in a constant velocity v ( q 1 q 0 ) / ( t 1 t 0 ) {\displaystyle v\approx \left(q_{1}-q_{0}\right)/\left(t_{1}-t_{0}\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

L d ( t 0 , t 1 , q 0 , q 1 ) = t 0 t 1 d t L ( t , q ( t ) , v ( t ) ) + O ( t 1 t 0 ) 2 , {\displaystyle L_{d}(t_{0},t_{1},q_{0},q_{1})=\int _{t_{0}}^{t_{1}}\,dt\,L(t,q(t),v(t))+{\mathcal {O}}(t_{1}-t_{0})^{2},}

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:

S d = L d ( t 0 , t 1 , q 0 , q 1 ) + L d ( t 1 , t 2 , q 1 , q 2 ) + . {\displaystyle S_{d}=L_{d}(t_{0},t_{1},q_{0},q_{1})+L_{d}(t_{1},t_{2},q_{1},q_{2})+\cdots .}

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 q 1 {\displaystyle q_{1}} , we have

S d q 1 = 0 = q 1 L d ( t 0 , t 1 , q 0 , q 1 ) + q 1 L d ( t 1 , t 2 , q 1 , q 2 ) . {\displaystyle {\frac {\partial S_{d}}{\partial q_{1}}}=0={\frac {\partial }{\partial q_{1}}}L_{d}\left(t_{0},t_{1},q_{0},q_{1}\right)+{\frac {\partial }{\partial q_{1}}}L_{d}\left(t_{1},t_{2},q_{1},q_{2}\right).}

Given an initial condition ( q 0 , q 1 ) {\displaystyle (q_{0},q_{1})} , and a sequence of times ( t 0 , t 1 , t 2 ) {\displaystyle (t_{0},t_{1},t_{2})} this provides a relation that can be solved for q 2 {\displaystyle q_{2}} . The solution is

q 2 = q 1 + t 2 t 1 t 1 t 0 ( q 1 q 0 ) ( t 2 t 0 ) ( t 2 t 1 ) 2 m d d q 1 V ( q 1 ) . {\displaystyle q_{2}=q_{1}+{\frac {t_{2}-t_{1}}{t_{1}-t_{0}}}(q_{1}-q_{0})-{\frac {(t_{2}-t_{0})(t_{2}-t_{1})}{2m}}{\frac {d}{dq_{1}}}V(q_{1}).}

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

p 0 q 0 L d ( t 0 , t 1 , q 0 , q 1 ) {\displaystyle p_{0}\equiv -{\frac {\partial }{\partial q_{0}}}L_{d}(t_{0},t_{1},q_{0},q_{1})}

and

p 1 q 1 L d ( t 0 , t 1 , q 0 , q 1 ) . {\displaystyle p_{1}\equiv {\frac {\partial }{\partial q_{1}}}L_{d}(t_{0},t_{1},q_{0},q_{1}).}

Given an initial condition ( q 0 , p 0 ) {\displaystyle (q_{0},p_{0})} , the stationary action condition is equivalent to solving the first of these equations for q 1 {\displaystyle q_{1}} , and then determining p 1 {\displaystyle p_{1}} using the second equation. This evolution scheme gives

q 1 = q 0 + t 1 t 0 m p 0 ( t 1 t 0 ) 2 2 m d d q 0 V ( q 0 ) {\displaystyle q_{1}=q_{0}+{\frac {t_{1}-t_{0}}{m}}p_{0}-{\frac {(t_{1}-t_{0})^{2}}{2m}}{\frac {d}{dq_{0}}}V(q_{0})}

and

p 1 = m q 1 q 0 t 1 t 0 t 1 t 0 2 d d q 1 V ( q 1 ) . {\displaystyle p_{1}=m{\frac {q_{1}-q_{0}}{t_{1}-t_{0}}}-{\frac {t_{1}-t_{0}}{2}}{\frac {d}{dq_{1}}}V(q_{1}).}

This is a leapfrog integration scheme for the system; two steps of this evolution are equivalent to the formula above for q 2 {\displaystyle q_{2}}

See also

  • Lie group integrator

References

  • E. Hairer, C. Lubich, and G. Wanner. Geometric Numerical Integration. Springer, 2002.
  • J. Marsden and M. West. Discrete mechanics and variational integrators. Acta Numerica, 2001, pp. 357–514.