use quarto, not Pluto to render pages

This commit is contained in:
jverzani
2022-07-24 16:38:24 -04:00
parent 93c993206a
commit 7b37ca828c
879 changed files with 793311 additions and 2678 deletions

View File

@@ -10,6 +10,11 @@ using SymPy
using Roots
using QuadGK
using JSON
```
Also, these methods from the `Contour` package:
```julia
import Contour: contours, levels, level, lines, coordinates
```
@@ -155,9 +160,8 @@ surface(xs, ys, 𝒇)
The `surface` function will generate the surface.
```julia; echo=false
note("""Using `surface` as a function name is equivalent to `plot(xs, ys, f, seriestype=:surface)`.""")
```
!!! note
Using `surface` as a function name is equivalent to `plot(xs, ys, f, seriestype=:surface)`.
We can also use `surface(xs, ys, zs)` where `zs` is not a vector, but
rather a *matrix* of values corresponding to a grid described by the
@@ -548,7 +552,6 @@ r2₁(t) = [γ₁(t)..., 0]
plot_parametric!(0..1/2, r2₁, linewidth=5, color=:black) # in the $x$-$y$ plane
```
The vector valued function `r3(t) = [γ(t)..., f(γ(t))]` takes the ``2``-dimensional path specified by $\vec\gamma(t)$ and adds a third, $x$, direction by composing the position with `f`. In this way, a ``2``-D path is visualized with a ``3``-D path. This viewpoint can be reversed, as desired.
However, the composition, $f\circ\vec\gamma$, is a univariate function, so this can also be visualized by
@@ -709,11 +712,8 @@ partial_x(f, y) = x -> ForwardDiff.derivative(u -> f(u,y), x)
```
```julia; echo=false
note("""
For vector-valued functions, we can overide the syntax `'` using `Base.adjoint`, as `'` is treated as a postfix operator in `Julia` for the `adjoint` operation. The symbol `\\nabla` is also available in `Julia`, but it is not an operator, so can't be used as mathematically written `∇f` (this could be used as a name though). In `CalculusWithJulia` a definition is made so essentially `∇(f) = x -> ForwardDiff.gradient(f, x)`. It does require parentheses to be called, as in `∇(f)`.
""")
```
!!! note
For vector-valued functions, we can overide the syntax `'` using `Base.adjoint`, as `'` is treated as a postfix operator in `Julia` for the `adjoint` operation. The symbol `\\nabla` is also available in `Julia`, but it is not an operator, so can't be used as mathematically written `∇f` (this could be used as a name though). In `CalculusWithJulia` a definition is made so essentially `∇(f) = x -> ForwardDiff.gradient(f, x)`. It does require parentheses to be called, as in `∇(f)`.
#### Symbolic expressions
@@ -1409,8 +1409,8 @@ From the graph, is the value of $f(1/2, 1)$ positive or negative?
```julia; hold=true; echo=false
choices = ["positive", "negative"]
ans = 1
radioq(choices, ans, keep_order=true)
answ = 1
radioq(choices, answ, keep_order=true)
```
@@ -1421,8 +1421,8 @@ choices = [
L"The line $x=0$",
L"The line $y=0$"
]
ans = 1
radioq(choices, ans, keep_order=true)
answ = 1
radioq(choices, answ, keep_order=true)
```
Consider the contour plot
@@ -1449,8 +1449,8 @@ L"is around $(0.7, 0)$ and with a value less than $-0.4$",
L"is around $(-2.0, 0)$ and with a value less than $-0.4$",
L"is around $(2.0, 0)$ and with a value less than $-0.4$"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
From this graph, where is the surface steeper?
@@ -1462,8 +1462,8 @@ L"near $(1/2, 0)$",
L"near $(3/4, 0)$",
L"near $(1, 0)$"
]
ans = 1
radioq(choices, ans, keep_order=true)
answ = 1
radioq(choices, answ, keep_order=true)
```
###### Question
@@ -1483,8 +1483,8 @@ choices = [
L"Yes, the closed loops near $(-1.5, 0)$ and $(1.5, 0)$ will contain these",
L"No, the vertical lines parallel to $x=0$ show this function to be flat"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
Imagine hiking on this surface within this region. Could you traverse from left to right without having to go up or down?
@@ -1519,8 +1519,8 @@ choices = [
"running essentially parallel to the contour lines",
"running essentially perpendicular to the contour lines"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
Why?
@@ -1530,8 +1530,8 @@ choices = [
"By being essentially parallel, the steepness of the roadway can be kept to a passable level",
"By being essentially perpendicular, the road can more quickly climb up the mountain"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
The pass is at about 2700 meters. As shown towards the top and bottom of the figure the contour lines show increasing heights, and to the left and right decreasing heights. The shape of the [pass](https://en.wikipedia.org/wiki/Mountain_pass) would look like:
@@ -1541,8 +1541,8 @@ choices = [
"A saddle-like shape, called a *col* or *gap*",
"A upside down bowl-like shape like the top of a mountain"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
###### Question
@@ -1561,8 +1561,8 @@ L"When $i(\vec{x}) = 0$",
L"When any of $f(\vec{x})$, $g(\vec{x})$, or $i(\vec{x})$ are zero",
L"The limit exists everywhere, as the function $f$, $g$, $h$, and $i$ have limits at $\vec{c}$ by assumption"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
###### Question
@@ -1602,8 +1602,8 @@ raw"`` \langle \cos(2y), \cos(y) \rangle``",
raw"`` \langle \sin(x), \sin(2x) \rangle``",
raw"`` \sin(x)\cos(2y)``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
Compute $f_y$
@@ -1615,8 +1615,8 @@ raw"`` \langle 2\sin(x), \sin(2x) \rangle``",
raw"`` \langle -2\sin(2y), -\sin(y) \rangle``",
raw"`` - \sin(2x)\sin(y)``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
@@ -1654,16 +1654,16 @@ The gradient is:
```julia; hold=true; echo=false
choices = ["two dimensional", "three dimensional"]
ans = 1
radioq(choices, ans, keep_order=true)
answ = 1
radioq(choices, answ, keep_order=true)
```
The surface is:
```julia; hold=true; echo=false
choices = ["two dimensional", "three dimensional"]
ans = 2
radioq(choices, ans, keep_order=true)
answ = 2
radioq(choices, answ, keep_order=true)
```
The gradient points in the direction of greatest increase of $f$. If a person were on a hill described by $z=f(x,y)$, what three dimensional vector would they follow to go the steepest way up the hill?
@@ -1674,8 +1674,8 @@ choices = [
raw"`` \langle -f_x, -f_y, 1 \rangle``",
raw"`` \langle f_x, f_y \rangle``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
##### Question
@@ -1700,8 +1700,8 @@ choices = [
raw"`` (f\circ\vec\gamma)(x,y)``",
raw"`` \vec\gamma(x,y)``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
A climber leaves base camp at $t_0$. At time $t > t_0$, what describes her elevation?
@@ -1712,8 +1712,8 @@ choices = [
raw"`` \vec\gamma(t)``",
raw"`` f(t)``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
What does the vector-valued function $\vec{r}(t) = \langle x(t), y(t), (f\circ\vec\gamma(t))\rangle$ describe:
@@ -1723,8 +1723,8 @@ choices = [
"The three dimensional position of the climber",
"The climbers gradient, pointing in the direction of greatest ascent"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
In the figure, the climbers are making a switch back, so as to avoid the steeper direct ascent. Mathematically $\nabla{f}(\vec\gamma(t)) \cdot \vec\gamma'(t)$ describes the directional derivative that they follow. Using $\|\vec{u}\cdot\vec{v}\| = \|\vec{u}\|\|\vec{v}\|\cos(\theta)$, does this route:
@@ -1735,8 +1735,8 @@ choices = [
L"Keep $\cos(\theta)$ as close to $1$ as possible, so the slope taken is as big as possible",
L"Keep $̧\cos(\theta)$ as close to $0$ as possible, so that they climbers don't waste energy going up and down"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
Suppose our climber reaches the top at time $t$. What would be $(f\circ\vec\gamma)'(t)$, assuming the derivative exists?
@@ -1747,8 +1747,8 @@ choices = [
L"It would be $\langle f_x, f_y\rangle$ and point towards the sky, the direction of greatest ascent",
"It would not exist, as there would not be enough oxygen to compute it"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
###### Question
@@ -1765,8 +1765,8 @@ raw"`` |\hat{T} \cdot \hat{P}| \leq \cos(π/18)``",
raw"`` |\hat{T} \cdot \hat{P}| \leq \sin(\pi/18)``",
raw"`` |\hat{T} \cdot \hat{P}| \leq \pi/18``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
The normal to the surface $z=f(x,y)$ is *not* the normal to the trail tread. Suppose $\vec{N}(t)$ is a function that returns this. At the same point $\vec\gamma(t)$, let $\vec{M} = \langle -f_x, -f_y, 0\rangle$ be a vector in 3 dimensions pointing downhill. Let "hats" indicate unit vectors. The outward slope is $\pi/2$ minus the angle between $\hat{N}$ and $\hat{M}$. What condition will ensure this angle is $5$ degrees ($\pi/36$ radians)?
@@ -1777,8 +1777,8 @@ choices = [
raw"`` |\hat{N} \cdot \hat{M}| \leq \sin(\pi/2 - \pi/18)``",
raw"`` |\hat{N} \cdot \hat{M}| \leq \pi/2 - \pi/18``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
@@ -1797,8 +1797,8 @@ choices = [
raw"`` 2 \cos{\left (3 \right )} - 7 \sin{\left (3 \right )}``",
raw"`` 4 x^{2} y \sin{\left (x - y^{2} \right )} - x^{2} \sin{\left (x - y^{2} \right )} + 2 x \cos{\left (x - y^{2} \right )}``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
@@ -1813,8 +1813,8 @@ choices = [
"Yes, by definition",
L"No, not unless $\vec{v}$ were a unit vector"
]
ans = 2
radioq(choices, ans)
answ = 2
radioq(choices, answ)
```
###### Question
@@ -1831,8 +1831,8 @@ choices = [
raw"`` \langle 4x^3, 2z, 2y\rangle``",
raw"`` \langle x^3 + 2x + 2x, 2y+ y^3, 2x\rangle``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
The value of $\vec\gamma'(t)$ is:
@@ -1843,8 +1843,8 @@ choices = [
raw"`` 1 + 2y + 3t^2``",
raw"`` \langle 1,2, 3 \rangle``"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
The value of $(f\circ\vec\gamma)'(t)$ is found by:
@@ -1855,8 +1855,8 @@ choices = [
L"Taking the dot product of $\nabla{f}(\vec\gamma'(t))$ and $\vec\gamma(t)$",
L"Taking the dot product of $\nabla{f}(x,y,z)$ and $\vec\gamma'(t)$"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
@@ -1887,8 +1887,8 @@ choices = [
"The green one",
"The red one"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
@@ -1915,8 +1915,8 @@ choices = [
"The green one",
"The red one"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
@@ -1947,8 +1947,8 @@ choices = [
L"Linear means $H$ is linear, so $g(\vec{x})$ describes a plane",
L"Linear means $H$ is the $0$ matrix, so the gradient couldn't have been $\vec{0}$"
]
ans = 1
radioq(choices, ans)
answ = 1
radioq(choices, answ)
```
Suppose, $H$ has the magic property that for *any* vector $\vec{v}^tH\vec{v} < 0$. What does this imply:
@@ -1959,8 +1959,8 @@ choices = [
L"That $g(\vec{x}) = f(\vec{c})$",
L"That $g(\vec{x}) \leq f(\vec{c})$"
]
ans = 1
radioq(choices, ans, keep_order=true)
answ = 1
radioq(choices, answ, keep_order=true)
```
###### Question
@@ -1974,8 +1974,8 @@ choices = [
raw"`` \partial^4{f}/\partial{x^2}\partial{y^2}``",
raw"`` \partial^4{f}/\partial{x^1}\partial{y^3}``"
]
ans = 1
radioq(choices, ans, keep_order=true)
answ = 1
radioq(choices, answ, keep_order=true)
```
###### Question
@@ -1993,8 +1993,8 @@ choices = [
raw"`` f_{yy}``"
]
x,y=1/2, 2
val, ans = findmax([6x*y, 3x^2, 6*y, 6x, 0])
radioq(choices, ans, keep_order=true)
val, answ = findmax([6x*y, 3x^2, 6*y, 6x, 0])
radioq(choices, answ, keep_order=true)
```
###### Question
@@ -2024,15 +2024,15 @@ Whereas,
At $(0,0)$ what is $ \frac{\partial \frac{\partial f}{\partial x}}{ \partial y}$?
```julia; hold=true; echo=false
ans = -1
numericq(ans)
answ = -1
numericq(answ)
```
At $(0,0)$ what is $ \frac{\partial \frac{\partial f}{\partial y}}{ \partial x}$?
```julia; hold=true; echo=false
ans = 1
numericq(ans)
answ = 1
numericq(answ)
```
Away from $(0,0)$ the mixed partial is $\frac{x^{6} + 9 x^{4} y^{2} - 9 x^{2} y^{4} - y^{6}}{x^{6} + 3 x^{4} y^{2} + 3 x^{2} y^{4} + y^{6}}$.
@@ -2043,8 +2043,8 @@ choices = [
L"This is not continuous at $(0,0)$, still the limit along the two paths $x=0$ and $y=0$ are equivalent.",
L"This is not continuous at $(0,0)$, as the limit along the two paths $x=0$ and $y=0$ are not equivalent."
]
ans = 3
radioq(choices, ans)
answ = 3
radioq(choices, answ)
```
###### Question
@@ -2096,8 +2096,8 @@ L"The Burgers equation: $f_t + ff_x = f_{xx}$; describes waves at the beach whic
L"The KdV equation: $f_t + 6ff_x+ f_{xxx} = 0$; models water waves in a narrow channel",
L"The Schrodinger equation: $f_t = (i\hbar/(2m))f_xx$; used to describe a quantum particle of mass $m$"
]
ans = 3
radioq(ode_choices, ans, keep_order=true)
answ = 3
radioq(ode_choices, answ, keep_order=true)
```
@@ -2106,8 +2106,8 @@ radioq(ode_choices, ans, keep_order=true)
What equation does the function $f(t, x) = sin(x-t) + sin(x+t)$ satisfy?
```julia; hold=true; echo=false
ans = 1
radioq(ode_choices, ans, keep_order=true)
answ = 1
radioq(ode_choices, answ, keep_order=true)
```
@@ -2116,14 +2116,14 @@ radioq(ode_choices, ans, keep_order=true)
What equation does the function $f(t, x) = e^{-(x+t)^2}$ satisfy?
```julia; hold=true; echo=false
ans = 4
radioq(ode_choices, ans, keep_order=true)
answ = 4
radioq(ode_choices, answ, keep_order=true)
```
What equation does the function $f(x,y) = \cos(x) + \sin(y)$ satisfy?
```julia; hold=true; echo=false
ans = 5
radioq(ode_choices, ans, keep_order=true)
answ = 5
radioq(ode_choices, answ, keep_order=true)
```