Numerical methods lecture slides on the Euler method for solving 1st order ODEs.
Some parts of this presentation are based on resources at http://nm.MathForCollege.com, primarily http://nm.mathforcollege.com/topics/ordinary_de.html
1. St. John's University of Tanzania
MAT210 NUMERICAL ANALYSIS
2013/14 Semester II
DIFFERENTIAL EQUATIONS
Euler's Method
Kaw, Chapter 8.02
Some parts of this presentation are based on resources at
http://nm.MathForCollege.com, primarily
http://nm.mathforcollege.com/topics/ordinary_de.html
2. MAT210 2013/14 Sem II 2 of 19
● Applications of mathematics
●
Functions
– Interpolation
●
Find values and polynomials within an interval
●
Pass thru all points available (df=0)
– Regression
●
Confirm models, estimate parameters
●
Pass close to all points (df>0)
● Their Derivatives
● Their Integrals
Where we have been
Can use the interpolation
or regression functions
3. MAT210 2013/14 Sem II 3 of 19
Where we must go
● A main use of all these pieces are
differential equations
●
Models where things are changing
● Numerical methods for solving differential
equations is a broad field
●
Method's for 1st order ODEs, methods for higher
order ODEs, PDEs of various types
●
Boundary value problems
– Finite Difference, Elements or Volumes
– Spectral Methods and more
4. MAT210 2013/14 Sem II 4 of 19
Ordinary Differential Equations
● That is as far as we go
●
Just to get a taste for future study
● Topics
● 1st order ODE
– Euler's Method
– Runga-Kutta Methods
● Higher order Initial Value
● Higher order Boundary Value
– Shooting Method versus Finite Differences
5. MAT210 2013/14 Sem II 5 of 19
Euler's Method
● Numerical technique to solve
● Simply moving along the slope in small
steps to reach the destination point
●
Simple to derive from Taylor Series
dy
dx
= f (x , y) , y(0)=y0
9. MAT210 2013/14 Sem II 9 of 19
Move on down the line
Slope=
Rise
Run
=
dy
dx
dy
dx
=
y1
−y0
x1
−x0
= f (x0,
y0
)
y1
=y0
+ f (x0,
y0
)(x1
−x0
)
This simply continus from 0 to 1 to 2 to ... i+1
yi+1
=yi
+ f (xi
, yi
)h , where xi+1
=xi
+h
13. MAT210 2013/14 Sem II 13 of 19
Is the solution plausible?
● End temperature < Ambient temperature
●
Violates laws governing heat transfer
● As usual
●
Look beyond the calculations with an
understanding of the system at hand
17. MAT210 2013/14 Sem II 17 of 19
Understanding the Error
●
For each step, true error is O(h2)
●
Step size halved, True error quartered
●
Results are different
●
Step size gets halved, True error halved
●
Why?
●
O(h2) is the local truncation error, i.e.
– Error from one point to the next
●
Global truncation error is proportional only to the
step size because
Error propagates from one point to another
19. MAT210 2013/14 Sem II 19 of 19
Options
● Either
●
Accept the limitation of Euler or
● Go out further with the Taylor Series to
improve the error at each step
– Runga-Kutta does just that
●
Note that all these methods have at their
heart the Taylor series expansion and the
related numerical derivatives
● Plus some creativity...