Module for the Finite Difference Method for Boundary Value Problems

Check out the new Numerical Analysis Projects page.

 

Theorem  (boundary value problem).  Assume that  [Graphics:Images/FiniteDifferenceMod_gr_1.gif]  is continuous on the region  [Graphics:Images/FiniteDifferenceMod_gr_2.gif]  and  that  [Graphics:Images/FiniteDifferenceMod_gr_3.gif]  and  [Graphics:Images/FiniteDifferenceMod_gr_4.gif]  are continuous on  [Graphics:Images/FiniteDifferenceMod_gr_5.gif].  If there exists a constant  [Graphics:Images/FiniteDifferenceMod_gr_6.gif]  for which  [Graphics:Images/FiniteDifferenceMod_gr_7.gif]  satisfy

    [Graphics:Images/FiniteDifferenceMod_gr_8.gif]  
and
    
[Graphics:Images/FiniteDifferenceMod_gr_9.gif],  

then the boundary value problem

    
[Graphics:Images/FiniteDifferenceMod_gr_10.gif]  with  [Graphics:Images/FiniteDifferenceMod_gr_11.gif]  

has a unique solution   [Graphics:Images/FiniteDifferenceMod_gr_12.gif].  

    The notation  [Graphics:Images/FiniteDifferenceMod_gr_13.gif]  has been used to distinguish the third variable of the function    [Graphics:Images/FiniteDifferenceMod_gr_14.gif].   Finally, the special case of linear differential equations is worthy of mention.

Corollary (linear boundary value problem).  Assume that  [Graphics:Images/FiniteDifferenceMod_gr_15.gif]  in the theorem has the form  [Graphics:Images/FiniteDifferenceMod_gr_16.gif]  and that  f  and its partial derivatives  [Graphics:Images/FiniteDifferenceMod_gr_17.gif]  and  [Graphics:Images/FiniteDifferenceMod_gr_18.gif] are continuous on  [Graphics:Images/FiniteDifferenceMod_gr_19.gif].  If there exists a constant  [Graphics:Images/FiniteDifferenceMod_gr_20.gif]  for which  p(t)  and   q(t)  satisfy

    [Graphics:Images/FiniteDifferenceMod_gr_21.gif]  
and
    
[Graphics:Images/FiniteDifferenceMod_gr_22.gif],  

then the linear boundary value problem

    
[Graphics:Images/FiniteDifferenceMod_gr_23.gif]  with  [Graphics:Images/FiniteDifferenceMod_gr_24.gif]  

has a unique solution   [Graphics:Images/FiniteDifferenceMod_gr_25.gif].  

Footnote. The significance of the theory.  

    We are all familiar with the differential equation  
[Graphics:Images/FiniteDifferenceMod_gr_26.gif] and its general solution  [Graphics:Images/FiniteDifferenceMod_gr_27.gif].
The boundary conditions with  [Graphics:Images/FiniteDifferenceMod_gr_28.gif]  can only be solved if  [Graphics:Images/FiniteDifferenceMod_gr_29.gif].  Unfortunately, because of this counter example, the "theory" which "guarantees" a solution must be phrased with "[Graphics:Images/FiniteDifferenceMod_gr_30.gif]."  A careful reading of the "theory" reveals that this is a sufficient condition and not a necessary condition.  Indeed there are many problems that can be solved with the "shooting method" , all we ask is to be cautious with its implementation and take note that it might not apply sometimes.    

Program (Finite-Difference Method).  To approximate the solution of the boundary value problem  [Graphics:Images/FiniteDifferenceMod_gr_31.gif]  with  [Graphics:Images/FiniteDifferenceMod_gr_32.gif]  and  [Graphics:Images/FiniteDifferenceMod_gr_33.gif]  over the interval  [Graphics:Images/FiniteDifferenceMod_gr_34.gif]  by using the finite difference method of order  [Graphics:Images/FiniteDifferenceMod_gr_35.gif]. The mesh we use is  [Graphics:Images/FiniteDifferenceMod_gr_36.gif]  and the solution points are[Graphics:Images/FiniteDifferenceMod_gr_37.gif].  

Procedures.   
(i)   Construct the tri-diagonal matrix and vector.
(ii)  
Solve the system in (i).
(iii)
Join the mesh points and vector from (ii) to form the solution points.

[Graphics:Images/FiniteDifferenceMod_gr_38.gif]
[Graphics:Images/FiniteDifferenceMod_gr_39.gif]
[Graphics:Images/FiniteDifferenceMod_gr_40.gif]

Example 1.  Solve  [Graphics:Images/FiniteDifferenceMod_gr_41.gif]  over  [Graphics:Images/FiniteDifferenceMod_gr_42.gif]  with  [Graphics:Images/FiniteDifferenceMod_gr_43.gif]  and  [Graphics:Images/FiniteDifferenceMod_gr_44.gif].
Use the finite difference method with 25 subintervals (total of 26 points).
Solution 1.

 

Example 2.  Solve  [Graphics:Images/FiniteDifferenceMod_gr_74.gif]  over  [Graphics:Images/FiniteDifferenceMod_gr_75.gif]  with  [Graphics:Images/FiniteDifferenceMod_gr_76.gif]  and  [Graphics:Images/FiniteDifferenceMod_gr_77.gif].
Use the finite difference method with 25 subintervals (total of 26 points).
Just use the subroutine and skip all the details.
Solution 2.

 

Example 3.  Solve  [Graphics:Images/FiniteDifferenceMod_gr_85.gif]  over  [Graphics:Images/FiniteDifferenceMod_gr_86.gif]  with  [Graphics:Images/FiniteDifferenceMod_gr_87.gif]  and  [Graphics:Images/FiniteDifferenceMod_gr_88.gif].
Use the finite difference method with 50 subintervals (total of 51 points).
Just use the subroutine and skip all the details.
Solution 3.

 

Example 4.  Determine how much the solutions in example 2 and 3 differ.
Solution 4.

 

Example 5.  Use Richardson's extrapolation and the results of example 2 and 3 to construct a more accurate solution for 25 subintervals.
Solution 5.

 

Example 6.  How good did it get?
Solution 6.

 

 

Research Experience for Undergraduates

Finite Difference Method for O.D.E.'s  Finite Difference Method for O.D.E.'s  
Internet hyperlinks to web sites and a bibliography of articles.  

 

Downloads (Finite Difference Method for O.D.E.'s Finite Difference Method for O.D.E.'s).  
Download this Mathematica notebook.  

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2003