next up previous
Next: About this document ...


Numerical Solutions of Differential Equations

A differential equation


\begin{displaymath}y' = f(y,t)\end{displaymath}

may be approximated as a difference equation.

If $\Delta t \approx 0$, then

\begin{eqnarray*}
y(a+\Delta t) & \approx & y(a) + y'(a) \Delta t \\
& = & y(a) + f(y(a),a) \Delta t
\end{eqnarray*}


Euler's Method

Iterating the approximation $y(a + \Delta t) \approx y(a) + f(y(a),a) \Delta t$, we can numerically approximate solutions to initial value problems $y' = f(y,t)$ and $y(t_0) = y_0$.

That is, given that $y$ satisfies the above initial value problem, to approximate $y(a)$, fix a positive integer $n$, set $\Delta = \frac{a -t_0}{n}$, and define $t_i := t_0 + i \Delta$ (for $0 \leq i \leq n$).


Euler's method, continued

We know that $y(t_0) = y_0$. Approximating, we have

\begin{eqnarray*}
y(t_1) & = & y(t_0 + \Delta) \\
& \approx & y(t_0) + \Delta y'(t_0) \\
& = & y_0 + \Delta f(y_0,t_0) \\
& =: & y_1
\end{eqnarray*}

Repeating this process, we find that $y(t_2) \approx y_1 + \Delta f(y_1,t_1) =: y_2$, ..., $y(a) = y(t_n) \approx y_{n-1} + \Delta f(y_{n-1},t_{n-1})$.


Example

Approximate the value of $y(1)$ when $y' = ty + 1$ and $y(0) = 0$ using $n = 2$.


Solution

Note that a symbolically solve $y' = ty + 1$ one must find an antiderivative to $e^{-\frac{1}{2}t^2}$.

Here $\Delta = \frac{1 - 0}{2} = 0.5$.

We compute

\begin{eqnarray*}
y(.5) & \approx & 0 + (0.5) ( 0 (0) + 1) \\
& = & 0.5 \\
& = & y_1
\end{eqnarray*}

\begin{eqnarray*}
y(1) & \approx & 0.5 + (0.5) ((0.5) (0.5) + 1) \\
& = & 0.5 + 0.5 (1.25) \\
& = & 0.5 + 0.625 \\
& = & 1.125
\end{eqnarray*}


Another Example

Approximate $y(1)$ when $y' = \sin(y)$ and $y(0) = .1$ using $n = 5$ subdivisions.


Obstructions to symbolic solutions

This time, our symbolic methods fail twice! To use the method of separation of variables, we would need to find an antiderivative of $\csc(y)$. Even if we were to succeed with this step, we would have to invert the function $\int \csc(y) dy$.


Solution

In this case, we compute mechanically.

$\Delta = \frac{1 - 0}{5} = 0.2$, $y_0 = 0.1$, and we wish to find $y_5 \approx y(1)$.

\begin{eqnarray*}
y(.2) & \approx & y_0 + \Delta \sin(y_0) \\
& = & 0.1 + (0.2...
...000 + (0.2000) (0.0998) \\
& \approx & 0.1200 \\
& =: & y_1
\end{eqnarray*}

\begin{eqnarray*}
y(.4) & \approx & y_1 + \Delta \sin(y_1) \\
& = & 0.1200 + (0.2000) \sin(0.1200) \\
& \approx & 0.1429 \\
& =: & y_2
\end{eqnarray*}

\begin{eqnarray*}
y(.6) & \approx & y_2 + \Delta \sin(y_2) \\
& = & 0.1429 + (0.2) \sin(0.1429) \\
& \approx & .1714 \\
& =: & y_3
\end{eqnarray*}

\begin{eqnarray*}
y(.8) & \approx & y_3 + \Delta \sin(y_3) \\
& = & .1714 + (0.2) \sin(.1714) \\
& \approx & .2055 \\
& =: & y_4
\end{eqnarray*}

\begin{eqnarray*}
y(1) & \approx & y_4 + \Delta \sin(y_4) \\
& = & .2055 + (0.2) \sin(.2055) \\
& \approx & .2463
\end{eqnarray*}




next up previous
Next: About this document ...
Thomas Scanlon 2004-04-11