Professional Documents
Culture Documents
http://numericalmethods.eng.usf.edu
Transforming Numerical Methods Education for STEM
Undergraduates
10/28/2015
http://numericalmethods.eng.usf.edu
Euler Method
http://numericalmethods.eng.usf.edu
Eulers Method
y
dy
f x, y , y0 y0
dx
Slope
Rise
Run
y1 y 0
x1 x0
f x0 , y 0
y1 y0 f x0 , y0 x1 x0
y0 f x0 , y0 h
3
True value
x0,y0
y1, Predicted
value
Step size, h
x
http://numericalmethods.eng.usf.edu
Eulers Method
y
yi 1 yi f xi , yi h
True Value
h xi 1 xi
yi
h
Step size
xi
xi+1
http://numericalmethods.eng.usf.edu
Example
dy
2 y 1.3e x , y0 5
dx
is rewritten as
dy
1.3e x 2 y, y0 5
dx
In this case
f x, y 1.3e x 2 y
5
http://numericalmethods.eng.usf.edu
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
d
2.2067 1012 4 81108 , 0 1200 K
dt
h 240 seconds.
http://numericalmethods.eng.usf.edu
Solution
Step 1:
d
2.2067 10 12 4 81108
dt
f t , 2.2067 10 12 4 81108
i 1 i f ti , i h
1 0 f t0 , 0 h
1200 f 0,1200240
1
7
106.09 K
240 1 106.09K
http://numericalmethods.eng.usf.edu
Solution Cont
Step 2:
For i 1,
t1 240, 1 106.09
2 1 f t1 , 1 h
106.09 f 240,106.09240
http://numericalmethods.eng.usf.edu
Solution Cont
The exact solution of the ordinary differential equation is given by the
solution of a non-linear equation as
0.92593 ln
300
1.8519 tan 1 0.00333 0.22067 103 t 2.9282
300
(480) 647.57 K
http://numericalmethods.eng.usf.edu
1400
1200
1000
Exact Solution
800
600
400
h=240
200
0
0
100
200
300
400
500
Time, t(sec)
http://numericalmethods.eng.usf.edu
Step, h
(480)
Et
|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
(480) 647.57 K
11
(exact)
http://numericalmethods.eng.usf.edu
1500
1000
Exact solution
500
h=120
h=240
0
0
-500
100
200
Tim e, t (sec)
300
400
500
h=480
-1000
-1500
Figure 4. Comparison of Eulers method with exact solution for different step sizes
12
http://numericalmethods.eng.usf.edu
800
400
0
0
100
200
300
400
500
-400
http://numericalmethods.eng.usf.edu
yi 1 yi
x
x
...
i
1
i
i
1
i
2
3
dx xi , yi
2! dx x , y
3! dx x , y
i
yi 1 yi f ( xi , yi )xi 1 xi
1
1
2
3
f ' ( xi , yi )xi 1 xi f ' ' ( xi , yi )xi 1 xi ...
2!
3!
As you can see the first two terms of the Taylor series
yi 1 yi f xi , yi h are the Eulers method.
f xi , yi 2 f xi , yi 3
h
h ...
2!
3!
Et h 2
http://numericalmethods.eng.usf.edu
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