Derivative of a Matrix with respect to a vector following the chain rule

61 Views Asked by At

\usepackage{amsmath}

I have a 2$\times$2 matrix $\bf \underline{A}$ that is a function of a 2-vector $\bf \overrightarrow u$ where

$$ {\bf \overrightarrow u}=[p,v]^{\text T} $$

such that

$$ \begin{equation*} {\bf \underline{A}}({\bf \overrightarrow u}) = \begin{bmatrix} -v & f(p) \\\\ g(p) & -v \end{bmatrix} \end{equation*} $$

where $f(p)$ and $g(p)$ are continuous real functions, and the real variables $p$ and $v$ are in turn functions of an independent real variable $t$.

I need to evaluate the time derivative of ${\bf \underline{A}}$. The problem with component-by-component differentiation is that as this matrix derivative is embedded in an explicit finite-difference scheme, these time derivatives do not conveniently fit into the computational stencil.

Therefore, I have expanded the derivative of the matrix ${\bf \underline{A}}$ with respect to $t$ as

$$ \begin{equation*} \frac{\partial{\bf \underline{A}}}{\partial {t}}= \Biggl[\frac{\partial{\bf \underline{A}}}{\partial {{\bf \overrightarrow u}}}\Biggr] \frac{\partial {{\bf \overrightarrow u}}}{\partial {t}} \end{equation*} $$

This form is convenient because the finite difference scheme directly involves the the vector ${\bf \overrightarrow u}$ and its derivatives.

I would imagine that the partial derivative in brackets is a 3rd Order tensor such that its inner product with the vector $\frac{\partial {{\bf \overrightarrow u}}}{\partial {t}}$ would yield a matrix (2nd order tensor). My question is whether there is some way clever around explicitly evaluating this 3rd Order tensor.

Some guidance and/or suggestions here would be deeply appreciated.

1

There are 1 best solutions below

0
On

$ \def\o{{\tt1}} \def\LR#1{\left(#1\right)} \def\op#1{\operatorname{#1}} \def\vecc#1{\op{vec}\LR{#1}} \def\Unvec#1{\op{Unvec}\LR{#1}} \def\trace#1{\op{Tr}\LR{#1}} \def\frob#1{\left\| #1 \right\|_F} \def\qiq{\quad\implies\quad} \def\p{\partial} \def\grad#1#2{\frac{\p #1}{\p #2}} \def\mr#1{\left[\begin{array}{r}#1\end{array}\right]} \def\mc#1{\left[\begin{array}{c|c}#1\end{array}\right]} \def\gradLR#1#2{\LR{\grad{#1}{#2}}} $Use vectorization to calculate a matrix-valued Jacobian instead of a $3^{rd}$order tensor, i.e. $$\eqalign{ a &= \vecc{A} &= \mr{-v \\ g \\ f \\ -v} \qiq \grad au &= \mr{0 & -\o \\ g' & 0 \\ f' & 0 \\ 0 & -\o} \quad }$$ Then calculate the time-derivative as $$\eqalign{ \grad at &= \gradLR au \gradLR ut \qiq \grad At &= \Unvec{\grad at} \\ }$$ In many computer languages, vec() and Unvec() are implemented via a reshape() function incurring no extra storage and virtually zero cost.