Skip to content
Snippets Groups Projects

First major update of src/2_coordinates.md

Merged Maciej Topyla requested to merge maciejedits into master
Compare and Show latest version
2 files
+ 117
88
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 114
85
@@ -21,7 +21,7 @@ The most common coordinates are *Cartesian coordinates*, where we use a
number $n$ of perpendicular axes. The coordinates corresponding to these
axes are $x_j$ where $j=1, \ldots, n$.
Cartesian coordinates are simple to describe and operate in. The coordinate axes are
Cartesian coordinates are simple to describe and operate on. The coordinate axes are
straight lines perpendicular to each other. It is therefore
very easy to do calculations in Cartesian coordinates. For example,
the distance $\Delta s$ between two points $(x_1, x_2, \ldots, x_n)$
@@ -29,7 +29,7 @@ and $(x'_1, x'_2, \ldots, x'_n)$ can be quickly computed using a general formula
$$\Delta s^2 = (x'_1 - x_1)^2 + (x'_2 - x_2)^2 + \ldots + (x'_n - x_n)^2.$$
(A space with such a distance definition is called a *Euclidean
(A space with such a distance definition is called an *Euclidean
space*.)
In mathematics, we are often dealing with so-called *infinitesimally* small
@@ -37,7 +37,7 @@ distances, for example in the definition of derivatives and integrals.
In Cartesian coordinates, the expressions for infinitesimal distances $ds$ and
infinitesimal volumes $dV$ are given as:
!!! info "Segment and volume element in n-dimensional Cartesian coordinates"
!!! info "Infinitesimal segment and volume elements in n-dimensional Cartesian coordinates"
$$ds = \sqrt{dx_1^2 + dx_2^2 + \ldots + dx_n^2}$$
$$dV = dx_1 dx_2 \ldots dx_N.$$
@@ -70,8 +70,7 @@ the angular coordinate $\varphi$ is dimensionless.
<figure markdown>
![image](figures/Coordinates_7_0.svg)
<figcaption>In this example of a polar plot, you can distinguish the radial coordinate (0.2, 0.4 etc.)
from the angular one expressed in degrees ($0^\circ$, $45^\circ$ etc.).</figcaption>
<figcaption>In this example of a polar plot, you can distinguish the radial coordinate (0.2, 0.4 etc.) from the angular one expressed in degrees ($0^\circ$, $45^\circ$ etc.).</figcaption>
</figure>
@@ -88,10 +87,10 @@ $$\begin{equation} y = r \sin \varphi.\end{equation}$$
<figcaption></figcaption>
</figure>
The inverse relation is given as:
#### The inverse relation
!!! info "Inverse relation between polar and Cartesian coordinate systems"
$$\begin{equation} r=\sqrt{x^2 + y^2}; \label{rxy}\end{equation}$$
\begin{equation} r=\sqrt{x^2 + y^2}; \label{rxy}\end{equation}
\begin{equation} \varphi=\begin{cases}
\arctan(y/x) & \text{$x>0$,}\\
\pi + \arctan(y/x) & \text{$x<0$ and $y>0$,}\\
@@ -118,7 +117,10 @@ If we consider two points which are *very close*, the analysis
simplifies however. We can use the geometry of the problem to find the
distance (see the figure below).
![image](figures/Coordinates_11_0.svg)
<figure markdown>
![image](figures/Coordinates_11_0.svg)
<figcaption></figcaption>
</figure>
When going from point 1 to point 2, we first traverse a small circular
arc of radius $r_1$ and then we move a small distance radially outward
@@ -134,7 +136,7 @@ We can use the same arguments also for the area: since the different
segments are approximately perpendicular, we find the area by simply
multiplying them:
!!! info "Surface element in polar coordinates
!!! info "Infinitesimal surface element in polar coordinates"
$$dA = r dr d\varphi.$$
This is an important formula to remember for integrating in polar
@@ -162,7 +164,7 @@ understood: the area swept by an angle difference $d\varphi$
<iframe width="100%" height=315 src="https://www.youtube-nocookie.com/embed/NGQWGx71w98?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Often, in physics important equations involve derivatives given in terms
Important equations in physics often involve derivatives given in terms
of Cartesian coordinates. One prominent example are equations of the form
$$\left(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}\right)
f(x, y) = \ldots.$$
@@ -170,7 +172,7 @@ The derivative operator $\left(\frac{\partial^2}{\partial x^2} +
\frac{\partial^2}{\partial y^2}\right)$ is so common it has its own name:
the Laplacian (here for two-dimensional space).
Such an equation is universal, but for particular situations it might be
This equation is universal, but for particular situations it might be
advantageous to use a different coordinate system, such as polar coordinates
for a system with rotational symmetry. The question then is: How does the
corresponding equation look like in a different coordinate system?
@@ -179,7 +181,7 @@ There are different ways to find the answer. Here, we will focus on
directly deriving the transformed equation through an explicit calculation
involving the chain rule for a function of several variables.
!!! info Chain rule for a multi-variable function
!!! info "Chain rule for a multi-variable function"
Let $f$ be a function of $n$ variables: $f(y_1, y_2, \ldots, y_n)$,
as well as $g_i(x_1, x_2, \ldots, x_n)$ for $i=1,2,\ldots, n$. Then
@@ -193,7 +195,7 @@ of a function of $r, \varphi$ in terms of $x$?
For this, we need to realize that there are relations between the coordinate systems.
In particular, $r = r(x,y)$ and $\varphi = \varphi(x, y)$ as defined in equations
\ref{rxy} and \ref{phixy}. In fact, we have been rather sloppy in our notation above,
of [the inverse relations](#the-inverse-relation). In fact, we have been rather sloppy in our notation above,
as the functions $f(x,y)$ and $f(r, \varphi)$ do not mean that I substitute $x=r$
and $y=\varphi$! It is more precise to state that there are two diferent
functions $f_\text{cart}(x,y)$ and $f_\text{polar}(r, \varphi)$ that are equivalent,
@@ -212,22 +214,22 @@ $$ \frac{\partial}{\partial x} f(r, \varphi) =
$$
and it is now a matter of (tedious) calculus to arrive at the right result.
This is the task of exercises 3 and 4, which finally compute the Laplacian
This is the task of exercises 3 and 4, which lead you to compute the Laplacian
in polar coordinates.
!!! warning Inverse function theorem
In this calculation one might be tempted to use the inverse
!!! warning "Inverse function theorem"
In this calculation, one might be tempted to use the inverse
function theorem to compute derivatives like
$\frac{\partial \varphi}{\partial x}$ from the much simpler
$\frac{\partial x}{\partial \varphi}$. Note though that here we
are dealing with functions depending on several variables, so the
*Jacobian* has to be used (see [Wikipedia](https://en.wikipedia.org/wiki/Inverse_function_theorem)). A direct calculation is in this particular case more easy.
$\frac{\partial x}{\partial \varphi}$. However, note that here we
are dealing with functions depending on several variables, so an appropriate
*Jacobian* has to be used (see [Wikipedia](https://en.wikipedia.org/wiki/Inverse_function_theorem)). A direct calculation is in this particular case considerably easier.
Note that this procedure also carries over to other coordinate systems,
although the calculations can become quite tedious. In these cases,
it's usually best to look up the correct form.
Note that this procedure also applies to transformations to other coordinate systems,
although the calculations can become quite tedious. In conventional cases,
it is usually advised to look up the correct form.
## Coordinate systems in 3D
## 2.3. Coordinate systems in 3D
<iframe width="100%" height=315 src="https://www.youtube-nocookie.com/embed/VjUbnZN1BvA?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
@@ -237,10 +239,10 @@ it's usually best to look up the correct form.
Three dimensional systems may have axial symmetry. An example is an
electrically charged wire of which we would like to calculate the
electric field, or a current-carrying wire for which we would like to
calculate the magnetic field. For such problems the most convenient
coordinates are *cylindrical coordinates*. For convenience, we choose
the symmetry-axis as the $z$-axis. Note that this can be done as we can
choose the coordinate system ourselves - this is not imposed by the
calculate the magnetic field. For such problems, the most convenient
coordinates are *cylindrical coordinates*. For a further convenience, we choose
the symmetry-axis as the $z$-axis. Note that this allowed, because we may
choose the coordinate system ourselves - it is not imposed by the
problem.
Cylindrical coordinates are defined straightforwardly: we use polar
@@ -248,22 +250,27 @@ coordinates $r$ and $\varphi$ in the $xy$ plane, and the distance $z$
along the symmetry-axis as the third coordinate. If the axis system is
chosen in physical space, we have two coordinates which have the
dimension of a distance: $r$ and $z$. The other coordinate,
$\varphi$, is of course dimensionless.
$\varphi$ is of course dimensionless.
What is the distance travelled along a path when we express this in
cylindrical coordinates? Let’s consider an example (Figure).
cylindrical coordinates? Let’s consider an example shown in the figure below.
![image](figures/Coordinates_13_0.svg)
<figure markdown>
![image](figures/Coordinates_13_0.svg)
<figcaption></figcaption>
</figure>
We want to find the length of the (small) red segment $d s$. By
inspecting the figure, we see that the horizontal (i.e. parallel to the
$xy$-plane) segment $d l$ is perpendicular to the vertical segment
$dz$. Using for $d l$ the length we obtained before for a line
segment in the $xy$ plane, expressed in polar coordinates, we
segment in the $xy$ plane expressed in polar coordinates, we
immediately find:
$$d s^2 = d l^2 + d z^2 = d r^2 + r^2 d \varphi^2 + d z^2.$$
The volume element is consequently given as
$$dV = r dr d\varphi dz.$$
The volume element is consequently given as:
!!! info "Infinitesimal volume element in cylindrical coordinates"
$$dV = r dr d\varphi dz.$$
### Spherical coordinates
@@ -274,91 +281,106 @@ and (2) the direction of the line connecting the origin to our point.
The specification of this direction can be identified with a point on a
sphere which is centered at the origin:
![image](figures/Coordinates_15_0.svg)
The position of a point on the sphere is specified using the two angles
$\theta$ and $\phi$ indicated in the figure.
<figure markdown>
![image](figures/Coordinates_15_0.svg)
<figcaption>The position of a point on the sphere is specified using the radius $r$ and two angles
$\theta$ and $\phi</figcaption>
</figure>
!!! warning
Note that in mathematics, often the angles are labelled the other way
round: there, $\phi$ is used for the angle between a line running from
the origin o the point of interest and the $z$-axis, and $\theta$ for
In mathematics, the angles are often labelled the other way
around: there, $\phi$ is used for the angle between a line running from
the origin to the point of interest and the $z$-axis, and $\theta$ for
the angle of the projection of that line with the $x$-axis. The
convention used here is custom in physics.
The relation between Cartesian and coordinates is defined by
$$x = r \cos \varphi \sin \vartheta$$
$$y = r \sin\varphi \sin \vartheta$$ $$z = r \cos\vartheta$$ The inverse
transformation is easy to find: $$r = \sqrt{x^2+y^2+z^2}$$
$$\theta = \arccos(z/\sqrt{x^2+y^2+z^2})$$
$$\phi = \begin{cases} \arctan(y/x) &{\rm for ~} x>0; \\
\pi + \arctan(y/x) & {\rm for ~} x<0 {\rm ~ and ~} y>0;\\
-\pi + \arctan(y/x) &{\rm ~ for ~} x<0 {\rm ~ and ~} y<0.
\end{cases}$$ These relations can be derived from the following figure:
convention used here is customary in physics.
The relation between Cartesian and spherical coordinates is defined by:
!!! info "The relation between Cartesian and spherical coordinates"
$$x = r \cos \varphi \sin \vartheta$$
$$y = r \sin\varphi \sin \vartheta$$ $$z = r \cos\vartheta$$
The inverse transformation is easy to find:
!!! info "The inverse relatuion between Cartesian and spherical coordinates"
$$r = \sqrt{x^2+y^2+z^2}$$
$$\theta = \arccos(z/\sqrt{x^2+y^2+z^2})$$
$$\phi = \begin{cases} \arctan(y/x) &{\rm for ~} x>0; \\
\pi + \arctan(y/x) & {\rm for ~} x<0 {\rm ~ and ~} y>0;\\
-\pi + \arctan(y/x) &{\rm for ~} x<0 {\rm ~ and ~} y<0.
\end{cases}$$
These relations can be derived from the following figure:
![image](figures/Coordinates_17_0.svg)
<figure markdown>
![image](figures/Coordinates_17_0.svg)
<figcaption></figcaption>
</figure>
The distance related to a change in the spherical coordinates is
calculated using Pythagoras’ theorem. The length $ds$ of a short segment
on the sphere with radius $r$ corresponding to changes in the polar
on the sphere with radius $r$ corresponding to the changes in the polar
angles of $d\vartheta$ and $d\varphi$ is given as
$$dl^2 = r^2 \left(\sin^2 \vartheta d\varphi^2 + d\vartheta^2\right).$$
In order to verify this, it is important to realize that all points with
*the same* coordinate $\vartheta$ span a circle in a horizontal plane
with a radius $r\sin\vartheta$ as shown in the figure below.
From this we can also infer that, for a segment with a radial component
$dr$ in addition to the displacement on the sphere, the displacement is:
From this, we can also infer that for a segment with a radial component
$dr$ in addition to the displacement on the surface of the sphere, the combined displacement is:
$$ds^2 = r^2 \left(\sin^2 \vartheta d\varphi^2 + d\vartheta^2\right) + dr^2.$$
The picture below shows the geometry behind the calculation of this
displacement.
![image](figures/Coordinates_19_0.svg)
<figure markdown>
![image](figures/Coordinates_19_0.svg)
<figcaption></figcaption>
</figure>
From these arguments we can again also find the volume element, it is
here given as
!!! info "Infinitesimal volume element in spherical coordinates"
$$dV = r^2 \sin\theta dr d\theta d\varphi.$$
## Summary
## 2.4. Summary
We have discussed four different coordinate systems:
1. *Cartesian coordinates*: $${\bf r} = (x_1, \ldots, x_n).$$ Can be
used for any dimension $n$. Convenient for: infinite spaces, systems
with rectangular symmatry.
1. !!! tip "Cartesian coordinates"
$${\bf r} = (x_1, \ldots, x_n).$$ This systems can be
used for any dimension $n$. It is particularly convenient for: infinite spaces, systems
with rectangular symmetry.
Distance between two points ${\bf r} = (x_1, \ldots, x_n)$ and
${\bf r}' = (x'_1, \ldots, x'_n)$:
$$\Delta s^2 = (x'_1 - x_1)^2 + (x'_2 - x_2)^2 + \ldots + (x'_n - x_n)^2.$$
2. *Polar coordinates*: $${\bf r} = (r, \phi).$$ Can be used in two
dimensions. Suitable for systems with circular symmetry or functions
given in terms of these coordinates.
2. !!! tip "Polar coordinates"
$${\bf r} = (r, \phi).$$ This system can be used in two
dimensions. It is particularly suitable for systems with circular symmetry or functions
given in terms of these coordinates. <br/>
Infinitesimal distance: $$ds^2 = dr^2 + r^2 d\phi^2.$$
Infinitesimal area: $$dA = r dr d\varphi.$$
3. *Cylindrical coordinates*: $${\bf r} = (r, \phi, z).$$ Can be
used in three dimensions. Suitable for systems with axial symmetry
or functions given in terms of these coordinates.
3. !!! tip "Cylindrical coordinates"
$${\bf r} = (r, \phi, z).$$ This system can be
used in three dimensions. It is particularly suitable for systems with axial symmetry
or functions given in terms of these coordinates. <br/>
Infinitesimal distance: $$ds^2 = dr^2 + r^2 d\phi^2 + dz^2.$$
Infinitesimal volume:: $$dV = r dr d\varphi dz.$$
4. *Spherical coordinates*: $${\bf r} = (r, \theta, \phi).$$ Can be
used in three dimensions. Suitable for systems with spherical
symmetry or functions given in terms of these coordinates.
Infinitesimal volume: $$dV = r dr d\varphi dz.$$
Infinitesimal distance:
4. !!! tip "Spherical coordinates"
$${\bf r} = (r, \theta, \phi).$$ This sysytem can be
used in three dimensions. It is particularly suitable for systems with spherical
symmetry or functions given in terms of these coordinates. <br/>
Infinitesimal distance:
$$ds^2 =r^2 (\sin^2 \theta d\phi^2 + d\theta^2) + dr^2 .$$
Infinitesimal volume:
$$dV = r^2 \sin(\theta) dr d\theta d\varphi.$$
## 2.5. Problems
## Problems
1. [:grinning:]
1. [:grinning:] *Warm-up*
1. Find the polar coordinates of the point with Cartesian
coordinates $${\bf r} = \sqrt{2} (1,1).$$
@@ -380,7 +402,8 @@ We have discussed four different coordinate systems:
5. $r=1$ and $\theta=\pi/4$ in spherical coordinates,
6. $\varphi=\pi/2$ and $\theta=\pi/2$ in spherical coordinates.
3. [:smirk:]
3. [:smirk:] *Partial derivatives*
(a) Consider the function $f(r,\varphi,\theta)=\frac{1}{r^2}$ defined
using spherical coordinates.
Compute $\frac{\partial}{\partial z} f(r, \varphi, \theta)$.
@@ -390,26 +413,32 @@ We have discussed four different coordinate systems:
question).
Compute again $\frac{\partial}{\partial z} f(r, \varphi, z)$.
4. [:smirk:] From the transformation from polar to Cartesian
4. [:smirk:] *Chain rule practice*
From the transformation from polar to Cartesian
coordinates, show that
$$\frac{\partial}{\partial x} = \cos\varphi \frac{\partial}{\partial r} - \frac{\sin\varphi}{r} \frac{\partial}{\partial \varphi}$$
and
$$\frac{\partial}{\partial y} = \sin\varphi \frac{\partial}{\partial r} + \frac{\cos\varphi}{r} \frac{\partial}{\partial \varphi}.$$
(Use the chain rule for differentiation).
5. [:sweat:] Using the result of problem 4, show that the Laplace
5. [:sweat:] *Laplace operator in spherical coordinates*
Using the result of problem 4, show that the Laplace
operator acting on a function $\psi({\bf r})$ in polar coordinates
takes the form
$$\nabla^2 \psi({\bf r}) =\left( \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}\right) \psi({\bf r}) = \frac{1}{r} \frac{\partial}{\partial r} \left( r \frac{\partial \psi(r,\varphi)}{\partial r} \right) + \frac{1}{r^2} \frac{\partial^2 \psi(r,\varphi)}{\partial \varphi^2}.$$
In a similar fashion it can be shown that for spherical coordinates,
the Laplace operator acting on a function $\psi({\bf r})$ becomes:
$$\nabla^2 \psi (r,\vartheta,\varphi) =
\frac{1}{r^2} \frac{\partial}{\partial r^2} \left( r^2 \frac{\partial \psi(r,\vartheta,\varphi)}{\partial r} \right) + \frac{1}{r^2\sin^2\vartheta} \frac{\partial^2 \psi(r,\vartheta, \varphi)}{\partial \varphi^2} + \frac{1}{r^2\sin\vartheta}
\frac{\partial}{\partial \vartheta}\left( \sin\vartheta \frac{\partial\psi(r,\vartheta, \varphi)}{\partial \vartheta}\right).$$
$$\begin{align} \nabla^2 \psi (r,\vartheta,\varphi) &=
\frac{1}{r^2} \frac{\partial}{\partial r^2} \left( r^2 \frac{\partial \psi(r,\vartheta,\varphi)}{\partial r} \right) \\ &+ \frac{1}{r^2\sin^2\vartheta} \frac{\partial^2 \psi(r,\vartheta, \varphi)}{\partial \varphi^2} \\ &+ \frac{1}{r^2\sin\vartheta}
\frac{\partial}{\partial \vartheta}\left( \sin\vartheta \frac{\partial\psi(r,\vartheta, \varphi)}{\partial \vartheta}\right).
\end{align}$$
This is however even more tedious (you do not have to show this).
6. [:grinning:] *Integration and coordinates I*
We define $f(r, \varphi) = \frac{1}{r}$ in polar coordinates. Explain how
a circular region, centered at the origin and with radius $r_0$, can be described
using polar coordinates. Then compute the integral of $f(r,\varphi)$ over
@@ -421,7 +450,7 @@ We have discussed four different coordinate systems:
8. [:smirk:] *Integration and coordinates III*
In 2D we can define a shape by specifying a function $r(\varphi)$:
In 2D, we can define a shape by specifying a function $r(\varphi)$:
![image](figures/shape_polar.svg)
Loading