# Transform torque from Euler angles to infinitesimal Cartesian rotations

For a certain pair of rigid bodies, I have the gradient of energy in terms of Euler angles. I want to transform this gradient to the gradient of energy in terms of rotations about the $x, y, z$ axes (the very useful gradient known as torque).

Performing the analogous transformation between, say, spherical coordinates and Cartesian is easy because both form a full basis. One simply expresses the spherical coordinates in terms of Cartesian and finds the partial derivatives for each $r, \theta, \phi$ with respect to $x, y, z$ (the Jacobian). Then matrix multiplication gives the answer.

But the Cartesian rotations are not a basis for full rotations! They are only a basis for infinitesimal rotations. Therefore it is not possible to take this simple chain-rule approach, because one cannot represent an arbitrary Euler angle in terms of fixed-axis $x, y, z$ rotations.

I strongly suspect that this Jacobian exists, especially since this Phys.SE post seems to have found it (without stating the Euler convention or any derivation or sources, making it useless). How can I find this Jacobian?

-
How did you get the gradient of potential energy with respect to Euler angles in the first place? Is there more to the problem, so maybe we could get the torque directly instead of walking it through Euler angles? – Muphrid Feb 8 '13 at 22:49
No, I only have access to the derivatives with respect to the Euler angles. What I have is a big 6-dimensional table of potential energies in terms of x,y,z, \theta,\psi,\phi. Getting the torques directly would mean storing arbitrary rotations in terms of three fixed-axis rotations, which is impossible. – MD_ftw Feb 9 '13 at 0:01

I think this is a very messy problem no matter how you approach it. Let me show you how to at least eliminate the calculus so I can leave you a linear algebraic problem to solve.

I don't know which Euler angle convention you're using. I'll guess: \begin{align} R(\phi,\theta,\psi) &=& R_z(\phi)R_y(\theta)R_z(\psi) \end{align}

Let's rewrite this using quaternions:

\begin{align}R(\phi,\theta,\psi) &=& \exp(k\phi/2)\exp(j\theta/2)\exp(k\psi/2) \end{align}

We're interested in how this rotation changes when we multiply by rotations through infinitesimal $x$ round the $x$-axis, $y$ round the $y$-axis and $z$ around the $z$-axis. (Note that order doesn't matter because we're asking about infinitesimals and computing first derivatives.)

\begin{align} R+\delta R &=& \exp(ix/2)\exp(jy/2)\exp(kz/2)\exp(k\phi/2)\exp(j\theta/2)\exp(k\psi/2) \\ \end{align}

Using the fact that $x$, $y$ and $z$ are infinitesimal we get: \begin{align} R+\delta R &=& (1+ix/2+jy/2+kz/2)\exp(k\phi/2)\exp(j\theta/2)\exp(k\psi/2) \\ \delta R &=& (ix/2+jy/2+kz/2)\exp(k\phi/2)\exp(j\theta/2)\exp(k\psi/2) \end{align} But we also have: \begin{align} R+\delta R &=& \exp(k(\phi+\delta\phi)/2)\exp(j(\theta+\delta\theta)/2)\exp(k(\psi+\delta\psi)/2)\\ \delta R &=& (\delta\phi/2)k\exp(k\phi/2)\exp(j\theta/2)\exp(k\psi/2)\\ &&+(\delta\theta/2)\exp(k\phi/2)j\exp(j\theta/2)\exp(k\psi/2)\\ &&+(\delta\psi/2)\exp(k\phi/2)\exp(j\theta/2)k\exp(k\psi/2) \end{align}

We want to use the fact that $\delta\psi={\partial\psi\over\partial x}dx+{\partial\psi\over\partial y}dy+{\partial\psi\over\partial z}dz$ etc. to get all of the partial derivatives. You can do this by simplifying the expressions above using basic quaternion algebra and $\exp(\theta n)=cos\theta+n\sin\theta$ for any unit quaternion $n$ and then equating coefficients of $1$, $i$, $j$ and $k$. Start by multiplying on the right by $R^{-1}$ because $\delta R R^{-1}$ has zero real part and you're then left with three linear equations in three variables. Shouldn't be too bad in a good computer algebra package. I'll let you finish it. By linearity you can drop all the divisions by two. That'll save some ink.

This sidesteps the horrible problem of converting to Euler coordinates and back and differentiating the resulting mess.

-
Any Euler convention works for me. This looks very helpful, I will try it and post the result if it works. I've been trying to do the equivalent operations using rotation matrices, but since setting two rotation matrices equal gives a system of nine equations, I was getting nowhere. – MD_ftw Feb 9 '13 at 0:06
You can carry out an almost identical analysis using matrices too. Although $\delta R R^{-1}$ is a 3x3 matrix it is antisymmetric (as is any infinitesimal rotation based at the identity) and so you only have three non-trivial components. – Dan Piponi Feb 9 '13 at 0:20
If I'm correct that $R^{-1}=exp(-k \phi/2)exp(-j \theta/2)exp(-k \psi/2)$, then doesn't $\delta R R^{-1} = (ix/2 + jy/2 + kz/2)$? And since $i$ never appears in the other expression for $\delta R$, that implies $x=0$, which can't be right. If I'm making an elementary mistake in quaternion algebra, I apologize and ask you to direct me to a source where I can learn more. – MD_ftw Feb 10 '13 at 2:26
I may get time to look at this later. But for now: in R^{-1} you need to reverse the order of exponentials. And an i should appear from uses of jk=i. You need to fully multiply out the quaternions before comparing. – Dan Piponi Feb 10 '13 at 15:37
This'll help too: physics.stackexchange.com/questions/53653/… – Dan Piponi Feb 11 '13 at 18:51