There is Lagrangian. To see this you need to download the demo and open the file using Mathematica. In section DETAILS there is an expression
\[ScriptCapitalL]=1/2(2 g Subscript[m, 2] (-r+R) cos \[Theta](t)+r^-2((Subscript[I, 2]+Subscript[m, 2] r^2) (r-R)^2 \[Theta]^\[Prime](t)^2+2 (r-R) R (Subscript[I, 2]+Subscript[m, 2] r^2 cos \[Theta](t)) \[Theta]^\[Prime](t) \[Phi]^\[Prime](t)+(Subscript[I, 1] r^2+(Subscript[I, 1]+(Subscript[m, 1]+Subscript[m, 2]) r^2) R^2) \[Phi]^\[Prime](t)^2))