What is the gradient in this skewed coordinate system?

105 Views Asked by At

Consider two bases $e_i$ and $f_i$ of $\mathbb{R}^2$ defined by: $$\begin{aligned} (f_1,f_2) &= (e_1,e_2)\cdot F\\ \begin{pmatrix}1&-1\\1&1\end{pmatrix} &= \begin{pmatrix}1&0\\0&1\end{pmatrix} \cdot \begin{pmatrix}1&-1\\1&1\end{pmatrix} \end{aligned}$$

and the cooresponding change of coordinates ($B\equiv F^{-1}$): $$\begin{aligned} B\cdot \begin{pmatrix}x\\y\end{pmatrix} &= \begin{pmatrix}\tilde x\\ \tilde y \end{pmatrix}_f = \begin{pmatrix}1/2 x + 1/2 y \\ -1/2 x+1/2y\end{pmatrix}_f \\ F\cdot \begin{pmatrix}\tilde x\\ \tilde y \end{pmatrix}_f &= \begin{pmatrix}x\\y\end{pmatrix} = \begin{pmatrix}\tilde x-\tilde y\\ \tilde x+\tilde y\end{pmatrix} \end{aligned}$$

I would like to find the gradient of a function in both coordinate systems. Here, tilde symbols are associated to the $f$-basis. Consider $$\begin{aligned} V(x,y) &= x^2 +y \\ \tilde V(\tilde x,\tilde y) &= (\tilde x-\tilde y)^2 + (\tilde x + \tilde y) \end{aligned}$$

The gradients are defined using the metric-tensor scalings, as $$\begin{aligned} \nabla &= \partial_x e_1 + \partial_y e_2\\ \tilde \nabla &= \frac{1}{\sqrt{f_1\cdot f_1}} \partial_{\tilde x} f_1 +\frac{1}{\sqrt{f_2\cdot f_2}} \partial_{\tilde y} f_2 = \frac{1}{\sqrt{2}} \partial_{\tilde x} f_1 +\frac{1}{\sqrt{2}} \partial_{\tilde y} f_2 \end{aligned}$$

Lets check the gradients at the point $(2,1)\equiv (1.5, -0.5)_f$ where the second coordinates are with respect to the $f$-basis:

$$\begin{aligned} \nabla V \vert_{(2,1)} &= \begin{pmatrix}2x \\1 \end{pmatrix}= \begin{pmatrix}4\\ 1\end{pmatrix} \\ \tilde \nabla\tilde V \vert_{(1.5,-0.5)}&= \frac{1}{\sqrt{2}} [2(\tilde x-\tilde y)+1] f_1 + \frac{1}{\sqrt{2}} [-2(\tilde x-\tilde y)+1] f_2 \\ &= \frac{1}{\sqrt{2}} 5 \begin{pmatrix}1\\1 \end{pmatrix} + \frac{1}{\sqrt{2}} (-3) \begin{pmatrix}-1\\1 \end{pmatrix} \\ &= \frac{1}{\sqrt{2}} \begin{pmatrix}8\\2 \end{pmatrix} \end{aligned}$$

Why do i get a different gradient vector as a result?

2

There are 2 best solutions below

5
On BEST ANSWER

Your gradient formula is incorrect; it should be $1/f_1\cdot f_1$ and $1/f_2\cdot f_2$ without the square roots. Then you get $$ \frac12\begin{pmatrix}8\\2\end{pmatrix} = \begin{pmatrix}4\\1\end{pmatrix}. $$

(It is also bad practice to write $\partial_{\tilde x}f_1$ as you do since we can and often do consider gradients in variable coordinate systems, and in this case the basis vectors $f_i$ will vary from point to point. The notation $\partial_{\tilde x}f_1$ suggest then that you would differentiate $f_1$, but this is incorrect when calculating the gradient and so the notation $f_1\partial_{\tilde x}$ is more advisable.)

The general procedure for any basis is to find its reciprocal basis $f^i$ defined by $$ f^i\cdot f_j = \delta^i_j. $$ Then the gradient is $$ \nabla = \sum_if^i\partial_i $$ where $\partial_i$ is the partial derivative with respect to the coordinate corresponding to $f_i$.

In your case your $f_i$ are orthogonal, so they are almost there own reciprocal; we just need to get the scaling right, and it should be obvious that $$ \frac{f_i}{f_i\cdot f_i}\cdot f_i = 1 $$ so indeed $f^i = f_i/f_i\cdot f_i$.

5
On

Too long for comment:

The components of the gradient of a scalar function, $\frac{\partial f}{\partial x^k}$, constitutes a covariant tensor. Attaching the contravariant basis we have (using Einstein notation):

$\nabla \bar{V}=\frac{\partial V}{\partial x^k}\mathbf{e}^k$

Now, it seems you are mixing up the basis vectors as well as the normalizations.

$$ \begin {align} x=\bar{x}-\bar{y} \\ y=\bar{x}+\bar{y} \end{align} $$

$$ \begin {align} \mathbf{e}_{\bar{x}}&=(1,1) & \mathbf{e}^{\bar{x}}&=(\frac12,\frac12) \\ \mathbf{e}_{\bar{y}}&=(-1,1) & \mathbf{e}^{\bar{y}}&=(-\frac12,\frac12) \end{align} $$

$$\begin{align}g_{ij}=\left(\begin{array}{cc} 2 & 0 \\ 0 & 2 \end{array}\right) & & g^{ij}=\left( \begin{array}{cc}\frac{1}{2} & 0 \\ 0 & \frac{1}{2}\end{array}\right)\end{align}$$

The Wikipedia article defines $\nabla V=\sum_i \frac{1}{h_i}\frac{\partial V}{\partial x^i}\hat{\mathbf{e}}_i$, where $\hat{\mathbf{e}}_i$ is the normalized covariant basis( $\frac{1}{h_i}\frac{\partial \mathbf{r}}{\partial x^i}$). In your case the covariant basis is $\mathbf{e}_{\bar{x}}=(1,1)$ and $\mathbf{e}_{\bar{y}}=(-1,1)$. The normalized covariant basis is $\hat{\mathbf{e}}_{\bar{x}}=\frac{1}{\sqrt2}(1,1)$ and $\hat{\mathbf{e}}_{\bar{y}}=\frac{1}{\sqrt2}(-1,1)$. Please pay attention to the hats on top of the basis indicating normalized vectors (vectors of unit length). The full sum is therefore $\nabla \bar{V}=\frac{1}{\sqrt2} 5(1,1)\frac{1}{\sqrt2}+\frac{1}{\sqrt2}(-3) (-1,1)\frac{1}{\sqrt2}=(4,1)$. This is of course the same thing as the gradient expressed in the contravariant basis $\nabla \bar{V}=\frac{\partial \bar{V}}{\partial \bar{x}^k}\mathbf{e}^k$