SlideShare a Scribd company logo
Finite Difference Methods
5/10/2015 1
Gaurav Mallik
SAU/AM(M)/2014/22
South Asian University
Rupali Sharma
SAU/AM(M)/2014/27
South Asian University
Divyansh Verma
SAU/AM(M)/2014/14
South Asian University
5/10/2015 2
Finite Difference Methods
• The most common alternatives to the shooting
method are finite-difference approaches.
• In these techniques, finite differences are
substituted for the derivatives in the original
equation, transforming a linear differential
equation into a set of simultaneous algebraic
equations.
Finite Difference Method for Linear Problem
The finite difference method for the linear second-order BVP
y‘’ = p(x)y’ + q(x)y + r(x) for a ≤ x ≤ b with y(a) = α and y(b) = β
we select an integer N > 0 and divide the interval [a, b] into
(N+1) equal subintervals whose endpoints are the mesh points
xi = a + ih for i = 0, 1, . . . , N+1 where h = (b−a)/(N+1)
xi are called collocation points, we find the solution at these points.
5/10/2015 3
x1 xN+1x2 x3 . . .
h h
xN
5/10/2015 4
Finite Difference Method for Linear Problem
At the interior mesh points, xi, for i = 1, 2, . . . , N, the differential
equation to be approximated is y’’(xi) = p(xi)y’(xi) + q(xi)y(xi) + r(xi)
Expanding ‘y’ in a third Taylor polynomial about xi evaluated
at xi+1 and xi−1, assuming that y Є C4[xi-1,xi], we have,
y(xi+1) = y(xi + h) = y(xi ) + h.y(1)(xi) + (h2/2).y(2) (xi) + (h3/6).y(3) (xi)
+ (h4/24).y(4)(ξ i
+) where ξi
+ Є (xi,xi+1) (I)
y(xi-1) = y(xi - h) = y(xi ) - h.y(1)(xi) + (h2/2).y(2) (xi) - (h3/6).y(3) (xi)
+ (h4/24).y(4)(ξ i
-) where ξi
- Є (xi,xi+1) (II)
5/10/2015 5
Finite Difference Method for Linear Problem
Adding I and II , we get
y(xi + h) + y(xi - h) = 2y(xi) + h2.y(2) (xi) + (h4/24).[y(4)(ξ i
+) + y(4)(ξ i
-)]
(By intermediate value theorem, there exists ξi Є (ξ i
+,ξi
-) such that
y(4)(ξ i) = [y(4)(ξ i
+) + y(4)(ξ i
-)] / 2 or 2y(4)(ξ i) = [y(4)(ξ i
+) + y(4)(ξ i
-)] )
y(xi + h) + y(xi - h) = 2y(xi) + h2.y(2) (xi) + (h4/24).[2y(4)(ξ i)]
y(2) (xi) = [ [y(xi + h) + y(xi - h) - 2y(xi) ] / h2 ] - (h2/12).[y(4)(ξ i)]
Subtracting II from I , we get
y(xi + h) - y(xi - h) = 2hy(1) (xi) + (2h3/6).y(3) (xi)
y(1) (xi) = [ [y(xi + h) - y(xi - h)] / 2h ] - (h2/6).y(3) (xi)
5/10/2015 6
Finite Difference Method for Linear Problem
Now substituting the value of y(2) (xi) and y(1) (xi) in original
differential equation, we get
[ [y(xi + h) + y(xi - h) - 2y(xi) ] / h2 ] - (h2/12).[y(4)(ξ i)]
= p(xi) [ [y(xi + h) - y(xi - h)] / 2h ] - (h2/6).y(3) (xi) + q(xi)y + r(xi)
Simplifying the above equation, we get
-(1+h.p(xi)/2)yi+1 + (2+h2.q(xi))yi – (1- h.p(xi)/2)yi = -h2ri
For i=1, -(1+h.p(x1)/2)y2 + (2+h2.q(x1))y1 – (1- h.p(x1)/2)y1 = -h2r1
For i=2, -(1+h.p(x2)/2)y3 + (2+h2.q(x2))y2 – (1- h.p(x2)/2)y2 = -h2r2
.
.
.
For i=N, -(1+h.p(xN)/2)yN+1 + (2+h2.q(xN))yN – (1- h.p(xN)/2)yN = -h2rN
5/10/2015 7
Finite Difference Method for Linear Problem
The system of equations can be expressed in Tri-diagonal nXn
matrix form Aw=b, where
=
5/10/2015 8
Finite Difference Method for Linear Problem
let yi=wi
5/10/2015 9
Example for Linear BVP
Solve (d2y/dx2) = xy with y(0)+y’(0)=1 and y(1)=1
such that 0≤x≤1
Solution : Here let h= 1/3
So by the formula discussed earlier we have,
(yi-1 -2yi +yi+1)/h2 = xi yi
(yi-1 -2yi +yi+1) = h2 xi yi
(yi-1 -2yi +yi+1) = (1/9)xi yi
Now, for i=0 we have,
(y-1 -2y0 +y1) = (1/9)x0 y0
(y-1 -2y0 +y1) = 0 1
5/10/2015 10
for i=1 we have, (y0 -2y1 +y2) = (1/9)x1 y1
(y0 -2y1 +y2) = (1/9)(1/3)y1
(y0 -2y1 +y2) = (1/27) y1
for i=2 we have, (y1 -2y2 +y3) = (1/9)x2y2
(y1 -2y2 +y3) = (1/9)(2/3)y2
(y1 -2y2 +y3) = (2/27)y2
The unknowns are y-1 , y1 , y2 and y0
Using (yi )‘ = (yi+1 – yi-1 +o(h3))/2h we get,
y’(0)= (y1 - y-1)/2h
1+ y0 = (y1 - y-1)/2h
y-1 = y1 –(2/3)(1- y0)
putting Eqn (4) in (1), we get, -2 y0 + 3y1 =1
Example for Linear BVP
2
3
4
5/10/2015 11
So,
-2 y0 + 3y1 =1
(y0 -2y1 +y2) = (1/27) y1
(y1 -2y2 +y3) = (2/27)y2
The matrix will be :
The Soln. is y1 = - 0.9879518, y2 = -0.3253012, y3 = 0.3253012
Example for Linear BVP
-2 3 0
1 -2-(1/27) 1
0 1 -2-(2/27)
y0
y1
y2
1
0
-1
=
5/10/2015 12
Finite Difference Method for Non- Linear Problem
General form of Non linear BVP:
y”= f(x,y,y’) for a≤x≤b such that y(a)=α , y(b)=β
ie
(yi+1 -2yi + yi-1)/h2 = f(xi ,yi , (yi+1- yi-1 )/2h –(h2)/6 y”(η))-
(h2)/12 y(n)(ξ i)
y0 = GIVEN and yN+1 = GIVEN
For i=1 y2 -2y1 = h2 * f(x1 ,y1 , (y2 – α )/2h) – α
i=2 y3 -2y2 + y1 = h2 * f(x2 ,y2 , (y3- y2 )/2h)
i=N -2yN + yN-1)/h2 = f(xN ,yN , (β- yN-1 )/2h )-β
5/10/2015 13
Example for Non-Linear BVP
Solve y”=(3/2)y2 with y(0)=4, y(1)=1 such that 0≤x≤1
using Newton Method
Solution :
yi+1 -2yi + yi-1 = (3/2) h2 (yi )2 = (3/2)(1/9)(yi )2
for i=1 we have,
y2 -2y1 + y0 =(1/6)(y1)2
for i=2 we have,
y3 -2y2 + y1 =(1/6)(y2 )2
So we get,
(y1)2 +12y1 -6y2 -24=0 ≡ F(y1,y2)
(y2 )2 -6y1 + 12y2 -6 =0 ≡ F(y1,y2)
5/10/2015 14
Example for Non-Linear BVP
Now, Jacobian J =
=
J-1 = 1/[(2y1+12)(2y2+12)-36]
∂F1 /∂y1 ∂F1 /∂y2
∂F2 /∂y1 ∂F2 /∂y2
2y1 +12 -6
-6 2y2 +12
2y1 +12 -6
-6 2y2 +12
5/10/2015 15
Example for Non-Linear BVP
Method : = - J-1 ((y1)N , (y2)N ) F ((y1)N , (y2)N )
for N=0
= - J-1 ((y1)0 , (y2)0 ) F ((y1)0, (y2)0 )
Now choose,
=
So we have, J
-1
= [1/(144-36)]
(y1)N+1
(y2)N+1
(y1)N
(y2)N
(y1)1
(y2)1
(y1)0
(y2)0
(y1)0
(y2)0
0
0
12 6
6 12
5/10/2015 16
Example for Non-Linear BVP
= (1/108)
And F((y1)0, (y2)0 ) =
= - (1/108) =
12 6
6 12
(y1)1
(y2)1
0
0
12 6
6 12
-24
-6
3
2
-24
-6
5/10/2015 17
References
Numerical Analysis (9th Edition) Richard L. Burden, J. Douglas Faires, 2010
5/10/2015 18
THANK
YOU
Ad

