This commit is contained in:
jverzani
2025-04-23 11:35:45 -04:00
parent 30be930f0f
commit b5f0300921
3 changed files with 113 additions and 72 deletions

View File

@@ -24,7 +24,7 @@ For a scalar function $f: R^n \rightarrow R$, the gradient of $f$, $\nabla{f}$,
| $f: R\rightarrow R$ | univariate | familiar graph of function | $f$ |
| $f: R\rightarrow R^m$ | vector-valued | space curve when n=2 or 3 | $\vec{r}$, $\vec{N}$ |
| $f: R^n\rightarrow R$ | scalar | a surface when n=2 | $f$ |
| $F: R^n\rightarrow R^n$ | vector field | a vector field when n=2 | $F$ |
| $F: R^n\rightarrow R^n$ | vector field | a vector field when n=2, 3| $F$ |
| $F: R^n\rightarrow R^m$ | multivariable | n=2,m=3 describes a surface | $F$, $\Phi$ |
@@ -34,7 +34,9 @@ After an example where the use of a multivariable function is of necessity, we d
## Vector fields
We have seen that the gradient of a scalar function, $f:R^2 \rightarrow R$, takes a point in $R^2$ and associates a vector in $R^2$. As such $\nabla{f}:R^2 \rightarrow R^2$ is a vector field. A vector field can be visualized by sampling a region and representing the field at those points. The details, as previously mentioned, are in the `vectorfieldplot` function of `CalculusWithJulia`.
We have seen that the gradient of a scalar function, $f:R^2 \rightarrow R$, takes a point in $R^2$ and associates a vector in $R^2$. As such $\nabla{f}:R^2 \rightarrow R^2$ is a vector field. A vector field is a vector-valued function from $R^n \rightarrow R^n$ for $n \geq 2$.
An input/output pair can be visualized by identifying the input values as a point, and the output as a vector visualized by anchoring the vector at the point. A vector field is a sampling of such pairs, usually taken over some ordered grid. The details, as previously mentioned, are in the `vectorfieldplot` function of `CalculusWithJulia`.
```{julia}
@@ -1071,7 +1073,7 @@ Adjusting $f$ to have a vanishing second -- but not third -- derivative at $c_0$
As for $g_1$, we have by construction $g_1(b_0) = 0$. By differentiation we get a pattern for some constants $c_j = (j+1)\cdot(j+2)\cdots \cdot k$ with $c_k = 1$.
$$
g^{(k)}(b) = k! \cdot \frac{f(a_0) - f(b)}{(a_0-b)^{k+1}} - \sum_{j=1}^k c_j \frac{f^{(j)}(b)}{(a_0 - b)^{k-j+1}}.
g^{(k)}(b) = k! \cdot \frac{f(a_0) - f(b)}{(a_0-b)^{k+1}} - \sum_{j=1}^k c_j \frac{f^{(j)}(b)}{(a_0 - b)^{k-j+1}}.
$$
Of note that when $f(a_0) = f(b_0) = 0$ that if $f^{(k)}(b_0)$ is the first non-vanishing derivative of $f$ at $b_0$ that $g^{(k)}(b_0) = f^{(k)}(b_0)/(b_0 - a_0)$ (they have the same sign).
@@ -1146,6 +1148,30 @@ This handles most cases, but leaves the possibility that a function with infinit
## Questions
##### Question
```{julia}
#| echo: false
gr()
p1 = vectorfieldplot((x,y) -> [x,y], xlim=(-4,4), ylim=(-4,4), nx=9, ny=9, title="A");
p2 = vectorfieldplot((x,y) -> [x-y,x], xlim=(-4,4), ylim=(-4,4), nx=9, ny=9,title="B");
p3 = vectorfieldplot((x,y) -> [y,0], xlim=(-4,4), ylim=(-4,4), nx=9, ny=9, title="C");
p4 = vectorfieldplot((x,y) -> [-y,x], xlim=(-4,4), ylim=(-4,4), nx=9, ny=9, title="D");
plot(p1, p2, p3, p4; layout=[2,2])
```
In the above figure, match the function with the vector field plot.
```{julia}
#| echo: false
plotly()
matchq(("`F(x,y)=[-y ,x]`", "`F(x,y)=[y,0]`",
"`F(x,y)=[x-y,x]`", "`F(x,y)=[x,y]`"),
("A", "B", "C", "D"),
(4,3,2,1);
label="For each function mark the correct vector field plot"
)
```
###### Question