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 configuration 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.
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 be the configuration coordinates of our system and let be the corresponding velocities. Then if our (conservative) mechanical system has potential energy function , the Lagrangian can be written as
The underlying premise of mechanics is that a system is going to follow some continuous path through its configuration space parametrized by time . 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 ) imaginable we can define a path integral which we call the action:
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 . To find critical points of that function, we differentiate and set it equal to zero. So we know that extrema of the function satisfy the equation
In the same way the physical trajectory of a mechanical system is a critical path with respect to the action functional when it satisfies the equation
The operator 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:
Solutions to these equations (incorporating the initial conditions) give us our actual physical trajectories.
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 . We might, for example using the midpoint rule, discretize this function as follows:
where is some constant denoting the length of time between steps. Here the discrete function approximates the value of the continuous function at some intermediate point between two discrete steps of position and . Then we can approximate the path integral functional with a discrete summation version:
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
where refers to partial differentiation in the -th slot of . The resulting update map is implicit and usually not algebraically solvable for , 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.