LUBacksubstitution discrepancy
- To: mathgroup at smc.vnet.net
- Subject: [mg54894] LUBacksubstitution discrepancy
- From: Gary.Anderson at frb.gov
- Date: Sat, 5 Mar 2005 01:34:38 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
i'm confused about the results below where
LUBackSubstitution leads to two different solutions for equivalent
problems.
(i am using 5.0 on linux/solaris and windows).
note:
1)the original input matrix(theMat) is not illconditioned(largest
singularval/smallest singularval approx 3)
2)the back substitution seems to produce the right number for symbolic(all
non zero?) rhs but an erroneous
answer for number(very sparse?) rhs.
3)i get a similar disparity in the course of calculations in a more
elaborate program that doesn't involve
a "cutandpaste" step like In[101].
thanks for any insights
gary
++++++++++++++++++++++++++++++++++++++
In[98]:= theMat={{0, 0, 0, 1}, {0, 1, 0, 1.125},
{1, -0.25, 0, 0}, {-0.5, 0, 1, 0}};
In[99]:= In[99]:=
theLud=LUDecomposition[{{0, 0, 0, 1}, {0, 1, 0, 1.125},
{1, -0.25, 0, 0}, {-0.5, 0, 1, 0}}]
In[99]:=
Out[99]= {{{1., 0., -0.5, 0.}, {-0.25, 1., -0.125, 0.},
> {0., 0., 1., 0.}, {0., 1.125, 0.140625, 1.}}, {3, 2, 4, 1},
> 4.51563}
In[100]:= In[100]:=
goodSoln=LUBackSubstitution[theLud,
{0, 0.109441, 0, 0}]
In[100]:=
Out[100]= {0.0273603, 0.109441, 0.0136801, 0.}
In[101]:= In[101]:=
badSoln=LUBackSubstitution[{{{1., 0, -0.5, 0},
{-0.25, 1., -0.125, 0}, {0, 0, 1., 0},
{0, 1.125, 0.140625, 1.}}, {3, 2, 4, 1}, 4.51562},
{0, 0.109441, 0, 0}]
In[101]:=
Out[101]= {0., 0.109441, 0., -0.123121}
In[102]:= In[102]:=
anotherGoodSoln=LUBackSubstitution[{{{1., 0, -0.5, 0},
{-0.25, 1., -0.125, 0}, {0, 0, 1., 0},
{0, 1.125, 0.140625, 1.}}, {3, 2, 4, 1}, 4.51562},
{aa, bb,cc, dd}]/.{aa->0,bb->0.109441,cc->0,dd->0}
In[102]:=
Out[102]= {0.0273603, 0.109441, 0.0136801, 0.}