# Del Operator conversion

1. Oct 29, 2013

### Redoctober

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

$$\nabla P = \frac{\partial P}{\partial x} i + \frac{\partial P}{\partial y} j + \frac{\partial P}{\partial z} k$$

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

i know that,

$$\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}$$

$$\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}$$

Taking the Cartesian - polar derivatives, therefore,

$$\frac{\partial P}{\partial x} = \frac{\partial P}{\partial r} \frac{1}{cos ~ \theta} - \frac{\partial P}{\partial \theta } \frac{\partial \theta}{rsin ~ \theta}$$

$$\frac{\partial P}{\partial y} = \frac{\partial P}{\partial r} \frac{1}{sin ~ \theta} + \frac{\partial P}{\partial \theta } \frac{\partial \theta}{rcos ~ \theta}$$

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

$$i = cos ~ \theta ~ e_r - sin ~ \theta ~ e_\theta$$
$$j = sin ~ \theta ~ e_r + cos ~ \theta ~ e_\theta$$

Finallly substituting all of these to get stuck as follows,

$$\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 \$$

I thought that it would cancel out cleanly but didn't. Any ideas ?

Last edited: Oct 29, 2013
2. Oct 29, 2013

### arildno

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:
$$x=r\cos\theta$$
$$y=r\sin\theta$$

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!

Taking partials with respect to x yields:
$$1=\frac{\partial{r}}{\partial{x}}*\cos\theta-r\sin\theta\frac{\partial\theta}{\partial{x}} (1)$$
$$0=\frac{\partial{r}}{\partial{x}}*\sin\theta+r\cos\theta\frac{\partial\theta}{\partial{x}}(2)$$

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

-------------------------------------------------------------
Note the counterintuitive result:
$$\frac{\partial{r}}{\partial{x}}=\frac{\partial{x}}{\partial{r}}$$

Last edited: Oct 29, 2013
3. Oct 30, 2013

### vanhees71

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
$$\vec{r}=\vec{e}_1 r \cos \theta + \vec{e}_2 r \sin \theta + \vec{e}_3 z,$$
where $\vec{e}_j$ 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 $\mathbb{R}^3$ except the $z$ axis ($r=0$). Thus one usually uses normalized basis vectors, i.e.,
$$\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}.$$
The gradient of a scalar field $\Phi(\vec{r})$ is defined in a coordinate-independent way by
$$\mathrm{d} \Phi=\mathrm{d} \vec{r} \cdot \vec{\nabla} \Phi.$$
Writing this out in cylinder coordinates gives
$$\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.$$
Comparing coefficients and using the orthonormality of the normalized coordinate orthonomral basis $(\hat{r},\hat{\theta},\hat{z})$ leads to
$$\vec{\nabla} \Phi=\hat{r} \partial_r \Phi + \frac{\hat{\theta}}{r} \partial_{\theta} \Phi + \hat{z} \partial_z \Phi.$$

4. Oct 30, 2013

### arildno

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".

5. Oct 31, 2013

### vanhees71

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 $h(\vec{x})=h(x_1,x_2)$, 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 $\vec{x}$ to position $\vec{x}+\mathrm{d} \vec{x}$. Clearly, according to the chain rule of multidimensional analysis the answer is
$$\mathrm{d} h=\mathrm{d} x \cdot \vec{\nabla} h(\vec{x}).$$

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 $\vec{\nabla} h$ must be a vector, because $\mathrm{d} h$ is clearly a scalar, and $\mathrm{d} \vec{x}$ is a vector (to be mathematically more correct, one should rather think of $\mathrm{d} \vec{x}$ as a vector and $\vec{\nabla} h$ 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, $\vec{j}$. 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 $\mathrm{d}^2 \vec{F}$ 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 $\vec{j}(\vec{x})$ is defined as a vector such that for an oriented surface element $\mathrm{d} \dot{m}=\mathrm{d}^2 \vec{F} \cdot \vec{j}$ 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 $\partial V$ that can be interpreted as the boundary of a volume $V$. 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
$$\dot{m}=\int_{\partial V} \mathrm{d}^2 \vec{F} \cdot \vec{j}.$$
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
$$\dot{m} = \mathrm{d}^3 \vec{x} \vec{\nabla} \cdot \vec{j}.$$
Since everything is independent of the choice of coordinates and since $\mathrm{d}^3 \vec{x}$ is a scalar, clearly the divergence $\vec{\nabla} \cdot \vec{x}$ 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
$$\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}.$$
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.

6. Oct 31, 2013

### Redoctober

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

$$F(x,y,z) = x^2 + 2y + 7z = constant$$

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

$$0 = 2x$$

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

$$\frac{\partial x}{\partial x} = \frac{\partial r}{\partial x}cos~\theta - sin ~ \theta \frac{\partial \theta}{\partial x}$$

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

$$d\vec{s} = dr\vec{e_r} + r d \theta \vec{e_\theta} + dz\vec{e_z}$$

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.

$$dA = \frac{\partial A}{\partial r} dr + \frac{\partial A}{\partial \theta} d \theta + \frac{\partial A}{\partial z} dz$$

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

$$dA = \nabla A \cdot d \vec{s}$$

this is only satisfied if the gradient operator is

$$\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}$$

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 :/

7. Nov 1, 2013

### arildno

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.

8. Nov 1, 2013

### vanhees71

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,
$$\vec{r}=\vec{e}_x r \cos \theta + \vec{e}_y r \sin \theta + z \vec{e}_z,$$
you get, e.g.,
$$\vec{e}_r=\partial_r \vec{r}/|\partial_r \vec{r}|=\vec{e}_x \cos \theta + \vec{e}_y \sin \theta.$$
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 $\theta=\text{const}, \quad z=\text{const}$, which is a radial straight line perpendicular to the [itez]z[/itex] axis pointing in a different direction for different $\theta$.

That's why in your final equation you must write
$$\vec{\nabla}=\vec{e}_r \partial_r + \vec{e}_\theta \frac{1}{r} \partial_{\theta} + \vec{e}_z \partial_z,$$
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

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook