trep is a Python module for simulation and trajectory optimization of mechanical systems in generalized coordinates.
The dynamics can be modeled in continuous time as a traditional ODE, or in discrete time using variational integrators.
The central component of trep is the System class. A System is a collection of coordinate frames, forces, potential energies, and constraints that describe a mechanical system in generalized coordinates. The System is capable of calculating the continuous dynamics and the first and second derivatives of the dynamics.