More Related Content

What's hot (20)

Introduction of Partial Differential Equations
Introduction of Partial Differential EquationsIntroduction of Partial Differential Equations
Introduction of Partial Differential Equations
SCHOOL OF MATHEMATICS, BIT.
 
Applied numerical methods lec10
Applied numerical methods lec10Applied numerical methods lec10
Applied numerical methods lec10
Yasser Ahmed
 
Seminar: Calculus of Variation
Seminar: Calculus of VariationSeminar: Calculus of Variation
Seminar: Calculus of Variation
Subhajit Pramanick
 
numerical methods
numerical methodsnumerical methods
numerical methods
HaiderParekh1
 
Numerical solution of system of linear equations
Numerical solution of system of linear equationsNumerical solution of system of linear equations
Numerical solution of system of linear equations
reach2arkaELECTRICAL
 
Point Collocation Method used in the solving of Differential Equations, parti...
Point Collocation Method used in the solving of Differential Equations, parti...Point Collocation Method used in the solving of Differential Equations, parti...
Point Collocation Method used in the solving of Differential Equations, parti...
Suddhasheel GHOSH, PhD
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
aman1894
 
Newton’s Forward & backward interpolation
Newton’s Forward &  backward interpolation Newton’s Forward &  backward interpolation
Newton’s Forward & backward interpolation
Meet Patel
 
