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
![{\displaystyle L(t,q,v)={\frac {1}{2}}mv^{2}-V(q),}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c788fa18d5165204aac831f11527175cf807eddd)
where
is the mass of the particle, and
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:
![{\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}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/addc59e160947d5af3389f9194164d1b2109737d)
Here we have chosen to approximate the time integral using the trapezoid method, and we use a linear approximation to the trajectory,
![{\displaystyle q(t)\approx {\frac {q_{1}-q_{0}}{t_{1}-t_{0}}}(t-t_{0})+q_{0}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/3f4c478b29a11a7879a73e6a3c3127edc3237f88)
between
and
, resulting in a constant velocity
. 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
![{\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},}](https://wikimedia.org/api/rest_v1/media/math/render/svg/34eea7b322dfd4df799cf7b94b6ab09e3104a2d6)
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:
![{\displaystyle S_{d}=L_{d}(t_{0},t_{1},q_{0},q_{1})+L_{d}(t_{1},t_{2},q_{1},q_{2})+\cdots .}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7e38dc15d75e5e5b31a6bfeeeac09c31ed8e928a)
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
, we have
![{\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).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/44014a4f61f5afe59cb67099d1471852bb8be90d)
Given an initial condition
, and a sequence of times
this provides a relation that can be solved for
. The solution is
![{\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}).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/778a10e6ecd6298b7cadae64b0d17241e563f8c3)
We can write this in a simpler form if we define the discrete momenta,
![{\displaystyle p_{0}\equiv -{\frac {\partial }{\partial q_{0}}}L_{d}(t_{0},t_{1},q_{0},q_{1})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/37b61be255f6866a064d1fac8358e73cf5ca846b)
and
![{\displaystyle p_{1}\equiv {\frac {\partial }{\partial q_{1}}}L_{d}(t_{0},t_{1},q_{0},q_{1}).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d18436b35be2db6b6cca9f02044d111af68921b1)
Given an initial condition
, the stationary action condition is equivalent to solving the first of these equations for
, and then determining
using the second equation. This evolution scheme gives
![{\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})}](https://wikimedia.org/api/rest_v1/media/math/render/svg/a8f1ffa13b0e72b3a5090f5ba5116ba07dabd9f3)
and
![{\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}).}](https://wikimedia.org/api/rest_v1/media/math/render/svg/18c30688b882817f275c102b7c780516295867a7)
This is a leapfrog integration scheme for the system; two steps of this evolution are equivalent to the formula above for
See also
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.