Last time | Next time |
Today:
This is your last "homework" to turn in; any other assignments will be part of your final takehome (thinking of 6.2, 6.3). And these are given on your assignment page.
The idea is to approach solving the ODE by using integration, which he observes tends to be a very stable operation.
An ODE of the form \(\dot{y} = f(t,y)\) with \(y(t_{0}) = y_{0}\) has an exact solution that can be written in terms of an integral: \[ \int_{t_{0}}^{\tilde{t}}\dot{y}\,dt = \int_{t_{0}}^{\tilde{t}}f(t,y)\,dt\nonumber \hspace{1cm} \longrightarrow \hspace{1cm} y(\tilde{t})-y(t_{0}) = \int_{t_{0}}^{\tilde{t}}f(t,y)\,dt\nonumber \hspace{1cm} \longrightarrow \hspace{1cm} y(\tilde{t}) = y(t_{0})+\int_{t_{0}}^{\tilde{t}}f(t,y)\,dt. \]
Trouble is, we've got no idea what that \(y\) is in the integrand; in fact, that's what we want!:)
Easy peasy!
\[ y_{i+1}=y_{i}+\frac{h}{2}\left[f(t_{i},y_{i})+f(t_{i+1},y_{i}+h\cdot f(t_{i},y_{i}))\right]. \]
\[ \begin{eqnarray*} k_{1} & = & f(t_{i},y_{i})\\ k_{2} & = & f\left(t_{i}+\frac{h}{2},y_{i}+\frac{h}{2}k_{1}\right)\\ k_{3} & = & f(t_{i+1},y_{i}+hk_{2})\\ y_{i+1} & = & y_{i}+\frac{h}{6}\left[k_{1}+4k_{2}+k_{3}\right]. \end{eqnarray*} \]
The choice above is suboptimal as the author emphasizes in this section -- there's a failure of the method to "live up to its hype".
\[ \begin{eqnarray*} k_{1} & = & f(t_{i},y_{i})\\ k_{2} & = & f\left(t_{i}+\frac{h}{2},y_{i}+\frac{h}{2}k_{1}\right)\\ k_{3} & = & f\left(t_{i}+\frac{h}{2},y_{i}+\frac{h}{2}k_{2}\right)\\ k_{4} & = & f(t_{i+1},y_{i}+hk_{3})\\ y_{i+1} & = & y_{i}+\frac{h}{6}\left[k_{1}+2k_{2}+2k_{3}+k_{4}\right]. \end{eqnarray*} \]
These choices are motivated by matching terms in Taylor series expansions, as one can see in the Crumpet.
It's not quite what you're asked to do in this algorithm, however, since you're to keep track of the errors, and keep poking at the largest:
But the idea is really swell, and I am delighted by this method!
Here's another picture of how we might build one of these.