SlideShare une entreprise Scribd logo
1  sur  13
Part 7:
Ordinary Differential Equations
–
–
–
–
–

Runge-Kutta Methods
Euler’s Method
Heun’s Method
Midpoint method
Systems of Equations
Runge-Kutta Methods
 We want to solve an ordinary differential equation of the form:
y

'

dy

f ( x, y )

dx

 The general approach of the solution is in the form of:
(new value)=(old value) + (slope) x (step size)

 All of the one-step methods under this
general category are called RungeKutta methods.
> Euler’s method
> Heun’s method
> Midpoint method
 The differences in these methods are
in the way (slope) is defined.

Slope=

yi

xi

xi

1

1

yi

h
Euler’s Method
 Simplest way of approximating the slope is in the form of first
derivative. Apply forward scheme finite difference for the starting
point:
y

yi

'

yi

1

h

predicted

f ( xi , yi )

yi

Then,
yi

1

yi

f ( xi , y i ) h

Euler’s
method
formula

where f(xi, yi) is calculated from
the initial condition.

1

true

yi

xi

xi

1

 That is the slope at the beginning is approximated as the slope
over the entire interval.
 As in the forward scheme finite difference method, error for this
approximation is O(h).
EX: Use Euler’s method to solve
dy

2x

3

12 x

2

20 x

8 .5

dx

from x=0 to x=2 with a step size of 0.5. The initial condition at x=0 is y=1.
Differential equation: f ( x , y )
Using Euler’s formula:
y ( 0 .5 )

y (0)

f ( 0 ,1) 0 . 5

2x

3

12 x

5 . 25

2

20 x

t

8 .5

63 . 1 %

Second step:
y (1)

y ( 0 .5 )

f ( 0 . 5,5 . 25 ) 0 . 5

5 . 875

t

95 . 8 %

Other steps:
y (1 . 5 )

5 . 1250

y ( 2 .0 )

4 . 5000

t
t

131 %
125 . 0 %

Error can be reduced by using a smaller step size (h).
Considering that Euler’s method has an error O(h), halving the step size will
halve the error.
Heun’s Method
 It is an improvement of Euler’s method.
 Improve the slope of the interval by averaging derivatives at the
starting and end points.
Slope=f(xi+1’ yi+10)

Slope=[f(xi’ yi)+f(xi+1’ yi+10)]/2

Slope=f(xi’ yi)

xi

Predictor

xi

1

xi

Corrector

xi

1
Approximate the slope at the starting point using Euler’s method
y

'

f ( x, y )

Extrapolate linearly to find y at the end point:
0

yi

yi

1

f ( xi , y i ) h

standard Euler method stops here.

This intermediate solution (predictor) is used to calculate the slope
at the end point:
'

0

yi

f ( xi 1 , yi 1 )

1

Calculate average of the two slopes at the starting and end points:
'

'

yi

'

y

yi

1

2

Use this slope to re-calculate y value at the end point (corrector):
'

yi

1

yi

yh
0

Predictor:
Corrector:

yi
yi

1

yi

1

yi

f ( xi , y i ) h

f ( xi , y i )

0

f ( xi 1 , y i 1 )

h

Heun’s
method

2

 Corrector equation involves yi+1 on both sides, which means that it
can be applied iteratively for the end point (i.e., older
approximation can be used iteratively to calculate a new
approximation).
 The iteration does not necessarily converge to the true solution
but approaches a solution with a finite truncation error.
 The method is accurate to O(h2).(compare to O(h) accuracy of
Euler’s method).
EX: Use Heun’s method to numerically solve the following ODE
y

'

4e

0 .8 x

0 .5 y

from x=0 to x=4 with a step size of h=1. Initial condition is (0,2).
Calculate the slope at the starting point (x=0):
'

y0

4e

0

0 .5 ( 2 )

3

Apply Euler’s (predictor) formula to evaluate y10
0

y1

2

3 (1)

5

t

25 . 3 %

Calculate slope at the end point (x=1)
'

0

y1

f ( x1 , y 1 )

4e

0 . 8 (1 )

0 .5 (5 )

Calculate average of the two slopes:
'

y

3

6 . 401164
2

