Variational Integrators

Mechanical systems arise naturally from variational principles. There are many approaches to deriving numerical integrators of differential equations; the particular class of integrators I study may be derived from discrete variational principles and are hence defined as variational integrators. Variational integrators of Hamiltonian systems arise when we seek discrete paths through the con figuration space of a mechanical system that are critical with respect to a discrete action in a manner analogous to the derivation of the equations of motion from Hamilton’s principle.

Variational Principles

For an overview of variational principles check out the corresponding Wikipedia article, or if you’re interested in learning about the subject in detail and have at least a solid undergraduate calculus background I’d recommend Cornelius Lanczos’s excellent text “The Variational Principles of Mechanics.” The quick and dirty version is that for a mechanical system we can define a function called the Lagrangian to be the difference between kinetic and potential energy. Let x be the configuration coordinates of our system and let \dot{x} be the corresponding velocities. Then if our (conservative) mechanical system has potential energy function V, the Lagrangian can be written as

L(x,\dot{x}) = \frac{1}{2}\langle M\dot{x}, \dot{x}\rangle -V(x).

The underlying premise of mechanics is that a system is going to follow some continuous path through its configuration space parametrized by time t. Variational principles actually start by examining all possible instances of that continuous path. Consider the act of throwing a baseball on the surface of the Earth. From experience we know that the trajectory of the ball will be parabolic (neglecting air resistance) but we can imagine the ball taking other exotic paths: a straight line between the two ball players, loop-the-loops in the air, perhaps the ball slows down, reverses direction and does few orbits around the thrower before spiraling into the catcher’s mitt! For any given position and velocity of the ball, the Lagrangian of the system has a real value, and for any trajectory (call it \bar{x}(t)) imaginable we can define a path integral which we call the action:

S(x,\dot{x}) = \int_{t_0}^{t_F} L(x(t),\dot{x}(t))dt.

What distinguishes the parabolic trajectory of the ball from all of the other possible, but non-physical paths? The parabolic, physical trajectory minimizes the action functional of the baseball system. Then, if we can set up the action functional for any given mechanical system and we have initial conditions for the system, how do we find a critical path? We actually can take a lesson from one-dimensional calculus to answer this question. Consider the function f(x). To find critical points of that function, we differentiate f and set it equal to zero. So we know that extrema x_c of the function f satisfy the equation

\dfrac{df}{dx}(x_c) = 0.

In the same way the physical trajectory \bar{x} of a mechanical system is a critical path with respect to the action functional when it satisfies the equation

\delta S(\bar{x},\dot{\bar{x}}) = 0.

The operator \delta is a special kind of derivative called the variational derivative; the specifics don’t matter too much here and for a finite dimensional system in practice it works much the same way as partial differentiation. The result of evaluating the above equation isn’t exactly a path yet, it is rather a system of ordinary differential equations called the Euler-Lagrange equations:

\dfrac{d}{dt}\dfrac{\partial L}{\partial \dot{x}} = \dfrac{\partial L}{\partial x}.

Solutions to these equations (incorporating the initial conditions) give us our actual physical trajectories.

Variational Integrators

Unfortunately, for most mechanical systems the Euler-Lagrange equations are unsolvable: the second-order differential equations describes the overall behavior of the mechanical system, but because of coupling forces and other complexities we may not be able to find explicit solutions: continuous paths through the configuration space.

Oftentimes the best we can do is approximate the continuous solutions to differential equations as discrete paths through the configuration space corresponding to predetermined discrete time intervals. There are many methods of finding integrators that approximate the equations of motion of a mechanical system with various advantages and disadvantages. The method I study is that of variational integrators: integrators that are derived from variational principles. Recall our definition of the Lagrangian L. We might, for example using the midpoint rule, discretize this function as follows:

L_d(x_k,x_{k+1}) = L\left( \dfrac{x_{k+1}+x_k}{2} , \dfrac{x_{k+1}-x_k}{h} \right)

where h is some constant denoting the length of time between steps. Here the discrete function L_d approximates the value of the continuous function L at some intermediate point between two discrete steps of position x_k and x_{k+1}. Then we can approximate the path integral functional S with a discrete summation version:

S_d = \sum\limits_{k=0}^{N-1} L_d(x_k,x_{k+1}) \approx \int_{t_0}^{t_F} L(x(t),\dot{x}(t))dt .

Once we have a discrete action, finding variational integrators becomes a matter of finding discrete paths through the configuration space that are critical with respect to the discrete action. Again, we will take a variational derivative of the action and set it to zero, finding a condition on update maps that implies the return of critical paths. The discrete Euler-Lagrange equations may be written in general as the condition

D_1 L_d(x_k,x_{k+1}) = - D_2 L_d(x_{k-1},x_k)

where D_i refers to partial differentiation in the i-th slot of L_d. The resulting update map is implicit and usually not algebraically solvable for x_{k+1}, however with decent root-finding techniques we can come up with solutions that are critical paths of the discrete action!

The phase flows of Hamiltonian systems are symplectic, that is to say a symplectic form is preserved on the phase space as the system evolves. Variational integrators are themselves naturally symplectic; symplectic integrators for the general form of Hamel’s equations will be useful in the study of systems that benefit from a choice of non-coordinate frame including relativistic systems and systems with constraints or symmetries. And in addition to symplecticity, even low order variational integrators display good long term behavior: energy—while not generally conserved—is often bounded in the implicit update maps derived from variational integrators.