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.

Enter the function p(t), q(t) and r(t).  

[Graphics:../Images/FiniteDifferenceMod_gr_45.gif]
[Graphics:../Images/FiniteDifferenceMod_gr_46.gif] [Graphics:../Images/FiniteDifferenceMod_gr_47.gif] [Graphics:../Images/FiniteDifferenceMod_gr_48.gif] [Graphics:../Images/FiniteDifferenceMod_gr_49.gif] [Graphics:../Images/FiniteDifferenceMod_gr_50.gif]

Construct the vectors for the tri-diagonal system.

 

[Graphics:../Images/FiniteDifferenceMod_gr_51.gif]

If you are curious, you can check out the values.
Remember. The tridiagonal system is used to solve for the points that lie strictly inside in the interval.
Also, the vectors are used for the mesh points, the three diagonals in the matrix and the column vector.

[Graphics:../Images/FiniteDifferenceMod_gr_52.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_53.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_54.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_55.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_56.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_57.gif]

Now solve the tri-diagonal system for the ordinates that are strictly inside the interval.  

 

[Graphics:../Images/FiniteDifferenceMod_gr_58.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_59.gif]


[Graphics:../Images/FiniteDifferenceMod_gr_60.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_61.gif]

We need to put the vectors together to form points.

 

[Graphics:../Images/FiniteDifferenceMod_gr_62.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_63.gif]

We need to  append the first and last boundary points to the list.

 

[Graphics:../Images/FiniteDifferenceMod_gr_64.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_65.gif]


[Graphics:../Images/FiniteDifferenceMod_gr_66.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_67.gif]

Now we have the solution.

 

[Graphics:../Images/FiniteDifferenceMod_gr_68.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_69.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_70.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_71.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_72.gif]

[Graphics:../Images/FiniteDifferenceMod_gr_73.gif]

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2003