eulermethod3

12

Upload: stellajoh

Post on 13-Jul-2015

335 views

Category:

Education


0 download

TRANSCRIPT

What is Euler’s [OIL-er’s]

Method?• Numerical approach to approximating the

particular solution of the differential equation

– y’=F(x,y)

• TRANSLATION: Essentially, you take an initial

condition (a point), and use that condition as a

starting point to take a small step h along the

tangent line to get to a new point. Rinse and

repeat using the new point as a starting point.

• *Note: The smaller the steps used, the more

accurate your graph will be.

Explanation of Euler’s Method

• y’= F(x,y) w/ initial condition (x0,y0)

– x1= x0+h (h is your step)

– y1=y0+hF(x0,y0)

• Plug your initial condition into this formula

to find (x1,y1) and RINSE AND REPEAT

this is the slope of the tangent line at your initial point

F(x,y)

• How to write a first-order differential

equation in the form

– Example:

yxfdx

dy,

50,3.12 yeydx

dy x

is rewritten as

50,23.1 yyedx

dy x

so that

yeyxf x 23.1,

Φ

Step size

h

True Value

yi+1, Predicted value

yi

x

y

xi xi+1

Example 1: page 411 #69

Use Euler’s Method to make a table of

values for the approximate solution of the

differential equation with the specified

initial value. Use n steps of size h.

y’=x+y y(0)=2 n=10

h=0.1

Example 1: page 411 #69

y1=y0+hF(x0,y0)

y1=2+(0.1)(0+2)

y1=2.2

y2=y1+hF(x1,y1)

y2=2.2+(0.1)(0.1+2.2)

y2=2.43

Y(0)=2N=10H=0.1

Example 1: page 411 #69

n 0 1 2 3 4 5 6

Xn 0 0.1 0.2 0.3 0.4 0.5 0.6

Yn 2 2.2 2.43 2.693 2.992 3.332 3.715

Real Life Application…

In 2000, the national debt of the United States was 5.6 trillion dollars and

in 2001, the debt rose to 5.8 trillion dollars. Using Euler’s method, one

could have estimated the national debt for the following years.

In year 2000 $5.6 trillion in

2001 $5.8 trillion is a 2%

increase.

t= years where t=0 is 2000, w=debt in billions of dollars

w’=.02w

Using step size h=1 for the range (0,10) the

first step would look something like…

T0=0 W0=5628.7

W1=W0+F(t0,w0)(h)

5628.7+(.02 x 5628.7)(1)

w(1)=$5741.3 in billions.

So 2001, the estimated value of the

national debt is about 5.7 trillion dollars.

Still pretty close to the actual value…

If you keep going…year debt w'=.02w

0 5628.7 112.5741 5741.274 114.82552 6889.529 137.79063 8267.435 165.34874 9920.921 198.41845 11905.11 238.10216 14286.13 285.72257 17143.35 342.8678 20572.02 411.44059 24686.43 493.7285

10 29623.71 592.4743

You eventually get the estimated value

for the annual debt of the United States

up to year 10, 2010.

However…, as you solve

for more values of w, it gets

more inaccurate because

Euler’s method is just an

estimation.

By looking at the actual values of

each year’s debt we can see the

inaccuracy of the Euler’s method

for this step size.

year debt w'=.02w0 5628.7 112.5741 5741.274 114.82552 6889.529 137.79063 8267.435 165.34874 9920.921 198.41845 11905.11 238.10216 14286.13 285.72257 17143.35 342.8678 20572.02 411.44059 24686.43 493.7285

10 29623.71 592.4743