4 . 701082

6 . 402164

Euler’s
method
Use the corrector formula to calculate the new prediction at x=1:
y1

2

4 . 701082 (1)

6 . 701082

t

8 . 18 %

Above is based on a single iteration at y1. Apply another iteration to refine the
predictor:
y1

2

[3

4e

0 . 8 (1 )

0 . 5 ( 6 . 701082 )]

6 . 275811

t

1 . 31 %

6 . 382129

t

3 . 03 %

2

Further correction:
y1

2

[3

4e

0 . 8 (1 )

Results for all the
points from x=0 to x=4:
(15 iterations at each point)

0 . 5 ( 6 . 275811 )]
2

x

y (true)

y (Heun)

0

2.0000000

2.0000000

0.00

1

6.1946314

6.360866

2.68

2

14.843922

15.302237

3.09

3

33.677172

34.743276

3.17

4

75.338963

77.735096

3.18

t(%)
Midpoint Method
 It is another improvement of Euler’s method.
 Approximate y at the midpoint of the interval, and use it for the
average slope of the entire interval.
Slope=f(xi+1/2’ yi+1/2)

Slope=f(xi+1/2’ yi+1/2)

xi

xi
yi

1/ 2

yi

f ( xi , yi )

Predictor

xi

1/ 2

h
2

yi

1

yi

f ( xi

1/ 2

Corrector

xi
, yi

1

1/ 2

)h
 No iteration can be made for the corrector.
 Just as the centered difference is superior to forward or backward
difference schemes, midpoint is superior to Euler’s method in the
same manner.

Euler’s method
Midpoint method

O(h)
O(h2)

truncation error

Summary:
 All the three methods, Euler’s, Heun’s (without iteration), and
midpoint methods, mentioned so far are under the general
category of one-step approaches called Runge-Kutta methods.
 Heun’s and midpoint methods are generally superior to Euler’s
method, even though they require somewhat more calculations.
Systems of Equations
 Problems requiring the solution of a system of ODE’s are very
common in engineering applications.
dy 1
dx
dy 2
dx

f 1 ( x , y 1 , y 2 ,..., y n )
f 2 ( x , y 1 , y 2 ,..., y n )

....
dy n
dx

n- initial conditions
need to be known
at the starting
value of x

f n ( x , y 1 , y 2 ,..., y n )

Euler’s Method:
 Simply apply Euler’s method for each equation at each step.
 Strcictly apply the one-step Euler’s formula for every equation
before proceeding to the next-step (i.e., do not update any
variable during a single step).
EX: Solve the following system of ODEs using Euler’s method.
dy 1

dy 2

0 .5 y1

dx

dx

4

0 .3 y 2

0 .1 y1

Assume that for x=0, y1=4, and y2=6. Integrate to x=2 with a step size h=0.5.
Apply Euler’s method:
y1 ( 0 . 5 )

4

y 2 ( 0 .5 )

6

0 .5 ( 4 ) 0 .5
4

0 .3( 6 )

3
0 . 1( 4 ) 0 . 5

6 .9

Other points are calculated in the same fashion. Results to x=2 are below:
x

y1

y2

0

4

6

0.5

3

6.9

1.0

2.25

7.715

1.5

1.6875

8.44525

2.0

1.265625

9.094087

Contenu connexe

Tendances

Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Syed Ahmed Zaki
 
Runge kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...
Runge  kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...Runge  kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...
Runge kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...Prashant Goad
 
application of first order ordinary Differential equations
application of first order ordinary Differential equationsapplication of first order ordinary Differential equations
application of first order ordinary Differential equationsEmdadul Haque Milon
 
Runge-Kutta methods with examples
Runge-Kutta methods with examplesRunge-Kutta methods with examples
Runge-Kutta methods with examplesSajjad Hossain
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equationsmuhammadabullah
 
Partial differential equation & its application.
Partial differential equation & its application.Partial differential equation & its application.
Partial differential equation & its application.isratzerin6
 
Partial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examplesPartial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examplesEnrique Valderrama
 
Newton divided difference interpolation
Newton divided difference interpolationNewton divided difference interpolation
Newton divided difference interpolationVISHAL DONGA
 
