I am working on a simultaneous linear equation problem using LU decomposition
and I'm unsure if this is the correct approach/answer to solve a system of simultaneous equations using LU decomposition. I'm looking for a way to check my resulting calculations and to understand if I have done the calculations correctly. This is my first time doing LU decomposition or doing matrix calculations at this level.
$5×1 + 6×2 + 2.3×3 + 6×4 = 4$
$9×1 + 2×2 + 3.5×3 + 7×4 = 5$
$3.5×1 + 6×2 + 2×3 + 3×4 = 6.7$
$1.5×1 + 2×2 + 1.5×3 + 6×4 = 7.8$
\begin{bmatrix}5&6&2.3&6\\9&2&3.5&7\\3.5&6&2&3\\1.5&2&1.5&6\end{bmatrix}
I multiply the top, third and fourth row by 10 and the second by 2 to make it easier to work with.
\begin{bmatrix}50&60&23&60\\18&4&7&14\\35&60&20&30\\15&20&15&60\end{bmatrix}
I calculated the L matrix as:
\begin{bmatrix}1&0&0&0\\9/25&1&0&0\\7/10&45/44&1&0\\3/10&5/44&1.584572&1\end{bmatrix}
and U matrix as:
\begin{bmatrix}50&60&23&60\\0&88/25&-1.28&-38/5\\0&0&5.2&-93/22\\0&0&0&12.6\end{bmatrix}
I have y as the following:
\begin{bmatrix}4\\5\\6.7\\7.8\end{bmatrix}
and solved the system with the following values for x
\begin{bmatrix}4\\3.56\\0.2590\\5.734906\end{bmatrix}
Best Answer
Your answer has a few issues, it was close.
You made some sign errors in values of $L$, and that messed up the final $L$.
For example, you should have $−45/44$ and $−5/44$ and that looks like it caused $L_{43}$ to be wrong. Of course, these issues caused similar errors in $U$.
The result should be
$$A = \begin{pmatrix}50&60&23&60\\18&4&7&14\\35&60&20&30\\15&20&15&60\end{pmatrix} = LU = \left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ \frac{9}{25} & 1 & 0 & 0 \\ \frac{7}{10} & -\frac{45}{44} & 1 & 0 \\ \frac{3}{10} & -\frac{5}{44} & \frac{175}{57} & 1 \\ \end{array} \right)\left( \begin{array}{cccc} 50 & 60 & 23 & 60 \\ 0 & -\frac{88}{5} & -\frac{32}{25} & -\frac{38}{5} \\ 0 & 0 & \frac{57}{22} & -\frac{435}{22} \\ 0 & 0 & 0 & \frac{1935}{19} \\ \end{array} \right)$$
Hopefully, you can take it from here.
Notes:
$1.$ You can always verify your result by substituting the values you got for $x$ back into the original system and seeing if the LHS = RHS.
$2.$ You could have also multiplied $LU$ and see if that returned $A$.
$3.$ Also, please recall that you multiplied your equations by $10$ and $2$, but forgot to make the corresponding update to $y$ for the final steps.
We now want to use back substitution to solve
$$A x = LU x = \left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ \frac{9}{25} & 1 & 0 & 0 \\ \frac{7}{10} & -\frac{45}{44} & 1 & 0 \\ \frac{3}{10} & -\frac{5}{44} & \frac{175}{57} & 1 \\ \end{array} \right)\left( \begin{array}{cccc} 50 & 60 & 23 & 60 \\ 0 & -\frac{88}{5} & -\frac{32}{25} & -\frac{38}{5} \\ 0 & 0 & \frac{57}{22} & -\frac{435}{22} \\ 0 & 0 & 0 & \frac{1935}{19} \\ \end{array} \right)x = y = \begin{pmatrix}40\\10\\67\\78\end{pmatrix}$$
The final result is
$$x = \begin{pmatrix}-\frac{1976}{645}\\-\frac{281}{860}\\ \frac{1327}{129}\\-\frac{256}{645} \end{pmatrix}$$