Example 8.  Consider the linear system AC=B in Example 7, i.e.  [Graphics:Images/LUFactorMod_gr_242.gif].

Solution 8.

(a). Enter the new matrix A and vector B.

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



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

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

(b). Solve the linear system for the coefficients [Graphics:../Images/LUFactorMod_gr_248.gif] using our  LUfactor[n]  and  SolveLU[n]  subroutines.

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


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

Remark.  The solution is quite different from that of Example 7.  This is not a problem in our subroutines, Mathematica will also get this answer.

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


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

    These solution values are so far from the previous ones in Example 7 that they appear to be a worthless answer, and this type of ill-conditioning is not easy to detect.  One would normally expect that a small change in a coefficient in the matrix would result in a small change in the computed solution.  We changed the element  [Graphics:../Images/LUFactorMod_gr_253.gif] a small fraction,  [Graphics:../Images/LUFactorMod_gr_254.gif],  and the changes in the coefficients went

from   [Graphics:../Images/LUFactorMod_gr_255.gif]    to    [Graphics:../Images/LUFactorMod_gr_256.gif].   

    The element  [Graphics:../Images/LUFactorMod_gr_257.gif]  was replaced with [Graphics:../Images/LUFactorMod_gr_258.gif] in the matrix ?  This change is merely [Graphics:../Images/LUFactorMod_gr_259.gif].  The percentage change in the solution [Graphics:../Images/LUFactorMod_gr_260.gif] is 36%.  

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



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

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


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


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

[Graphics:../Images/LUFactorMod_gr_266.gif]
[Graphics:../Images/LUFactorMod_gr_267.gif]

Continue with the explorations.

(c). Construct the polynomial  p[x].  The coefficients are stored in the array  c  and the elements are [Graphics:../Images/LUFactorMod_gr_268.gif].

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


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

We are done.

We can graph the polynomial, this is just for fun !

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


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

[Graphics:../Images/LUFactorMod_gr_273.gif]
[Graphics:../Images/LUFactorMod_gr_274.gif]
[Graphics:../Images/LUFactorMod_gr_275.gif]

Behold, do our eyes see anything significantly different from the previous graph in Example 7 ?

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


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

[Graphics:../Images/LUFactorMod_gr_278.gif]
[Graphics:../Images/LUFactorMod_gr_279.gif]


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

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

[Graphics:../Images/LUFactorMod_gr_282.gif]
[Graphics:../Images/LUFactorMod_gr_283.gif]

If you were looking for the polynomial  [Graphics:../Images/LUFactorMod_gr_284.gif] and found the polynomial  [Graphics:../Images/LUFactorMod_gr_285.gif]  would you be happy ?

Warning.  Remember to check the condition number of your matrix, beware if it is large and seek alternate ways to find compute a solution.  In approximation theory there are other methods and algorithms which can be used.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004