use quarto, not Pluto to render pages
This commit is contained in:
@@ -62,10 +62,10 @@ nothing
|
||||
|
||||
The gradient of a scalar function $f:R^n \rightarrow R$ is a vector field of partial derivatives. In $R^2$, we have:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla{f} = \langle \frac{\partial{f}}{\partial{x}},
|
||||
\frac{\partial{f}}{\partial{y}} \rangle.
|
||||
~$$
|
||||
```
|
||||
|
||||
It has the interpretation of pointing out the direction of greatest ascent for the surface $z=f(x,y)$.
|
||||
|
||||
@@ -113,15 +113,15 @@ p
|
||||
|
||||
Consider the sides with outward normal $\hat{i}$. The contribution to the surface integral, $\oint_S (F\cdot\hat{N})dS$, could be *approximated* by
|
||||
|
||||
$$~
|
||||
```math
|
||||
\left(F(x + \Delta x, y, z) \cdot \hat{i}\right) \Delta y \Delta z,
|
||||
~$$
|
||||
```
|
||||
|
||||
whereas, the contribution for the face with outward normal $-\hat{i}$ could be approximated by:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\left(F(x, y, z) \cdot (-\hat{i}) \right) \Delta y \Delta z.
|
||||
~$$
|
||||
```
|
||||
|
||||
The functions are being evaluated at a point on the face of the
|
||||
surface. For Riemann integrable functions, any point in a partition
|
||||
@@ -129,11 +129,11 @@ may be chosen, so our choice will not restrict the generality.
|
||||
|
||||
The total contribution of the two would be:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\left(F(x + \Delta x, y, z) \cdot \hat{i}\right) \Delta y \Delta z +
|
||||
\left(F(x, y, z) \cdot (-\hat{i})\right) \Delta y \Delta z =
|
||||
\left(F_x(x + \Delta x, y, z) - F_x(x, y, z)\right) \Delta y \Delta z,
|
||||
~$$
|
||||
```
|
||||
|
||||
as $F \cdot \hat{i} = F_x$.
|
||||
|
||||
@@ -142,11 +142,11 @@ as $F \cdot \hat{i} = F_x$.
|
||||
If this is repeated for the other two pair of matching faces, we get a definition for the *divergence*:
|
||||
|
||||
> The *divergence* of a vector field $F:R^3 \rightarrow R^3$ is given by
|
||||
> $$~
|
||||
> ```math
|
||||
> \text{divergence}(F) =
|
||||
> \lim \frac{1}{\Delta V} \oint_S F\cdot\hat{N} dS =
|
||||
> \frac{\partial{F_x}}{\partial{x}} +\frac{\partial{F_y}}{\partial{y}} +\frac{\partial{F_z}}{\partial{z}}.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
The limit expression for the divergence will hold for any smooth closed surface, $S$, converging on $(x,y,z)$, not just box-like ones.
|
||||
|
||||
@@ -155,9 +155,9 @@ The limit expression for the divergence will hold for any smooth closed surface,
|
||||
|
||||
The derivation of the divergence is done for $n=3$, but could also have easily been done for two dimensions ($n=2$) or higher dimensions $n>3$. The formula in general would be: for $F(x_1, x_2, \dots, x_n): R^n \rightarrow R^n$:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\text{divergence}(F) = \sum_{i=1}^n \frac{\partial{F_i}}{\partial{x_i}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
----
|
||||
@@ -198,7 +198,7 @@ annotate!([
|
||||
|
||||
Let $F=\langle F_x, F_y\rangle$. For small enough values of $\Delta{x}$ and $\Delta{y}$ the line integral, $\oint_C F\cdot d\vec{r}$ can be *approximated* by $4$ terms:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\left(F(x,y) \cdot \hat{i}\right)\Delta{x} &+
|
||||
\left(F(x+\Delta{x},y) \cdot \hat{j}\right)\Delta{y} +
|
||||
@@ -211,15 +211,15 @@ F_x(x, y+\Delta{y}) (-\Delta{x}) + F_y(x,y) (-\Delta{y})\\
|
||||
(F_y(x + \Delta{x}, y) - F_y(x, y))\Delta{y} -
|
||||
(F_x(x, y+\Delta{y})-F_x(x,y))\Delta{x}.
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
|
||||
The Riemann approximation allows a choice of evaluation point for Riemann integrable functions, and the choice here lends itself to further analysis.
|
||||
Were the above divided by $\Delta{x}\Delta{y}$, the area of the box, and a limit taken, partial derivatives appear to suggest this formula:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\lim \frac{1}{\Delta{x}\Delta{y}} \oint_C F\cdot d\vec{r} =
|
||||
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
The scalar function on the right hand side is called the (two-dimensional) curl of $F$ and the left-hand side lends itself as a measure of the microscopic circulation of the vector field, $F:R^2 \rightarrow R^2$.
|
||||
@@ -303,31 +303,36 @@ p
|
||||
|
||||
Now we compute the *line integral*. Consider the top face, $S_1$, connecting $(x,y,z+\Delta z), (x + \Delta x, y, z + \Delta z), (x + \Delta x, y + \Delta y, z + \Delta z), (x, y + \Delta y, z + \Delta z)$, Using the *right hand rule*, parameterize the boundary curve, $C_1$, in a counter clockwise direction so the right hand rule yields the outward pointing normal ($\hat{k}$). Then the integral $\oint_{C_1} F\cdot \hat{T} ds$ is *approximated* by the following Riemann sum of $4$ terms:
|
||||
|
||||
$$~
|
||||
F(x,y, z+\Delta{z}) \cdot \hat{i}\Delta{x} +
|
||||
F(x+\Delta x, y, z+\Delta{z}) \cdot \hat{j} \Delta y +
|
||||
F(x, y+\Delta y, z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} +
|
||||
F(x, y, z+\Delta{z}) \cdot (-\hat{j}) \Delta{y}.
|
||||
~$$
|
||||
|
||||
```math
|
||||
\begin{align*}
|
||||
F(x,y, z+\Delta{z}) \cdot \hat{i}\Delta{x} &+ F(x+\Delta x, y, z+\Delta{z}) \cdot \hat{j} \Delta y \\
|
||||
&+ F(x, y+\Delta y, z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} \\
|
||||
&+ F(x, y, z+\Delta{z}) \cdot (-\hat{j}) \Delta{y}.
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
(The points $c_i$ are chosen from the endpoints of the line segments.)
|
||||
|
||||
|
||||
|
||||
$$~
|
||||
\oint_{C_1} F\cdot \hat{T} ds \approx
|
||||
(F_y(x+\Delta x, y, z+\Delta{z}) - F_y(x, y, z+\Delta{z})) \Delta{y} -
|
||||
(F_x(x,y + \Delta{y}, z+\Delta{z}) - F_x(x, y, z+\Delta{z})) \Delta{x}
|
||||
~$$
|
||||
```math
|
||||
\begin{align*}
|
||||
\oint_{C_1} F\cdot \hat{T} ds
|
||||
&\approx (F_y(x+\Delta x, y, z+\Delta{z}) \\
|
||||
&- F_y(x, y, z+\Delta{z})) \Delta{y} \\
|
||||
&- (F_x(x,y + \Delta{y}, z+\Delta{z}) \\
|
||||
&- F_x(x, y, z+\Delta{z})) \Delta{x}
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
As before, were this divided by the *area* of the surface, we have after rearranging and cancellation:
|
||||
|
||||
$$~
|
||||
\frac{1}{\Delta{S_1}} \oint_{C_1} F \cdot \hat{T} ds \approx
|
||||
\frac{F_y(x+\Delta x, y, z+\Delta{z}) - F_y(x, y, z+\Delta{z})}{\Delta{x}}
|
||||
-
|
||||
\frac{F_x(x, y+\Delta y, z+\Delta{z})-F_x(x, y, z+\Delta{z})}{\Delta{y}}.
|
||||
~$$
|
||||
```math
|
||||
\begin{align*}
|
||||
\frac{1}{\Delta{S_1}} \oint_{C_1} F \cdot \hat{T} ds &\approx
|
||||
\frac{F_y(x+\Delta x, y, z+\Delta{z}) - F_y(x, y, z+\Delta{z})}{\Delta{x}}\\
|
||||
&- \frac{F_x(x, y+\Delta y, z+\Delta{z}) - F_x(x, y, z+\Delta{z})}{\Delta{y}}.
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
In the limit, as $\Delta{S} \rightarrow 0$, this will converge to $\partial{F_y}/\partial{x}-\partial{F_x}/\partial{y}$.
|
||||
|
||||
@@ -336,56 +341,56 @@ Had the bottom of the box been used, a similar result would be found, up to a mi
|
||||
Unlike the two dimensional case, there are other directions to consider and here
|
||||
the other sides will yield different answers. Consider now the face connecting $(x,y,z), (x+\Delta{x}, y, z), (x+\Delta{x}, y, z + \Delta{z})$, and $ (x,y,z+\Delta{z})$ with outward pointing normal $-\hat{j}$. Let $S_2$ denote this face and $C_2$ describe its boundary. Orient this curve so that the right hand rule points in the $-\hat{j}$ direction (the outward pointing normal). Then, as before, we can approximate:
|
||||
|
||||
$$~
|
||||
\begin{align}
|
||||
```math
|
||||
\begin{align*}
|
||||
\oint_{C_2} F \cdot \hat{T} ds
|
||||
&\approx
|
||||
F(x,y,z) \cdot \hat{i} \Delta{x} +
|
||||
F(x+\Delta{x},y,z) \cdot \hat{k} \Delta{z} +
|
||||
F(x,y,z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} +
|
||||
F(x, y, z) \cdot (-\hat{k}) \Delta{z}\\
|
||||
F(x,y,z) \cdot \hat{i} \Delta{x} \\
|
||||
&+ F(x+\Delta{x},y,z) \cdot \hat{k} \Delta{z} \\
|
||||
&+ F(x,y,z+\Delta{z}) \cdot (-\hat{i}) \Delta{x} \\
|
||||
&+ F(x, y, z) \cdot (-\hat{k}) \Delta{z}\\
|
||||
&= (F_z(x+\Delta{x},y,z) - F_z(x, y, z))\Delta{z} -
|
||||
(F_x(x,y,z+\Delta{z}) - F(x,y,z)) \Delta{x}.
|
||||
\end{align}
|
||||
~$$
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
Dividing by $\Delta{S}=\Delta{x}\Delta{z}$ and taking a limit will give:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\lim \frac{1}{\Delta{S}} \oint_{C_2} F \cdot \hat{T} ds =
|
||||
\frac{\partial{F_z}}{\partial{x}} - \frac{\partial{F_x}}{\partial{z}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
Had, the opposite face with outward normal $\hat{j}$ been chosen, the answer would differ by a factor of $-1$.
|
||||
|
||||
Similarly, let $S_3$ be the face with outward normal $\hat{i}$ and curve $C_3$ bounding it with parameterization chosen so that the right hand rule points in the direction of $\hat{i}$. This will give
|
||||
|
||||
|
||||
$$~
|
||||
```math
|
||||
\lim \frac{1}{\Delta{S}} \oint_{C_3} F \cdot \hat{T} ds =
|
||||
\frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
In short, depending on the face chosen, a different answer is given, but all have the same type.
|
||||
|
||||
> Define the *curl* of a $3$-dimensional vector field $F=\langle F_x,F_y,F_z\rangle$ by:
|
||||
> $$~
|
||||
> ```math
|
||||
> \text{curl}(F) =
|
||||
> \langle \frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}},
|
||||
> \frac{\partial{F_x}}{\partial{z}} - \frac{\partial{F_z}}{\partial{x}},
|
||||
> \frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}} \rangle.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
If $S$ is some surface with closed boundary $C$ oriented so that the unit normal, $\hat{N}$, of $S$ is given by the right hand rule about $C$, then
|
||||
|
||||
$$~
|
||||
```math
|
||||
\hat{N} \cdot \text{curl}(F) = \lim \frac{1}{\Delta{S}} \oint_C F \cdot \hat{T} ds.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
The curl has a formal representation in terms of a $3\times 3$ determinant, similar to that used to compute the cross product, that is useful for computation:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\text{curl}(F) = \det\left[
|
||||
\begin{array}{}
|
||||
\hat{i} & \hat{j} & \hat{k}\\
|
||||
@@ -393,7 +398,7 @@ $$~
|
||||
F_x & F_y & F_z
|
||||
\end{array}
|
||||
\right]
|
||||
~$$
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
@@ -419,18 +424,18 @@ curl(F::Function, pt) = curl(ForwardDiff.jacobian(F, pt))
|
||||
|
||||
The divergence, gradient, and curl all involve partial derivatives. There is a notation employed that can express the operations more succinctly. Let the [Del operator](https://en.wikipedia.org/wiki/Del) be defined in Cartesian coordinates by the formal expression:
|
||||
|
||||
> $$~
|
||||
> ```math
|
||||
> \nabla = \langle
|
||||
> \frac{\partial}{\partial{x}},
|
||||
> \frac{\partial}{\partial{y}},
|
||||
> \frac{\partial}{\partial{z}}
|
||||
> \rangle.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
This is a *vector differential operator* that acts on functions and vector fields through the typical notation to yield the three operations:
|
||||
|
||||
$$~
|
||||
\begin{align}
|
||||
```math
|
||||
\begin{align*}
|
||||
\nabla{f} &= \langle
|
||||
\frac{\partial{f}}{\partial{x}},
|
||||
\frac{\partial{f}}{\partial{y}},
|
||||
@@ -440,13 +445,15 @@ $$~
|
||||
\frac{\partial}{\partial{x}},
|
||||
\frac{\partial}{\partial{y}},
|
||||
\frac{\partial}{\partial{z}}
|
||||
\rangle \cdot F =
|
||||
\rangle \cdot F \\
|
||||
&=
|
||||
\langle
|
||||
\frac{\partial}{\partial{x}},
|
||||
\frac{\partial}{\partial{y}},
|
||||
\frac{\partial}{\partial{z}}
|
||||
\rangle \cdot
|
||||
\langle F_x, F_y, F_z \rangle =
|
||||
\langle F_x, F_y, F_z \rangle \\
|
||||
&=
|
||||
\frac{\partial{F_x}}{\partial{x}} +
|
||||
\frac{\partial{F_y}}{\partial{y}} +
|
||||
\frac{\partial{F_z}}{\partial{z}},\quad\text{the divergence;}\\
|
||||
@@ -464,15 +471,12 @@ $$~
|
||||
F_x & F_y & F_z
|
||||
\end{array}
|
||||
\right],\quad\text{the curl}.
|
||||
\end{align}
|
||||
~$$
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
Mathematically operators have not been seen previously, but the concept of an operation on a function that returns another function is a common one when using `Julia`. We have seen many examples (`plot`, `D`, `quadgk`, etc.). In computer science such functions are called *higher order* functions, as they accept arguments which are also functions.
|
||||
""")
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
!!! note
|
||||
Mathematically operators have not been seen previously, but the concept of an operation on a function that returns another function is a common one when using `Julia`. We have seen many examples (`plot`, `D`, `quadgk`, etc.). In computer science such functions are called *higher order* functions, as they accept arguments which are also functions.
|
||||
|
||||
----
|
||||
|
||||
In the `CalculusWithJulia` package, the constant `\nabla[\tab]`, producing $\nabla$ implements this operator for functions and symbolic expressions.
|
||||
@@ -543,11 +547,9 @@ There is a subtle difference in usage. Symbolically the evaluation of
|
||||
function evaluation, parentheses must be used in the numeric case.
|
||||
|
||||
|
||||
```julia; echo=false
|
||||
note("""
|
||||
As mentioned, for the symbolic evaluations, a specification of three variables (here `x`, `y`, and `z`) is necessary. This use takes `free_symbols` to identify three free symbols which may not always be the case. (It wouldn't be for, say, `F(x,y,z) = [a*x,b*y,0]`, `a` and `b` constants.) In those cases, the notation accepts a tuple to specify the function or vector field and the variables, e.g. (`∇( (f(x,y,z), [x,y,z]) )`, as illustrated; `∇ × (F(x,y,z), [x,y,z])`; or `∇ ⋅ (F(x,y,z), [x,y,z])` where this is written using function calls to produce the symbolic expression in the first positional argument, though a direct expression could also be used. In these cases, the named versions `gradient`, `curl`, and `divergence` may be preferred.
|
||||
""")
|
||||
```
|
||||
!!! note
|
||||
As mentioned, for the symbolic evaluations, a specification of three variables (here `x`, `y`, and `z`) is necessary. This use takes `free_symbols` to identify three free symbols which may not always be the case. (It wouldn't be for, say, `F(x,y,z) = [a*x,b*y,0]`, `a` and `b` constants.) In those cases, the notation accepts a tuple to specify the function or vector field and the variables, e.g. (`∇( (f(x,y,z), [x,y,z]) )`, as illustrated; `∇ × (F(x,y,z), [x,y,z])`; or `∇ ⋅ (F(x,y,z), [x,y,z])` where this is written using function calls to produce the symbolic expression in the first positional argument, though a direct expression could also be used. In these cases, the named versions `gradient`, `curl`, and `divergence` may be preferred.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -588,9 +590,9 @@ p
|
||||
|
||||
Consider the limit definition of the divergence:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\cdot{F} = \lim \frac{1}{\Delta{V}} \oint_S F\cdot\hat{N} dA.
|
||||
~$$
|
||||
```
|
||||
|
||||
In the vector field above, the shape along the curved edges has constant magnitude field. On the left curved edge, the length is smaller and the field is smaller than on the right. The flux across the left edge will be less than the flux across the right edge, and a net flux will exist. That is, there is divergence.
|
||||
|
||||
@@ -747,37 +749,37 @@ Let $f$ and $g$ denote scalar functions, $R^3 \rightarrow R$ and $F$ and $G$ be
|
||||
|
||||
As with the sum rule of univariate derivatives, these operations satisfy:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\nabla(f + g) &= \nabla{f} + \nabla{g}\\
|
||||
\nabla\cdot(F+G) &= \nabla\cdot{F} + \nabla\cdot{G}\\
|
||||
\nabla\times(F+G) &= \nabla\times{F} + \nabla\times{G}.
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
|
||||
### Product rule
|
||||
|
||||
The product rule $(uv)' = u'v + uv'$ has related formulas:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\nabla{(fg)} &= (\nabla{f}) g + f\nabla{g} = g\nabla{f} + f\nabla{g}\\
|
||||
\nabla\cdot{fF} &= (\nabla{f})\cdot{F} + f(\nabla\cdot{F})\\
|
||||
\nabla\times{fF} &= (\nabla{f})\times{F} + f(\nabla\times{F}).
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
|
||||
### Rules over cross products
|
||||
|
||||
The cross product of two vector fields is a vector field for which the divergence and curl may be taken. There are formulas to relate to the individual terms:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\nabla\cdot(F \times G) &= (\nabla\times{F})\cdot G - F \cdot (\nabla\times{G})\\
|
||||
\nabla\times(F \times G) &= F(\nabla\cdot{G}) - G(\nabla\cdot{F} + (G\cdot\nabla)F-(F\cdot\nabla)G\\
|
||||
&= \nabla\cdot(BA^t - AB^t).
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
The curl formula is more involved.
|
||||
|
||||
### Vanishing properties
|
||||
@@ -785,9 +787,9 @@ The curl formula is more involved.
|
||||
Surprisingly, the curl and divergence satisfy two vanishing properties. First
|
||||
|
||||
> The curl of a gradient field is $\vec{0}$
|
||||
> $$~
|
||||
> ```math
|
||||
> \nabla \times \nabla{f} = \vec{0},
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
if the scalar function $f$ is has continuous second derivatives (so the mixed partials do not depend on order).
|
||||
|
||||
@@ -800,14 +802,15 @@ The combination $\nabla\cdot\nabla{f}$ is defined and is called the Laplacian. T
|
||||
Second,
|
||||
|
||||
> The divergence of a curl field is $0$:
|
||||
>$$~
|
||||
>```math
|
||||
>\nabla \cdot(\nabla\times{F}) = 0.
|
||||
> ~$$
|
||||
> ```
|
||||
|
||||
This is not as clear, but can be seen algebraically as terms cancel. First:
|
||||
|
||||
$$~
|
||||
\nabla\cdot(\nabla\times{F}) =
|
||||
```math
|
||||
\begin{align*}
|
||||
\nabla\cdot(\nabla\times{F}) &=
|
||||
\langle
|
||||
\frac{\partial}{\partial{x}},
|
||||
\frac{\partial}{\partial{y}},
|
||||
@@ -816,19 +819,20 @@ $$~
|
||||
\frac{\partial{F_z}}{\partial{y}} - \frac{\partial{F_y}}{\partial{z}},
|
||||
\frac{\partial{F_x}}{\partial{z}} - \frac{\partial{F_z}}{\partial{x}},
|
||||
\frac{\partial{F_y}}{\partial{x}} - \frac{\partial{F_x}}{\partial{y}}
|
||||
\rangle
|
||||
=
|
||||
\rangle \\
|
||||
&=
|
||||
\left(\frac{\partial^2{F_z}}{\partial{y}\partial{x}} - \frac{\partial^2{F_y}}{\partial{z}\partial{x}}\right) +
|
||||
\left(\frac{\partial^2{F_x}}{\partial{z}\partial{y}} - \frac{\partial^2{F_z}}{\partial{x}\partial{y}}\right) +
|
||||
\left(\frac{\partial^2{F_y}}{\partial{x}\partial{z}} - \frac{\partial^2{F_x}}{\partial{y}\partial{z}}\right)
|
||||
~$$
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
Focusing on one component function, $F_z$ say, we see this contribution:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\frac{\partial^2{F_z}}{\partial{y}\partial{x}} -
|
||||
\frac{\partial^2{F_z}}{\partial{x}\partial{y}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
This is zero under the assumption that the second partial derivatives are continuous.
|
||||
|
||||
@@ -887,12 +891,17 @@ This is because of how the line integrals are oriented so that the right-hand ru
|
||||
|
||||
The [invariance of charge](https://en.wikipedia.org/wiki/Maxwell%27s_equations#Charge_conservation) can be derived as a corollary of Maxwell's equation. The divergence of the curl of the magnetic field is $0$, leading to:
|
||||
|
||||
$$~
|
||||
0 = \nabla\cdot(\nabla\times{B}) =
|
||||
\mu_0(\nabla\cdot{J} + \epsilon_0 \nabla\cdot{\frac{\partial{E}}{\partial{t}}}) =
|
||||
\mu_0(\nabla\cdot{J} + \epsilon_0 \frac{\partial}{\partial{t}}(\nabla\cdot{E}))
|
||||
= \mu_0(\nabla\cdot{J} + \frac{\partial{\rho}}{\partial{t}}).
|
||||
~$$
|
||||
```mat
|
||||
\begin{align*}
|
||||
0 &= \nabla\cdot(\nabla\times{B}) \\
|
||||
&=
|
||||
\mu_0(\nabla\cdot{J} + \epsilon_0 \nabla\cdot{\frac{\partial{E}}{\partial{t}}}) \\
|
||||
&=
|
||||
\mu_0(\nabla\cdot{J} + \epsilon_0 \frac{\partial}{\partial{t}}(\nabla\cdot{E})) \\
|
||||
&=
|
||||
\mu_0(\nabla\cdot{J} + \frac{\partial{\rho}}{\partial{t}}).
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
That is $\nabla\cdot{J} = -\partial{\rho}/\partial{t}$.
|
||||
This says any change in the charge density in time ($\partial{\rho}/\partial{t}$) is balanced off by a divergence in the electric current density ($\nabla\cdot{J}$). That is, charge can't be created or destroyed in an isolated system.
|
||||
@@ -907,14 +916,14 @@ From [Wikipedia](https://en.wikipedia.org/wiki/Helmholtz_decomposition) we have
|
||||
|
||||
Let $F$ be a vector field on a **bounded** domain $V$ which is twice continuously differentiable. Let $S$ be the surface enclosing $V$. Then $F$ can be decomposed into a curl-free component and a divergence-free component:
|
||||
|
||||
$$~
|
||||
```math
|
||||
F = -\nabla(\phi) + \nabla\times A.
|
||||
~$$
|
||||
```
|
||||
|
||||
Without explaining why, these values can be computed using volume and
|
||||
surface integrals:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\phi(\vec{r}') &=
|
||||
\frac{1}{4\pi} \int_V \frac{\nabla \cdot F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV -
|
||||
@@ -922,16 +931,16 @@ $$~
|
||||
A(\vec{r}') &= \frac{1}{4\pi} \int_V \frac{\nabla \times F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV +
|
||||
\frac{1}{4\pi} \oint_S \frac{F(\vec{r})}{\|\vec{r}'-\vec{r} \|} \times \hat{N} dS.
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
|
||||
If $V = R^3$, an unbounded domain, *but* $F$ *vanishes* faster than $1/r$, then the theorem still holds with just the volume integrals:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\phi(\vec{r}') &=\frac{1}{4\pi} \int_V \frac{\nabla \cdot F(\vec{r})}{\|\vec{r}'-\vec{r} \|} dV\\
|
||||
A(\vec{r}') &= \frac{1}{4\pi} \int_V \frac{\nabla \times F(\vec{r})}{\|\vec{r}'-\vec{r}\|} dV.
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
## Change of variable
|
||||
@@ -942,7 +951,7 @@ Some details are [here](https://en.wikipedia.org/wiki/Curvilinear_coordinates),
|
||||
|
||||
We restrict to $n=3$ and use $(x,y,z)$ for Cartesian coordinates and $(u,v,w)$ for an *orthogonal* curvilinear coordinate system, such as spherical or cylindrical. If $\vec{r} = \langle x,y,z\rangle$, then
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
d\vec{r} &= \langle dx,dy,dz \rangle = J \langle du,dv,dw\rangle\\
|
||||
&=
|
||||
@@ -953,55 +962,58 @@ d\vec{r} &= \langle dx,dy,dz \rangle = J \langle du,dv,dw\rangle\\
|
||||
\frac{\partial{\vec{r}}}{\partial{v}} dv
|
||||
\frac{\partial{\vec{r}}}{\partial{w}} dw.
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
|
||||
The term ${\partial{\vec{r}}}/{\partial{u}}$ is tangent to the curve formed by *assuming* $v$ and $w$ are constant and letting $u$ vary. Similarly for the other partial derivatives. Orthogonality assumes that at every point, these tangent vectors are orthogonal.
|
||||
|
||||
As ${\partial{\vec{r}}}/{\partial{u}}$ is a vector it has a magnitude and direction. Define the scale factors as the magnitudes:
|
||||
|
||||
$$~
|
||||
```math
|
||||
h_u = \| \frac{\partial{\vec{r}}}{\partial{u}} \|,\quad
|
||||
h_v = \| \frac{\partial{\vec{r}}}{\partial{v}} \|,\quad
|
||||
h_w = \| \frac{\partial{\vec{r}}}{\partial{w}} \|.
|
||||
~$$
|
||||
```
|
||||
|
||||
and let $\hat{e}_u$, $\hat{e}_v$, and $\hat{e}_w$ be the unit, direction vectors.
|
||||
|
||||
This gives the following notation:
|
||||
|
||||
$$~
|
||||
```math
|
||||
d\vec{r} = h_u du \hat{e}_u + h_v dv \hat{e}_v + h_w dw \hat{e}_w.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
From here, we can express different formulas.
|
||||
|
||||
For line integrals, we have the line element:
|
||||
|
||||
$$~
|
||||
```math
|
||||
dl = \sqrt{d\vec{r}\cdot d\vec{r}} = \sqrt{(h_ud_u)^2 + (h_vd_v)^2 + (h_wd_w)^2}.
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
Consider the surface for constant $u$. The vector $\hat{e}_v$ and $\hat{e}_w$ lie in the surface's tangent plane, and the surface element will be:
|
||||
|
||||
$$~
|
||||
```math
|
||||
dS_u = \| h_v dv \hat{e}_v \times h_w dw \hat{e}_w \| = h_v h_w dv dw \| \hat{e}_v \| = h_v h_w dv dw.
|
||||
~$$
|
||||
```
|
||||
|
||||
This uses orthogonality, so $\hat{e}_v \times \hat{e}_w$ is parallel to $\hat{e}_u$ and has unit length. Similarly, $dS_v = h_u h_w du dw$ and $dS_w = h_u h_v du dv$ .
|
||||
|
||||
The volume element is found by *projecting* $d\vec{r}$ onto the $\hat{e}_u$, $\hat{e}_v$, $\hat{e}_w$ coordinate system through $(d\vec{r} \cdot\hat{e}_u) \hat{e}_u$, $(d\vec{r} \cdot\hat{e}_v) \hat{e}_v$, and $(d\vec{r} \cdot\hat{e}_w) \hat{e}_w$. Then forming the triple scalar product to compute the volume of the parallelepiped:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align*}
|
||||
\left[(d\vec{r} \cdot\hat{e}_u) \hat{e}_u\right] \cdot
|
||||
\left(
|
||||
\left[(d\vec{r} \cdot\hat{e}_v) \hat{e}_v\right] \times
|
||||
\left[(d\vec{r} \cdot\hat{e}_w) \hat{e}_w\right]
|
||||
\right) =
|
||||
(h_u h_v h_w) ( du dv dw ) (\hat{e}_u \cdot (\hat{e}_v \times \hat{e}_w) =
|
||||
\right) &=
|
||||
(h_u h_v h_w) ( du dv dw ) (\hat{e}_u \cdot (\hat{e}_v \times \hat{e}_w) \\
|
||||
&=
|
||||
h_u h_v h_w du dv dw,
|
||||
~$$
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
as the unit vectors are orthonormal, their triple scalar product is $1$ and $d\vec{r}\cdot\hat{e}_u = h_u du$, etc.
|
||||
|
||||
@@ -1010,13 +1022,13 @@ as the unit vectors are orthonormal, their triple scalar product is $1$ and $d\v
|
||||
|
||||
We consider spherical coordinates with
|
||||
|
||||
$$~
|
||||
```math
|
||||
F(r, \theta, \phi) = \langle
|
||||
r \sin(\phi) \cos(\theta),
|
||||
r \sin(\phi) \sin(\theta),
|
||||
r \cos(\phi)
|
||||
\rangle.
|
||||
~$$
|
||||
```
|
||||
|
||||
The following figure draws curves starting at $(r_0, \theta_0, \phi_0)$ formed by holding $2$ of the $3$ variables constant. The tangent vectors are added in blue. The surface $S_r$ formed by a constant value of $r$ is illustrated.
|
||||
|
||||
@@ -1061,7 +1073,7 @@ p
|
||||
|
||||
The tangent vectors found from the partial derivatives of $\vec{r}$:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\begin{align}
|
||||
\frac{\partial{\vec{r}}}{\partial{r}} &=
|
||||
\langle \cos(\theta) \cdot \sin(\phi), \sin(\theta) \cdot \sin(\phi), \cos(\phi)\rangle,\\
|
||||
@@ -1070,17 +1082,19 @@ $$~
|
||||
\frac{\partial{\vec{r}}}{\partial{\phi}} &=
|
||||
\langle r\cdot\cos(\theta)\cdot\cos(\phi), r\cdot\sin(\theta)\cdot\cos(\phi), -r\cdot\sin(\phi) \rangle.
|
||||
\end{align}
|
||||
~$$
|
||||
```
|
||||
|
||||
With this, we have $h_r=1$, $h_\theta=r\sin(\phi)$, and $h_\phi = r$. So that
|
||||
|
||||
$$~
|
||||
dl = \sqrt{dr^2 + (r\sin(\phi)d\theta^2) + (rd\phi)^2},\quad
|
||||
dS_r = r^2\sin(\phi)d\theta d\phi,\quad
|
||||
dS_\theta = rdr d\phi,\quad
|
||||
dS_\phi = r\sin(\phi)dr d\theta, \quad\text{and}\quad
|
||||
dV = r^2\sin(\phi) drd\theta d\phi.
|
||||
~$$
|
||||
```math
|
||||
\begin{align*}
|
||||
dl &= \sqrt{dr^2 + (r\sin(\phi)d\theta^2) + (rd\phi)^2},\\
|
||||
dS_r &= r^2\sin(\phi)d\theta d\phi,\\
|
||||
dS_\theta &= rdr d\phi,\\
|
||||
dS_\phi &= r\sin(\phi)dr d\theta, \quad\text{and}\\
|
||||
dV &= r^2\sin(\phi) drd\theta d\phi.
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
The following visualizes the volume and the surface elements.
|
||||
|
||||
@@ -1132,25 +1146,27 @@ p
|
||||
|
||||
If $f$ is a scalar function then $df = \nabla{f} \cdot d\vec{r}$ by the chain rule. Using the curvilinear coordinates:
|
||||
|
||||
$$~
|
||||
df =
|
||||
```math
|
||||
\begin{align*}
|
||||
df &=
|
||||
\frac{\partial{f}}{\partial{u}} du +
|
||||
\frac{\partial{f}}{\partial{v}} dv +
|
||||
\frac{\partial{f}}{\partial{w}} dw
|
||||
=
|
||||
\frac{\partial{f}}{\partial{w}} dw \\
|
||||
&=
|
||||
\frac{1}{h_u}\frac{\partial{f}}{\partial{u}} h_udu +
|
||||
\frac{1}{h_v}\frac{\partial{f}}{\partial{v}} h_vdv +
|
||||
\frac{1}{h_w}\frac{\partial{f}}{\partial{w}} h_wdw.
|
||||
~$$
|
||||
\end{align*}
|
||||
```
|
||||
|
||||
But, as was used above, $d\vec{r} \cdot \hat{e}_u = h_u du$, etc. so $df$ can be re-expressed as:
|
||||
|
||||
$$~
|
||||
```math
|
||||
df = (\frac{1}{h_u}\frac{\partial{f}}{\partial{u}}\hat{e}_u +
|
||||
\frac{1}{h_v}\frac{\partial{f}}{\partial{v}}\hat{e}_v +
|
||||
\frac{1}{h_w}\frac{\partial{f}}{\partial{w}}\hat{e}_w) \cdot d\vec{r} =
|
||||
\nabla{f} \cdot d\vec{r}.
|
||||
~$$
|
||||
```
|
||||
|
||||
The gradient is the part within the parentheses.
|
||||
|
||||
@@ -1158,55 +1174,55 @@ The gradient is the part within the parentheses.
|
||||
|
||||
As an example, in cylindrical coordinates, we have $h_r =1$, $h_\theta=r$, and $h_z=1$, giving:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla{f} = \frac{\partial{f}}{\partial{r}}\hat{e}_r +
|
||||
\frac{1}{r}\frac{\partial{f}}{\partial{\theta}}\hat{e}_\theta +
|
||||
\frac{\partial{f}}{\partial{z}}\hat{e}_z
|
||||
~$$
|
||||
```
|
||||
|
||||
|
||||
### The divergence in a new coordinate system
|
||||
|
||||
The divergence is a result of the limit of a surface integral,
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla \cdot F = \lim \frac{1}{\Delta{V}}\oint_S F \cdot \hat{N} dS.
|
||||
~$$
|
||||
```
|
||||
|
||||
Taking $V$ as a box in the curvilinear coordinates, with side lengths $h_udu$, $h_vdv$, and $h_wdw$
|
||||
the surface integral is computed by projecting $F$ onto each normal area element and multiplying by the area. The task is similar to how the the divergence was derived above, only now the terms are like $\partial{(F_uh_vh_w)}/\partial{u}$ due to the scale factors ($F_u$ is the u component of $F$.) The result is:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\cdot F = \frac{1}{h_u h_v h_w}\left[
|
||||
\frac{\partial{(F_uh_vh_w)}}{\partial{u}} +
|
||||
\frac{\partial{(h_uF_vh_w)}}{\partial{v}} +
|
||||
\frac{\partial{(h_uh_vF_w)}}{\partial{w}} \right].
|
||||
~$$
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
For example, in cylindrical coordinates, we have
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla \cdot F = \frac{1}{r}
|
||||
\left[
|
||||
\frac{\partial{F_r r}}{\partial{r}} +
|
||||
\frac{\partial{F_\theta}}{\partial{\theta}} +
|
||||
\frac{\partial{F_x}}{\partial{z}}
|
||||
\right].
|
||||
~$$
|
||||
```
|
||||
|
||||
### The curl in a new coordinate system
|
||||
|
||||
The curl, like the divergence, can be expressed as the limit of an integral:
|
||||
|
||||
$$~
|
||||
```math
|
||||
(\nabla \times F) \cdot \hat{N} = \lim \frac{1}{\Delta{S}} \oint_C F \cdot d\vec{r},
|
||||
~$$
|
||||
```
|
||||
|
||||
where $S$ is a surface perpendicular to $\hat{N}$ with boundary $C$. For a small rectangular surface, the derivation is similar to above, only the scale factors are included. This gives, say, for the $\hat{e}_u$ normal, $\frac{\partial{(h_zF_z)}}{\partial{y}} - \frac{\partial{(h_yF_y)}}{\partial{z}}$. The following determinant form combines the terms compactly:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times{F} = \det \left[
|
||||
\begin{array}{}
|
||||
h_u\hat{e}_u & h_v\hat{e}_v & h_w\hat{e}_w \\
|
||||
@@ -1214,13 +1230,13 @@ h_u\hat{e}_u & h_v\hat{e}_v & h_w\hat{e}_w \\
|
||||
h_uF_u & h_v F_v & h_w F_w
|
||||
\end{array}
|
||||
\right].
|
||||
~$$
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
For example, in cylindrical coordinates, the curl is:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\det\left[
|
||||
\begin{array}{}
|
||||
\hat{r} & r\hat{\theta} & \hat{k} \\
|
||||
@@ -1228,11 +1244,11 @@ $$~
|
||||
F_r & rF_\theta & F_z
|
||||
\end{array}
|
||||
\right]
|
||||
~$$
|
||||
```
|
||||
|
||||
Applying this to the function $F(r,\theta, z) = \hat{\theta}$ we get:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\text{curl}(F) = \det\left[
|
||||
\begin{array}{}
|
||||
\hat{r} & r\hat{\theta} & \hat{k} \\
|
||||
@@ -1247,7 +1263,7 @@ $$~
|
||||
\end{array}
|
||||
\right] =
|
||||
\hat{k}.
|
||||
~$$
|
||||
```
|
||||
|
||||
As $F$ represents a vector field that rotates about the $z$ axis at a constant rate, the magnitude of the curl should be a constant and it should point in the $\hat{k}$ direction, as we found.
|
||||
|
||||
@@ -1290,8 +1306,8 @@ raw" ``x y + x e^{x y} + \cos{\left (x \right )}``",
|
||||
raw" ``x y + x e^{x y}``",
|
||||
raw" ``x e^{x y} + \cos{\left (x \right )}``"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans)
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1306,8 +1322,8 @@ raw" ``xz``",
|
||||
raw" ``-yz``",
|
||||
raw" ``ye^{xy}``"
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1320,8 +1336,8 @@ raw" ``0``",
|
||||
raw" ``\vec{0}``",
|
||||
raw" ``6``"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans)
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1329,21 +1345,21 @@ radioq(choices, ans)
|
||||
|
||||
In two dimension's the curl of a gradient field simplifies to:
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times\nabla{f} = \nabla\times
|
||||
\langle\frac{\partial{f}}{\partial{x}},
|
||||
\frac{\partial{f}}{\partial{y}}\rangle =
|
||||
\frac{\partial{\frac{\partial{f}}{\partial{y}}}}{\partial{x}} -
|
||||
\frac{\partial{\frac{\partial{f}}{\partial{x}}}}{\partial{y}}.
|
||||
~$$
|
||||
```
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
choices = [
|
||||
L"This is $0$ if the partial derivatives are continuous by Schwarz's (Clairault's) theorem",
|
||||
L"This is $0$ for any $f$, as $\nabla\times\nabla$ is $0$ since the cross product of vector with itself is the $0$ vector."
|
||||
]
|
||||
ans = 1
|
||||
radioq(choices, ans)
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1365,8 +1381,8 @@ choices=[
|
||||
"The field is irrotational (curl free)",
|
||||
"The field has a non-trivial curl and divergence"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ=1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1388,8 +1404,8 @@ choices=[
|
||||
"The field is irrotational (curl free)",
|
||||
"The field has a non-trivial curl and divergence"
|
||||
]
|
||||
ans=2
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ=2
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
###### Question
|
||||
@@ -1403,8 +1419,8 @@ choices=[
|
||||
"The field is irrotational (curl free)",
|
||||
"The field has a non-trivial curl and divergence"
|
||||
]
|
||||
ans=3
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ=3
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1419,8 +1435,8 @@ choices=[
|
||||
"The field is irrotational (curl free)",
|
||||
"The field has a non-trivial curl and divergence"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans, keep_order=true)
|
||||
answ=1
|
||||
radioq(choices, answ, keep_order=true)
|
||||
```
|
||||
|
||||
|
||||
@@ -1431,7 +1447,7 @@ For spherical coordinates, $\Phi(r, \theta, \phi)=r \langle \sin\phi\cos\theta,\
|
||||
|
||||
The curl then will then be
|
||||
|
||||
$$~
|
||||
```math
|
||||
\nabla\times{F} = \det \left[
|
||||
\begin{array}{}
|
||||
\hat{e}_r & r\sin\phi\hat{e}_\theta & r\hat{e}_\phi \\
|
||||
@@ -1439,7 +1455,7 @@ $$~
|
||||
F_r & r\sin\phi F_\theta & r F_\phi
|
||||
\end{array}
|
||||
\right].
|
||||
~$$
|
||||
```
|
||||
|
||||
For a *radial* function $F = h(r)e_r$. (That is $F_r = h(r)$, $F_\theta=0$, and $F_\phi=0$. What is the curl of $F$?
|
||||
|
||||
@@ -1449,6 +1465,6 @@ raw" ``\vec{0}``",
|
||||
raw" ``re_\phi``",
|
||||
raw" ``rh'(r)e_\phi``"
|
||||
]
|
||||
ans=1
|
||||
radioq(choices, ans)
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user