An Example of LU Decomposition Method of Solving Simultaneous Linear Equations
|
In this segment we'll talk about
the LU decomposition method. We'll do that through an example. So, here is
example we're asked to simply solve this set of equations right here. We are
given the LU decomposition of the coefficient matrix; this is our lower
triangular matrix; this is upper triangular matrix. So, it's already given to
you if you want to figure out how we do the LU decomposition of the matrix
itself, go to the uh the video description and you will see a link there. What which we need to do is let's
first recall what we what LU decomposition is. We have [A][X] equal to [C],
we write our [A] in the LU form, and then we say hey we got to first solve
[L] times [Z] is equal to [C], and then we've got to solve [U] times [X] is
equal to [Z]. So, this becomes our first set of equations this becomes our
second set of equations and once we find [Z] here we put it back in here and
then we can find x. So, let's go and take this first part separately and this
second part separately. So, the [L] times [Z] equal to
[C] would look like this. So, that's our [L] matrix then we are saying hey
this is our [Z] vector and this is our right-hand side vector. And as you can
see what we'll do is we'll solve it by using forward substitution; so, this
is [L] times [Z] equal to [C], and the part of the LU decomposition method we
are doing here is forward substitution. So, if you look at the first equation,
we’ll have z1 = 1/6.8, then the second equation will look like this, and we
expand the third equation, we will get this equation right here. So, it makes
it uh clear that hey we need to solve this equation first, that's for z1,
then we can solve for z2 here, and solve for z3 here. So, z1 already 1/6.8,
so no need to go any further than that. We take this one we say z2 is 177.2
minus 2.56*z1 divided by 1. So, we don't need to really divide by 1, but
let's just show it there. So, we got 177.2 minus 2.56 times z1, and this
number here turns out to be equal to -96.208. So, let's go and do this third
equation here. So, that's what we'll get for z3, will be this quantity. So, we
substitute the values of z2 now, which is which we just found out. And we
substitute the value of z1, which we found out from the first equation, and
this number here turns out to be equal to 0.76. So, what we have found out is z1 here, we
found z2 right here, and we found z3 here. And this is what we're going to be
using in the in the back substitution part. So, we have found out what the
[Z] vector is at the end of the forward substitution steps. And we find z1,
z2, and z3 to be equal to 106.8, minus 96.208, and 0.76. So, what we have to do now is we
have to do the back substitution part, so that's back substitution. We
already know what [U] is, we just found out what [Z], is so we can find out
what x is. So, if we write down our equations for [U][X] equal to [Z], this
is what's going to look like so let's write down what the [U] matrix is the
upper triangular one, multiplied by our unknown vector x1 x2 and x3, here
I’ll have 106.8, -96.208, 0.76. So, what we're going to do is in the back
substitution we start with the last equation first, so that gives us 0.7*x3 =
0.76, because it'll be 0 times x1 plus 0 times x 2 plus 0.7 x3, which is
right here, equal to this quantity. And that gives us x3 = 0.76 divided by 0.7
and we get 1.0857. Let's look at the second last equation. We’ll get -4.8*x2
– 1.56*x3equal to minus 96.208. There is no x1 term because we have a 0 here.
And what does that give us? So, if we write down what x2 is, and we write it
in the same form as we would be doing it if we were doing this through a
computer program, so that's why I'm taking things to the right side and
dividing by the coefficient of x2, so we get uh this quantity right here. And
this number here turns out to be equal to 19.691. So, let's go and see what do we get by from the first equation which is right here
which will have all the unknowns, but at the same time we already know that
we have found the other unknowns except for x1. So, I’ll write down x1 or
write down the equation in terms of x1, because that's the only unknown and
now we substitute the values of x2, which we just found out, and x3, and this
number here turns out to be equal to 0.29048. So, I basically found out what
the solution is. The x vector is x1 x2 and x3, and that turns out to be equal
to the following numbers. So, we have found out x and that's what how LU decomposition
method works. And that is the end of this segment. |