From 3138ead6bfd6e88e8cdbf9e4c32df64e18bc4595 Mon Sep 17 00:00:00 2001 From: Prefetch Date: Fri, 9 Jun 2023 19:52:54 +0200 Subject: Improve knowledge base --- source/know/concept/spherical-coordinates/index.md | 294 +++++++++++++++------ 1 file changed, 209 insertions(+), 85 deletions(-) (limited to 'source/know/concept/spherical-coordinates') diff --git a/source/know/concept/spherical-coordinates/index.md b/source/know/concept/spherical-coordinates/index.md index f037182..01c5a61 100644 --- a/source/know/concept/spherical-coordinates/index.md +++ b/source/know/concept/spherical-coordinates/index.md @@ -8,9 +8,9 @@ categories: layout: "concept" --- -**Spherical coordinates** are an extension of polar coordinates to 3D. +**Spherical coordinates** are an extension of polar coordinates $$(r, \varphi)$$ to 3D. The position of a given point in space is described by -three coordinates $$(r, \theta, \varphi)$$, defined as: +three variables $$(r, \theta, \varphi)$$, defined as: * $$r$$: the **radius** or **radial distance**: distance to the origin. * $$\theta$$: the **elevation**, **polar angle** or **colatitude**: @@ -18,6 +18,10 @@ three coordinates $$(r, \theta, \varphi)$$, defined as: * $$\varphi$$: the **azimuth**, **azimuthal angle** or **longitude**: angle from the positive $$x$$-axis, typically in the counter-clockwise sense. +Note that this is the standard notation among physicists, +but mathematicians often switch the definitions of $$\theta$$ and $$\varphi$$, +while still writing $$(r, \theta, \varphi)$$. + Cartesian coordinates $$(x, y, z)$$ and the spherical system $$(r, \theta, \varphi)$$ are related by: @@ -32,104 +36,142 @@ $$\begin{aligned} \end{aligned}$$ Conversely, a point given in $$(x, y, z)$$ -can be converted to $$(r, \theta, \varphi)$$ -using these formulae: +can be converted to $$(r, \theta, \varphi)$$ using these formulae, +where $$\mathtt{atan2}$$ is the 2-argument arctangent, +which is needed to handle the signs correctly: $$\begin{aligned} \boxed{ - r = \sqrt{x^2 + y^2 + z^2} - \qquad - \theta = \arccos(z / r) - \qquad - \varphi = \mathtt{atan2}(y, x) + \begin{aligned} + r + &= \sqrt{x^2 + y^2 + z^2} + \\ + \theta + &= \arccos(z / r) + \\ + \varphi + &= \mathtt{atan2}(y, x) + \end{aligned} } \end{aligned}$$ -The spherical coordinate system is +Spherical coordinates form an [orthogonal curvilinear system](/know/concept/orthogonal-curvilinear-coordinates/), -whose scale factors $$h_r$$, $$h_\theta$$ and $$h_\varphi$$ we want to find. -To do so, we calculate the differentials of the Cartesian coordinates: +whose **scale factors** $$h_r$$, $$h_\theta$$ and $$h_\varphi$$ we need. +To get those, we calculate the unnormalized local basis: $$\begin{aligned} - \dd{x} &= \dd{r} \sin\theta \cos\varphi + \dd{\theta} r \cos\theta \cos\varphi - \dd{\varphi} r \sin\theta \sin\varphi + h_r \vu{e}_r + &= \vu{e}_x \pdv{x}{r} + \vu{e}_y \pdv{y}{r} + \vu{e}_z \pdv{z}{r} \\ - \dd{y} &= \dd{r} \sin\theta \sin\varphi + \dd{\theta} r \cos\theta \sin\varphi + \dd{\varphi} r \sin\theta \cos\varphi + &= \vu{e}_x \sin{\theta} \cos{\varphi} + \vu{e}_y \sin{\theta} \sin{\varphi} + \vu{e}_z \cos{\theta} \\ - \dd{z} &= \dd{r} \cos\theta - \dd{\theta} r \sin\theta -\end{aligned}$$ - -And then we calculate the line element $$\dd{\ell}^2$$, -skipping many terms thanks to orthogonality: - -$$\begin{aligned} - \dd{\ell}^2 - &= \:\:\:\: \dd{r}^2 \big( \sin^2(\theta) \cos^2(\varphi) + \sin^2(\theta) \sin^2(\varphi) + \cos^2(\theta) \big) + h_\theta \vu{e}_\theta + &= \vu{e}_x \pdv{x}{\theta} + \vu{e}_y \pdv{y}{\theta} + \vu{e}_z \pdv{z}{\theta} \\ - &\quad + \dd{\theta}^2 \big( r^2 \cos^2(\theta) \cos^2(\varphi) + r^2 \cos^2(\theta) \sin^2(\varphi) + r^2 \sin^2(\theta) \big) + &= \vu{e}_x \: r \cos{\theta} \cos{\varphi} + \vu{e}_y \: r \cos{\theta} \sin{\varphi} - \vu{e}_z \: r \sin{\theta} \\ - &\quad + \dd{\varphi}^2 \big( r^2 \sin^2(\theta) \sin^2(\varphi) + r^2 \sin^2(\theta) \cos^2(\varphi) \big) + h_\varphi \vu{e}_\varphi + &= \vu{e}_x \pdv{x}{\varphi} + \vu{e}_y \pdv{y}{\varphi} + \vu{e}_z \pdv{z}{\varphi} \\ - &= \dd{r}^2 + r^2 \: \dd{\theta}^2 + r^2 \sin^2(\theta) \: \dd{\varphi}^2 + &= - \vu{e}_x \: r \sin{\theta} \sin{\varphi} + \vu{e}_y \: r \sin{\theta} \cos{\varphi} \end{aligned}$$ -Finally, we can simply read off -the squares of the desired scale factors -$$h_r^2$$, $$h_\theta^2$$ and $$h_\varphi^2$$: +By normalizing the **local basis vectors** +$$\vu{e}_r$$, $$\vu{e}_\theta$$ and $$\vu{e}_\varphi$$, +we arrive at these expressions: $$\begin{aligned} \boxed{ - h_r = 1 - \qquad - h_\theta = r - \qquad - h_\varphi = r \sin\theta + \begin{aligned} + h_r + &= 1 + \\ + h_\theta + &= r + \\ + h_\varphi + &= r \sin{\theta} + \end{aligned} } -\end{aligned}$$ - -With these factors, we can easily convert things from the Cartesian system -using the standard formulae for orthogonal curvilinear coordinates. -The basis vectors are: - -$$\begin{aligned} + \qquad\qquad \boxed{ \begin{aligned} \vu{e}_r - &= \sin\theta \cos\varphi \:\vu{e}_x + \sin\theta \sin\varphi \:\vu{e}_y + \cos\theta \:\vu{e}_z + &= \vu{e}_x \sin{\theta} \cos{\varphi} + \vu{e}_y \sin{\theta} \sin{\varphi} + \vu{e}_z \cos{\theta} \\ \vu{e}_\theta - &= \cos\theta \cos\varphi \:\vu{e}_x + \cos\theta \sin\varphi \:\vu{e}_y - \sin\theta \:\vu{e}_z + &= \vu{e}_x \cos{\theta} \cos{\varphi} + \vu{e}_y \cos{\theta} \sin{\varphi} - \vu{e}_z \sin{\theta} \\ \vu{e}_\varphi - &= - \sin\varphi \:\vu{e}_x + \cos\varphi \:\vu{e}_y + &= - \vu{e}_x \sin{\varphi} + \vu{e}_y \cos{\varphi} \end{aligned} } \end{aligned}$$ -The basic vector operations (gradient, divergence, Laplacian and curl) are given by: +Thanks to these scale factors, we can easily convert calculus from the Cartesian system +using the standard formulae for orthogonal curvilinear coordinates. + + + + + +## Differential elements + +For line integrals, +the tangent vector element $$\dd{\vb{\ell}}$$ for a curve is as follows: $$\begin{aligned} \boxed{ - \nabla f - = \vu{e}_r \pdv{f}{r} - + \vu{e}_\theta \frac{1}{r} \pdv{f}{\theta} + \mathbf{e}_\varphi \frac{1}{r \sin\theta} \pdv{f}{\varphi} + \dd{\vb{\ell}} + = \vu{e}_r \dd{r} + + \: \vu{e}_\theta \: r \dd{\theta} + + \: \vu{e}_\varphi \: r \sin{\theta} \dd{\varphi} } \end{aligned}$$ +For surface integrals, +the normal vector element $$\dd{\vb{S}}$$ for a surface is given by: + $$\begin{aligned} \boxed{ - \nabla \cdot \vb{V} - = \frac{1}{r^2} \pdv{(r^2 V_r)}{r} - + \frac{1}{r \sin\theta} \pdv{(\sin\theta V_\theta)}{\theta} - + \frac{1}{r \sin\theta} \pdv{V_\varphi}{\varphi} + \dd{\vb{S}} + = \vu{e}_r \: r^2 \sin{\theta} \dd{\theta} \dd{\varphi} + + \: \vu{e}_\theta \: r \sin{\theta} \dd{r} \dd{\varphi} + + \: \vu{e}_\varphi \: r \dd{r} \dd{\theta} } \end{aligned}$$ +And for volume integrals, +the infinitesimal volume $$\dd{V}$$ takes the following form: + $$\begin{aligned} \boxed{ - \nabla^2 f - = \frac{1}{r^2} \pdv{}{r}\Big( r^2 \pdv{f}{r} \Big) - + \frac{1}{r^2 \sin\theta} \pdv{}{\theta}\Big( \sin\theta \pdv{f}{\theta} \Big) - + \frac{1}{r^2 \sin^2(\theta)} \pdvn{2}{f}{\varphi} + \dd{V} + = r^2 \sin{\theta} \dd{r} \dd{\theta} \dd{\varphi} + } +\end{aligned}$$ + + + +## Common operations + +The basic vector operations (gradient, divergence, curl and Laplacian) are given by: + +$$\begin{aligned} + \boxed{ + \nabla f + = \vu{e}_r \pdv{f}{r} + + \vu{e}_\theta \frac{1}{r} \pdv{f}{\theta} + \mathbf{e}_\varphi \frac{1}{r \sin{\theta}} \pdv{f}{\varphi} + } +\end{aligned}$$ + +$$\begin{aligned} + \boxed{ + \nabla \cdot \vb{V} + = \pdv{V_r}{r} + \frac{2}{r} V_r + + \frac{1}{r} \pdv{V_\theta}{\theta} + \frac{\cot{\theta}}{r} V_\theta + + \frac{1}{r \sin\theta} \pdv{V_\varphi}{\varphi} } \end{aligned}$$ @@ -137,70 +179,152 @@ $$\begin{aligned} \boxed{ \begin{aligned} \nabla \times \vb{V} - &= \frac{\vu{e}_r}{r \sin\theta} \Big( \pdv{(\sin\theta V_\varphi)}{\theta} - \pdv{V_\theta}{\varphi} \Big) + &= \quad \vu{e}_r \bigg( \frac{1}{r} \pdv{V_\varphi}{\theta} + \frac{\cot{\theta}}{r} V_\varphi + - \frac{1}{r \sin{\theta}} \pdv{V_\theta}{\varphi} \bigg) \\ - &+ \frac{\vu{e}_\theta}{r} \Big( \frac{1}{\sin\theta} \pdv{V_r}{\varphi} - \pdv{(r V_\varphi)}{r} \Big) + &\quad\: + \vu{e}_\theta \bigg( \frac{1}{r \sin{\theta}} \pdv{V_r}{\varphi} + - \pdv{V_\varphi}{r} - \frac{V_\varphi}{r} \bigg) \\ - &+ \frac{\vu{e}_\varphi}{r} \Big( \pdv{(r V_\theta)}{r} - \pdv{V_r}{\theta} \Big) + &\quad\: + \vu{e}_\varphi \bigg( \pdv{V_\theta}{r} + \frac{V_\theta}{r} + - \frac{1}{r} \pdv{V_r}{\theta} \bigg) \end{aligned} } \end{aligned}$$ -The differential element of volume $$\dd{V}$$ -takes the following form: - $$\begin{aligned} \boxed{ - \dd{V} - = r^2 \sin\theta \dd{r} \dd{\theta} \dd{\varphi} + \nabla^2 f + = \pdvn{2}{f}{r} + \frac{2}{r} \pdv{f}{r} + + \frac{1}{r^2} \pdvn{2}{f}{\theta} + \frac{\cot{\theta}}{r^2} \pdv{f}{\theta} + + \frac{1}{r^2 \sin^2{\theta}} \pdvn{2}{f}{\varphi} } \end{aligned}$$ -So, for example, an integral over all of space is converted like so: -$$\begin{aligned} - \iiint_{-\infty}^\infty f(x, y, z) \dd{V} - = \int_0^{2\pi} \int_0^\pi \int_0^\infty f(r, \theta, \varphi) \: r^2 \sin\theta \dd{r} \dd{\theta} \dd{\varphi} -\end{aligned}$$ -The isosurface elements are as follows, where $$S_r$$ is a surface at constant $$r$$, etc.: +## Uncommon operations + +Uncommon operations include: +the gradient of a divergence $$\nabla (\nabla \cdot \vb{V})$$, +the gradient of a vector $$\nabla \vb{V}$$, +the advection of a vector $$(\vb{U} \cdot \nabla) \vb{V}$$ with respect to $$\vb{U}$$, +the Laplacian of a vector $$\nabla^2 \vb{V}$$, +and the divergence of a 2nd-order tensor $$\nabla \cdot \overline{\overline{\vb{T}}}$$: $$\begin{aligned} \boxed{ \begin{aligned} - \dd{S}_r = r^2 \sin\theta \dd{\theta} \dd{\varphi} - \qquad - \dd{S}_\theta = r \sin\theta \dd{r} \dd{\varphi} - \qquad - \dd{S}_\varphi = r \dd{r} \dd{\theta} + \nabla (\nabla \cdot \vb{V}) + &= \quad \vu{e}_r \bigg( \pdvn{2}{V_r}{r} + \frac{1}{r} \mpdv{V_\theta}{r}{\theta} + \frac{1}{r \sin{\theta}} \mpdv{V_\varphi}{\varphi}{r} + + \frac{2}{r} \pdv{V_r}{r} - \frac{1}{r^2} \pdv{V_\theta}{\theta} + \\ + &\qquad\qquad - \frac{1}{r^2 \sin{\theta}} \pdv{V_\varphi}{\varphi} + + \frac{\cot{\theta}}{r} \pdv{V_\theta}{r} - \frac{2}{r^2} V_r - \frac{\cot{\theta}}{r^2} V_\theta \bigg) + \\ + &\quad\: + \vu{e}_\theta \bigg( \frac{1}{r} \mpdv{V_r}{\theta}{r} + \frac{1}{r^2} \pdvn{2}{V_\theta}{\theta} + + \frac{1}{r^2 \sin{\theta}} \mpdv{V_\varphi}{\theta}{\varphi} + \frac{2}{r^2} \pdv{V_r}{\theta} + \\ + &\qquad\qquad + \frac{\cot{\theta}}{r^2} \pdv{V_\theta}{\theta} + - \frac{\cos{\theta}}{r^2 \sin^2{\theta}} \pdv{V_\varphi}{\varphi} - \frac{V_\theta}{r^2 \sin^2{\theta}} \bigg) + \\ + &\quad\: + \vu{e}_\varphi \bigg( \frac{1}{r \sin{\theta}} \mpdv{V_r}{\varphi}{r} + \frac{1}{r^2 \sin{\theta}} \mpdv{V_\theta}{\varphi}{\theta} + + \frac{1}{r^2 \sin^2{\theta}} \pdvn{2}{V_\varphi}{\varphi} + \\ + &\qquad\qquad + \frac{2}{r^2 \sin{\theta}} \pdv{V_r}{\varphi} + \frac{\cos{\theta}}{r^2 \sin^2{\theta}} \pdv{V_\theta}{\varphi} \bigg) \end{aligned} } \end{aligned}$$ -Similarly, the normal vector element $$\dd{\vu{S}}$$ for an arbitrary surface is given by: +$$\begin{aligned} + \boxed{ + \begin{aligned} + \nabla \vb{V} + &= \quad \vu{e}_r \vu{e}_r \pdv{V_r}{r} + \vu{e}_r \vu{e}_\theta \pdv{V_\theta}{r} + \vu{e}_r \vu{e}_\varphi \pdv{V_\varphi}{r} + \\ + &\quad\: + \vu{e}_\theta \vu{e}_r \bigg( \frac{1}{r} \pdv{V_r}{\theta} - \frac{V_\theta}{r} \bigg) + + \vu{e}_\theta \vu{e}_\theta \bigg( \frac{1}{r} \pdv{V_\theta}{\theta} + \frac{V_r}{r} \bigg) + + \vu{e}_\theta \vu{e}_\varphi \frac{1}{r} \pdv{V_\varphi}{\theta} + \\ + &\quad\: + \vu{e}_\varphi \vu{e}_r \bigg( \frac{1}{r \sin{\theta}} \pdv{V_r}{\varphi} - \frac{V_\varphi}{r} \bigg) + + \vu{e}_\varphi \vu{e}_\theta \bigg( \frac{1}{r \sin{\theta}} \pdv{V_\theta}{\varphi} - \frac{\cot{\theta}}{r} V_\varphi \bigg) + \\ + &\quad\: + \vu{e}_\varphi \vu{e}_\varphi + \bigg( \frac{1}{r \sin{\theta}} \pdv{V_\varphi}{\varphi} + \frac{V_r}{r} + \frac{\cot{\theta}}{r} V_\theta \bigg) + \end{aligned} + } +\end{aligned}$$ $$\begin{aligned} \boxed{ - \dd{\vu{S}} - = \vu{e}_r \: r^2 \sin\theta \dd{\theta} \dd{\varphi} - + \vu{e}_\theta \: r \sin\theta \dd{r} \dd{\varphi} - + \vu{e}_\varphi \: r \dd{r} \dd{\theta} + \begin{aligned} + (\vb{U} \cdot \nabla) \vb{V} + &= \quad \vu{e}_r \bigg( U_r \pdv{V_r}{r} + \frac{U_\theta}{r} \pdv{V_r}{\theta} + + \frac{U_\varphi}{r \sin{\theta}} \pdv{V_r}{\varphi} - \frac{U_\theta V_\theta}{r} - \frac{U_\varphi V_\varphi}{r} \bigg) + \\ + &\quad\: + \vu{e}_\theta \bigg( U_r \pdv{V_\theta}{r} + \frac{U_\theta}{r} \pdv{V_\theta}{\theta} + + \frac{U_\varphi}{r \sin{\theta}} \pdv{V_\theta}{\varphi} + \frac{U_\theta V_r}{r} - \frac{\cot{\theta}}{r} U_\varphi V_\varphi \bigg) + \\ + &\quad\: + \vu{e}_\varphi \bigg( U_r \pdv{V_\varphi}{r} + \frac{U_\theta}{r} \pdv{V_\varphi}{\theta} + + \frac{U_\varphi}{r \sin{\theta}} \pdv{V_\varphi}{\varphi} + \frac{U_\varphi V_r}{r} + \frac{\cot{\theta}}{r} U_\varphi V_\theta \bigg) + \end{aligned} } \end{aligned}$$ -And finally, the tangent vector element $$\dd{\vu{\ell}}$$ of a given curve is as follows: +$$\begin{aligned} + \boxed{ + \begin{aligned} + \nabla^2 \vb{V} + &= \quad\: \vu{e}_r \bigg( \pdvn{2}{V_r}{r} + \frac{1}{r^2} \pdvn{2}{V_r}{\theta} + \frac{1}{r^2 \sin^2{\theta}} \pdvn{2}{V_r}{\varphi} + + \frac{2}{r} \pdv{V_r}{r} + \frac{\cot{\theta}}{r^2} \pdv{V_r}{\theta} + \\ + &\qquad\qquad - \frac{2}{r^2} \pdv{V_\theta}{\theta} - \frac{2}{r^2 \sin{\theta}} \pdv{V_\varphi}{\varphi} + - \frac{2}{r^2} V_r - \frac{2 \cot{\theta}}{r^2} V_\theta \bigg) + \\ + &\quad\: + \vu{e}_\theta \bigg( \pdvn{2}{V_\theta}{r} + \frac{1}{r^2} \pdvn{2}{V_\theta}{\theta} + + \frac{1}{r^2 \sin^2{\theta}} \pdvn{2}{V_\theta}{\varphi} + \frac{2}{r^2} \pdv{V_r}{\theta} + \frac{2}{r} \pdv{V_\theta}{r} + \\ + &\qquad\qquad + \frac{\cot{\theta}}{r^2} \pdv{V_\theta}{\theta} + - \frac{2 \cos{\theta}}{r^2 \sin^2{\theta}} \pdv{V_\varphi}{\varphi} - \frac{V_\theta}{r^2 \sin^2{\theta}} \bigg) + \\ + &\quad\: + \vu{e}_\varphi \bigg( \pdvn{2}{V_\varphi}{r} + \frac{1}{r^2} \pdvn{2}{V_\varphi}{\theta} + + \frac{1}{r^2 \sin^2{\theta}} \pdvn{2}{V_\varphi}{\varphi} + \frac{2}{r^2 \sin{\theta}} \pdv{V_r}{\varphi} + \\ + &\qquad\qquad + \frac{2 \cos{\theta}}{r^2 \sin^2{\theta}} \pdv{V_\theta}{\varphi} + + \frac{2}{r} \pdv{V_\varphi}{r} + \frac{\cot{\theta}}{r^2} \pdv{V_\varphi}{\theta} + - \frac{V_\varphi}{r^2 \sin^2{\theta}} \bigg) + \end{aligned} + } +\end{aligned}$$ $$\begin{aligned} \boxed{ - \dd{\vu{\ell}} - = \vu{e}_r \: \dd{r} - + \vu{e}_\theta \: r \dd{\theta} - + \vu{e}_\varphi \: r \sin\theta \dd{\varphi} + \begin{aligned} + \nabla \cdot \overline{\overline{\mathbf{T}}} + &= \quad \vu{e}_r \bigg( \pdv{T_{rr}}{r} + \frac{1}{r} \pdv{T_{\theta r}}{\theta} + \frac{1}{r \sin{\theta}} \pdv{T_{\varphi r}}{\varphi} + \\ + &\qquad\qquad + \frac{2}{r} T_{rr} + \frac{\cot{\theta}}{r} T_{\theta r} - \frac{T_{\theta \theta}}{r} - \frac{T_{\varphi \varphi}}{r} \bigg) + \\ + &\quad\: + \vu{e}_\theta \bigg(\pdv{T_{r \theta}}{r} + \frac{1}{r} \pdv{T_{\theta \theta}}{\theta} + + \frac{1}{r \sin{\theta}} \pdv{T_{\varphi \theta}}{\varphi} + \\ + &\qquad\qquad + \frac{2}{r} T_{r \theta} + \frac{T_{\theta r}}{r} + + \frac{\cot{\theta}}{r} T_{\theta \theta} - \frac{\cot{\theta}}{r} T_{\varphi \varphi} \bigg) + \\ + &\quad\: + \vu{e}_\varphi \bigg( \pdv{T_{r \varphi}}{r} + \frac{1}{r} \pdv{T_{\theta \varphi}}{\theta} + + \frac{1}{r \sin{\theta}} \pdv{T_{\varphi \varphi}}{\varphi} + \\ + &\qquad\qquad + \frac{2}{r} T_{r \varphi} + \frac{\cot{\theta}}{r} T_{\theta \varphi} + + \frac{T_{\varphi r}}{r} + \frac{\cot{\theta}}{r} T_{\varphi \theta} \bigg) + \end{aligned} } \end{aligned}$$ + ## References 1. M.L. Boas, *Mathematical methods in the physical sciences*, 2nd edition, Wiley. +2. B. Lautrup, + *Physics of continuous matter: exotic and everyday phenomena in the macroscopic world*, 2nd edition, + CRC Press. -- cgit v1.2.3