Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The Wikipedia article Divergence, in the section Application to

  1. May 20, 2010 #1
    The Wikipedia article Divergence, in the section Application to

    The Wikipedia article Divergence, in the section Application to Cartesian coordinates, says of the del-dot formula for divergence, "Although expressed in terms of coordinates, the result is invariant under orthogonal transformations, as the physical interpretation suggests" ( http://en.wikipedia.org/wiki/Divergence ).

    Suppose I take a vector field with Cartesan coordinates (x,y,-2z).

    [tex]\text{div} (\vec{v})=\sum_{i=1}^{n}\frac{\partial v_i}{\partial x_i} = 1+1-2=0.[/tex]

    But if I first apply the orthogonal transformation expressed by the matrix

    [tex]A = \begin{bmatrix}1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -1 \end{bmatrix},[/tex]

    then

    [tex]\text{div} (A \vec{v}) = 1 + 1 + 2 = 4.[/tex]

    So should the statement refer specifically to rotations (special/continuous orthogonal transformations)?
     
  2. jcsd
  3. May 20, 2010 #2
    Re: Divergence

    Notice that under your interpretation, the statement isn't true for special orthogonal transformations either since you could take your example but with -1 in the middle instead of 1. Then A is in SO(3) but div(Av) is still not 0.

    What is meant is that this definition of divergence is invariant under orthogonal coordinate transformations, and this is different then just multiplying the vector field by an orthogonal matrix since the tangent vectors and coordinates change. In your example with A = diag(1,1,-1), let the new coordinates be x',y',z'. Then A takes x -> x', y -> y', z -> -z' and (1,0,0) -> (1,0,0), (0,1,0) -> (0,1,0), and (0,0,1) -> (0,0,-1). Therefore in the primed coordinates, v actually looks the same: it is (x',y',-2z').
     
  4. May 20, 2010 #3
    Re: Divergence

    Draw a picture of a one dimensional vector field so that the vectors point towards the origo. Like this:

    ... ---> --> -> o <- <-- <--- ...

    Then look at the picture through a mirror. It going to look the same! :rolleyes:

    The arrows will change places in mirror, but they change directions too, so that's why it's not going to look like as if the arrows started to point away from the origo.

    If [itex]f(\boldsymbol{x})[/itex] is a scalar function, and you want to transform it with transformation [itex]A[/itex], then the transformed scalar function is given by formula

    [tex]
    \overline{f}(\boldsymbol{x}) = f(A^{-1}\boldsymbol{x})
    [/tex]

    But if [itex]\boldsymbol{f}(\boldsymbol{x})[/itex] is a vector function, then the transformed vector function is given by a formula

    [tex]
    \overline{\boldsymbol{f}}(\boldsymbol{x}) = A\boldsymbol{f}(A^{-1}\boldsymbol{x}).
    [/tex]
     
  5. May 20, 2010 #4
    Re: Divergence

    Ah, I see. Thanks to you both.

    To take another example (a rotation this time, so that it's not the same as its inverse), if F(x,y)=(x,-y), whose divergence is 1-1=0, and we rotate the coordinates by 90 degrees, x' = -y, and y' = x.

    [tex]\begin{bmatrix}0 & -1\\ 1 & 0\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}-x\\y\end{bmatrix}[/tex]

    [tex]\textbf{F}'(x',y')=A(x',-y')=A((-y),-(x))=\begin{bmatrix}0 & 1\\ -1 & 0\end{bmatrix}\begin{bmatrix}-y\\-x\end{bmatrix}=\begin{bmatrix}-x\\y\end{bmatrix}[/tex]

    [tex]\frac{\partial (-x)}{\partial (-y)}+\frac{\partial y}{\partial x}=0+0=0[/tex]
     
  6. May 20, 2010 #5
    Re: Divergence

    Not everything in those calculations is ok.

    If you start with a vector function

    [tex]
    F(x,y) = \left(\begin{array}{c}
    x \\ -y \\
    \end{array}\right)
    [/tex]

    and rotate it 90 degrees counter clockwise, the result should be

    [tex]
    F'(x',y') = \left(\begin{array}{c}
    -x' \\ y' \\
    \end{array}\right)
    [/tex]

    The divergence is

    [tex]
    \nabla\cdot F' = \frac{\partial}{\partial x'} (-x') + \frac{\partial}{\partial y'} y' = -1 +1 = 0
    [/tex]
     
  7. May 21, 2010 #6
    Re: Divergence

    Hmm... I think it starts off right with x' = -y, and y' = x, but then I got it wrong when I wrote it in matrix form. That should have been

    [tex]\begin{bmatrix}0 & -1 \\ 1 & 0\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}-y\\x\end{bmatrix}[/tex]

    Next I apply the vector field function F.

    [tex]F(x',y')=(x',-y')=(-y,-(x))=(-y,-x)[/tex]

    Then I apply to the value of the vector field the inverse of the coordinate transformation, as you suggested:

    [tex]F'(x',y')=A^{-1}F(x',y')[/tex]

    [tex]=\begin{bmatrix}0 & 1 \\ -1 & 0\end{bmatrix}\begin{bmatrix}-y\\-x\end{bmatrix}=\begin{bmatrix}-x\\y\end{bmatrix}[/tex]

    so F'(x',y')=(-x,y)=(-y',-x'), and for the divergence, I get

    [tex]\frac{\partial (-x)}{\partial x'}+\frac{\partial y}{\partial y'}=\frac{\partial (-x)}{\partial (-y)}+\frac{\partial y}{\partial x}=0+0=0[/tex]

    How did you get F'(x',y')=(-x',y')? Have I misunderstood your final formula in #3? I took it to mean that the result could be got by the following steps:

    1. Apply coordinate transformation to position vector.
    2. Apply vector field function F to the result of 1.
    3. Apply the inverse of the coordinate transformation to the result of 2.
     
  8. May 21, 2010 #7
    Re: Divergence

    Take another example, [itex]\boldsymbol{f}=(x,0)[/itex].

    [tex]\text{div} \boldsymbol{f}(\boldsymbol{x})=\frac{\partial f_1}{\partial x}+\frac{\partial f_2}{\partial y}=1+0=1.[/tex]

    Let [itex]A^{-1}[/itex] be a coordinate transformation corresponding to a rotation of the coordinate axes by 90 degrees counterclockwise.

    [tex]A^{-1}\boldsymbol{x}=\begin{bmatrix}0 & -1\\ 1 & 0\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}=\begin{bmatrix}-y\\x\end{bmatrix}[/tex]

    So x' = -y, and y' = x, and

    [tex]\boldsymbol{f}(A^{-1}\boldsymbol{x})=(-y,0)[/tex]

    Therefore

    [tex]\overline{\boldsymbol{f}}(\boldsymbol{x}) = A\boldsymbol{f}(A^{-1}\boldsymbol{x})=\begin{bmatrix}0 & 1\\ -1 & 0\end{bmatrix}\begin{bmatrix}-y\\0\end{bmatrix}=\begin{bmatrix}0\\y\end{bmatrix}.[/tex]

    But

    [tex]\text{div} \overline{\boldsymbol{f}}(\boldsymbol{x})=\frac{\partial f_1'}{\partial x'}+\frac{\partial f_2'}{\partial y'}=\frac{\partial f_1'}{\partial (-y)}+\frac{\partial f_2'}{\partial x}=0+0=0.[/tex]

    On the other hand, at least in this case, if we just transform the position vector and not the vector field, then sum the derivatives of each component with respect to the corresponding transformed coordinate, x', y', we get 1+0=1.

    What am I doing wrong?
     
    Last edited: May 21, 2010
  9. May 21, 2010 #8
    Re: Divergence

    The primes are creating confusion. It is possible to carry out the transformation without any primed variables.

    If you use my notation

    [tex]
    \overline{\boldsymbol{f}}(\boldsymbol{x}) = A\boldsymbol{f}(A^{-1}\boldsymbol{x})
    [/tex]

    then compute divergences like this:

    [tex]
    \nabla\cdot\boldsymbol{f} = \frac{\partial f_1}{\partial x_1} + \frac{\partial f_2}{\partial x_2}
    [/tex]

    [tex]
    \nabla\cdot\overline{\boldsymbol{f}} = \frac{\partial \overline{f_1}}{\partial x_1} + \frac{\partial \overline{f_2}}{\partial x_2}
    [/tex]
     
  10. May 21, 2010 #9
    Re: Divergence

    That's right. You can also check it by drawing a picture. A collection of arrows pointing left and right away from the y-axis, is transformed into a collection of arrows point up and down away from the x-axis.

    The divergence should come from this expression:

    [tex]
    \nabla\cdot\overline{\boldsymbol{f}} = \frac{\partial }{\partial x}0 + \frac{\partial}{\partial y} y = 1
    [/tex]
     
  11. May 21, 2010 #10
    Re: Divergence

    Sorry, I just used primes in the same sense as your overlines to denote variables in the new coordinate system. In the second of these equations, why aren't the partials with respect to the new coordinates, like this:

    [tex]
    \nabla\cdot\boldsymbol{f} = \frac{\partial f_1}{\partial x_1} + \frac{\partial f_2}{\partial x_2}
    [/tex]

    [tex]
    \nabla\cdot\overline{\boldsymbol{f}} = \frac{\partial \overline{f_1}}{\partial \overline{x}_1} + \frac{\partial \overline{f_2}}{\partial \overline{x}_2}
    [/tex]
     
  12. May 21, 2010 #11
    Re: Divergence

    Because I chose to denote the variables in [itex]\overline{\boldsymbol{f}}[/itex] with [itex]\boldsymbol{x}[/itex].

    If you instead used a notation [tex]\overline{\boldsymbol{f}}(\overline{x}_1,\overline{x}_2)[/tex], then the divergence would be what you wrote.

    My choice of notation is equivalent with this choise:

    [tex]
    \overline{\boldsymbol{f}}(\overline{\boldsymbol{x}}) = A\boldsymbol{f}(\boldsymbol{x})
    [/tex]

    if [itex]\overline{\boldsymbol{x}}=A\boldsymbol{x}[/itex]. But I don't think that this makes anything easier. You have different variables on the different sides of the equation, so it is more difficult to see what happens if you take a partial derivative with respect to something. The equation should be modified so that only [itex]\overline{\boldsymbol{x}}[/itex] or [itex]\boldsymbol{x}[/itex] is present, so that chances to make mistakes get reduced.
     
  13. May 21, 2010 #12
    Re: Divergence

    Is the following correct?

    The vector field in the old coordinates:

    [tex]\boldsymbol{f}(\boldsymbol{x}) = A\boldsymbol{f}(A^{-1}\boldsymbol{x})=A^{-1}\boldsymbol{f}(A\boldsymbol{x}).[/tex]

    The vector field in the new coordinates:

    [tex]\overline{\boldsymbol{f}}(\overline{\boldsymbol{x}}) = A\boldsymbol{f}(\boldsymbol{x})=\boldsymbol{f}(A^{-1}\boldsymbol{x}).[/tex]

    Its divergence in the old coordinates:

    [tex]\text{div}\boldsymbol{f}=\sum_{i=1}^{n}\frac{\partial }{\partial x_i}f_i(\mathbf{x}),[/tex]

    which can also be expressed as

    [tex]\sum_{i=1}^{n}\frac{\partial }{\partial x_i}Af_i(A^{-1}\mathbf{x})=\sum_{i=1}^{n}\frac{\partial }{\partial x_i}A^{-1}f_i(A\mathbf{x}),[/tex]

    and is equal to its divergence in the new:

    [tex]\sum_{i=1}^{n}\frac{\partial }{\partial \overline{x}_i}f_i(A^{-1}\mathbf{x})=\sum_{i=1}^{n}\frac{\partial }{\partial \overline{x}_i}Af_i(\mathbf{x}).[/tex]
     
  14. May 22, 2010 #13
    Re: Divergence

    Well, I suppose not [itex]A\mathbf{f}(\boldsymbol{x})[/itex], as that's the sort of mistake I was making originally. But if we look at [tex]\mathbf{f}(A^{-1}\boldsymbol{x})[/tex] in terms of your one dimensional symmetric example, taking, say, [itex]\mathbf{f}(\boldsymbol{x})=\mathbf{x}[/itex], and the transformation [itex]\mathbf{x}\mapsto-\mathbf{x}[/tex], we have: [itex]\mathbf{f}(A^{-1}\boldsymbol{x})=\mathbf{f}(-\boldsymbol{x})=-\mathbf{x}[/itex] (right?), whereas [itex]A\mathbf{f}(A^{-1}\boldsymbol{x})=-\mathbf{f}(-\boldsymbol{x})=\mathbf{x}[/itex] (wrong?).
     
  15. May 22, 2010 #14
    Re: Divergence

    Both of your equations are right. (The one with "(right?)" and with "(wrong?)").

    In particular

    [tex]
    \overline{f}(x) = Af(A^{-1}x) = -f(-x) = x
    [/tex]

    is right. That's what I explained originally when talking about looking the picture through a mirror.

    (Actually in my original mirror explanation is used a function [itex]f(x)=-x[/itex] and not a function [itex]f(x)=x[/itex], but it's a small detail only.)
     
  16. May 22, 2010 #15
    Re: Divergence

    What if we take a function that doesn't have mirror symmetry, though? Then the reflection does change the coordinates. For example, sticking to one dimension:

    [tex]f(x)=x^3;[/tex]

    [tex]A:\mathbb{R}\to\mathbb{R}\; | \; Ax=-x \enspace \text{and} \enspace A^{-1}=A;[/tex]

    [tex](1) \enspace f(Ax)=f(\overline{x})=Af(x)=\overline{f}(x)=-x^3.[/tex]

    But

    [tex](2) \enspace Af(Ax)=\overline{f}(\overline{x})=-(-x^3)=x^3=f(x),[/tex]

    which is the original, untransformed function, so (2) is the identity transformation. The derivative is only invariant under transformation (1) if we take it with respect to the new coordinate,

    [tex]\frac{\mathrm{d} \overline{f}}{\mathrm{d} \overline{x}}=3\overline{x}^2=-3x^2.[/tex]

    If we want to go back to using the old coordinate, we can reverse the transformation using (2), then

    [tex]\frac{\mathrm{d} A\overline{f}}{\mathrm{d} x}=\frac{\mathrm{d} f}{\mathrm{d} x}=-3\overline{x}^2=3x^2.[/tex]

    But I don't understand how this last equation tells us whether the derivative is invariant under reflection. Doesn't it just tell us, trivially, that it's invariant under the identity transformation?
     
    Last edited: May 22, 2010
  17. May 22, 2010 #16
    Re: Divergence

    On second thoughts, f(x) = x3 does make a 1d vector field with reflective symmetry about the origin, doesn't it? I was thinking of the graph. I'll try that again with

    [tex]f(x)=x^2;[/tex]

    So the vectors on both sides of the origin are pointing right. In this case,

    [tex]f(Ax)=f(-x)=(-x)^2=x^2=f(x)[/tex]

    [tex]\neq Af(x)=-x^2=Af(Ax)=-f(-x).[/tex]

    So, for this example, [itex]Af(Ax)[/itex] isn't the identify transformation.

    [tex]\frac{\mathrm{d} f}{\mathrm{d} x}=2x,[/tex]

    whereas

    [tex]\frac{\mathrm{d} \overline{f}}{\mathrm{d} x}=\frac{\mathrm{d} \overline{f}}{\mathrm{d} \overline{x}}=-2x.[/tex]
     
    Last edited: May 22, 2010
  18. May 22, 2010 #17
    Re: Divergence

    An illustrated example.

    [tex]\textbf{p}=\begin{bmatrix}p_x\\p_y\end{bmatrix}[/tex]

    denotes a position vector in some Cartesian coordinate system. Take the not-particularly-symmetric vector field, [itex]\textbf{v}(\textbf{p})[/itex], with vectors including those shown in this picture.

    Rotate the basis vectors by some angle [itex]\theta[/itex], eg. 90 degrees counterclockwise:

    [tex]R=\begin{bmatrix}\cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta)\end{bmatrix} = \begin{bmatrix}0 & -1 \\ 1 & 0 \end{bmatrix}[/tex]

    The position vector in the new basis is

    [tex]\overline{\textbf{p}}=R^{-1}\textbf{p}=\begin{bmatrix}0 & 1 \\ -1 & 0 \end{bmatrix}\begin{bmatrix}p_x\\ p_y\end{bmatrix}=\begin{bmatrix}p_y\\ -p_x\end{bmatrix}[/tex]

    Then, from the picture, it looks to me as if

    [tex]\overline{\textbf{v}}(\overline{\textbf{p}})=R^{-1}v(R^{-1}p).[/tex]

    The coordinates of the point illustrated in the first quadrant (top left) have rotated 90 degrees clockwise relative to the axes, and the field vector at this point, [itex]\overline{\textbf{v}}(\overline{\textbf{p}})[/itex], has also turned 90 degrees clockwise; it was pointing right, in the positive x direction, but if you turn your head 90 degrees anticlockwise, it points "down" in the negative y-bar direction.

    (Or, more simply, consider a nonzero field vector at the origin. If the basis vectors are rotated by some angle counterclockwise, then, relative to them, this field vector must rotate clockwise.)
     

    Attached Files:

    Last edited: May 23, 2010
  19. May 22, 2010 #18
    Re: Divergence

    To test this, I looked at an example of a vector field from Davis & Snider's Vector Analysis:

    [tex]\textbf{F}=x\textbf{i}+y^2z\textbf{j}+xz^3\textbf{k}.[/tex]

    I rotated the axes 90o about the z-axis so that

    [tex]\begin{bmatrix}0 & 1 & 0\\ -1 & 0 & 0\\ 0 & 0 & 1\end{bmatrix}\begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}y\\-x\\z\end{bmatrix}.[/tex]

    [tex]\begin{bmatrix}x\\y^2z\\xz^3\end{bmatrix} \mapsto \begin{bmatrix}y\\(-x)^2z\\yz^3\end{bmatrix}[/tex]

    [tex]\begin{bmatrix}0 & 1 & 0\\ -1 & 0 & 0\\ 0 & 0 & 1\end{bmatrix} \begin{bmatrix}y\\(-x)^2z\\yz^3\end{bmatrix}=\begin{bmatrix}(-x)^2z\\-y\\yz^3\end{bmatrix}=\begin{bmatrix}x^2z\\-y\\yz^3\end{bmatrix}[/tex]

    And interpreting the divergence formula naturally, taking the derivatives with respect whichever coordinate system the components of the vector field are given in:

    [tex]\text{div}\textbf{F}=1+2yz+3xz^2;[/tex]

    [tex]\text{div}\overline{\textbf{F}}=\frac{\partial x^2z}{\partial y}+\frac{\partial -y}{\partial (-x)}+\frac{\partial yz^3}{\partial z}=0+0+3yz^2,[/tex]

    (argh!) which are not, in general, the same. I think it also comes to [itex]3yz^2[/itex] if we use your formula from #3,

    [tex]\text{div} \, R\mathbf{F}(R^{-1}\mathbf{p}),[/tex]

    instead of the one I suggested in #17,

    [tex]\text{div} \, R^{-1}\mathbf{F}(R^{-1}\mathbf{p}).[/tex]

    Obviously I'm still deeply confused. Either I'm doing something backwards, or too many times, or not enough times, or in the wrong order, or am still misinterpreting the result, or...
     
  20. May 22, 2010 #19
    Re: Divergence

    The reason I think I must be doing something wrong, or still not understanding the concept, in posts such as #7 and the more recent ones is that some of these equations give different values for the divergence of the same vector field depending on which Cartesian coordinate system I use. This contradicts the statement that the value of the divergence "is invariant under orthogonal transformations". I'm thinking of invariant in the sense that the magnitude of a vector is invariant under orthogonal transformations, always having the same scalar value.
     
  21. May 25, 2010 #20
    Re: Divergence

    Aha, I think I might finally be getting there! Or rather, what jostpuur has said is finally sinking in. I drew these diagrams to help me see what's a function of what. The set at the top represents the set of points in a Euclidean space. Below that are the two copies of Rn where the coordinates of position vectors live, and below that (in the red vector space picture) the copies of Rn where the components of the field vectors live in the two different coordinate systems. C is the coordinate transformation. Then, just following the arrows we see that

    [tex]\overline{V}=\overline{V}(\overline{p})=\overline{V}(Cp)=CV(p)=CV(C^{-1}p)[/tex]

    as jostpuur pointed out. The other diagram shows a scalar field.

    Taking as an example V=(y2,x), and p=(3,2), and C a rotation of the basis by 90 degrees counterclockwise,

    [tex]\overline{p}=Cp=(2,-3)=(\overline{x},\overline{y})[/tex]

    [tex]\overline{V}=CV=(x,-y^2)=(-\overline{y},-\overline{x}^2)=(3,-4)[/tex]

    [tex]\frac{\partial y^2}{\partial x}+\frac{\partial x}{\partial y}=0=\frac{\partial (-\overline{y})}{\partial \overline{x}}+\frac{\partial (-\overlinex{x}^2)}{\partial \overline{y}}[/tex]

    because

    [tex]\overline{x}=y[/tex]

    [tex]\overline{y}=-x[/tex]

    so

    [tex]\frac{\partial (-\overline{y})}{\partial \overline{x}}=\frac{\partial (-\overline{y})}{\partial \overline{y}}\frac{\partial \overline{y}}{\partial x}\frac{\partial x}{\partial \overline{x}}=(-1)(-1)\frac{\partial x}{\partial y}=0[/tex]

    and

    [tex]\frac{\partial (-\overline{x})^2}{\partial \overline{y}}=\frac{\partial (-\overline{x})^2}{\partial \overline{x}}\frac{\partial \overline{x}}{\partial y}\frac{\partial y}{\partial \overline{y}}=-2\overline{x}\frac{\partial y}{\partial (-x)}=-2y(-1)0=0[/tex]
     

    Attached Files:

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook