In this work an efficient dynamics algorithm is developed, which is applica
ble to a wide range of multibody systems, including underactuated systems,
branched or tree-topology systems, robots, and walking machines. The dynami
cs algorithm is differentiated with respect to the input parameters in orde
r to form sensitivity equations. The algorithm makes use of techniques and
notation from the theory of Lie groups and Lie algebras, which is reviewed
briefly. One of the strengths of our formulation is the ability to easily d
ifferentiate the dynamics algorithm with respect to parameters of interest.
We demonstrate one important use of our dynamics and sensitivity algorithm
s by using them to solve difficult optimal control problems for underactuat
ed systems. The algorithms in this paper have been implemented in a softwar
e package named Cstorm. (Computer simulation tool for the optimization of r
obot manipulators), which runs from within Matlab and Simulink. It can be d
ownloaded from the website http://www.eng.uci.edu/(similar to)bobrow/.