make pdf file generation work

This commit is contained in:
jverzani
2022-10-10 14:28:05 -04:00
parent a0b913eed8
commit a9ca131870
59 changed files with 884 additions and 1330 deletions

View File

@@ -70,7 +70,6 @@ That is, if we stitched together pieces of the slope field, would we get a curve
```{julia}
#| hold: true
#| echo: false
#| cache: true
## {{{euler_graph}}}
function make_euler_graph(n)
x, y = symbols("x, y")
@@ -241,17 +240,7 @@ It is more work for the computer, but not for us, and clearly a much better appr
## The Euler method
```{julia}
#| hold: true
#| echo: false
imgfile ="figures/euler.png"
caption = """
Figure from first publication of Euler's method. From [Gander and Wanner](http://www.unige.ch/~gander/Preprints/Ritz.pdf).
"""
ImageFile(:ODEs, imgfile, caption)
```
![Figure from first publication of Euler's method. From [Gander and Wanner](http://www.unige.ch/~gander/Preprints/Ritz.pdf).](./figures/euler.png)
The name of our function reflects the [mathematician](https://en.wikipedia.org/wiki/Leonhard_Euler) associated with the iteration:
@@ -361,9 +350,13 @@ caption = """
A child's bead game. What shape wire will produce the shortest time for a bed to slide from a top to the bottom?
"""
ImageFile(:ODEs, imgfile, caption)
#ImageFile(:ODEs, imgfile, caption)
nothing
```
![A child's bead game. What shape wire will produce the shortest time for a bed to slide from a top to the bottom?](./figures/bead-game.jpg)
Restrict our attention to the $x$-$y$ plane, and consider a path, between the point $(0,A)$ and $(B,0)$. Let $y(x)$ be the distance from $A$, so $y(0)=0$ and at the end $y$ will be $A$.
@@ -378,16 +371,22 @@ caption = """
As early as 1638, Galileo showed that an object falling along `AC` and then `CB` will fall faster than one traveling along `AB`, where `C` is on the arc of a circle.
From the [History of Math Archive](http://www-history.mcs.st-and.ac.uk/HistTopics/Brachistochrone.html).
"""
ImageFile(:ODEs, imgfile, caption)
#ImageFile(:ODEs, imgfile, caption)
nothing
```
![As early as 1638, Galileo showed that an object falling along `AC`
and then `CB` will fall faster than one traveling along `AB`, where
`C` is on the arc of a circle. From the [History of Math
Archive](http://www-history.mcs.st-and.ac.uk/HistTopics/Brachistochrone.html).
](./figures/galileo.png)
This simulation also suggests that a curved path is better than the shorter straight one:
```{julia}
#| hold: true
#| echo: false
#| cache: true
##{{{brach_graph}}}
function brach(f, x0, vx0, y0, vy0, dt, n)
@@ -603,13 +602,11 @@ $$
We can try the Euler method here. A simple approach might be this iteration scheme:
$$
\begin{align*}
x_{n+1} &= x_n + h,\\
u_{n+1} &= u_n + h v_n,\\
v_{n+1} &= v_n - h \cdot g/l \cdot \sin(u_n).
\end{align*}
$$
Here we need *two* initial conditions: one for the initial value $u(t_0)$ and the initial value of $u'(t_0)$. We have seen if we start at an angle $a$ and release the bob from rest, so $u'(0)=0$ we get a sinusoidal answer to the linearized model. What happens here? We let $a=1$, $L=5$ and $g=9.8$: