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 rational arithmetic.  

Solution 1 (b).

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

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

The column form for B is:

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


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

The matrix A can be constructed with the command.

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


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

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

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


[Graphics:../Images/Tri-DiagonalMod_gr_81.gif]
[Graphics:../Images/Tri-DiagonalMod_gr_82.gif]

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

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


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

Verify the answer.

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


[Graphics:../Images/Tri-DiagonalMod_gr_86.gif]
[Graphics:../Images/Tri-DiagonalMod_gr_87.gif]

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

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004