Merge pull request #110 from fangliu-tju/main

update vector_fields.qmd
This commit is contained in:
john verzani 2023-06-27 09:01:46 -04:00 committed by GitHub
commit 7f3acefd00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,17 +164,10 @@ zs = [Z(theta, phi) for theta in thetas, phi in phis]
surface(xs, ys, zs) ## see note
```
:::{.callout-note}
## Note
:::
Only *some* backends for `Plots` will produce this type of plot. Both `plotly()` and `pyplot()` will, but not `gr()`.
:::{.callout-note}
## Note
PyPlot can be used directly to make these surface plots: `import PyPlot; PyPlot.plot_surface(xs,ys,zs).
PyPlot can be used directly to make these surface plots: `import PyPlot; PyPlot.plot_surface(xs,ys,zs).`
:::
@ -216,7 +209,7 @@ At the point $(\theta, \phi) = (\pi/12, \pi/6)$ this evaluates to the following.
```{julia}
subs.(out, theta.=> PI/12, phi.=>PI/6) .|> N
subs.(out, theta=> PI/12, phi=>PI/6) .|> N
```
We found numeric values, so that we can compare to the numerically identical values computed by the `jacobian` function from `ForwardDiff`:
@ -300,7 +293,7 @@ After specializing the total derivative to the cases already discussed, we have:
* Univariate functions. Here $f'(t)$ is also univariate. Identifying $J$ with the $1 \times 1$ matrix with component $f'(t)$, then the total derivative is just a restatement of the derivative existing.
* Vector-valued functions $\vec{f}(t) = \langle f_1(t), f_2(t), \dots, f_m(t) \rangle$, each component univariate. Then the derivative, $\vec{f}'(t) = \langle \frac{df_1}{dt}, \frac{df_2}{dt}, \dots, \frac{df_m}{dt} \rangle$. The total derivative in this case, is a a $m \times 1$ vector of partial derivatives, and since there is only $1$ variable, would be written without partials. So the two agree.
* Vector-valued functions $\vec{f}(t) = \langle f_1(t), f_2(t), \dots, f_m(t) \rangle$, each component univariate. Then the derivative, $\vec{f}'(t) = \langle \frac{df_1}{dt}, \frac{df_2}{dt}, \dots, \frac{df_m}{dt} \rangle$. The total derivative in this case, is a $m \times 1$ vector of partial derivatives, and since there is only $1$ variable, would be written without partials. So the two agree.
* Scalar functions $f(\vec{x}) = a$ of type $R^n \rightarrow R$. The
@ -433,7 +426,7 @@ The determinant, of geometric interest, will be
det(Jac) |> simplify
```
The determinant is of interest, as the linear mapping represented by the Jacobian changes the area of the associated coordinate vectors. The determinant describes ow this area changes, as a multiplying factor.
The determinant is of interest, as the linear mapping represented by the Jacobian changes the area of the associated coordinate vectors. The determinant describes how this area changes, as a multiplying factor.
##### Example Spherical Coordinates
@ -462,7 +455,7 @@ Some mappings are:
| Cartesian (x,y,z) | Spherical ($r$, $\theta$, $\phi$) | Cylindrical ($r$, $\theta$, $z$) |
|:-----------------:|:---------------------------------:|:--------------------------------:|
| (1, 1, 0) | $(\sqrt{2}, \pi/4, \pi/2)$ | $(\sqrt{2},\pi/4, 0)$ |
| (0, 1, 1) | $(\sqrt{2}, 0, \pi/4)$ | $(\sqrt{2}, 0, 1)$ |
| (1, 0, 1) | $(\sqrt{2}, 0, \pi/4)$ | $(\sqrt{2}, 0, 1)$ |
---
@ -663,7 +656,7 @@ det(A1), 1/det(A2)
##### Example: Implicit Differentiation, the Implicit Function Theorem
The technique of *implicit differentiation* is a useful one, as it allows derivatives of more complicated expressions to be found. The main idea, expressed here with three variables is if an equation may be viewed as $F(x,y,z) = c$, $c$ a constant, then $z=\phi(x,y)$ may be viewed as a function of $x$ and $y$. Hence, we can use the chain rule to find: $\partial z / \partial x$ and $\partial z /\partial x$. Let $G(x,y) = \langle x, y, \phi(x,y) \rangle$ and then differentiation $(F \circ G)(x,y) = c$:
The technique of *implicit differentiation* is a useful one, as it allows derivatives of more complicated expressions to be found. The main idea, expressed here with three variables is if an equation may be viewed as $F(x,y,z) = c$, $c$ a constant, then $z=\phi(x,y)$ may be viewed as a function of $x$ and $y$. Hence, we can use the chain rule to find: $\partial z / \partial x$ and $\partial z /\partial y$. Let $G(x,y) = \langle x, y, \phi(x,y) \rangle$ and then differentiation $(F \circ G)(x,y) = c$:
@ -732,7 +725,7 @@ We would like to express the tangent plane in terms of $\partial{z}/\partial{x}$
$$
\frac{2x}{a^2} + \frac{2z}{c^2} \frac{\partial{z}}{\partial{x}} = 0, \quad
\frac{2y}{a^2} + \frac{2z}{c^2} \frac{\partial{z}}{\partial{y}} = 0.
\frac{2y}{b^2} + \frac{2z}{c^2} \frac{\partial{z}}{\partial{y}} = 0.
$$
Solving, we get
@ -741,7 +734,7 @@ Solving, we get
$$
\frac{\partial{z}}{\partial{x}} = -\frac{2x}{a^2}\frac{c^2}{2z},
\quad
\frac{\partial{z}}{\partial{y}} = -\frac{2y}{a^2}\frac{c^2}{2z},
\frac{\partial{z}}{\partial{y}} = -\frac{2y}{b^2}\frac{c^2}{2z},
$$
*provided* $z \neq 0$. At $z=0$ the tangent plane exists, but we can't describe it in this manner, as it is vertical. However, the choice of variables to use is not fixed in the theorem, so if $x \neq 0$ we can express $x = x(y,z)$ and express the tangent plane in terms of $\partial{x}/\partial{y}$ and $\partial{x}/\partial{z}$. The answer is similar to the above, and we won't repeat. Similarly, should $x = z = 0$, the $y \neq 0$ and we can use an implicit definition $y = y(x,z)$ and express the tangent plane through $\partial{y}/\partial{x}$ and $\partial{y}/\partial{z}$.
@ -1006,7 +999,7 @@ Let $z\sin(z) = x^3y^2 + z$. Compute $\partial{z}/\partial{x}$ implicitly.
#| hold: true
#| echo: false
choices = [
raw"`` 3x^2y^2/(z\cos(z) + \sin(z) + 1)``",
raw"`` 3x^2y^2/(z\cos(z) + \sin(z) - 1)``",
raw"`` 2x^3y/ (z\cos(z) + \sin(z) + 1)``",
raw"`` 3x^2y^2``"
]
@ -1017,7 +1010,7 @@ radioq(choices, answ)
###### Question
Let $x^4 + y^4 + z^4 + x^2y^2z^2 = 1$. Compute $\partial{z}/\partial{y}$ implicitly.
Let $x^4 - y^4 - z^4 + x^2y^2z^2 = 1$. Compute $\partial{z}/\partial{y}$ implicitly.
```{julia}