Runge kutta
Runge kuttaRunge kutta
Runge kutta
Shubham Tomar
 
introduction to differential equations
introduction to differential equationsintroduction to differential equations
introduction to differential equations
Emdadul Haque Milon
 
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
 
Ordinary differential equations
Ordinary differential equationsOrdinary differential equations
Ordinary differential equations
Ahmed Haider
 
First order linear differential equation
First order linear differential equationFirst order linear differential equation
First order linear differential equation
Nofal Umair
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
Tarun Gehlot
 
Laplace transforms
Laplace transformsLaplace transforms
Laplace transforms
Awais Chaudhary
 
3 bessel's functions
3 bessel's functions3 bessel's functions
3 bessel's functions
Mayank Maruka
 
Higher order differential equations
Higher order differential equationsHigher order differential equations
Higher order differential equations
Mateus Nieves Enrique - DIE-UD
 
Higher order ODE with applications
Higher order ODE with applicationsHigher order ODE with applications
Higher order ODE with applications
Pratik Gadhiya
 
Jacobi and gauss-seidel
Jacobi and gauss-seidelJacobi and gauss-seidel
Jacobi and gauss-seidel
arunsmm
 
Secant Method
Secant MethodSecant Method
Secant Method
Afraz Khan
 
Applied numerical methods lec10
Applied numerical methods lec10Applied numerical methods lec10
Applied numerical methods lec10
Yasser Ahmed
 
Seminar: Calculus of Variation
Seminar: Calculus of VariationSeminar: Calculus of Variation
Seminar: Calculus of Variation
Subhajit Pramanick
 
Numerical solution of system of linear equations
Numerical solution of system of linear equationsNumerical solution of system of linear equations
Numerical solution of system of linear equations
reach2arkaELECTRICAL
 
Point Collocation Method used in the solving of Differential Equations, parti...
Point Collocation Method used in the solving of Differential Equations, parti...Point Collocation Method used in the solving of Differential Equations, parti...
Point Collocation Method used in the solving of Differential Equations, parti...
Suddhasheel GHOSH, PhD
 
