Euler Method - Numerical Methods - Lecture Slides, Slides of Mathematical Methods for Numerical Analysis and Optimization

Main points are: Euler Method, Graphical Interpretation, First Order Differential Equation, Ambient Temperature, Equation for Temperature, Approximate Temperature, Non-Linear Equation, Comparison of Exact Solutions

Typology: Slides

2012/2013

Uploaded on 04/16/2013

mmadhav
mmadhav 🇮🇳

5

(8)

74 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Euler Method
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Euler Method - Numerical Methods - Lecture Slides and more Slides Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Euler Method

Euler’s Method

Φ

Step size, h

x

y

x 0 ,y (^0)

True value

y 1 , Predicted value

f ( x , y ), y ( ) 0 y 0

dx

dy = =

Slope Run

Rise

1 0

1 0 x x

y y

= f ( x 0 , y 0 )

y 1 = y 0 + f ( x 0 , y 0 )( x 1 − x 0 )

= y (^) 0 + f ( x 0 , y 0 ) h

Figure 1 Graphical interpretation of the first step of Euler’s method

How to write Ordinary Differential

Equation

Example

+ 2 y = 1. 3 e −^ , y ( ) 0 = 5

dx

dy (^) x

is rewritten as

= 1. 3 e −^ − 2 y , y ( ) 0 = 5 dx

dy (^) x

In this case

f ( x y ) e y

x

How does one write a first order differential equation in the form of

f ( x y ) dx

dy = ,

Example

A ball at 1200K is allowed to cool down in air at an ambient temperature

of 300K. Assuming heat is lost only due to radiation, the differential

equation for the temperature of the ball is given by

( ) ( ) K

dt

d

  1. 2067 10 81 10 , 0 1200

12 4 8 = − × − × =

− θ θ

θ

Find the temperature at t^ =^480 seconds using Euler’s method. Assume a step size of

h = 240 seconds.

Solution Cont

For i =^1 ,^ t 1 =^240 , θ 1 =^106.^09

( )

( )

( )

K

f

f t h

12 4 8

2 1 1 1

= + − × − ×

θ θ θ

Step 2:

θ (^2) is the approximate temperature at (^) t = t 2 = t 1 + h = 240 + 240 = 480

θ ( 480 ) ≈θ 2 = 110. 32 K

Solution Cont

The exact solution of the ordinary differential equation is given by the

solution of a non-linear equation as

  1. 8519 tan ( 0. 00333 ) 0. 22067 10 2. 9282 300
  1. 92593 ln

1 3 − =− × −

θ t

The solution to this nonlinear equation at t=480 seconds is

θ( 480 )= 647. 57 K

Step, h θ(480) E t |єt|%

480

240

120

60

30

−987.

Effect of step size

θ( 480 )= 647. 57 K

Table 1. Temperature at 480 seconds as a function of step size, h

(exact)

Comparison with exact results

0

500

1000

1500

0 100 200 300 400 500 Temperature, Tim e, t (sec)

Exact solution

h= h=

h=

θ(K)

Figure 4. Comparison of Euler’s method with exact solution for different step sizes

Errors in Euler’s Method

2 Eth

It can be seen that Euler’s method has large errors. This can be illustrated using

Taylor series.

( ) ( ) ( ) ... 3!

1 ,

3

3 2 1 ,

2

2

1 ,

  • 1 =^ + + − + + − + i + − i + x y

i i x y

i i x y

i i x x dx

d y x x dx

d y x x dx

dy y y i i i i i i

( ) ( ) ''( , )( ) ...

3 1

2

yi + 1 = yi + f xi yi xi + 1 − xi + f xi yi xi + 1 − xi + f xi yi xi + − xi +

As you can see the first two terms of the Taylor series

y (^) i + 1 = yi + f ( xi , yi ) h

The true error in the approximation is given by

( ) ( ) ... 3!

,

2!

, (^2 )

′′

′ = h

f x y h

f x y E

i i i i t

are the Euler’s method.