align fix; theorem style; condition number

This commit is contained in:
jverzani
2024-10-31 14:22:21 -04:00
parent 3e7e3a9727
commit 18aae2aa93
61 changed files with 1705 additions and 819 deletions

View File

@@ -302,20 +302,20 @@ We could also do the above problem symbolically with the aid of `SymPy`. Here ar
```{julia}
@syms 𝐰::real 𝐡::real
@syms w₀::real h₀::real
𝐀₀ = 𝐰 * 𝐡 + pi * (𝐰/2)^2 / 2
𝐏erim = 2*𝐡 + 𝐰 + pi * 𝐰/2
𝐡₀ = solve(𝐏erim - 20, 𝐡)[1]
𝐀₁ = 𝐀₀(𝐡 => 𝐡₀)
𝐰₀ = solve(diff(𝐀₁,𝐰), 𝐰)[1]
A₀ = w₀ * h₀ + pi * (w₀/2)^2 / 2
Perim = 2*h₀ + w₀ + pi * w₀/2
h₁ = solve(Perim - 20, h₀)[1]
A₁ = A₀(h₀ => h₁)
w₁ = solve(diff(A₁,w₀), w₀)[1]
```
We know that `𝐰₀` is the maximum in this example from our previous work. We shall see soon, that just knowing that the second derivative is negative at `𝐰₀` would suffice to know this. Here we check that condition:
We know that `w₀` is the maximum in this example from our previous work. We shall see soon, that just knowing that the second derivative is negative at `w₀` would suffice to know this. Here we check that condition:
```{julia}
diff(𝐀₁, 𝐰, 𝐰)(𝐰 => 𝐰₀)
diff(A₁, w₀, w₀)(w₀ => w₁)
```
As an aside, compare the steps involved above for a symbolic solution to those of previous work for a numeric solution:
@@ -614,7 +614,7 @@ We see two terms: one with $x=L$ and another quadratic. For the simple case $r_0
```{julia}
solve(q(r1=>r0), x)
solve(q(r1=>r0) ~ 0, x)
```
Well, not so fast. We need to check the other endpoint, $x=0$:
@@ -632,7 +632,7 @@ Now, if, say, travel above the line is half as slow as travel along, then $2r_0
```{julia}
out = solve(q(r1 => 2r0), x)
out = solve(q(r1 => 2r0) ~ 0, x)
```
It is hard to tell which would minimize time without more work. To check a case ($a=1, L=2, r_0=1$) we might have
@@ -1372,11 +1372,12 @@ solve(x/b ~ (x+a)/(b + b*p), x)
With $x = a/p$ we get by Pythagorean's theorem that
$$
\begin{align*}
c^2 &= (a + a/p)^2 + (b + bp)^2 \\
&= a^2(1 + \frac{1}{p})^2 + b^2(1+p)^2.
\end{align*}
$$
The ladder problem minimizes $c$ or equivalently $c^2$.