Boundary Value Problems - Finite Difference
Boundary Value Problems - Finite DifferenceBoundary Value Problems - Finite Difference
Boundary Value Problems - Finite DifferenceMohammad Tawfik
 
Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Asad Ali
 
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJ
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJAPPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJ
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJZuhair Bin Jawaid
 
Fixed point iteration
Fixed point iterationFixed point iteration
Fixed point iterationIsaac Yowetu
 
Runge Kutta Method
Runge Kutta Method Runge Kutta Method
Runge Kutta Method Bhavik Vashi
 
Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Muhammad Waqas
 
Solution of equations and eigenvalue problems
Solution of equations and eigenvalue problemsSolution of equations and eigenvalue problems
Solution of equations and eigenvalue problemsSanthanam Krishnan
 
Interpolation in Numerical Methods
Interpolation in Numerical Methods Interpolation in Numerical Methods
Interpolation in Numerical Methods Dr. Tushar J Bhatt
 
Partial differentiation
Partial differentiationPartial differentiation
Partial differentiationTanuj Parikh
 

Tendances (20)

Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)Presentation on Numerical Method (Trapezoidal Method)
Presentation on Numerical Method (Trapezoidal Method)
 
Runge kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...
Runge  kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...Runge  kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...
Runge kutta method -by Prof.Prashant Goad(R.C.Patel Institute of Technology,...
 
Runge Kutta Method
Runge Kutta MethodRunge Kutta Method
Runge Kutta Method
 
application of first order ordinary Differential equations
application of first order ordinary Differential equationsapplication of first order ordinary Differential equations
application of first order ordinary Differential equations
 
Runge-Kutta methods with examples
Runge-Kutta methods with examplesRunge-Kutta methods with examples
Runge-Kutta methods with examples
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
 
Partial differential equation & its application.
Partial differential equation & its application.Partial differential equation & its application.
Partial differential equation & its application.
 
Partial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examplesPartial Differential Equations, 3 simple examples
Partial Differential Equations, 3 simple examples
 
Runge kutta
Runge kuttaRunge kutta
Runge kutta
 
Newton divided difference interpolation
Newton divided difference interpolationNewton divided difference interpolation
Newton divided difference interpolation
 
Boundary Value Problems - Finite Difference
Boundary Value Problems - Finite DifferenceBoundary Value Problems - Finite Difference
Boundary Value Problems - Finite Difference
 
Interpolation
InterpolationInterpolation
Interpolation
 
Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2Numerical Analysis (Solution of Non-Linear Equations) part 2
Numerical Analysis (Solution of Non-Linear Equations) part 2
 
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJ
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJAPPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJ
APPLICATIONS OF DIFFERENTIAL EQUATIONS-ZBJ
 
Fixed point iteration
Fixed point iterationFixed point iteration
Fixed point iteration
 
Runge Kutta Method
Runge Kutta Method Runge Kutta Method
Runge Kutta Method
 
Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1Engineering Numerical Analysis Lecture-1
Engineering Numerical Analysis Lecture-1
 
Solution of equations and eigenvalue problems
Solution of equations and eigenvalue problemsSolution of equations and eigenvalue problems
Solution of equations and eigenvalue problems
 
Interpolation in Numerical Methods
Interpolation in Numerical Methods Interpolation in Numerical Methods
Interpolation in Numerical Methods
 
Partial differentiation
Partial differentiationPartial differentiation
Partial differentiation
 

En vedette

Eulermethod2
Eulermethod2Eulermethod2
Eulermethod2stellajoh
 
Numerical solution using runge kutta with programming in c++
Numerical solution using runge kutta with programming in c++Numerical solution using runge kutta with programming in c++
Numerical solution using runge kutta with programming in c++Vijay Choudhary
 
AP Calculus AB March 25, 2009
AP Calculus AB March 25, 2009AP Calculus AB March 25, 2009
AP Calculus AB March 25, 2009Darren Kuropatwa
 
MILNE'S PREDICTOR CORRECTOR METHOD
MILNE'S PREDICTOR CORRECTOR METHODMILNE'S PREDICTOR CORRECTOR METHOD
MILNE'S PREDICTOR CORRECTOR METHODKavin Raval
 
AP Calculus AB March 26, 2009
AP Calculus AB March 26, 2009AP Calculus AB March 26, 2009
AP Calculus AB March 26, 2009Darren Kuropatwa
 
DIFFRENTIAL EQUATIONS
DIFFRENTIAL EQUATIONSDIFFRENTIAL EQUATIONS
DIFFRENTIAL EQUATIONSAafaq Malik
 
Adequacy of solutions
Adequacy of solutionsAdequacy of solutions
Adequacy of solutionsTarun Gehlot
 
A2 /EXPT/THER/KELLY/APRIL
A2 /EXPT/THER/KELLY/APRILA2 /EXPT/THER/KELLY/APRIL
A2 /EXPT/THER/KELLY/APRILRama Chandra
 
Applied numerical methods lec6
Applied numerical methods lec6Applied numerical methods lec6
Applied numerical methods lec6Yasser Ahmed
 
Cequel: Chemical Equilibrium in Excel
Cequel:  Chemical Equilibrium in ExcelCequel:  Chemical Equilibrium in Excel
Cequel: Chemical Equilibrium in ExcelJonathan French
 
Eulermethod3
Eulermethod3Eulermethod3
Eulermethod3stellajoh
 
Euler method notes sb
Euler method notes sbEuler method notes sb
Euler method notes sbjanetvmiller
 

En vedette (20)

Eulermethod2
Eulermethod2Eulermethod2
Eulermethod2
 
Unit vi
Unit viUnit vi
Unit vi
 
Numerical solution using runge kutta with programming in c++
Numerical solution using runge kutta with programming in c++Numerical solution using runge kutta with programming in c++
Numerical solution using runge kutta with programming in c++
 
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
 
Ch02 7
Ch02 7Ch02 7
Ch02 7
 
MILNE'S PREDICTOR CORRECTOR METHOD
MILNE'S PREDICTOR CORRECTOR METHODMILNE'S PREDICTOR CORRECTOR METHOD
MILNE'S PREDICTOR CORRECTOR METHOD
 
AP Calculus AB March 26, 2009
AP Calculus AB March 26, 2009AP Calculus AB March 26, 2009
AP Calculus AB March 26, 2009
 
Calc 6.1b
Calc 6.1bCalc 6.1b
Calc 6.1b
 
DIFFRENTIAL EQUATIONS
DIFFRENTIAL EQUATIONSDIFFRENTIAL EQUATIONS
DIFFRENTIAL EQUATIONS
 
Numerical Integration
Numerical IntegrationNumerical Integration
Numerical Integration
 
Ma2002 1.6 rm
Ma2002 1.6 rmMa2002 1.6 rm
Ma2002 1.6 rm
 
Adequacy of solutions
Adequacy of solutionsAdequacy of solutions
Adequacy of solutions
 
Ma2002 1.16 rm
Ma2002 1.16 rmMa2002 1.16 rm
Ma2002 1.16 rm
 
A2 /EXPT/THER/KELLY/APRIL
A2 /EXPT/THER/KELLY/APRILA2 /EXPT/THER/KELLY/APRIL
A2 /EXPT/THER/KELLY/APRIL
 
Applied numerical methods lec6
Applied numerical methods lec6Applied numerical methods lec6
Applied numerical methods lec6
 
Cequel: Chemical Equilibrium in Excel
Cequel:  Chemical Equilibrium in ExcelCequel:  Chemical Equilibrium in Excel
Cequel: Chemical Equilibrium in Excel
 
Eulermethod3
Eulermethod3Eulermethod3
Eulermethod3
 
Euler method notes sb
Euler method notes sbEuler method notes sb
Euler method notes sb
 
10 09
10 0910 09
10 09
 

Similaire à Es272 ch7

Applications Of MATLAB Ordinary Differential Equations (ODE
Applications Of MATLAB  Ordinary Differential Equations (ODEApplications Of MATLAB  Ordinary Differential Equations (ODE
Applications Of MATLAB Ordinary Differential Equations (ODEJustin Knight
 
Computational techniques
Computational techniquesComputational techniques
Computational techniquesRafi Dar
 
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docxCALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docxRAHUL126667
 
numericalmethods.pdf
numericalmethods.pdfnumericalmethods.pdf
numericalmethods.pdfShailChettri
 
Mit18 330 s12_chapter5
Mit18 330 s12_chapter5Mit18 330 s12_chapter5
Mit18 330 s12_chapter5CAALAAA
 
Complex Variables and Numerical Methods
Complex Variables and Numerical MethodsComplex Variables and Numerical Methods
Complex Variables and Numerical MethodsDhrumit Patel
 
Introduction to Differential Equations
Introduction to Differential EquationsIntroduction to Differential Equations
Introduction to Differential EquationsVishvaraj Chauhan
 
Episode 50 : Simulation Problem Solution Approaches Convergence Techniques S...
Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques S...Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques S...
Episode 50 : Simulation Problem Solution Approaches Convergence Techniques S...SAJJAD KHUDHUR ABBAS
 
presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve Mukuldev Khunte
 
MATLAB ODE
MATLAB ODEMATLAB ODE
MATLAB ODEKris014
 
Trapezoidal Method IN Numerical Analysis
Trapezoidal Method IN  Numerical AnalysisTrapezoidal Method IN  Numerical Analysis
Trapezoidal Method IN Numerical AnalysisMostafijur Rahman
 
Maths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayMaths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayDr. Asish K Mukhopadhyay
 
Numerical Analysis and Its application to Boundary Value Problems
Numerical Analysis and Its application to Boundary Value ProblemsNumerical Analysis and Its application to Boundary Value Problems
Numerical Analysis and Its application to Boundary Value ProblemsGobinda Debnath
 

Similaire à Es272 ch7 (20)

Applications Of MATLAB Ordinary Differential Equations (ODE
Applications Of MATLAB  Ordinary Differential Equations (ODEApplications Of MATLAB  Ordinary Differential Equations (ODE
Applications Of MATLAB Ordinary Differential Equations (ODE
 
Computational techniques
Computational techniquesComputational techniques
Computational techniques
 
Term project
Term projectTerm project
Term project
 
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docxCALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
CALIFORNIA STATE UNIVERSITY, NORTHRIDGEMECHANICAL ENGINEERIN.docx
 
numericalmethods.pdf
numericalmethods.pdfnumericalmethods.pdf
numericalmethods.pdf
 
Euler Method
Euler MethodEuler Method
Euler Method
 
Mit18 330 s12_chapter5
Mit18 330 s12_chapter5Mit18 330 s12_chapter5
Mit18 330 s12_chapter5
 
Maths digital text
Maths digital textMaths digital text
Maths digital text
 
Calc 6.1a
Calc 6.1aCalc 6.1a
Calc 6.1a
 
Computational Dynamics edited
Computational Dynamics editedComputational Dynamics edited
Computational Dynamics edited
 
Complex Variables and Numerical Methods
Complex Variables and Numerical MethodsComplex Variables and Numerical Methods
Complex Variables and Numerical Methods
 
Introduction to Differential Equations
Introduction to Differential EquationsIntroduction to Differential Equations
Introduction to Differential Equations
 
Calculus
CalculusCalculus
Calculus
 
Episode 50 : Simulation Problem Solution Approaches Convergence Techniques S...
Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques S...Episode 50 :  Simulation Problem Solution Approaches Convergence Techniques S...
Episode 50 : Simulation Problem Solution Approaches Convergence Techniques S...
 
presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve presentation on Euler and Modified Euler method ,and Fitting of curve
presentation on Euler and Modified Euler method ,and Fitting of curve
 
Ijmet 10 01_021
Ijmet 10 01_021Ijmet 10 01_021
Ijmet 10 01_021
 
MATLAB ODE
MATLAB ODEMATLAB ODE
MATLAB ODE
 
Trapezoidal Method IN Numerical Analysis
Trapezoidal Method IN  Numerical AnalysisTrapezoidal Method IN  Numerical Analysis
Trapezoidal Method IN Numerical Analysis
 
Maths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K MukhopadhyayMaths iii quick review by Dr Asish K Mukhopadhyay
Maths iii quick review by Dr Asish K Mukhopadhyay
 
Numerical Analysis and Its application to Boundary Value Problems
Numerical Analysis and Its application to Boundary Value ProblemsNumerical Analysis and Its application to Boundary Value Problems
Numerical Analysis and Its application to Boundary Value Problems
 

Plus de Batuhan Yıldırım (10)

Es272 ch6
Es272 ch6Es272 ch6
Es272 ch6
 
Es272 ch5b
Es272 ch5bEs272 ch5b
Es272 ch5b
 
Es272 ch5a
Es272 ch5aEs272 ch5a
Es272 ch5a
 
Es272 ch4b
Es272 ch4bEs272 ch4b
Es272 ch4b
 
Es272 ch4a
Es272 ch4aEs272 ch4a
Es272 ch4a
 
Es272 ch1
Es272 ch1Es272 ch1
Es272 ch1
 
Es272 ch0
Es272 ch0Es272 ch0
Es272 ch0
 
Es272 ch3b
Es272 ch3bEs272 ch3b
Es272 ch3b
 
Es272 ch3a
Es272 ch3aEs272 ch3a
Es272 ch3a
 
Es272 ch2
Es272 ch2Es272 ch2
Es272 ch2
 

Dernier

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Dernier (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Es272 ch7

  • 1. Part 7: Ordinary Differential Equations – – – – – Runge-Kutta Methods Euler’s Method Heun’s Method Midpoint method Systems of Equations
  • 2. Runge-Kutta Methods  We want to solve an ordinary differential equation of the form: y ' dy f ( x, y ) dx  The general approach of the solution is in the form of: (new value)=(old value) + (slope) x (step size)  All of the one-step methods under this general category are called RungeKutta methods. > Euler’s method > Heun’s method > Midpoint method  The differences in these methods are in the way (slope) is defined. Slope= yi xi xi 1 1 yi h
  • 3. Euler’s Method  Simplest way of approximating the slope is in the form of first derivative. Apply forward scheme finite difference for the starting point: y yi ' yi 1 h predicted f ( xi , yi ) yi Then, yi 1 yi f ( xi , y i ) h Euler’s method formula where f(xi, yi) is calculated from the initial condition. 1 true yi xi xi 1  That is the slope at the beginning is approximated as the slope over the entire interval.  As in the forward scheme finite difference method, error for this approximation is O(h).
  • 4. EX: Use Euler’s method to solve dy 2x 3 12 x 2 20 x 8 .5 dx from x=0 to x=2 with a step size of 0.5. The initial condition at x=0 is y=1. Differential equation: f ( x , y ) Using Euler’s formula: y ( 0 .5 ) y (0) f ( 0 ,1) 0 . 5 2x 3 12 x 5 . 25 2 20 x t 8 .5 63 . 1 % Second step: y (1) y ( 0 .5 ) f ( 0 . 5,5 . 25 ) 0 . 5 5 . 875 t 95 . 8 % Other steps: y (1 . 5 ) 5 . 1250 y ( 2 .0 ) 4 . 5000 t t 131 % 125 . 0 % Error can be reduced by using a smaller step size (h). Considering that Euler’s method has an error O(h), halving the step size will halve the error.
  • 5. Heun’s Method  It is an improvement of Euler’s method.  Improve the slope of the interval by averaging derivatives at the starting and end points. Slope=f(xi+1’ yi+10) Slope=[f(xi’ yi)+f(xi+1’ yi+10)]/2 Slope=f(xi’ yi) xi Predictor xi 1 xi Corrector xi 1
  • 6. Approximate the slope at the starting point using Euler’s method y ' f ( x, y ) Extrapolate linearly to find y at the end point: 0 yi yi 1 f ( xi , y i ) h standard Euler method stops here. This intermediate solution (predictor) is used to calculate the slope at the end point: ' 0 yi f ( xi 1 , yi 1 ) 1 Calculate average of the two slopes at the starting and end points: ' ' yi ' y yi 1 2 Use this slope to re-calculate y value at the end point (corrector): ' yi 1 yi yh
  • 7. 0 Predictor: Corrector: yi yi 1 yi 1 yi f ( xi , y i ) h f ( xi , y i ) 0 f ( xi 1 , y i 1 ) h Heun’s method 2  Corrector equation involves yi+1 on both sides, which means that it can be applied iteratively for the end point (i.e., older approximation can be used iteratively to calculate a new approximation).  The iteration does not necessarily converge to the true solution but approaches a solution with a finite truncation error.  The method is accurate to O(h2).(compare to O(h) accuracy of Euler’s method).
  • 8. EX: Use Heun’s method to numerically solve the following ODE y ' 4e 0 .8 x 0 .5 y from x=0 to x=4 with a step size of h=1. Initial condition is (0,2). Calculate the slope at the starting point (x=0): ' y0 4e 0 0 .5 ( 2 ) 3 Apply Euler’s (predictor) formula to evaluate y10 0 y1 2 3 (1) 5 t 25 . 3 % Calculate slope at the end point (x=1) ' 0 y1 f ( x1 , y 1 ) 4e 0 . 8 (1 ) 0 .5 (5 ) Calculate average of the two slopes: ' y 3 6 . 401164 2 4 . 701082 6 . 402164 Euler’s method
  • 9. Use the corrector formula to calculate the new prediction at x=1: y1 2 4 . 701082 (1) 6 . 701082 t 8 . 18 % Above is based on a single iteration at y1. Apply another iteration to refine the predictor: y1 2 [3 4e 0 . 8 (1 ) 0 . 5 ( 6 . 701082 )] 6 . 275811 t 1 . 31 % 6 . 382129 t 3 . 03 % 2 Further correction: y1 2 [3 4e 0 . 8 (1 ) Results for all the points from x=0 to x=4: (15 iterations at each point) 0 . 5 ( 6 . 275811 )] 2 x y (true) y (Heun) 0 2.0000000 2.0000000 0.00 1 6.1946314 6.360866 2.68 2 14.843922 15.302237 3.09 3 33.677172 34.743276 3.17 4 75.338963 77.735096 3.18 t(%)
  • 10. Midpoint Method  It is another improvement of Euler’s method.  Approximate y at the midpoint of the interval, and use it for the average slope of the entire interval. Slope=f(xi+1/2’ yi+1/2) Slope=f(xi+1/2’ yi+1/2) xi xi yi 1/ 2 yi f ( xi , yi ) Predictor xi 1/ 2 h 2 yi 1 yi f ( xi 1/ 2 Corrector xi , yi 1 1/ 2 )h
  • 11.  No iteration can be made for the corrector.  Just as the centered difference is superior to forward or backward difference schemes, midpoint is superior to Euler’s method in the same manner. Euler’s method Midpoint method O(h) O(h2) truncation error Summary:  All the three methods, Euler’s, Heun’s (without iteration), and midpoint methods, mentioned so far are under the general category of one-step approaches called Runge-Kutta methods.  Heun’s and midpoint methods are generally superior to Euler’s method, even though they require somewhat more calculations.
  • 12. Systems of Equations  Problems requiring the solution of a system of ODE’s are very common in engineering applications. dy 1 dx dy 2 dx f 1 ( x , y 1 , y 2 ,..., y n ) f 2 ( x , y 1 , y 2 ,..., y n ) .... dy n dx n- initial conditions need to be known at the starting value of x f n ( x , y 1 , y 2 ,..., y n ) Euler’s Method:  Simply apply Euler’s method for each equation at each step.  Strcictly apply the one-step Euler’s formula for every equation before proceeding to the next-step (i.e., do not update any variable during a single step).
  • 13. EX: Solve the following system of ODEs using Euler’s method. dy 1 dy 2 0 .5 y1 dx dx 4 0 .3 y 2 0 .1 y1 Assume that for x=0, y1=4, and y2=6. Integrate to x=2 with a step size h=0.5. Apply Euler’s method: y1 ( 0 . 5 ) 4 y 2 ( 0 .5 ) 6 0 .5 ( 4 ) 0 .5 4 0 .3( 6 ) 3 0 . 1( 4 ) 0 . 5 6 .9 Other points are calculated in the same fashion. Results to x=2 are below: x y1 y2 0 4 6 0.5 3 6.9 1.0 2.25 7.715 1.5 1.6875 8.44525 2.0 1.265625 9.094087