Skip to Main Content
We present a technique to implement scalable variational integrators for generic mechanical systems in generalized coordinates. Systems are represented by a tree-based structure that provides efficient means to algorithmically calculate values (position, velocities, and derivatives) needed for variational integration without the need to resort to explicit equations of motion. The variational integrator handles closed kinematic chains, holonomic constraints, dissipation, and external forcing without modification. To avoid the full equations of motion, this method uses recursive equations, and caches calculated values, to scale to large systems by the use of generalized coordinates. An example of a closed-kinematic-chain system is included along with a comparison with the open-dynamics engine (ODE) to illustrate the scalability and desirable energetic properties of the technique. A second example demonstrates an application to an actuated mechanical system.