Partial differential equations
Partial differential equationsPartial differential equations
Partial differential equations
aman1894
 
Newton’s Forward & backward interpolation
Newton’s Forward &  backward interpolation Newton’s Forward &  backward interpolation
Newton’s Forward & backward interpolation
Meet Patel
 
introduction to differential equations
introduction to differential equationsintroduction to differential equations
introduction to differential equations
Emdadul Haque Milon
 
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
 
Ordinary differential equations
Ordinary differential equationsOrdinary differential equations
Ordinary differential equations
Ahmed Haider
 
First order linear differential equation
First order linear differential equationFirst order linear differential equation
First order linear differential equation
Nofal Umair
 
Gaussian quadratures
Gaussian quadraturesGaussian quadratures
Gaussian quadratures
Tarun Gehlot
 
3 bessel's functions
3 bessel's functions3 bessel's functions
3 bessel's functions
Mayank Maruka
 
Higher order ODE with applications
Higher order ODE with applicationsHigher order ODE with applications
Higher order ODE with applications
Pratik Gadhiya
 
Jacobi and gauss-seidel
Jacobi and gauss-seidelJacobi and gauss-seidel
Jacobi and gauss-seidel
arunsmm
 

Similar to Finite difference method (20)

Introduction to Differential Equations
Introduction to Differential EquationsIntroduction to Differential Equations
Introduction to Differential Equations
Vishvaraj Chauhan
 
Answers to Problems for Advanced Engineering Mathematics, 6th Edition – Denni...
Answers to Problems for Advanced Engineering Mathematics, 6th Edition – Denni...Answers to Problems for Advanced Engineering Mathematics, 6th Edition – Denni...
Answers to Problems for Advanced Engineering Mathematics, 6th Edition – Denni...
financemanag
 
Numerical Methods and Analysis
Numerical Methods and AnalysisNumerical Methods and Analysis
Numerical Methods and Analysis
Rajshahi University of Engineering and Technology
 
Answers to Problems for Advanced Engineering Mathematics, 7th Edition by Denn...
Answers to Problems for Advanced Engineering Mathematics, 7th Edition by Denn...Answers to Problems for Advanced Engineering Mathematics, 7th Edition by Denn...
Answers to Problems for Advanced Engineering Mathematics, 7th Edition by Denn...
physics2024
 
