Euler Method of solving Initial value problems

ashugizaw1506 34 views 16 slides May 07, 2024
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

This document is helpful to study Euler method of Numerical solutions for Ordinary differential equations of first order with Initial value problems.


Slide Content

5/7/2024 http://numericalmethods.eng.usf.edu 1
Euler Method
Major: All Engineering Majors
Authors: Autar Kaw, Charlie Barker
http://numericalmethods.eng.usf.edu
Transforming Numerical Methods Education for STEM
Undergraduates

Euler Method
http://numericalmethods.eng.usf.edu

http://numericalmethods.eng.usf.edu3
Euler’s Method
Φ
Stepsize,h
x
y
x
0
,y
0
Truevalue
y
1
,Predicted
value
00,, yyyxf
dx
dy

SlopeRun
Rise
 01
01
xx
yy


  
00,yxf   
010001 , xxyxfyy   hyxfy
000 ,
Figure 1Graphical interpretation of the first step of Euler’s method

http://numericalmethods.eng.usf.edu4
Euler’s Method
Φ
Step size
h
True Value
y
i+1,Predicted value
y
i
x
y
x
i x
i+1
Figure 2.General graphical interpretation of Euler’s method hyxfyy
iiii ,
1 
 iixxh 
1

http://numericalmethods.eng.usf.edu5
How to write Ordinary Differential
Equation
Example50,3.12 

yey
dx
dy x
isrewrittenas50,23.1 

yye
dx
dy x
Inthiscase yeyxf
x
23.1, 

How does one write a first order differential equation in the form ofyxf
dx
dy
,

http://numericalmethods.eng.usf.edu6
Example
Aballat1200Kisallowedtocooldowninairatanambienttemperature
of300K.Assumingheatislostonlyduetoradiation,thedifferential
equationforthetemperatureoftheballisgivenby  K
dt
d
12000,1081102067.2
8412




Findthetemperatureat480t secondsusingEuler’smethod.Assumeastepsizeof240h
seconds.

http://numericalmethods.eng.usf.edu7
Solution

 
  
 
K
f
htf
htf
iiii
09.106
2405579.41200
24010811200102067.21200
2401200,01200
,
,
8412
0001
1










Step1:1
istheapproximatetemperatureat2402400
01  httt  K09.106240
1  
8412
1081102067.2 


dt
d   
8412
1081102067.2, 

tf

http://numericalmethods.eng.usf.edu8
Solution Cont
For09.106,240,1
11  ti 
 
  
 
K
f
htf
32.110
240017595.009.106
240108109.106102067.209.106
24009.106,24009.106
,
8412
1112






 Step2:2
istheapproximatetemperatureat480240240
12  httt  K32.110480
2

http://numericalmethods.eng.usf.edu9
Solution Cont
Theexactsolutionoftheordinarydifferentialequationisgivenbythe
solutionofanon-linearequationas  9282.21022067.000333.0tan8519.1
300
300
ln92593.0
31




t


Thesolutiontothisnonlinearequationatt=480secondsisK57.647)480(

http://numericalmethods.eng.usf.edu10
Comparison of Exact and
Numerical Solutions
Figure 3.Comparing exact and Euler’s method 0
200
400
600
800
1000
1200
1400
0 100 200 300 400 500
Time, t(sec)
Temperature,
h=240
Exact Solution
θ(K)

Step, h(480) E
t |є
t|%
480
240
120
60
30
−987.81
110.32
546.77
614.97
632.77
1635.4
537.26
100.80
32.607
14.806
252.54
82.964
15.566
5.0352
2.2864
http://numericalmethods.eng.usf.edu11
Effect of step size
Table1.Temperatureat480secondsasafunctionofstepsize,hK57.647)480(
(exact)

http://numericalmethods.eng.usf.edu12
Comparison with exact results-1500
-1000
-500
0
500
1000
1500
0 100 200 300 400 500
Tim e, t (sec)
Temperature,
Exact solution
h=120
h=240
h=480
θ(K)
Figure 4.Comparison of Euler’s method with exact solution for different step sizes

http://numericalmethods.eng.usf.edu13
Effects of step size on Euler’s
Method-1200
-800
-400
0
400
800
0 100 200 300 400 500
Step size, h (s)
Temperature,
θ(K)
Figure 5.Effect of step size in Euler’s method.

http://numericalmethods.eng.usf.edu14
Errors in Euler’s Method
ItcanbeseenthatEuler’smethodhaslargeerrors.Thiscanbeillustratedusing
Taylorseries.     ...
!3
1
!2
1 3
1
,
3
3
2
1
,
2
2
1
,
1

 ii
yx
ii
yx
ii
yx
ii
xx
dx
yd
xx
dx
yd
xx
dx
dy
yy
iiii
ii      ...),(''
!3
1
),('
!2
1
),(
3
1
2
111 
 iiiiiiiiiiiiii xxyxfxxyxfxxyxfyy
AsyoucanseethefirsttwotermsoftheTaylorserieshyxfyy
iiii ,
1 

Thetrueerrorintheapproximationisgivenby 
...
!3
,
!2
,
32




 h
yxf
h
yxf
E
iiii
t
aretheEuler’smethod.2
hE
t

Additional Resources
For all resources on this topic such as digital audiovisual
lectures, primers, textbook chapters, multiple-choice
tests, worksheets in MATLAB, MATHEMATICA, MathCad
and MAPLE, blogs, related physical problems, please
visit
http://numericalmethods.eng.usf.edu/topics/euler_meth
od.html

THE END
http://numericalmethods.eng.usf.edu