Example 1.  Create a 31 by 31 tridiagonal matrix A where the main diagonal elements are all "2" and all elements of the subdiagonal and superdiagonal elements are "1."  Then solve the linear system  [Graphics:Images/Tri-DiagonalMod_gr_56.gif]  where  [Graphics:Images/Tri-DiagonalMod_gr_57.gif].  Compute the solution using decimal arithmetic.  

Solution 1 (a).

[Graphics:../Images/Tri-DiagonalMod_gr_58.gif]

[Graphics:../Images/Tri-DiagonalMod_gr_59.gif]

The column form for B is:

[Graphics:../Images/Tri-DiagonalMod_gr_60.gif]


[Graphics:../Images/Tri-DiagonalMod_gr_61.gif]

The matrix A can be constructed with the command.

[Graphics:../Images/Tri-DiagonalMod_gr_62.gif]


[Graphics:../Images/Tri-DiagonalMod_gr_63.gif]

We can print out the system to be solved if we wish.

[Graphics:../Images/Tri-DiagonalMod_gr_64.gif]


[Graphics:../Images/Tri-DiagonalMod_gr_65.gif]
[Graphics:../Images/Tri-DiagonalMod_gr_66.gif]

Solve the system Mathematica's built in  LinearSolve[A,B]  procedure.  

[Graphics:../Images/Tri-DiagonalMod_gr_67.gif]


[Graphics:../Images/Tri-DiagonalMod_gr_68.gif]

Notice that this linear system is producing some round off error near the 14th decimal place.

Verify the answer.

[Graphics:../Images/Tri-DiagonalMod_gr_69.gif]


[Graphics:../Images/Tri-DiagonalMod_gr_70.gif]
[Graphics:../Images/Tri-DiagonalMod_gr_71.gif]

[Graphics:../Images/Tri-DiagonalMod_gr_72.gif]

[Graphics:../Images/Tri-DiagonalMod_gr_73.gif]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004