Solutions for Problems in "A First Course in Differential Equations" (11th Ed...
Solutions for Problems in "A First Course in Differential Equations" (11th Ed...Solutions for Problems in "A First Course in Differential Equations" (11th Ed...
Solutions for Problems in "A First Course in Differential Equations" (11th Ed...
electricaleng2024
 
Advanced Engineering Mathematics Solutions Manual.pdf
Advanced Engineering Mathematics Solutions Manual.pdfAdvanced Engineering Mathematics Solutions Manual.pdf
Advanced Engineering Mathematics Solutions Manual.pdf
Whitney Anderson
 
Answers to Problems for Advanced Engineering Mathematics 6th Edition Internat...
Answers to Problems for Advanced Engineering Mathematics 6th Edition Internat...Answers to Problems for Advanced Engineering Mathematics 6th Edition Internat...
Answers to Problems for Advanced Engineering Mathematics 6th Edition Internat...
solution9159
 
160280102021 c2 aem (2)
160280102021 c2 aem (2)160280102021 c2 aem (2)
160280102021 c2 aem (2)
L.D. COLLEGE OF ENGINEERING
 
Pair Of Linear Equations In Two Variables
Pair Of Linear Equations In Two VariablesPair Of Linear Equations In Two Variables
Pair Of Linear Equations In Two Variables
Deo Baran
 
Quadratic Function Presentation
Quadratic Function PresentationQuadratic Function Presentation
Quadratic Function Presentation
RyanWatt
 
Tam 2nd
Tam 2ndTam 2nd
Tam 2nd
canalculus
 
AEM Integrating factor to orthogonal trajactories
AEM Integrating factor to orthogonal trajactoriesAEM Integrating factor to orthogonal trajactories
AEM Integrating factor to orthogonal trajactories
Sukhvinder Singh
 
Diff-Eqs
Diff-EqsDiff-Eqs
Diff-Eqs
Maria Mehmood
 
Partial diferential good
Partial diferential goodPartial diferential good
Partial diferential good
genntmbr
 
Simultaneous equations
Simultaneous equations Simultaneous equations
Simultaneous equations
fisayo omoniyi
 
Mathematics ppt.pptx
Mathematics ppt.pptxMathematics ppt.pptx
Mathematics ppt.pptx
SangitaPatil50
 
Linear equation in two variable
Linear equation in two variableLinear equation in two variable
Linear equation in two variable
Ramjas College
 
CalculusStudyGuide
CalculusStudyGuideCalculusStudyGuide
CalculusStudyGuide
Mo Elkhatib
 
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Hareem Aslam
 
Rbsc class-9-maths-chapter-4
Rbsc class-9-maths-chapter-4 Rbsc class-9-maths-chapter-4
Rbsc class-9-maths-chapter-4
Arvind Saini
 
Introduction to Differential Equations
Introduction to Differential EquationsIntroduction to Differential Equations
Introduction to Differential Equations
Vishvaraj Chauhan
 
Answers to Problems for Advanced Engineering Mathematics, 6th Edition – Denni...
Answers to Problems for Advanced Engineering Mathematics, 6th Edition – Denni...Answers to Problems for Advanced Engineering Mathematics, 6th Edition – Denni...
Answers to Problems for Advanced Engineering Mathematics, 6th Edition – Denni...
financemanag
 
Answers to Problems for Advanced Engineering Mathematics, 7th Edition by Denn...
Answers to Problems for Advanced Engineering Mathematics, 7th Edition by Denn...Answers to Problems for Advanced Engineering Mathematics, 7th Edition by Denn...
Answers to Problems for Advanced Engineering Mathematics, 7th Edition by Denn...
physics2024
 
Solutions for Problems in "A First Course in Differential Equations" (11th Ed...
Solutions for Problems in "A First Course in Differential Equations" (11th Ed...Solutions for Problems in "A First Course in Differential Equations" (11th Ed...
Solutions for Problems in "A First Course in Differential Equations" (11th Ed...
electricaleng2024
 
Advanced Engineering Mathematics Solutions Manual.pdf
Advanced Engineering Mathematics Solutions Manual.pdfAdvanced Engineering Mathematics Solutions Manual.pdf
Advanced Engineering Mathematics Solutions Manual.pdf
Whitney Anderson
 
Answers to Problems for Advanced Engineering Mathematics 6th Edition Internat...
Answers to Problems for Advanced Engineering Mathematics 6th Edition Internat...Answers to Problems for Advanced Engineering Mathematics 6th Edition Internat...
Answers to Problems for Advanced Engineering Mathematics 6th Edition Internat...
solution9159
 
Pair Of Linear Equations In Two Variables
Pair Of Linear Equations In Two VariablesPair Of Linear Equations In Two Variables
Pair Of Linear Equations In Two Variables
Deo Baran
 
Quadratic Function Presentation
Quadratic Function PresentationQuadratic Function Presentation
Quadratic Function Presentation
RyanWatt
 
AEM Integrating factor to orthogonal trajactories
AEM Integrating factor to orthogonal trajactoriesAEM Integrating factor to orthogonal trajactories
AEM Integrating factor to orthogonal trajactories
Sukhvinder Singh
 
Partial diferential good
Partial diferential goodPartial diferential good
Partial diferential good
genntmbr
 
Simultaneous equations
Simultaneous equations Simultaneous equations
Simultaneous equations
fisayo omoniyi
 
Linear equation in two variable
Linear equation in two variableLinear equation in two variable
Linear equation in two variable
Ramjas College
 
CalculusStudyGuide
CalculusStudyGuideCalculusStudyGuide
CalculusStudyGuide
Mo Elkhatib
 
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Hareem Aslam
 
Rbsc class-9-maths-chapter-4
Rbsc class-9-maths-chapter-4 Rbsc class-9-maths-chapter-4
Rbsc class-9-maths-chapter-4
Arvind Saini
 
Ad

Recently uploaded (20)

spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
The History of Kashmir Karkota Dynasty NEP.pptx
The History of Kashmir Karkota Dynasty NEP.pptxThe History of Kashmir Karkota Dynasty NEP.pptx
The History of Kashmir Karkota Dynasty NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Cultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptxCultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptx
UmeshTimilsina1
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptxU3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
Mayuri Chavan
 
spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)spinal cord disorders (Myelopathies and radiculoapthies)
spinal cord disorders (Myelopathies and radiculoapthies)
Mohamed Rizk Khodair
 
Drugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdfDrugs in Anaesthesia and Intensive Care,.pdf
Drugs in Anaesthesia and Intensive Care,.pdf
crewot855
 
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
Mental Health Assessment in 5th semester bsc. nursing and also used in 2nd ye...
parmarjuli1412
 
E-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26ASE-Filing_of_Income_Tax.pptx and concept of form 26AS
E-Filing_of_Income_Tax.pptx and concept of form 26AS
Abinash Palangdar
 
Myopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduateMyopathies (muscle disorders) for undergraduate
Myopathies (muscle disorders) for undergraduate
Mohamed Rizk Khodair
 
antiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidenceantiquity of writing in ancient India- literary & archaeological evidence
antiquity of writing in ancient India- literary & archaeological evidence
PrachiSontakke5
 
How to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 PurchaseHow to Manage Amounts in Local Currency in Odoo 18 Purchase
How to Manage Amounts in Local Currency in Odoo 18 Purchase
Celine George
 
Overview Well-Being and Creative Careers
Overview Well-Being and Creative CareersOverview Well-Being and Creative Careers
Overview Well-Being and Creative Careers
University of Amsterdam
 
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
MCQ PHYSIOLOGY II (DR. NASIR MUSTAFA) MCQS)
Dr. Nasir Mustafa
 
Cultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptxCultivation Practice of Onion in Nepal.pptx
Cultivation Practice of Onion in Nepal.pptx
UmeshTimilsina1
 
How to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo SlidesHow to Create Kanban View in Odoo 18 - Odoo Slides
How to Create Kanban View in Odoo 18 - Odoo Slides
Celine George
 
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
How to Clean Your Contacts Using the Deduplication Menu in Odoo 18
Celine George
 
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon DolabaniHistory Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
History Of The Monastery Of Mor Gabriel Philoxenos Yuhanon Dolabani
fruinkamel7m
 
What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)What is the Philosophy of Statistics? (and how I was drawn to it)
What is the Philosophy of Statistics? (and how I was drawn to it)
jemille6
 
All About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdfAll About the 990 Unlocking Its Mysteries and Its Power.pdf
All About the 990 Unlocking Its Mysteries and Its Power.pdf
TechSoup
 
Cultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptxCultivation Practice of Turmeric in Nepal.pptx
Cultivation Practice of Turmeric in Nepal.pptx
UmeshTimilsina1
 
Chemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptxChemotherapy of Malignancy -Anticancer.pptx
Chemotherapy of Malignancy -Anticancer.pptx
Mayuri Chavan
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
BÀI TẬP BỔ TRỢ TIẾNG ANH 9 THEO ĐƠN VỊ BÀI HỌC - GLOBAL SUCCESS - CẢ NĂM (TỪ...
Nguyen Thanh Tu Collection
 
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptxU3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
U3 ANTITUBERCULAR DRUGS Pharmacology 3.pptx
Mayuri Chavan
 
Ad

Finite difference method

  • 1. Finite Difference Methods 5/10/2015 1 Gaurav Mallik SAU/AM(M)/2014/22 South Asian University Rupali Sharma SAU/AM(M)/2014/27 South Asian University Divyansh Verma SAU/AM(M)/2014/14 South Asian University
  • 2. 5/10/2015 2 Finite Difference Methods • The most common alternatives to the shooting method are finite-difference approaches. • In these techniques, finite differences are substituted for the derivatives in the original equation, transforming a linear differential equation into a set of simultaneous algebraic equations.
  • 3. Finite Difference Method for Linear Problem The finite difference method for the linear second-order BVP y‘’ = p(x)y’ + q(x)y + r(x) for a ≤ x ≤ b with y(a) = α and y(b) = β we select an integer N > 0 and divide the interval [a, b] into (N+1) equal subintervals whose endpoints are the mesh points xi = a + ih for i = 0, 1, . . . , N+1 where h = (b−a)/(N+1) xi are called collocation points, we find the solution at these points. 5/10/2015 3 x1 xN+1x2 x3 . . . h h xN
  • 4. 5/10/2015 4 Finite Difference Method for Linear Problem At the interior mesh points, xi, for i = 1, 2, . . . , N, the differential equation to be approximated is y’’(xi) = p(xi)y’(xi) + q(xi)y(xi) + r(xi) Expanding ‘y’ in a third Taylor polynomial about xi evaluated at xi+1 and xi−1, assuming that y Є C4[xi-1,xi], we have, y(xi+1) = y(xi + h) = y(xi ) + h.y(1)(xi) + (h2/2).y(2) (xi) + (h3/6).y(3) (xi) + (h4/24).y(4)(ξ i +) where ξi + Є (xi,xi+1) (I) y(xi-1) = y(xi - h) = y(xi ) - h.y(1)(xi) + (h2/2).y(2) (xi) - (h3/6).y(3) (xi) + (h4/24).y(4)(ξ i -) where ξi - Є (xi,xi+1) (II)
  • 5. 5/10/2015 5 Finite Difference Method for Linear Problem Adding I and II , we get y(xi + h) + y(xi - h) = 2y(xi) + h2.y(2) (xi) + (h4/24).[y(4)(ξ i +) + y(4)(ξ i -)] (By intermediate value theorem, there exists ξi Є (ξ i +,ξi -) such that y(4)(ξ i) = [y(4)(ξ i +) + y(4)(ξ i -)] / 2 or 2y(4)(ξ i) = [y(4)(ξ i +) + y(4)(ξ i -)] ) y(xi + h) + y(xi - h) = 2y(xi) + h2.y(2) (xi) + (h4/24).[2y(4)(ξ i)] y(2) (xi) = [ [y(xi + h) + y(xi - h) - 2y(xi) ] / h2 ] - (h2/12).[y(4)(ξ i)] Subtracting II from I , we get y(xi + h) - y(xi - h) = 2hy(1) (xi) + (2h3/6).y(3) (xi) y(1) (xi) = [ [y(xi + h) - y(xi - h)] / 2h ] - (h2/6).y(3) (xi)
  • 6. 5/10/2015 6 Finite Difference Method for Linear Problem Now substituting the value of y(2) (xi) and y(1) (xi) in original differential equation, we get [ [y(xi + h) + y(xi - h) - 2y(xi) ] / h2 ] - (h2/12).[y(4)(ξ i)] = p(xi) [ [y(xi + h) - y(xi - h)] / 2h ] - (h2/6).y(3) (xi) + q(xi)y + r(xi) Simplifying the above equation, we get -(1+h.p(xi)/2)yi+1 + (2+h2.q(xi))yi – (1- h.p(xi)/2)yi = -h2ri For i=1, -(1+h.p(x1)/2)y2 + (2+h2.q(x1))y1 – (1- h.p(x1)/2)y1 = -h2r1 For i=2, -(1+h.p(x2)/2)y3 + (2+h2.q(x2))y2 – (1- h.p(x2)/2)y2 = -h2r2 . . . For i=N, -(1+h.p(xN)/2)yN+1 + (2+h2.q(xN))yN – (1- h.p(xN)/2)yN = -h2rN
  • 7. 5/10/2015 7 Finite Difference Method for Linear Problem The system of equations can be expressed in Tri-diagonal nXn matrix form Aw=b, where =
  • 8. 5/10/2015 8 Finite Difference Method for Linear Problem let yi=wi
  • 9. 5/10/2015 9 Example for Linear BVP Solve (d2y/dx2) = xy with y(0)+y’(0)=1 and y(1)=1 such that 0≤x≤1 Solution : Here let h= 1/3 So by the formula discussed earlier we have, (yi-1 -2yi +yi+1)/h2 = xi yi (yi-1 -2yi +yi+1) = h2 xi yi (yi-1 -2yi +yi+1) = (1/9)xi yi Now, for i=0 we have, (y-1 -2y0 +y1) = (1/9)x0 y0 (y-1 -2y0 +y1) = 0 1
  • 10. 5/10/2015 10 for i=1 we have, (y0 -2y1 +y2) = (1/9)x1 y1 (y0 -2y1 +y2) = (1/9)(1/3)y1 (y0 -2y1 +y2) = (1/27) y1 for i=2 we have, (y1 -2y2 +y3) = (1/9)x2y2 (y1 -2y2 +y3) = (1/9)(2/3)y2 (y1 -2y2 +y3) = (2/27)y2 The unknowns are y-1 , y1 , y2 and y0 Using (yi )‘ = (yi+1 – yi-1 +o(h3))/2h we get, y’(0)= (y1 - y-1)/2h 1+ y0 = (y1 - y-1)/2h y-1 = y1 –(2/3)(1- y0) putting Eqn (4) in (1), we get, -2 y0 + 3y1 =1 Example for Linear BVP 2 3 4
  • 11. 5/10/2015 11 So, -2 y0 + 3y1 =1 (y0 -2y1 +y2) = (1/27) y1 (y1 -2y2 +y3) = (2/27)y2 The matrix will be : The Soln. is y1 = - 0.9879518, y2 = -0.3253012, y3 = 0.3253012 Example for Linear BVP -2 3 0 1 -2-(1/27) 1 0 1 -2-(2/27) y0 y1 y2 1 0 -1 =
  • 12. 5/10/2015 12 Finite Difference Method for Non- Linear Problem General form of Non linear BVP: y”= f(x,y,y’) for a≤x≤b such that y(a)=α , y(b)=β ie (yi+1 -2yi + yi-1)/h2 = f(xi ,yi , (yi+1- yi-1 )/2h –(h2)/6 y”(η))- (h2)/12 y(n)(ξ i) y0 = GIVEN and yN+1 = GIVEN For i=1 y2 -2y1 = h2 * f(x1 ,y1 , (y2 – α )/2h) – α i=2 y3 -2y2 + y1 = h2 * f(x2 ,y2 , (y3- y2 )/2h) i=N -2yN + yN-1)/h2 = f(xN ,yN , (β- yN-1 )/2h )-β
  • 13. 5/10/2015 13 Example for Non-Linear BVP Solve y”=(3/2)y2 with y(0)=4, y(1)=1 such that 0≤x≤1 using Newton Method Solution : yi+1 -2yi + yi-1 = (3/2) h2 (yi )2 = (3/2)(1/9)(yi )2 for i=1 we have, y2 -2y1 + y0 =(1/6)(y1)2 for i=2 we have, y3 -2y2 + y1 =(1/6)(y2 )2 So we get, (y1)2 +12y1 -6y2 -24=0 ≡ F(y1,y2) (y2 )2 -6y1 + 12y2 -6 =0 ≡ F(y1,y2)
  • 14. 5/10/2015 14 Example for Non-Linear BVP Now, Jacobian J = = J-1 = 1/[(2y1+12)(2y2+12)-36] ∂F1 /∂y1 ∂F1 /∂y2 ∂F2 /∂y1 ∂F2 /∂y2 2y1 +12 -6 -6 2y2 +12 2y1 +12 -6 -6 2y2 +12
  • 15. 5/10/2015 15 Example for Non-Linear BVP Method : = - J-1 ((y1)N , (y2)N ) F ((y1)N , (y2)N ) for N=0 = - J-1 ((y1)0 , (y2)0 ) F ((y1)0, (y2)0 ) Now choose, = So we have, J -1 = [1/(144-36)] (y1)N+1 (y2)N+1 (y1)N (y2)N (y1)1 (y2)1 (y1)0 (y2)0 (y1)0 (y2)0 0 0 12 6 6 12
  • 16. 5/10/2015 16 Example for Non-Linear BVP = (1/108) And F((y1)0, (y2)0 ) = = - (1/108) = 12 6 6 12 (y1)1 (y2)1 0 0 12 6 6 12 -24 -6 3 2 -24 -6
  • 17. 5/10/2015 17 References Numerical Analysis (9th Edition) Richard L. Burden, J. Douglas Faires, 2010
  翻译: