The variational integrator simulates a discrete mechanical systems. Given a known state (time \(t_{k-1}\), configuration \(q_{k-1}\), and discrete momentum \(p_{k-1}\)) and inputs (force inputs \(u_{k-1}\) and next kinematic configuration \(\rho_{k-1}\)), the integrator finds the next state:
The integrator also finds the discrete constraint force variable \(\lambda_{k-1}\).
The variational integrator finds the next state by numerically solving the constrained Discrete Euler-Langrange (DEL) equation for \(q_k\) and \(\lambda_{k-1}\):
and then calculating the new discrete momentum:
In trep, we simplify notation by letting \(k=2\), so that we consider \(t_1\), \(q_1\), and \(p_1\) to be the previous state, and \(t_2\), \(q_2\), and \(p_2\) to be the new or current state.