em dash; sentence case
This commit is contained in:
@@ -184,7 +184,7 @@ plot(exp(-1/2)*exp(x^2/2), x0, 2)
|
||||
plot!(xs, ys)
|
||||
```
|
||||
|
||||
Not bad. We wouldn't expect this to be exact - due to the concavity of the solution, each step is an underestimate. However, we see it is an okay approximation and would likely be better with a smaller $h$. A topic we pursue in just a bit.
|
||||
Not bad. We wouldn't expect this to be exact---due to the concavity of the solution, each step is an underestimate. However, we see it is an okay approximation and would likely be better with a smaller $h$. A topic we pursue in just a bit.
|
||||
|
||||
|
||||
Rather than type in the above command each time, we wrap it all up in a function. The inputs are $n$, $a=x_0$, $b=x_n$, $y_0$, and, most importantly, $F$. The output is massaged into a function through a call to `linterp`, rather than two vectors. The `linterp` function[^Interpolations] we define below just finds a function that linearly interpolates between the points and is `NaN` outside of the range of the $x$ values:
|
||||
@@ -263,7 +263,7 @@ Each step introduces an error. The error in one step is known as the *local trun
|
||||
The total error, or more commonly, *global truncation error*, is the error between the actual answer and the approximate answer at the end of the process. It reflects an accumulation of these local errors. This error is *bounded* by a constant times $h$. Since it gets smaller as $h$ gets smaller in direct proportion, the Euler method is called *first order*.
|
||||
|
||||
|
||||
Other, somewhat more complicated, methods have global truncation errors that involve higher powers of $h$ - that is for the same size $h$, the error is smaller. In analogy is the fact that Riemann sums have error that depends on $h$, whereas other methods of approximating the integral have smaller errors. For example, Simpson's rule had error related to $h^4$. So, the Euler method may not be employed if there is concern about total resources (time, computer, ...), it is important for theoretical purposes in a manner similar to the role of the Riemann integral.
|
||||
Other, somewhat more complicated, methods have global truncation errors that involve higher powers of $h$---that is for the same size $h$, the error is smaller. In analogy is the fact that Riemann sums have error that depends on $h$, whereas other methods of approximating the integral have smaller errors. For example, Simpson's rule had error related to $h^4$. So, the Euler method may not be employed if there is concern about total resources (time, computer, ...), it is important for theoretical purposes in a manner similar to the role of the Riemann integral.
|
||||
|
||||
|
||||
In the examples, we will see that for many problems the simple Euler method is satisfactory, but not always so. The task of numerically solving differential equations is not a one-size-fits-all one. In the following, a few different modifications are presented to the basic Euler method, but this just scratches the surface of the topic.
|
||||
@@ -648,7 +648,7 @@ plot(euler2(x0, xn, y0, yp0, 360), 0, 4T)
|
||||
plot!(x -> pi/4*cos(sqrt(g/l)*x), 0, 4T)
|
||||
```
|
||||
|
||||
Even now, we still see that something seems amiss, though the issue is not as dramatic as before. The oscillatory nature of the pendulum is seen, but in the Euler solution, the amplitude grows, which would necessarily mean energy is being put into the system. A familiar instance of a pendulum would be a child on a swing. Without pumping the legs - putting energy in the system - the height of the swing's arc will not grow. Though we now have oscillatory motion, this growth indicates the solution is still not quite right. The issue is likely due to each step mildly overcorrecting and resulting in an overall growth. One of the questions pursues this a bit further.
|
||||
Even now, we still see that something seems amiss, though the issue is not as dramatic as before. The oscillatory nature of the pendulum is seen, but in the Euler solution, the amplitude grows, which would necessarily mean energy is being put into the system. A familiar instance of a pendulum would be a child on a swing. Without pumping the legs---putting energy in the system---the height of the swing's arc will not grow. Though we now have oscillatory motion, this growth indicates the solution is still not quite right. The issue is likely due to each step mildly overcorrecting and resulting in an overall growth. One of the questions pursues this a bit further.
|
||||
|
||||
|
||||
## Questions
|
||||
@@ -794,7 +794,7 @@ Modify the `euler2` function to implement the Euler-Cromer method. What do you s
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
"The same as before - the amplitude grows",
|
||||
"The same as before---the amplitude grows",
|
||||
"The solution is identical to that of the approximation found by linearization of the sine term",
|
||||
"The solution has a constant amplitude, but its period is slightly *shorter* than that of the approximate solution found by linearization",
|
||||
"The solution has a constant amplitude, but its period is slightly *longer* than that of the approximate solution found by linearization"]
|
||||
|
||||
@@ -149,7 +149,7 @@ $$
|
||||
U'(t) = -r U(t), \quad U(0) = U_0.
|
||||
$$
|
||||
|
||||
This shows that the rate of change of $U$ depends on $U$. Large positive values indicate a negative rate of change - a push back towards the origin, and large negative values of $U$ indicate a positive rate of change - again, a push back towards the origin. We shouldn't be surprised to either see a steady decay towards the origin, or oscillations about the origin.
|
||||
This shows that the rate of change of $U$ depends on $U$. Large positive values indicate a negative rate of change---a push back towards the origin, and large negative values of $U$ indicate a positive rate of change---again, a push back towards the origin. We shouldn't be surprised to either see a steady decay towards the origin, or oscillations about the origin.
|
||||
|
||||
|
||||
What will we find? This equation is different from the previous two equations, as the function $U$ appears on both sides. However, we can rearrange to get:
|
||||
@@ -177,7 +177,7 @@ $$
|
||||
In words, the initial difference in temperature of the object and the environment exponentially decays to $0$.
|
||||
|
||||
|
||||
That is, as $t > 0$ goes to $\infty$, the right hand will go to $0$ for $r > 0$, so $T(t) \rightarrow T_a$ - the temperature of the object will reach the ambient temperature. The rate of this is largest when the difference between $T(t)$ and $T_a$ is largest, so when objects are cooling the statement "hotter things cool faster" is appropriate.
|
||||
That is, as $t > 0$ goes to $\infty$, the right hand will go to $0$ for $r > 0$, so $T(t) \rightarrow T_a$---the temperature of the object will reach the ambient temperature. The rate of this is largest when the difference between $T(t)$ and $T_a$ is largest, so when objects are cooling the statement "hotter things cool faster" is appropriate.
|
||||
|
||||
|
||||
A graph of the solution for $T_0=200$ and $T_a=72$ and $r=1/2$ is made as follows. We've added a few line segments from the defining formula, and see that they are indeed tangent to the solution found for the differential equation.
|
||||
@@ -403,7 +403,7 @@ To finish, we call `dsolve` to find a solution (if possible):
|
||||
out = dsolve(eqn)
|
||||
```
|
||||
|
||||
This answer - to a first-order equation - has one free constant, `C₁`, which can be solved for from an initial condition. We can see that when $a > 0$, as $x$ goes to positive infinity the solution goes to $1$, and when $x$ goes to negative infinity, the solution goes to $0$ and otherwise is trapped in between, as expected.
|
||||
This answer---to a first-order equation---has one free constant, `C₁`, which can be solved for from an initial condition. We can see that when $a > 0$, as $x$ goes to positive infinity the solution goes to $1$, and when $x$ goes to negative infinity, the solution goes to $0$ and otherwise is trapped in between, as expected.
|
||||
|
||||
|
||||
The limits are confirmed by investigating the limits of the right-hand:
|
||||
@@ -618,6 +618,7 @@ nothing
|
||||
```
|
||||
|
||||
 would be modeled by a catenary.](./figures/verrazano-narrows-bridge-anniversary-historic-photos-2.jpeg)
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -641,7 +642,7 @@ $$
|
||||
x''(t) = 0, \quad y''(t) = -g.
|
||||
$$
|
||||
|
||||
That is, the $x$ position - where no forces act - has $0$ acceleration, and the $y$ position - where the force of gravity acts - has constant acceleration, $-g$, where $g=9.8m/s^2$ is the gravitational constant. These equations can be solved to give:
|
||||
That is, the $x$ position---where no forces act---has $0$ acceleration, and the $y$ position---where the force of gravity acts---has constant acceleration, $-g$, where $g=9.8m/s^2$ is the gravitational constant. These equations can be solved to give:
|
||||
|
||||
|
||||
$$
|
||||
@@ -957,7 +958,7 @@ radioq(choices, answ)
|
||||
##### Question
|
||||
|
||||
|
||||
The example with projectile motion in a medium has a parameter $\gamma$ modeling the effect of air resistance. If `y` is the answer - as would be the case if the example were copy-and-pasted in - what can be said about `limit(y, gamma=>0)`?
|
||||
The example with projectile motion in a medium has a parameter $\gamma$ modeling the effect of air resistance. If `y` is the answer---as would be the case if the example were copy-and-pasted in---what can be said about `limit(y, gamma=>0)`?
|
||||
|
||||
|
||||
```{julia}
|
||||
@@ -966,7 +967,7 @@ The example with projectile motion in a medium has a parameter $\gamma$ modeling
|
||||
choices = [
|
||||
"The limit is a quadratic polynomial in `x`, mirroring the first part of that example.",
|
||||
"The limit does not exist, but the limit to `oo` gives a quadratic polynomial in `x`, mirroring the first part of that example.",
|
||||
"The limit does not exist -- there is a singularity -- as seen by setting `gamma=0`."
|
||||
"The limit does not exist---there is a singularity---as seen by setting `gamma=0`."
|
||||
]
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
|
||||
Reference in New Issue
Block a user