SlideShare une entreprise Scribd logo
1  sur  17
Ch 2.7: Numerical Approximations:
Euler’s Method
Recall that a first order initial value problem has the form
If f and ∂f/∂y are continuous, then this IVP has a unique
solution y = φ(t) in some interval about t0.
When the differential equation is linear, separable or exact,
we can find the solution by symbolic manipulations.
However, the solutions for most differential equations of
this form cannot be found by analytical means.
Therefore it is important to be able to approach the problem
in other ways.
00 )(),,( ytyytf
dt
dy
==
Direction Fields
For the first order initial value problem
we can sketch a direction field and visualize the behavior of
solutions. This has the advantage of being a relatively
simple process, even for complicated equations. However,
direction fields do not lend themselves to quantitative
computations or comparisons.
,)(),,( 00 ytyytfy ==′
Numerical Methods
For our first order initial value problem
an alternative is to compute approximate values of the
solution y = φ(t) at a selected set of t-values.
Ideally, the approximate solution values will be accompanied
by error bounds that ensure the level of accuracy.
There are many numerical methods that produce numerical
approximations to solutions of differential equations, some of
which are discussed in Chapter 8.
In this section, we examine the tangent line method, which is
also called Euler’s Method.
,)(),,( 00 ytyytfy ==′
Euler’s Method: Tangent Line Approximation
For the initial value problem
we begin by approximating solution y = φ(t) at initial point t0.
The solution passes through initial point (t0, y0) with slope
f(t0,y0). The line tangent to solution at initial point is thus
The tangent line is a good approximation to solution curve on
an interval short enough.
Thus if t1 is close enough to t0,
we can approximate φ(t1) by
( )( )0000 , ttytfyy −+=
,)(),,( 00 ytyytfy ==′
( )( )010001 , ttytfyy −+=
Euler’s Formula
For a point t2 close to t1, we approximate φ(t2) using the line
passing through (t1, y1) with slope f(t1,y1):
Thus we create a sequence yn of approximations to φ(tn):
where fn = f(tn,yn).
For a uniform step size h = tn – tn-1, Euler’s formula becomes
( )
( )
( )nnnnn ttfyy
ttfyy
ttfyy
−⋅+=
−⋅+=
−⋅+=
++ 11
12112
01001

( )( )121112 , ttytfyy −+=
,2,1,0,1 =+=+ nhfyy nnn
Euler Approximation
To graph an Euler approximation, we plot the points
(t0, y0), (t1, y1),…, (tn, yn), and then connect these points with
line segments.
( ) ( )nnnnnnnn ytffttfyy ,where,11 =−⋅+= ++
Example 1: Euler’s Method (1 of 3)
For the initial value problem
we can use Euler’s method with h = 0.1 to approximate the
solution at t = 0.1, 0.2, 0.3, 0.4, as shown below.
( )( )( )
( )( )( )
( )( )( ) 80.3)1.0(88.22.08.988.2
88.2)1.0(94.12.08.994.1
94.1)1.0(98.2.08.998.
98.)1.0(8.90
334
223
112
001
≈−+=⋅+=
≈−+=⋅+=
≈−+=⋅+=
=+=⋅+=
hfyy
hfyy
hfyy
hfyy
0)0(,2.08.9 =−=′ yyy
Example 1: Exact Solution (2 of 3)
We can find the exact solution to our IVP, as in Chapter 1.2:
( )
( )t
Ct
ey
ky
ekkey
Cty
dt
y
dy
yy
yyy
2.0
2.0
149
491)0(
,49
2.049ln
2.0
49
492.0
0)0(,2.08.9
−
−
−=⇒
−=⇒=
±=+=
+−=−
−=
−
−−=′
=−=′
Example 1: Error Analysis (3 of 3)
From table below, we see that the errors are small. This is
most likely due to round-off error and the fact that the
exact solution is approximately linear on [0, 0.4]. Note:
t Exact y Approx y Error % Rel Error
0.00 0 0.00 0.00 0.00
0.10 0.97 0.98 -0.01 -1.03
0.20 1.92 1.94 -0.02 -1.04
0.30 2.85 2.88 -0.03 -1.05
0.40 3.77 3.8 -0.03 -0.80
100ErrorRelativePercent ×
−
=
exact
approxexact
y
yy
Example 2: Euler’s Method (1 of 3)
For the initial value problem
we can use Euler’s method with h = 0.1 to approximate the
solution at t = 1, 2, 3, and 4, as shown below.
Exact solution (see Chapter 2.1):
( )
( )
( )
( )

15.4)1.0()15.3)(2(3.0415.3
15.3)1.0()31.2)(2(2.0431.2
31.2)1.0()6.1)(2(1.046.1
6.1)1.0()1)(2(041
334
223
112
001
≈+−+=⋅+=
≈+−+=⋅+=
=+−+=⋅+=
=+−+=⋅+=
hfyy
hfyy
hfyy
hfyy
1)0(,24 =+−=′ yyty
t
ety 2
4
11
2
1
4
7
++−=
Example 2: Error Analysis (2 of 3)
The first ten Euler approxs are given in table below on left.
A table of approximations for t = 0, 1, 2, 3 is given on right.
See text for numerical results with h = 0.05, 0.025, 0.01.
The errors are small initially, but quickly reach an
unacceptable level. This suggests a nonlinear solution.
t Exact y Approx y Error % Rel Error
0.00 1.00 1.00 0.00 0.00
0.10 1.66 1.60 0.06 3.55
0.20 2.45 2.31 0.14 5.81
0.30 3.41 3.15 0.26 7.59
0.40 4.57 4.15 0.42 9.14
0.50 5.98 5.34 0.63 10.58
0.60 7.68 6.76 0.92 11.96
0.70 9.75 8.45 1.30 13.31
0.80 12.27 10.47 1.80 14.64
0.90 15.34 12.89 2.45 15.96
1.00 19.07 15.78 3.29 17.27
t Exact y Approx y Error % Rel Error
0.00 1.00 1.00 0.00 0.00
1.00 19.07 15.78 3.29 17.27
2.00 149.39 104.68 44.72 29.93
3.00 1109.18 652.53 456.64 41.17
4.00 8197.88 4042.12 4155.76 50.69
t
ety 2
4
11
2
1
4
7
:SolutionExact
++−=
Example 2: Error Analysis & Graphs (3 of 3)
Given below are graphs showing the exact solution (red)
plotted together with the Euler approximation (blue).
t Exact y Approx y Error % Rel Error
0.00 1.00 1.00 0.00 0.00
1.00 19.07 15.78 3.29 17.27
2.00 149.39 104.68 44.72 29.93
3.00 1109.18 652.53 456.64 41.17
4.00 8197.88 4042.12 4155.76 50.69
t
ety 2
4
11
2
1
4
7
:SolutionExact
++−=
General Error Analysis Discussion (1 of 4)
Recall that if f and ∂f/∂y are continuous, then our first order
initial value problem
has a solution y = φ(t) in some interval about t0.
In fact, the equation has infinitely many solutions, each one
indexed by a constant c determined by the initial condition.
Thus φ is the member of an infinite family of solutions that
satisfies φ(t0) = y0.
00 )(),,( ytyytfy ==′
General Error Analysis Discussion (2 of 4)
The first step of Euler’s method uses the tangent line to φ at
the point (t0, y0) in order to estimate φ(t1) with y1.
The point (t1, y1) is typically not on the graph of φ, because y1
is an approximation of φ(t1).
Thus the next iteration of Euler’s method does not use a
tangent line approximation to φ, but rather to a nearby
solution φ1 that passes through the point (t1, y1).
Thus Euler’s method uses a
succession of tangent lines
to a sequence of different
solutions φ, φ1, φ2,… of the
differential equation.
Error Analysis Example:
Converging Family of Solutions (3 of 4)
Since Euler’s method uses tangent lines to a sequence of
different solutions, the accuracy after many steps depends on
behavior of solutions passing through (tn, yn), n = 1, 2, 3, …
For example, consider the following initial value problem:
The direction field and graphs of a few solution curves are
given below. Note that it doesn’t matter which solutions we
are approximating with tangent lines, as all solutions get closer
to each other as t increases.
Results of using Euler’s method
for this equation are given in text.
2/
326)(1)0(,23 ttt
eetyyyey −−−
−−==⇒=−+=′ φ
Error Analysis Example:
Divergent Family of Solutions (4 of 4)
Now consider the initial value problem for Example 2:
The direction field and graphs of solution curves are given
below. Since the family of solutions is divergent, at each step
of Euler’s method we are following a different solution than
the previous step, with each solution separating from the
desired one more and more as t increases.
4112471)0(,24 2t
etyyyty ++−=⇒=+−=′
Error Bounds and Numerical Methods
In using a numerical procedure, keep in mind the question of
whether the results are accurate enough to be useful.
In our examples, we compared approximations with exact
solutions. However, numerical procedures are usually used
when an exact solution is not available. What is needed are
bounds for (or estimates of) errors, which do not require
knowledge of exact solution. More discussion on these issues
and other numerical methods is given in Chapter 8.
Since numerical approximations ideally reflect behavior of
solution, a member of a diverging family of solutions is harder
to approximate than a member of a converging family.
Also, direction fields are often a relatively easy first step in
understanding behavior of solutions.

Contenu connexe

Tendances

Introduction to Differential Equations
Introduction to Differential EquationsIntroduction to Differential Equations
Introduction to Differential EquationsVishvaraj Chauhan
 
euler's theorem
euler's theoremeuler's theorem
euler's theoremmihir jain
 
Euler's Method
Euler's MethodEuler's Method
Euler's Methoddmidgette
 
Initial value problems
Initial value problemsInitial value problems
Initial value problemsAli Jan Hasan
 
numericai matmatic matlab uygulamalar ali abdullah
numericai matmatic  matlab  uygulamalar ali abdullahnumericai matmatic  matlab  uygulamalar ali abdullah
numericai matmatic matlab uygulamalar ali abdullahAli Abdullah
 
Classification of singularity
Classification of singularityClassification of singularity
Classification of singularityRaj Parekh
 
Numerical Solution of Ordinary Differential Equations
Numerical Solution of Ordinary Differential EquationsNumerical Solution of Ordinary Differential Equations
Numerical Solution of Ordinary Differential EquationsMeenakshisundaram N
 
Runge Kutta Method
Runge Kutta Method Runge Kutta Method
Runge Kutta Method Bhavik Vashi
 
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IVEngineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IVRai University
 
Numerical Methods - Oridnary Differential Equations - 2
Numerical Methods - Oridnary Differential Equations - 2Numerical Methods - Oridnary Differential Equations - 2
Numerical Methods - Oridnary Differential Equations - 2Dr. Nirav Vyas
 
Newton’s Divided Difference Formula
Newton’s Divided Difference FormulaNewton’s Divided Difference Formula
Newton’s Divided Difference FormulaJas Singh Bhasin
 
Finite difference method
Finite difference methodFinite difference method
Finite difference methodDivyansh Verma
 

Tendances (20)

Ep 5512 lecture-02
Ep 5512 lecture-02Ep 5512 lecture-02
Ep 5512 lecture-02
 
Introduction to Differential Equations
Introduction to Differential EquationsIntroduction to Differential Equations
Introduction to Differential Equations
 
Runge kutta
Runge kuttaRunge kutta
Runge kutta
 
euler's theorem
euler's theoremeuler's theorem
euler's theorem
 
Euler's Method
Euler's MethodEuler's Method
Euler's Method
 
Unit1 vrs
Unit1 vrsUnit1 vrs
Unit1 vrs
 
Initial value problems
Initial value problemsInitial value problems
Initial value problems
 
Numerical method (curve fitting)
Numerical method (curve fitting)Numerical method (curve fitting)
Numerical method (curve fitting)
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
numericai matmatic matlab uygulamalar ali abdullah
numericai matmatic  matlab  uygulamalar ali abdullahnumericai matmatic  matlab  uygulamalar ali abdullah
numericai matmatic matlab uygulamalar ali abdullah
 
Classification of singularity
Classification of singularityClassification of singularity
Classification of singularity
 
Ch05 4
Ch05 4Ch05 4
Ch05 4
 
Numerical Solution of Ordinary Differential Equations
Numerical Solution of Ordinary Differential EquationsNumerical Solution of Ordinary Differential Equations
Numerical Solution of Ordinary Differential Equations
 
Runge Kutta Method
Runge Kutta Method Runge Kutta Method
Runge Kutta Method
 
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IVEngineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
Engineering Mathematics-IV_B.Tech_Semester-IV_Unit-IV
 
Numerical Methods - Oridnary Differential Equations - 2
Numerical Methods - Oridnary Differential Equations - 2Numerical Methods - Oridnary Differential Equations - 2
Numerical Methods - Oridnary Differential Equations - 2
 
Ch05 3
Ch05 3Ch05 3
Ch05 3
 
Ch08 1
Ch08 1Ch08 1
Ch08 1
 
Newton’s Divided Difference Formula
Newton’s Divided Difference FormulaNewton’s Divided Difference Formula
Newton’s Divided Difference Formula
 
Finite difference method
Finite difference methodFinite difference method
Finite difference method
 

En vedette

Perturbation methods last
Perturbation methods lastPerturbation methods last
Perturbation methods lastSabir Ahmed
 
Calculus II - 13
Calculus II - 13Calculus II - 13
Calculus II - 13David Mao
 
Successive iteration method for reconstruction of missing data
Successive iteration method for reconstruction of missing dataSuccessive iteration method for reconstruction of missing data
Successive iteration method for reconstruction of missing dataIAEME Publication
 
AP Calculus AB March 25, 2009
AP Calculus AB March 25, 2009AP Calculus AB March 25, 2009
AP Calculus AB March 25, 2009Darren Kuropatwa
 
AP Calculus AB March 26, 2009
AP Calculus AB March 26, 2009AP Calculus AB March 26, 2009
AP Calculus AB March 26, 2009Darren Kuropatwa
 
On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...PlusOrMinusZero
 
Eulermethod3
Eulermethod3Eulermethod3
Eulermethod3stellajoh
 
Hpcc euler
Hpcc eulerHpcc euler
Hpcc eulerrhuzefa
 
Euler method notes sb
Euler method notes sbEuler method notes sb
Euler method notes sbjanetvmiller
 
Introduction to Numerical Methods for Differential Equations
Introduction to Numerical Methods for Differential EquationsIntroduction to Numerical Methods for Differential Equations
Introduction to Numerical Methods for Differential Equationsmatthew_henderson
 
Euler Method using MATLAB
Euler Method using MATLABEuler Method using MATLAB
Euler Method using MATLABM.Ahmed Waqas
 
Automobile 3rd sem aem ppt.2016
Automobile 3rd sem aem ppt.2016Automobile 3rd sem aem ppt.2016
Automobile 3rd sem aem ppt.2016kalpeshvaghdodiya
 
metode euler
metode eulermetode euler
metode eulerRuth Dian
 
Interactives Methods
Interactives MethodsInteractives Methods
Interactives MethodsUIS
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical MethodsESUG
 

En vedette (20)

Perturbation methods last
Perturbation methods lastPerturbation methods last
Perturbation methods last
 
Calculus II - 13
Calculus II - 13Calculus II - 13
Calculus II - 13
 
Successive iteration method for reconstruction of missing data
Successive iteration method for reconstruction of missing dataSuccessive iteration method for reconstruction of missing data
Successive iteration method for reconstruction of missing data
 
DLR_DG_AZIZ_2003
DLR_DG_AZIZ_2003DLR_DG_AZIZ_2003
DLR_DG_AZIZ_2003
 
AP Calculus AB March 25, 2009
AP Calculus AB March 25, 2009AP Calculus AB March 25, 2009
AP Calculus AB March 25, 2009
 
AP Calculus AB March 26, 2009
AP Calculus AB March 26, 2009AP Calculus AB March 26, 2009
AP Calculus AB March 26, 2009
 
On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...On finite differences, interpolation methods and power series expansions in i...
On finite differences, interpolation methods and power series expansions in i...
 
Eulermethod3
Eulermethod3Eulermethod3
Eulermethod3
 
Hpcc euler
Hpcc eulerHpcc euler
Hpcc euler
 
Day 4 examples
Day 4 examplesDay 4 examples
Day 4 examples
 
Euler method notes sb
Euler method notes sbEuler method notes sb
Euler method notes sb
 
10 09
10 0910 09
10 09
 
Introduction to Numerical Methods for Differential Equations
Introduction to Numerical Methods for Differential EquationsIntroduction to Numerical Methods for Differential Equations
Introduction to Numerical Methods for Differential Equations
 
Euler Method using MATLAB
Euler Method using MATLABEuler Method using MATLAB
Euler Method using MATLAB
 
Automobile 3rd sem aem ppt.2016
Automobile 3rd sem aem ppt.2016Automobile 3rd sem aem ppt.2016
Automobile 3rd sem aem ppt.2016
 
Differential equations intro
Differential equations introDifferential equations intro
Differential equations intro
 
metode euler
metode eulermetode euler
metode euler
 
Interactives Methods
Interactives MethodsInteractives Methods
Interactives Methods
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
METHOD OF JACOBI
METHOD OF JACOBIMETHOD OF JACOBI
METHOD OF JACOBI
 

Similaire à Numerical Approximations Using Euler's Method

CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docxCALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docxRAHUL126667
 
MATLAB sessions Laboratory 3MAT 275 Laboratory 3Numeric.docx
MATLAB sessions Laboratory 3MAT 275 Laboratory 3Numeric.docxMATLAB sessions Laboratory 3MAT 275 Laboratory 3Numeric.docx
MATLAB sessions Laboratory 3MAT 275 Laboratory 3Numeric.docxandreecapon
 
numericalmethods.pdf
numericalmethods.pdfnumericalmethods.pdf
numericalmethods.pdfShailChettri
 
Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...
Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...
Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...Sheila Sinclair
 
Mit18 330 s12_chapter5
Mit18 330 s12_chapter5Mit18 330 s12_chapter5
Mit18 330 s12_chapter5CAALAAA
 
MATLAB ODE
MATLAB ODEMATLAB ODE
MATLAB ODEKris014
 
Laplace transform
Laplace transformLaplace transform
Laplace transformjoni joy
 
Trapezoidal Method IN Numerical Analysis
Trapezoidal Method IN  Numerical AnalysisTrapezoidal Method IN  Numerical Analysis
Trapezoidal Method IN Numerical AnalysisMostafijur Rahman
 
A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...Alexander Decker
 
This is testing Algorithm Writing For this assessment we will be c.pdf
This is testing Algorithm Writing For this assessment we will be c.pdfThis is testing Algorithm Writing For this assessment we will be c.pdf
This is testing Algorithm Writing For this assessment we will be c.pdfaroraopticals15
 
A Solution Manual And Notes For Kalman Filtering Theory And Practice Using ...
A Solution Manual And Notes For  Kalman Filtering  Theory And Practice Using ...A Solution Manual And Notes For  Kalman Filtering  Theory And Practice Using ...
A Solution Manual And Notes For Kalman Filtering Theory And Practice Using ...Daniel Wachtel
 
Free Ebooks Download
Free Ebooks Download Free Ebooks Download
Free Ebooks Download Edhole.com
 

Similaire à Numerical Approximations Using Euler's Method (20)

Matlab lab.pdf
Matlab lab.pdfMatlab lab.pdf
Matlab lab.pdf
 
Ch02 4
Ch02 4Ch02 4
Ch02 4
 
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docxCALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
 
MATLAB sessions Laboratory 3MAT 275 Laboratory 3Numeric.docx
MATLAB sessions Laboratory 3MAT 275 Laboratory 3Numeric.docxMATLAB sessions Laboratory 3MAT 275 Laboratory 3Numeric.docx
MATLAB sessions Laboratory 3MAT 275 Laboratory 3Numeric.docx
 
Term project
Term projectTerm project
Term project
 
numericalmethods.pdf
numericalmethods.pdfnumericalmethods.pdf
numericalmethods.pdf
 
Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...
Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...
Accuracy Study On Numerical Solutions Of Initial Value Problems (IVP) In Ordi...
 
Mit18 330 s12_chapter5
Mit18 330 s12_chapter5Mit18 330 s12_chapter5
Mit18 330 s12_chapter5
 
MATLAB ODE
MATLAB ODEMATLAB ODE
MATLAB ODE
 
Laplace transform
Laplace transformLaplace transform
Laplace transform
 
Ch07 7
Ch07 7Ch07 7
Ch07 7
 
Trapezoidal Method IN Numerical Analysis
Trapezoidal Method IN  Numerical AnalysisTrapezoidal Method IN  Numerical Analysis
Trapezoidal Method IN Numerical Analysis
 
A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...A semi analytic method for solving two-dimensional fractional dispersion equa...
A semi analytic method for solving two-dimensional fractional dispersion equa...
 
Data Analysis Assignment Help
Data Analysis Assignment HelpData Analysis Assignment Help
Data Analysis Assignment Help
 
This is testing Algorithm Writing For this assessment we will be c.pdf
This is testing Algorithm Writing For this assessment we will be c.pdfThis is testing Algorithm Writing For this assessment we will be c.pdf
This is testing Algorithm Writing For this assessment we will be c.pdf
 
Intro
IntroIntro
Intro
 
A Solution Manual And Notes For Kalman Filtering Theory And Practice Using ...
A Solution Manual And Notes For  Kalman Filtering  Theory And Practice Using ...A Solution Manual And Notes For  Kalman Filtering  Theory And Practice Using ...
A Solution Manual And Notes For Kalman Filtering Theory And Practice Using ...
 
Free Ebooks Download
Free Ebooks Download Free Ebooks Download
Free Ebooks Download
 
Integrating_Factors
Integrating_FactorsIntegrating_Factors
Integrating_Factors
 
Ch03 2
Ch03 2Ch03 2
Ch03 2
 

Plus de Rendy Robert (20)

Ch08 3
Ch08 3Ch08 3
Ch08 3
 
Ch07 9
Ch07 9Ch07 9
Ch07 9
 
Ch07 8
Ch07 8Ch07 8
Ch07 8
 
Ch07 6
Ch07 6Ch07 6
Ch07 6
 
Ch07 5
Ch07 5Ch07 5
Ch07 5
 
Ch07 4
Ch07 4Ch07 4
Ch07 4
 
Ch07 3
Ch07 3Ch07 3
Ch07 3
 
Ch07 2
Ch07 2Ch07 2
Ch07 2
 
Ch07 1
Ch07 1Ch07 1
Ch07 1
 
Ch06 6
Ch06 6Ch06 6
Ch06 6
 
Ch06 5
Ch06 5Ch06 5
Ch06 5
 
Ch06 4
Ch06 4Ch06 4
Ch06 4
 
Ch06 3
Ch06 3Ch06 3
Ch06 3
 
Ch06 2
Ch06 2Ch06 2
Ch06 2
 
Ch06 1
Ch06 1Ch06 1
Ch06 1
 
Ch05 8
Ch05 8Ch05 8
Ch05 8
 
Ch05 7
Ch05 7Ch05 7
Ch05 7
 
Ch05 6
Ch05 6Ch05 6
Ch05 6
 
Ch05 5
Ch05 5Ch05 5
Ch05 5
 
Ch05 2
Ch05 2Ch05 2
Ch05 2
 

Numerical Approximations Using Euler's Method

  • 1. Ch 2.7: Numerical Approximations: Euler’s Method Recall that a first order initial value problem has the form If f and ∂f/∂y are continuous, then this IVP has a unique solution y = φ(t) in some interval about t0. When the differential equation is linear, separable or exact, we can find the solution by symbolic manipulations. However, the solutions for most differential equations of this form cannot be found by analytical means. Therefore it is important to be able to approach the problem in other ways. 00 )(),,( ytyytf dt dy ==
  • 2. Direction Fields For the first order initial value problem we can sketch a direction field and visualize the behavior of solutions. This has the advantage of being a relatively simple process, even for complicated equations. However, direction fields do not lend themselves to quantitative computations or comparisons. ,)(),,( 00 ytyytfy ==′
  • 3. Numerical Methods For our first order initial value problem an alternative is to compute approximate values of the solution y = φ(t) at a selected set of t-values. Ideally, the approximate solution values will be accompanied by error bounds that ensure the level of accuracy. There are many numerical methods that produce numerical approximations to solutions of differential equations, some of which are discussed in Chapter 8. In this section, we examine the tangent line method, which is also called Euler’s Method. ,)(),,( 00 ytyytfy ==′
  • 4. Euler’s Method: Tangent Line Approximation For the initial value problem we begin by approximating solution y = φ(t) at initial point t0. The solution passes through initial point (t0, y0) with slope f(t0,y0). The line tangent to solution at initial point is thus The tangent line is a good approximation to solution curve on an interval short enough. Thus if t1 is close enough to t0, we can approximate φ(t1) by ( )( )0000 , ttytfyy −+= ,)(),,( 00 ytyytfy ==′ ( )( )010001 , ttytfyy −+=
  • 5. Euler’s Formula For a point t2 close to t1, we approximate φ(t2) using the line passing through (t1, y1) with slope f(t1,y1): Thus we create a sequence yn of approximations to φ(tn): where fn = f(tn,yn). For a uniform step size h = tn – tn-1, Euler’s formula becomes ( ) ( ) ( )nnnnn ttfyy ttfyy ttfyy −⋅+= −⋅+= −⋅+= ++ 11 12112 01001  ( )( )121112 , ttytfyy −+= ,2,1,0,1 =+=+ nhfyy nnn
  • 6. Euler Approximation To graph an Euler approximation, we plot the points (t0, y0), (t1, y1),…, (tn, yn), and then connect these points with line segments. ( ) ( )nnnnnnnn ytffttfyy ,where,11 =−⋅+= ++
  • 7. Example 1: Euler’s Method (1 of 3) For the initial value problem we can use Euler’s method with h = 0.1 to approximate the solution at t = 0.1, 0.2, 0.3, 0.4, as shown below. ( )( )( ) ( )( )( ) ( )( )( ) 80.3)1.0(88.22.08.988.2 88.2)1.0(94.12.08.994.1 94.1)1.0(98.2.08.998. 98.)1.0(8.90 334 223 112 001 ≈−+=⋅+= ≈−+=⋅+= ≈−+=⋅+= =+=⋅+= hfyy hfyy hfyy hfyy 0)0(,2.08.9 =−=′ yyy
  • 8. Example 1: Exact Solution (2 of 3) We can find the exact solution to our IVP, as in Chapter 1.2: ( ) ( )t Ct ey ky ekkey Cty dt y dy yy yyy 2.0 2.0 149 491)0( ,49 2.049ln 2.0 49 492.0 0)0(,2.08.9 − − −=⇒ −=⇒= ±=+= +−=− −= − −−=′ =−=′
  • 9. Example 1: Error Analysis (3 of 3) From table below, we see that the errors are small. This is most likely due to round-off error and the fact that the exact solution is approximately linear on [0, 0.4]. Note: t Exact y Approx y Error % Rel Error 0.00 0 0.00 0.00 0.00 0.10 0.97 0.98 -0.01 -1.03 0.20 1.92 1.94 -0.02 -1.04 0.30 2.85 2.88 -0.03 -1.05 0.40 3.77 3.8 -0.03 -0.80 100ErrorRelativePercent × − = exact approxexact y yy
  • 10. Example 2: Euler’s Method (1 of 3) For the initial value problem we can use Euler’s method with h = 0.1 to approximate the solution at t = 1, 2, 3, and 4, as shown below. Exact solution (see Chapter 2.1): ( ) ( ) ( ) ( )  15.4)1.0()15.3)(2(3.0415.3 15.3)1.0()31.2)(2(2.0431.2 31.2)1.0()6.1)(2(1.046.1 6.1)1.0()1)(2(041 334 223 112 001 ≈+−+=⋅+= ≈+−+=⋅+= =+−+=⋅+= =+−+=⋅+= hfyy hfyy hfyy hfyy 1)0(,24 =+−=′ yyty t ety 2 4 11 2 1 4 7 ++−=
  • 11. Example 2: Error Analysis (2 of 3) The first ten Euler approxs are given in table below on left. A table of approximations for t = 0, 1, 2, 3 is given on right. See text for numerical results with h = 0.05, 0.025, 0.01. The errors are small initially, but quickly reach an unacceptable level. This suggests a nonlinear solution. t Exact y Approx y Error % Rel Error 0.00 1.00 1.00 0.00 0.00 0.10 1.66 1.60 0.06 3.55 0.20 2.45 2.31 0.14 5.81 0.30 3.41 3.15 0.26 7.59 0.40 4.57 4.15 0.42 9.14 0.50 5.98 5.34 0.63 10.58 0.60 7.68 6.76 0.92 11.96 0.70 9.75 8.45 1.30 13.31 0.80 12.27 10.47 1.80 14.64 0.90 15.34 12.89 2.45 15.96 1.00 19.07 15.78 3.29 17.27 t Exact y Approx y Error % Rel Error 0.00 1.00 1.00 0.00 0.00 1.00 19.07 15.78 3.29 17.27 2.00 149.39 104.68 44.72 29.93 3.00 1109.18 652.53 456.64 41.17 4.00 8197.88 4042.12 4155.76 50.69 t ety 2 4 11 2 1 4 7 :SolutionExact ++−=
  • 12. Example 2: Error Analysis & Graphs (3 of 3) Given below are graphs showing the exact solution (red) plotted together with the Euler approximation (blue). t Exact y Approx y Error % Rel Error 0.00 1.00 1.00 0.00 0.00 1.00 19.07 15.78 3.29 17.27 2.00 149.39 104.68 44.72 29.93 3.00 1109.18 652.53 456.64 41.17 4.00 8197.88 4042.12 4155.76 50.69 t ety 2 4 11 2 1 4 7 :SolutionExact ++−=
  • 13. General Error Analysis Discussion (1 of 4) Recall that if f and ∂f/∂y are continuous, then our first order initial value problem has a solution y = φ(t) in some interval about t0. In fact, the equation has infinitely many solutions, each one indexed by a constant c determined by the initial condition. Thus φ is the member of an infinite family of solutions that satisfies φ(t0) = y0. 00 )(),,( ytyytfy ==′
  • 14. General Error Analysis Discussion (2 of 4) The first step of Euler’s method uses the tangent line to φ at the point (t0, y0) in order to estimate φ(t1) with y1. The point (t1, y1) is typically not on the graph of φ, because y1 is an approximation of φ(t1). Thus the next iteration of Euler’s method does not use a tangent line approximation to φ, but rather to a nearby solution φ1 that passes through the point (t1, y1). Thus Euler’s method uses a succession of tangent lines to a sequence of different solutions φ, φ1, φ2,… of the differential equation.
  • 15. Error Analysis Example: Converging Family of Solutions (3 of 4) Since Euler’s method uses tangent lines to a sequence of different solutions, the accuracy after many steps depends on behavior of solutions passing through (tn, yn), n = 1, 2, 3, … For example, consider the following initial value problem: The direction field and graphs of a few solution curves are given below. Note that it doesn’t matter which solutions we are approximating with tangent lines, as all solutions get closer to each other as t increases. Results of using Euler’s method for this equation are given in text. 2/ 326)(1)0(,23 ttt eetyyyey −−− −−==⇒=−+=′ φ
  • 16. Error Analysis Example: Divergent Family of Solutions (4 of 4) Now consider the initial value problem for Example 2: The direction field and graphs of solution curves are given below. Since the family of solutions is divergent, at each step of Euler’s method we are following a different solution than the previous step, with each solution separating from the desired one more and more as t increases. 4112471)0(,24 2t etyyyty ++−=⇒=+−=′
  • 17. Error Bounds and Numerical Methods In using a numerical procedure, keep in mind the question of whether the results are accurate enough to be useful. In our examples, we compared approximations with exact solutions. However, numerical procedures are usually used when an exact solution is not available. What is needed are bounds for (or estimates of) errors, which do not require knowledge of exact solution. More discussion on these issues and other numerical methods is given in Chapter 8. Since numerical approximations ideally reflect behavior of solution, a member of a diverging family of solutions is harder to approximate than a member of a converging family. Also, direction fields are often a relatively easy first step in understanding behavior of solutions.