One more question about matrix calculus: this time about skew-symmetric matrices

124 Views Asked by At

Formula for the transition from tensors to vectors in matrix calculus

https://mathematica.stackexchange.com/questions/251079/derivative-matrix-by-vector-in-mathematica

Given:

  1. $Q=R_z(\psi)R_y(\xi)R_x(\phi)$ - rotation matrix

  2. $\boldsymbol{\theta}=\left[\begin{array}{@{}c@{}} \phi \\ \xi \\ \psi \end{array} \right]$ - vector of angles

  3. $p=Q\left[\begin{array}{@{}c@{}} 0 \\ 0 \\ 1 \end{array} \right]$ - vector

  4. $[p]_×=\begin{pmatrix} 0 & -p(3) & p(2) \\ p(3) & 0 & -p(1) \\ -p(2) & p(1) & 0\end{pmatrix}$ - skew-symmetry matrix for vector $p$

  5. $E=\begin{pmatrix} p+p & p-\left[\begin{array}{@{}c@{}} 1 \\ 1 \\ 1 \end{array} \right] & p \times \left[\begin{array}{@{}c@{}} 1 \\ 1 \\ 1 \end{array} \right] \end{pmatrix}$ - matrix

  6. $I_p=[p]_×[p]_×^T+EE^T$


Task:

Find general formula in vector-matrix form for derivative of matrix $I_p$ by vector $\boldsymbol{\theta}$, i.e. $\frac{dI_p}{d\boldsymbol{\theta}}$


My considerations:

If we pay attention, then everything is based on the matrix $\frac{dQ}{d\boldsymbol{\theta}}$. But I need to find a formula that does not require a manual transition to skew-symmetric matrices, i.e. everything happens automatically, and in return we get full matrix $\frac{dI_p}{d\boldsymbol{\theta}}$.

EDIT:

For one coordinate it will look like this to get the derivative of the skew-symmetric matrix.

$\frac{d[p]_x}{d\phi}=\frac{dp}{d\phi}\times\left[\begin{array}{@{}c@{}} 1 \\ 0 \\ 0 \end{array} \right]$

$\frac{d[p]_x}{d\xi}=\frac{dp}{d\xi}\times\left[\begin{array}{@{}c@{}} 0 \\ 1 \\ 0 \end{array} \right]$

$\frac{d[p]_x}{d\psi}=\frac{dp}{d\phi}\times\left[\begin{array}{@{}c@{}} 0 \\ 0 \\ 1 \end{array} \right]$

How to "pack" it in one operation?

EDIT №2:

$\frac{d[p]_x}{d\boldsymbol{\theta}}=[Skew^T(\left[\begin{array}{@{}c@{}} 1 \\ 0 \\ 0 \end{array} \right])\frac{dQ}{d\boldsymbol{\theta}}(\left[\begin{array}{@{}c@{}} 0 \\ 0 \\ 1 \end{array} \right] \otimes I_n);Skew^T(\left[\begin{array}{@{}c@{}} 0 \\ 1 \\ 0 \end{array} \right])\frac{dQ}{d\boldsymbol{\theta}}(\left[\begin{array}{@{}c@{}} 0 \\ 0 \\ 1 \end{array} \right] \otimes I_n);Skew^T(\left[\begin{array}{@{}c@{}} 0 \\ 0 \\ 1 \end{array} \right])\frac{dQ}{d\boldsymbol{\theta}}(\left[\begin{array}{@{}c@{}} 0 \\ 0 \\ 1 \end{array} \right] \otimes I_n)$

1

There are 1 best solutions below

3
On BEST ANSWER

I see your second edit. Replying to your first edit, it also takes the form: $$ \operatorname{vec}\frac{d [p]_\times}{d \theta} = \left( \begin{bmatrix}1\\0\\0\end{bmatrix}_\times \oplus \begin{bmatrix}0\\1\\0\end{bmatrix}_\times \oplus \begin{bmatrix}0\\0\\1\end{bmatrix}_\times \right) \operatorname{vec}\frac{d p}{d \theta} $$ Here, $\operatorname{vec}\begin{bmatrix}a & b & c\end{bmatrix} = \begin{bmatrix}a \\ b \\ c\end{bmatrix}$ where $a,b,c\in\mathbb{R}^3$, and $A \oplus B = \begin{bmatrix}A & 0 \\ 0 & B\end{bmatrix}$ for matrices $A, B$. However, I argue that $\frac{d [p]_\times}{d \theta}$ has 27 entries to be determined as @tomek pointed out. Since $[p]_\times \in \mathbb{R}^{3\times 3}$, $\frac{d [p]_\times}{d \theta}$ is the derivative of the map $\mathbb{R}^3 \mapsto \mathbb{R}^{3\times 3}, \theta \mapsto [p]_\times$ evaluated at $\theta$, i.e., $\left[\mathbb{R}^3 \mapsto L(\mathbb{R}^3, \mathbb{R}^{3\times 3})\right]_\theta \in L(\mathbb{R}^3, \mathbb{R}^{3\times 3}) \cong \mathbb{R}^{3\times 3\times 3} \cong \mathbb{R}^{27}$.

If $\frac{d I_p}{d p}$ is attained, the chain rule can take over the analysis. Let $I_p = A(p) + B(p)$ with $A(p) = [p]_\times [p]_\times^\top$ and $B(p) = EE^\top$. Since $A(p) = p^\top p I_3 - pp^\top$, the derivative $\frac{d A}{dp} = A'(p)$ where $A' : \mathbb{R}^3 \mapsto L(\mathbb{R}^3, \mathbb{R}^{3 \times 3})$ satisfies $A'(p)(x) = 2p^\top x I_3 - (xp^\top + px^\top)$, as $$\begin{align*} A(p + h) - A(p) &= p^\top h I_3 + h^\top p I_3 + h^\top h I_3 - hp^\top - ph^\top - hh^\top \\&= 2p^\top h I_3 - (hp^\top + ph^\top) + o(h) .\end{align*}$$