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

Del Operator conversion

  1. Oct 29, 2013 #1
    I have been trying to convert the Del operator from Cartesian to Cylindrical coords since like 5 days. but still i can't see why my way doesn't work. It worked for the 3D heat equation and 3D wave equation but for vector quantities no :( ...

    This is the way i followed

    [tex] \nabla P = \frac{\partial P}{\partial x} i + \frac{\partial P}{\partial y} j + \frac{\partial P}{\partial z} k [/tex]

    Since there is no significant change in z vector, i will work on converting the i and j terms. therefore,

    i know that,

    [tex] \frac{\partial P}{\partial x} = \frac{\partial P}{\partial r} \frac{\partial r}{\partial x} + \frac{\partial P}{\partial \theta } \frac{\partial \theta}{\partial x} [/tex]

    [tex] \frac{\partial P}{\partial y} = \frac{\partial P}{\partial r} \frac{\partial r}{\partial y} + \frac{\partial P}{\partial \theta } \frac{\partial \theta}{\partial y} [/tex]

    Taking the Cartesian - polar derivatives, therefore,

    [tex] \frac{\partial P}{\partial x} = \frac{\partial P}{\partial r} \frac{1}{cos ~ \theta} - \frac{\partial P}{\partial \theta } \frac{\partial \theta}{rsin ~ \theta} [/tex]

    [tex] \frac{\partial P}{\partial y} = \frac{\partial P}{\partial r} \frac{1}{sin ~ \theta} + \frac{\partial P}{\partial \theta } \frac{\partial \theta}{rcos ~ \theta} [/tex]

    Now, it can be shown that the vectors can be transformed to

    [tex] i = cos ~ \theta ~ e_r - sin ~ \theta ~ e_\theta [/tex]
    [tex] j = sin ~ \theta ~ e_r + cos ~ \theta ~ e_\theta [/tex]

    Finallly substituting all of these to get stuck as follows,

    [tex] \nabla P = \frac{\partial P}{\partial r}e_r - \frac{\partial P}{\partial \theta} \frac{cos ~ \theta}{r ~ sin ~ \theta}e_r - \frac{\partial P}{\partial r} \frac{sin ~ \theta}{cos ~ \theta}e_\theta + \frac{\partial P}{\partial \theta} \frac{1}{r}e_\theta + \frac{\partial P}{\partial r}e_r + \frac{\partial P}{\partial \theta} \frac{sin ~ \theta}{r ~ cos ~ \theta}e_r + \frac{\partial P}{\partial r} \frac{cos ~ \theta}{sin ~ \theta}e_\theta + \frac{\partial P}{\partial \theta} \frac{1}{r}e_\theta + \frac{\partial P}{ \partial z}e_z \ [/tex]

    I thought that it would cancel out cleanly but didn't. Any ideas ?
    Last edited: Oct 29, 2013
  2. jcsd
  3. Oct 29, 2013 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    Partial derivatives do NOT follow the simple rule for inverses in the one-variable of case.
    For example, dr/dx is NOT 1/cos(theta).

    Let us look at the transfomation rules properly!

    We have:

    Now both of these are identities, and we may therefore differentiate both of them, say with respect to x.
    I'll leave the analogous case for "y" to you, follow closely! :smile:

    Taking partials with respect to x yields:
    [tex]1=\frac{\partial{r}}{\partial{x}}*\cos\theta-r\sin\theta\frac{\partial\theta}{\partial{x}} (1)[/tex]

    Now, to extract dr/dx from this, we multiply (1) with cos(theta), (2) with sin(theta), and add the results together!
    That yields:
    [tex]\cos\theta=\frac{\partial{r}}{\partial{x}} (3)[/tex]
    To extract d(theta)/dx, we multiply (1) with -sin(theta), (2) with cos(theta), and gain when adding:

    Note the counterintuitive result:
    Last edited: Oct 29, 2013
  4. Oct 30, 2013 #3


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    It's much simpler to use the coordinate-independent definitions of the vector operators to express them in a given bases.

    Cylinder coordinates are defined by
    [tex]\vec{r}=\vec{e}_1 r \cos \theta + \vec{e}_2 r \sin \theta + \vec{e}_3 z,[/tex]
    where [itex]\vec{e}_j[/itex] are an arbitrary right-handed Cartesian basis system.

    Cylinder coordinates are orthogonal coordinates, i.e., the tangent vectors on the coordinate lines are perpendicular to each other in any point, where the cylinder coordinates are well defined, which is the entire [itex]\mathbb{R}^3[/itex] except the [itex]z[/itex] axis ([itex]r=0[/itex]). Thus one usually uses normalized basis vectors, i.e.,
    [tex]\hat{r}=\frac{\partial_r \vec{r}}{|\partial_r \vec{r}|}=\partial_r \vec{r}, \quad \hat{\theta}=\frac{\partial_{\theta} \vec{r}}{|\partial_{\theta} \vec{r}|}=\frac{\partial_{\theta} \vec{r}}{r}, \quad ]\hat{z}=\frac{\partial_z \vec{r}}{|\partial_r \vec{r}|}=\partial_z \vec{r}.[/tex]
    The gradient of a scalar field [itex]\Phi(\vec{r})[/itex] is defined in a coordinate-independent way by
    [tex]\mathrm{d} \Phi=\mathrm{d} \vec{r} \cdot \vec{\nabla} \Phi.[/tex]
    Writing this out in cylinder coordinates gives
    [tex]\mathrm{d} r \partial_r \Phi+\mathrm{d} \theta \partial_{\theta} \Phi + \mathrm{d} z \partial_{z} \Phi=(\mathrm{d} r \hat{r} + r \mathrm{d}\theta \hat{\theta} + \mathrm{d}z \hat{z}) \cdot \vec{\nabla} \Phi.[/tex]
    Comparing coefficients and using the orthonormality of the normalized coordinate orthonomral basis [itex](\hat{r},\hat{\theta},\hat{z})[/itex] leads to
    [tex]\vec{\nabla} \Phi=\hat{r} \partial_r \Phi + \frac{\hat{\theta}}{r} \partial_{\theta} \Phi + \hat{z} \partial_z \Phi.[/tex]
  5. Oct 30, 2013 #4


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    I totally agree that it is more ELEGANT, vanhees, to do it in your way, and in addition, more amenable for generalization. Thus, objectively speaking, your approach is strictly better than mine.

    As for simplicity, however, I'd say that is an issue of where you are, and what you have become used to.

    For example, the concept of "coordinate-independent definitions of the vector operators" is not particularly simple to grasp if you still feel slightly awed/intimidated about non-Cartesian coordinates, not to speak of "operators".
  6. Oct 31, 2013 #5


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    Of course, one should motivate these definitions. It's of course a question what's the best motivation. For me it's clearly continuum mechanics, but that may be, because I'm a physicist.

    For the gradient (in two dimensions), I'd rather take the example of somebody walking on a hilly landscape. In Cartesian coordinates you can describe this landscape as a (scalar) function [itex]h(\vec{x})=h(x_1,x_2)[/itex], which gives you the height as a function of the projection of the hiker's position to an appropriate plane (e.g., "sea level").

    Then you may ask, how the height changes, when the hiker walks an infinitesimal step from position [itex]\vec{x}[/itex] to position [itex]\vec{x}+\mathrm{d} \vec{x}[/itex]. Clearly, according to the chain rule of multidimensional analysis the answer is
    [tex]\mathrm{d} h=\mathrm{d} x \cdot \vec{\nabla} h(\vec{x}).[/tex]

    Clearly that's a coordinate independent quantity, the hills do not bother ad all, how we describe the location of the hiker on them, and thus [itex]\vec{\nabla} h[/itex] must be a vector, because [itex]\mathrm{d} h[/itex] is clearly a scalar, and [itex]\mathrm{d} \vec{x}[/itex] is a vector (to be mathematically more correct, one should rather think of [itex]\mathrm{d} \vec{x}[/itex] as a vector and [itex]\vec{\nabla} h[/itex] as a dual vector (one-form), but in Euclidean vector spaces this overcomplicates things for the beginner).

    To motivate the divergence (in 3D space), I'd consider the flow of a fluid through a (closed) surface. For that you first need to define (oriented) area elements and the current density of the fluid, [itex]\vec{j}[/itex]. The oriented area element is described as an infinitesimal piece of a surface (which you can approximate by the corresponding piece of the tangent plane). Then you define [itex]\mathrm{d}^2 \vec{F}[/itex] as a vector which is perpendicular to this surface element with the magnitude given by the area of it. The choice of the direction is arbitrary, and you have two possibilities. The choice of one of these possibilities at any point of the surface defines the orientation of the surface.

    Now the current-density field of the fluid [itex]\vec{j}(\vec{x})[/itex] is defined as a vector such that for an oriented surface element [itex]\mathrm{d} \dot{m}=\mathrm{d}^2 \vec{F} \cdot \vec{j}[/itex] gives the mass of fluid flowing through the volume element per unit time. The sign is of course relative to the chosen orientation of the surface.

    Now consider a closed surface [itex]\partial V[/itex] that can be interpreted as the boundary of a volume [itex]V[/itex]. Here, the standard orientation is to let the surface-element vectors point out of the volume. Then the total amount of mass flowing out of the volume through its boundary is given by
    [tex]\dot{m}=\int_{\partial V} \mathrm{d}^2 \vec{F} \cdot \vec{j}.[/tex]
    Clearly, again the fluid and the surface couldn't care less in which coordinates I parametrize my surface and in which basis I describe my vectors. Again it's a scalar quantity.

    Now to get a local definition of the total flow of mass you can make the volume (and with it it's boundary) arbitrarily small. Then an approximate calculation (e.g., in Cartesian coordinates), which becomes exact in the limit of an infinitesimal volume element gives
    [tex]\dot{m} = \mathrm{d}^3 \vec{x} \vec{\nabla} \cdot \vec{j}.[/tex]
    Since everything is independent of the choice of coordinates and since [itex]\mathrm{d}^3 \vec{x}[/itex] is a scalar, clearly the divergence [itex]\vec{\nabla} \cdot \vec{x}[/itex] is a scalar field. You can evaluate in any coordinates you like, by using this definition in terms of the limit of a surface integral
    [tex]\vec{\nabla} \cdot \vec{j}(\vec{x})=\lim_{\mathrm{d} V \rightarrow \{\vec{x} \}} \frac{1}{\mathrm{d} V} \int_{\partial \mathrm{d} V} \mathrm{d}^2 \vec{F} \cdot \vec{j}.[/tex]
    In a similar way you can define the curl of a vector field via the circulation of a fluid, leading to the corresponding coordinate-independent definition via a limit of a line integral along a closed curve, which is the boundary of a surface.
  7. Oct 31, 2013 #6
    Thanks a lot for your replies. I am sorry that i am late to reply. Unfortunately i had a busy week filled with midterm exams.

    Now, i am trying to find the gaps where i have problems regarding the nature of partial derivatives. I found out the following.

    Lets assume a function such that

    [tex] F(x,y,z) = x^2 + 2y + 7z = constant [/tex]

    if i take the partial with respect to x then i will get

    [tex] 0 = 2x [/tex]

    comparing this to the polar - cartesian identity, there is a difference. i mean

    [tex] \frac{\partial x}{\partial x} = \frac{\partial r}{\partial x}cos~\theta - sin ~ \theta \frac{\partial \theta}{\partial x} [/tex]

    Since partials of r and theta with respect to x are not necessarily zero, this implies that they are functions of x and each other. Now this is logical since x=r*cos(theta) can be reordered for that. But for F(x,y,z) , the case is different. the partials with respect to x will set y and z to zero although if arranged z can appear to be a function of x and y ??! Why is this so.

    Regarding the gradient operator for cylindrical. Is the following approach correct ?

    Lets assume a property A (scalar) such as density/Temperature in flow. It will change by an increment of dA as we move in a path dr such that

    [tex] d\vec{s} = dr\vec{e_r} + r d \theta \vec{e_\theta} + dz\vec{e_z} [/tex]

    I have written the path in this way since at a distance r from origin, the path taken in the angle direction should be dc = r.dθ .

    Finally, from chain rule, i know that.

    [tex] dA = \frac{\partial A}{\partial r} dr + \frac{\partial A}{\partial \theta} d \theta + \frac{\partial A}{\partial z} dz [/tex]

    Since the change on a path is because of the convection term in the material derivative ( Assuming steady field ) therefore,

    [tex] dA = \nabla A \cdot d \vec{s} [/tex]

    this is only satisfied if the gradient operator is

    [tex] \nabla = \frac{\partial}{\partial r} \vec{e_r} + \frac{1}{r} \frac{\partial}{\partial \theta} \vec{e_\theta} + \frac{\partial}{\partial z} \vec{e_z} [/tex]

    I am getting interested with the Vector analysis, Linear Algebra and partial differentials since i took an introduction to PDEs last semester and i have started Aerodynamics recently. Unfortunately, the university rushes everything and doesn't provide such kind of "math in depth" therefore i feel that i miss a lot of knowledge and need to start building my math skills alone. This idea gets me stuck because i don't know where to start :/
  8. Nov 1, 2013 #7


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    No, there is no difference.
    Because you CANNOT differentiate like that, x , y and z are NOT independent in that equation, precisely as r, theta and x are not independent of each other in the transformation rule.
  9. Nov 1, 2013 #8


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    Your derivation is basically correct, but you must be careful with your notation! The unit basis vectors of the curvilinear coordinates are generally not constant (that's the case only for Cartesian coordinates). E.g., in cylinder coordinates, expressed in a Cartesian basis,
    [tex]\vec{r}=\vec{e}_x r \cos \theta + \vec{e}_y r \sin \theta + z \vec{e}_z,[/tex]
    you get, e.g.,
    [tex]\vec{e}_r=\partial_r \vec{r}/|\partial_r \vec{r}|=\vec{e}_x \cos \theta + \vec{e}_y \sin \theta.[/tex]
    Clearly the unit vector depends on the location in space. That's clear geometrically, because it's the unit tangent vector of the coordinate line [itex]\theta=\text{const}, \quad z=\text{const}[/itex], which is a radial straight line perpendicular to the [itez]z[/itex] axis pointing in a different direction for different [itex]\theta[/itex].

    That's why in your final equation you must write
    [tex]\vec{\nabla}=\vec{e}_r \partial_r + \vec{e}_\theta \frac{1}{r} \partial_{\theta} + \vec{e}_z \partial_z,[/tex]
    because the partial derivative must not act on the curvilinear unit-basis vectors.

    For a quick very intuitive treatment of vector calculus I recommend Sommerfeld's marvelous lectures on theoretical physics. In volume 2 (Fluid Dynamics) he has an introductory chapter about vector calculus.

    A. Sommerfeld, Lectures on theoretical physics vol. 2, Mechanics of deformable bodies, Academic Press 1950

    Another very good introduction is given in

    M. Abraham, R. Becker, The classical theory of electricity and magnetism, Blackie and Son 1932
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook