1
$\begingroup$

I am trying to calculate the derivative of the Jacobian matrix without using any symbolic methods or toolbox. The problem is that the calculation leads to a different result that the what it should be after manual differentiation. The method of calculation I am using for the derivative is the using the Hessian tensor $\dot J= (H(q) \overline \times_3 \dot q)$ where $\overline \times _3$ is the n-mode vector product of a tensor as in [1]. The Hessians are computed as [2].

The example I am using for the calculation is a double pendulum but with the second joint being about the x-axis (perpendicular to the first axis of rotation) such that the double pendulum rotates in 3-dimensions.

Assume the Jacobian is given as:

\begin{equation} J_2=\begin{pmatrix} l_1cos(\alpha_1) & 0\\ 0 & l_2cos(\alpha_2)\\ l_1sin(\alpha_1)+l_2sin(\alpha_1)cos(\alpha_2) & l_2cos(\alpha_1)sin(\alpha_2)\\ 0 & cos(\alpha_1)\\ -1 & 0 \\0 & sin(\alpha_1)\end{pmatrix} \end{equation}

Starting from the given Jacobian the results of the Hessians are as follows: \begin{align} \frac{\partial^2X_2}{\partial \theta_1^2} &= \begin{pmatrix}\begin{pmatrix}0\\-1\\0\end{pmatrix} \times \begin{pmatrix}l_1cos(\alpha_1)\\0\\l_1sin(\alpha_1)+l_2sin(\alpha_1)cos(\alpha_2)\end{pmatrix} \\ 0 \\0\\0 \end{pmatrix} = \begin{pmatrix}-l_1sin(\alpha_1)-l_2sin(\alpha_1)cos(\alpha_2)\\0\\l_1cos(\alpha_1)\\0\\0\\0\end{pmatrix}\\ \frac{\partial^2X_2}{\partial \theta_1\theta_2} &= \begin{pmatrix}\begin{pmatrix}0\\-1\\0\end{pmatrix} \times \begin{pmatrix}0\\l_2cos(\alpha_2)\\l_2cos(\alpha_1)sin(\alpha_2)\end{pmatrix} \\ \begin{pmatrix}0\\-1\\0\end{pmatrix} \times \begin{pmatrix}cos(\alpha_1) \\0\\sin(\alpha_1) \end{pmatrix}\end{pmatrix} = \begin{pmatrix}-l_2cos(\alpha_1)sin(\alpha_2)\\0\\0\\-sin(\alpha_1)\\0\\cos(\alpha_1)\end{pmatrix}\\ \frac{\partial^2X_2}{\partial \theta_2^2} &= \begin{pmatrix}\begin{pmatrix}cos(\alpha_1)\\0\\sin(\alpha_1)\end{pmatrix} \times \begin{pmatrix}0\\l_2cos(\alpha_2)\\l_2cos(\alpha_1)sin(\alpha_2)\end{pmatrix} \\ 0\\0\\0 \end{pmatrix} = \begin{pmatrix}-l_2cos(\alpha_2)sin(\alpha_1)\\-l_2cos^2(\alpha_1)sin(\alpha_2)\\l_2cos(\alpha_1)cos(\alpha_2)\\0\\0\\0\end{pmatrix} \end{align}

The Hessian Tensor becomes: \begin{align} H_1 &= \begin{pmatrix}-l_1sin(\alpha_1)-l_2sin(\alpha_1)cos(\alpha_2) & -l_2cos(\alpha_1)sin(\alpha_2)\\ -l_2cos(\alpha_1)sin(\alpha_2)& -l_2cos(\alpha_2)sin(\alpha_1)\end{pmatrix}\\ H_2 &= \begin{pmatrix}0&0\\0&l_2cos^2(\alpha_1)sin(\alpha_2)\end{pmatrix}\\ H_3 &= \begin{pmatrix}l_1cos(\alpha_1) &0\\0 & l_2cos(\alpha_1)cos(\alpha_2)\end{pmatrix}\\ H_4 &= \begin{pmatrix}0 & -sin(\alpha_1)\\-sin(\alpha_1)&0\end{pmatrix}\\ H_5 &= \begin{pmatrix}0&0\\0&0\end{pmatrix}\\ H_6 &= \begin{pmatrix}0&cos(\alpha_1)\\cos(\alpha_1)&0\end{pmatrix} \end{align}

This results in: \begin{equation} \dot J = \begin{pmatrix} (-l_1sin(\alpha_1)-l_2sin(\alpha_1)cos(\alpha_2))\dot \alpha_1 + -l_2cos(\alpha_1)sin(\alpha_2)\dot \alpha_2 & -l_2cos(\alpha_1)sin(\alpha_2)\dot \alpha_1 + -l_2cos(\alpha_2)sin(\alpha_1)\dot \alpha_2\\ 0 & l_2cos^2(\alpha_1)sin(\alpha_2)\dot \alpha_2\\ l_1cos(\alpha_1) \dot \alpha_1 & l_2cos(\alpha_1)cos(\alpha_2)\dot \alpha_2\\ -sin(\alpha_1)\dot \alpha_2 & -sin(\alpha_1)\dot \alpha_1 \\ 0 &0 \\ cos(\alpha_1)\dot\alpha_2 & cos(\alpha_1)\dot \alpha_2\end{pmatrix} \end{equation}

Am I doing something wrong with the n-mode vector product of a tensor? I don't think the Hessian are wrong since the 2nd column in the rotation term of the $\dot J$ is right. Any help would be appreciated.

1

2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.