0

Given $\alpha$ a scalar, $\mathbf{X}$ an $N_x \times 1$ vector that is a function of $\alpha$, $\mathbf{U}$ an $N_u \times 1$ vector that is a function of $\alpha$ and $\mathbf{X}$, and $\mathbf{C}$ an $N_u \times N_u$ matrix that is a function of $\alpha$, $\mathbf{X}$, and $\mathbf{U}$. I am trying to compute the total derivative of $\mathbb{F} = \mathbf{C} \mathbf{U}$ with respect to $\alpha$ using the chain rule:

$$\underbrace{\frac{d \mathbb{F}}{d \alpha}}_{N_u \times 1} = \underbrace{\frac{\partial \mathbb{F}}{\partial \alpha}}_{N_u \times 1} + \underbrace{\frac{\partial \mathbb{F}}{\partial \mathbf{X}}}_{N_u \times N_x} \underbrace{\frac{\partial \mathbf{X}}{\partial \alpha}}_{N_x \times 1} + \underbrace{\frac{\partial \mathbb{F}}{\partial \mathbf{U}}}_{N_u \times N_u} \underbrace{\frac{\partial \mathbf{U}}{\partial \alpha}}_{N_u \times 1},$$

The first term is straight forward. How can I compute the second term on the RHS and put it in the above form (i.e., put $\frac{\partial \mathbf{X}}{\partial \alpha}$ on the right)?

I figured out the following:

$$\underbrace{\frac{\partial \mathbb{F}}{\partial \mathbf{X}}}_{N_u \times N_x} \underbrace{\frac{\partial \mathbf{X}}{\partial \alpha}}_{N_x \times 1} = \underbrace{\frac{\partial \mathbf{C}}{\partial \mathbf{X}}}_{N_u \times N_u \times N_x} \underbrace{\frac{\partial \mathbf{X}}{\partial \alpha}}_{N_x \times 1} \underbrace{\mathbf{U}}_{N_u \times 1} + \underbrace{\mathbf{C}}_{N_u \times N_u} \underbrace{\frac{\partial \mathbf{U}}{\partial \mathbf{X}}}_{N_u \times N_x} \underbrace{\frac{\partial \mathbf{X}}{\partial \alpha}}_{N_x \times 1},$$

As you can see, confusion comes from the first term on the RHS in the above equation. I can't figure out how to perform the derivative of the matrix $\mathbf{C}$ with respect to $\mathbf{X}$ and how to put the size correctly so the multiplication is correct. Finally, in such case, is it possible to reorder the term to put $\frac{\partial \mathbf{X}}{\partial \alpha}$ on the right?

The context is optimization of fluid-structure interaction problems if any one is interested. Any help is highly appreciated.

  • The gradient $,\Gamma=\left(\frac{\partial C}{\partial x}\right)$ is a third-order tensor which cannot be written using standard matrix notation, however, in index notation it's quite simple. Or, depending on the specific functions used to define $(x,u,C),,$ it may be possible to obtain the desired gradient without requiring any third-order tensors. – greg Mar 28 '21 at 23:02
  • $C$ is one of the finite element matrices used to model Navier-Stokes equations. I have many of these matrices so I wrote it general to get help with the basic idea. 2. I think now it might be simpler to simply differentiate with a single element of $X$ each time and rearrange the final result (e.g. for loop in code, not the most efficient). I was just hoping to write a compact expression for this equation. 3. Would you kindly show me an example on how to do this in index notation? Or direct me to a nice resource on matrix calculus (applied more than abstract would be much better).
  • – Mohamed Abdelhamid Mar 29 '21 at 03:34