MA282 – Fall 2012 / 2.6 A Numerical Method

Consider the IVP

dydx=y3+x2, y0=0

The graph of a solution is

Note that the equation is neither linear nor separable; there is not a formula for the solution.

Q. How do we get the graph?

A. Use Numerical Algorithm to obtain an approximate solution.

We are going to consider only the simplest of numerical methods known as Euler’s Method.
Recall the Linearization or Linear Approximation from Calculus I
Example Estimate 4.001 by Linearization

We now generalize the procedure to DE:

Euler’s Method Consider an IVP
dydx=fx, y, yx0=y0

Idea: We will not find a differentiable function that satisfies the IVP. Instead, a set of points xk, yk is generated and the points are used for an approximation, i.e., yxk≈yk.

First we choose the step size Δx=h and start at x0, y0 to find x1, y1

x1=x0+ h

y1= fx0, y0⋅x1-x0+y0=fx0, y0⋅h+y0

where the slope of the tangent line at x0, y0 is f(x0, y0).

That is, y1=Lx1 ; the point x1, y1 on the tangent line is an approximation to the point x1, yx1 on the solution curve. Of course the accuracy of the approximation yx1≈y1 depends heavily on the step size.

We now repeat the process using a second “tangent line” at x1, y1. By replacing x0, y0 in the above discussion with the new starting point x1, y1, we obtain an approximation yx2≈y2 corresponding to two steps of length h from x0, that is,
x2=x1+ h=x0+ 2h

y2= fx1, y1⋅x2-x1+y1=fx1, y1⋅h+y1

Continuing in this manner, we see that y1, y2, y3, ⋯ can be defined recursively by the general formula

xn+1=x0+ nh

yn+1= fxn, yn⋅h+yn n=0, 1, 2, 3, ⋯

Example dydx=y2-x, y-1=-12 ; use Euler's Method to obtain an approximation to

y2 using Δx=12 .

Sol:
Algorithm:

Table of xk, yk, mk where mk=f(xk, yk):

k / xk / yk / mk
0 / - 1 / - 0.500
1
2
3
4
5
6

Graph of a solution:

Example dydx=exsiny, y0=5

Let us see what happens when we use Euler’s Method to approximate the solution with various

Step sizes 0.01≤Δx ≤0.1.

The graph below from the EXCEL spreadsheet: Δx=0.05

The spreadsheet for this example is also posted the course web site.

Q. Is this believable? Explain.
A.