1. Home
  2. Explore
  3. Mathematics
  4. Introduction to Numerical Methods

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Introduction to Numerical Methods

Transcript

hi everyone in this video I want to talk to you about numerical methods specifically what are numerical methods and what are they used for so numerical methods are essentially a mathematical way so think of this as a tool that we now have to solve certain problems now that may still be confusing to you so let me clarify numerical Methods at their core allow us to approximately solve math problems these could be problems that we couldn't otherwise solve analytically how does this even work though well in school we learned that to take the integral of a function we take the antiderivative and simply apply the balance of the integral and solve well what if solving analytically just simply takes too long or it's impossible well that's when numerical methods come in I just want to properly Define analytical and numerical methods to help you understand the difference analytical means we are applying a set of logical steps to solve our problem

that are proven to find the exact answer of the problem so for example if we said we had X Plus 1 equals 0 we could easily find exactly what x is equal to by adding -1 to both sides this works for many derivatives integrals and everything else you learned at school so far however what if finding that exact answer were to take you say 20 hours or or even after all that work you find out it's not even possible to find an answer when you know that there should be one well that is where numerical methods come in numerical methods is essentially plugging in inputs to a problem checking how close the output is to a solution changing our input and repeating this process until we get as close as we desire to our approximated solution so numerical methods never allow us to reach an exact answer like analytical solutions could but they can't get us as close as we desire we are just trading off computation time so how long our computer takes to plug in as many

numbers as it needs versus accuracy how close we are to the solution of the problem so to make this more clear let's go back to our X Plus 1 equals zero problem and begin with say a guess of one-half well we plug in one half for x and find that one one-half does not equal zero so we would try a new guess and so on and so forth until our left side gets really close to our right side this may sound like it's more work in this simple example but using computers and working with more complicated problems numerical methods are a lifesaver hi everyone in many of the future numerical methods videos we're going to be dealing with systems of linear equations so I figured it would be wise to cover a summary of what they are a system of linear equations is just a collection of linear equations that are independent so this means that we can't derive one from another with basic math operations this essentially means that we can't say we have two equations if

both of our equations are X plus seven equals zero and also x equals minus seven they are the same thing just seven is subtracted from both sides also all of the linear equations need to be related in some way and share the same set of variables so now that we have a rough idea of what a system of linear equations is we should review what a linear equation is just to be thorough an equation is linear if each term is simply a constant or a constant multiplied by a variable think of this like the equation of a line Y equals m times x which is a constant times of variable plus b which is simply constant you could also have something like A1 times X1 plus A2 times X2 plus b equals zero since all of these are a constant or a constant times a variable we know that our equation is linear so you may ask what would it mean to solve a system of linear equations we will go through the methods of actually solving these systems of linear equations in future videos within this

playlist for now just know that solving a system of linear equations essentially means to find and thus assign a value to each of your unknown variables because there are sometimes more than one solution to a system of linear equations the total set of solutions that can solve our system of linear equations is called the solution set there are three possible solutions when solving a system of linear equations firstly we could have infinitely many solutions which occurs when our linear equations are on top of one another secondly the system could have a single unique solution this is when our system of equations all cross at a single point lastly the system could have no solution and this means that there is no possible point where all of our linear equations pass through to more easily solve problems with relatively large numbers of linear equations we can write the linear systems of equations in Matrix form so the way I think of this is that

we keep an inventory of all of our variables within Matrix a the size of Matrix a will be determined by the number of linear equations you have which will tell you how many rows you need and the number of variables will tell you how many columns that you need in The Matrix equation our Matrix a is multiplied by X which is a column Vector representing all of our unknowns and this equals B which is a constant Vector which basically means that it is just filled with some constant number so 0 10 100 Etc this Matrix equation can also be represented in an augmented Matrix which basically means the same thing it just visually simplifies things as you can see here the augmented Matrix looks very similar just the variables column is absent and essentially replaced with a line an important thing I want you to note is that to solve a system of linear equations you must have at a minimum the number of unknowns equal to or less than the number of equations you have if you

have more unknowns than equations you will not be able to solve the system of equations throughout this course to more easily solve systems of linear equations we will essentially place our linear equations inside a matrix convert it to a special Matrix which I will talk about in the next video and then solve using a numerical method on a computer program converting the system of linear equations to a matrix will make our lives significantly easier when it comes to Future programming hi everyone in this video we're going to be talking about singular matrices in particular what are they what do they look like and why should we be interested in them a singular Matrix is a square Matrix so the number of columns in The Matrix equals the number of rows in The Matrix that is non-invertible but what does that even mean you may ask well this means that we cannot take the inverse of the Matrix as the system of equation ax equals B does not have a unique solution

one way to check if a matrix is singular is by finding the determinant singular matrices always have a determinant of zero the determinant of a matrix is fairly abstract in what it means but the way I think of it is in 2D the scaling formation of a given area and in 3D it is the volume scaling transformation remember in the previous video I showed you that an infinite amount of answers to a system of linear equations is when the linear equations all fall on the same line well let's combine these two concepts we know a system of equations on a single line will have an infinite amount of solutions right well when the determinant of a system is zero the area or volume becomes zero thus collapsing all the equations onto a single line and making a unique solution if possible I'm going to attempt to show you this graphically now since we know that the determinant describes a factor by which we are scaling no matter what area we

pick on our graph it'll all scale by the same amount therefore it only makes sense for us to pick an area that makes our lives easiest so let's start in 2D with an i hat vector and a j hat vector and we are going to be applying the transformation presented here we know that our x value will scale to 2 and our y value will scale to four therefore our area was formally one and is now 8. therefore when we calculate the determinant we should expect it to be eight since our area was scaled by eight the same logic applies for the determinant in 3D as well just with volume scaling but what about if our determine is zero well that means that after the transformation our area is going to be zero and as we've previously stated this means that there is an infinite number of solutions to our system of linear equations and not a unique one I hope this quick video aided your understanding of singular matrices and Y determinant of zero signifies to us that a matrix is singular

hi everyone in this video I want to talk about special matrices in particular what are they what do they look like and why should we be interested in them when we are solving our systems of linear equations we roughly follow the same process convert our equations into Matrix form or an augmented Matrix turn that into a special Matrix and then solve for every variable before we get into numerical methods to solve linear equations let's talk about what special matrices are special matrices are matrixes that are simple and easy to solve like I said previously our goal is to arrive at one of these special matrices before solving for our variables there are four special matrices of interest to us the first is an identity Matrix which you may be already familiar with this is the simplest Matrix there is and it represents a completely solved system of linear equations in this case every X variable value is simply corresponding to the constant of B in that given row

the second special Matrix we should try to spot is a diagonal matrix this is simply an identity Matrix except the values in the a matrix are not all ones to resolve this we simply divide the diagonal and the B constant by the coefficient in the E Matrix the Third special Matrix is an upper triangular Matrix in this Matrix every value below the main diagonal is zero when we have this type of Matrix the last row variable can easily be found and then we can work our way up solving each row as we go

by that I mean once we solve for the final row we can use a newly found variable value to solve for the row above it as it will be our only unknown in that row now you can just keep repeating this process as you work your way upwards to row one this process is called backward substitution the fourth and final type of special Matrix is a lower triangular Matrix this is simply the same as an upper triangular Matrix except all the zeros are now above the diagonal and not below it the process of solving this Matrix is the same as well except instead of working our way up the rows we will now be working our way down the rows this process is called forward substitution although diagonal and identity matrixes are the most straightforward and ideal they are usually much more time consuming to get our matrices in those forms therefore since the two special triangular matrices can be also solved in one pass these are the forms that we usually try to achieve when solving our

systems of linear equations also another interesting thing to note is that when you have your Matrix in one of these special Matrix configurations is that the determinant is simply the product of all of the diagonal components therefore if any one of them is zero your determinant will be zero and thus will instantly tell you if your Matrix is singular and does not have a unique solution hi everyone in this video I want to talk about what Gauss elimination is the steps to performing a Gauss elimination and then go through a quick example to ensure you understand first off let's start with what Gauss elimination is ghost elimination is the process of transforming our system of linear equations into a matrix and transforming that Matrix into an upper triangular Matrix this makes solving for all of our variables extremely easy the process of Gauss elimination is simple once you get it however if you currently don't understand why we are

doing something I hope this video will make it clear to you the steps to performing against elimination are the following Step 1 create our augmented Matrix which remember looks like this Step 2 for every Row in the First Column except the top one turn each element to Zero by subtracting Row one times the scaling factor from it the scaling factor is simply the element you want to turn to zero for that row divide it by the only value that will not be a zero in that column so for us right now this

will be the term on the top left corner of our Matrix step 3 is repeating the Second Step but moving diagonally down right one every time and we just repeat this until we only have one non-zero variable left in a given row lastly in Step 4 we use backward substitution to solve for all of our unknowns and that is it that is Gauss illumination I think this topic is best taught through an example so let's do that let's say we have found that our system of linear equations is the following

going through our Gauss illumination steps we must first convert it into an augmented Matrix like so the First Column of the newly formed Matrix is our X variable the second column is y and the third column is z the fourth and final column is simply the constant Vector which is the scalar value that each linear equation is equal to each row in this Matrix represents a new linear equation so if we had a fourth linear equation given we would just add it into any one of these rows that we wish

now that our augmented Matrix is set up we should take note of our first and second column we are allowed to switch the position of one linear equation with another as it is not changing anything since the x value in the first row linear equation is zero it makes sense to swap this with either Row 2 or 3 to save ourselves an extra stat I just want to add not only does this little step save us some work it is absolutely necessary to move our zeros off of our diagonals if we can to avoid divide by

zero errors so if you have a zero on your diagonal you have to try to switch that row with another row if you cannot illuminate all the zeros on the diagonal of your Matrix then that means that your Matrix is singular and has infinitely many solutions now let's quickly go through the Gauss elimination process to solve the system of linear equations so to begin let's highlight in purple all the values that we need to make zero we start on column one and work our way to the right therefore we need all values in column one except for the one in Row 1 to be zero we do this by scaling and subtracting and apply this to the rest of the row this ensures that we can always get zeros in the areas that we want zeros now let's quickly do this for the rest of the row therefore this is our current augmented Matrix let's re-show our purple area of values that we need to turn to zero and move to column two we use the element in Row 2 column two and repeat our process of scaling and

subtracting to get zeros once you get one full row down the process is identical no matter how many rows you have therefore I will just go ahead and complete the problem there we go we have just solved our system of linear equations in the next few videos I plan to show you how to implement this code into several different coding languages which should greatly help your understanding so be sure to look out for those videos hey everyone in this Gauss elimination example video we are asked to solve the following two by two Matrix using Gauss elimination which means we need to solve for our two unknown variables X and Y in the following system of linear equations on the right here I have placed the steps that we will follow in order to solve a system of linear equations using Gauss elimination I recommend that you pause the video now and try to answer this question on your own first and then validate your answer with mine

okay so let's get right into the problem through these steps we will create an upper triangular Matrix which looks something like this and then we will use backward substitution to find the variables that are currently unknown to us so we are basically just isolating one of our variables and then using that to solve for our other one so to solve this our first step says that we have to create an augmented Matrix which separates our coefficient Matrix and our constant or scalar Matrix like so now in order to solve this Matrix using Gauss elimination we need to transform this equation into an upper triangular Matrix which means that we need to turn all elements in our Matrix below the diagonal to zero then we will use backward substitution as I said before to solve for the remaining variables so we need to turn this 4 here into a zero to accomplish this we need to perform some row operations the easiest way to do this is using the following scaling Factor equation

let's say that we want to make this element zero we take this value minus our row that we are not changing Row 1 in this case then multiply this by our scaling Factor this will set this number to our initial one ensuring that we always get zero then we must complete the same calculation for the remaining values in that row with the initial scaling Factor always staying the same the scaling Factor works as we are not actually changing our equation think of these two equations here they're the exact same just one of them has every variable or every value scaled by two however since both sides of our equation are scaled it is the exact same equation this results in the following augmented Matrix which is now in Upper triangular form therefore we are now ready to begin solving for our unknown variables firstly our y variable is readily solvable as 3y equals -2 can be solved by dividing both sides of our equation by three therefore Y is equal to minus two over three

plugging in this newly found variable into our first equation and solving we can find that X is equal to 3. with Gauss elimination we can actually go back and quickly validate our answers as well using our initial linear equations we can just plug in our newly solved variables and if the left and right hand side of both of our equations don't equal then we know we made a mistake somewhere firstly we have two times three plus three times minus two over three equals four this works out to six minus two equals four which checks out therefore our newly found variables make sense with equation 1. next we have four times three plus nine times minus two over three equals six therefore 4 times 3 is 12 minus six is six and our variables also make sense for equation two clearly our newly found variables solve both of our linear equations and thus we have solved the system of linear equations using Gauss elimination everyone in this ghost elimination

example video we are asked to solve the following two by two Matrix using Gauss elimination which means we need to solve for our two unknown variables X and Y in the following system of linear equations on the right here I have placed the steps that we will follow in order to solve a system of equations using Gauss elimination I recommend that you pause the video now and try to answer this question on your own first and then validate your answer with mine so let's get right into the problem our

first step says to create an augmented Matrix which separates our coefficient Matrix and our constant Matrix or our scalar Matrix like so now in order to solve this Matrix using Gauss elimination we first need to transform this Matrix into an upper triangular Matrix which means we need to turn all elements in our Matrix below the diagonal to zero then we'll use backward substitution to solve for the remaining variables if we think about this we actually have this question mostly solved remember

that we are allowed to move our rows around within our augmented Matrix as this is not actually changing anything with our actual equations therefore we can switch rows 1 and 2 and we get the following augmented Matrix as you can now see our upper triangular Matrix is actually now properly set up as all the elements within our yellow triangle here are zero so let's begin using backward substitution to solve for unknown variables X and Y in our new equation two we have two y equals six

therefore Y is equal to 3. now we can use this newly found y variable to solve for a known X variable using equation one so we have 7x plus 9 equals 2. plugging in our y value we have the following equation solving we can see that X is equal to minus 25 over 7. now with Gauss elimination we can actually go back and quickly validate our answers using our initial linear equations we can just plug in our newly solved variables and if the left and right hand side of our equation don't equal then we

know that we made a mistake somewhere firstly we have two times three is equal to 6 which is true therefore our variables are valid solutions to our first equation secondly we have seven times minus 25 over 7 plus 9 times 3 equals two this works out to minus 25 plus 27 which does equal 2. therefore our newly found variables are proper solutions to both of our initial equations everyone in this video I want to talk about what partial pivoting is in numerical methods and how we can apply

it to a problem partial pivoting is the method used in numerical methods to help us reduce truncation or round off error when solving our system of equations and it increases our numerical stability so it is essentially a tool that will help us better solve our numerical methods problems in brief we use partial pivoting to get more accurate answers when solving systems of equation problems and it prevents us from having a zero on our main diagonal if at all possible firstly we can have partial pivoting or full or complete pivoting partial means we only consider and move rows within our Matrix and thereby changing the order in which we present our Matrix whereas full or complete pivoting which is slightly different considers both rows and columns and thereby changes the order in which our equations are presented and the variable order you can think of pivoting as rotating our equations which if you remember is not actually changing our Matrix at all

but you may ask aren't we just adding more operations and therefore more calculations which will slow our algorithm down well yeah partial pivoting is not meant to speed up our program but it will add some numerical stability to our problem and as I said reduce our truncation error so now that we know what partial pivoting is and why we might want to use it how do we actually go about implementing partial pivoting and why does it reduce truncation error firstly let me just say that with partial pivoting we're going to be working with the elements in our main diagonal you can refer to this as our pivot element if you wish as a formula we use partial pivoting if the absolute value of our pivot element the element along our main diagonal and our row of interest is smaller than another element in the same column then we switch the rows thereby pivoting them then you would continue and complete your numerical method for that row and repeat this process therefore as an algorithm the partial

pivoting method is typically applied before each iteration so for example in ghost elimination problem we would check if our main diagonal element is the largest within its column if it is not then we switch that with the row that does have the largest absolute element in that given column this essentially allows us to have the largest number possible as our divisor and our scaling factor which we commonly use to reduce rows we do this since the larger number in our denominator will lead to less truncation errors which will grow like a snowball throat or problem so in summary partial pivoting is an extremely valuable numerical method tool that will allow us to reduce truncation errors and prevent zeros on our main diagonals when solving a system of linear equations I hope that this video helped your understanding of the purpose behind partial pivoting and why we use it in numerical methods everyone in this numerical Method video we are going to be solving the following

system of equations using Gauss elimination with partial pivoting so if you missed my previous videos on Gauss elimination or partial pivoting check out the videos Linked In the description down below and then come back to this video so let's get right into this example the first thing we are going to do is convert the system of equations into an augmented Matrix as it makes it less cumbersome and makes solving our Matrix much cleaner The Matrix will look like this once augmented to solve this problem using guess elimination we're going to follow this procedure firstly we'll transform all the elements that are pinkier to zero and then we will use backward substitution to work back and solve for all of our variables then lastly we'll validate our variables are correct by proving that they do solve our system of linear equations but how do we reduce all the pink elements to zero especially since we are asked to use partial pivoting well here's the procedure to complete

step one of our process every iteration that we complete we will Begin by first checking if a partial pivot is necessary if so we will perform the partial pivot if not then we skip this step and then use our scaling factor to transform all of the pink elements to zero now we are ready to begin our work as stated above the first order of business here is to check if a partial pivot is necessary as stated in the previous video we work from left to right down our main diagonal therefore we first focus on column one to check if partial pivot is going to be necessary we need to look in the First Column and see if a absolute of any elements are larger than our two here that is currently our main diagonal or our pivot element as you can see the absolute value of 15 is larger than 2 or 1. therefore partial pivoting tells us to swap these two rows and we now have the following augmented Matrix now we just Advance ahead using our typical Gauss elimination

so we have element Row 1 column one minus our Row 2 scaling factor which will be 2 over 15 times our row two column one element and then we find the row three scaling Factor equation the same way now I'm just going to show the calculations here and color code them to the corresponding variable

now to fully eliminate truncation error we should just leave our fractions like so however with partial pivoting we are minimizing truncation error by using a larger number and our scaling Factor denominator so it is slightly less important depending on your application at the end of the video I will show the solution of this Matrix with and without using fractions so after our first Gauss elimination step we are left with the following augmented Matrix now we need to check if partial pivoting is necessary again for row 2. so looking at our main diagonal and down we can see that the absolute of 2.866 is larger than the absolute of 0.733 therefore we use partial pivoting as flop Rows 2 and 3. this leaves us with the following augmented Matrix repeating the calculations we did above we can convert the remaining pink elements to zero and fully solve our Matrix therefore we have Row three minus our scaling factor which is 0.733 over 2.866 times row 2.

after completing these calculations here you can see that we are left with the following Matrix Additionally you will notice that we have all of our pink elements to zero as we said we wanted earlier therefore we are now ready to begin backward substitution and solve these three equations we begin with our last row and we can solve for Z which is 3.157 then using Z we can plug it into equation two and solve for y Y is equal to minus 0.1018 and lastly using Y and Z we can solve for our first equation here which is X which works out to 0.3469 lastly we stated earlier that we can validate our results by plugging these variables into our original equations so that is easy enough and we can validate your answers with the ones I just presented here

I hope that this video helped your understanding of how to complete a guess elimination problem with partial pivoting hey everyone in this Gauss elimination example video we are being asked to solve for the following three by three Matrix using Gauss elimination which means that we need to solve for our three unknown variables X Y and Z in the following system of linear equations on the right here I have placed the steps that we will follow in order to solve the system of equations using Gauss elimination through these steps we will create an upper triangular Matrix which looks like this and then we will use backward substitution to find the variables that are currently unknown to us so we're basically just isolating for one of our variables and then using that backwards to solve for our other ones to solve this our first step says that we create an augmented Matrix which separates our coefficient Matrix and our constant or scalar Matrix like so

now in order to solve this Matrix using guess elimination we need to transform this equation into an upper triangular Matrix which means that we need to turn all elements below our main diagonal to zero then we will use backward substitution like I stated earlier to solve for the remaining variables so we need to turn all these values here to zero to accomplish this we need to perform some row operations the easiest way to do this is using the following scalar Factor equation so let's say that we want to make this element zero we take this value minus our row that we are not changing Row 1 in this case then multiply this by our factor and that will set this number to the first number ensuring that we always get zero then we must complete the same calculation for the remaining values in the row with the initial scaling Factor always staying the same so through this technique we can easily get our 1 and 4 values here to zero so I'll just write this out like so such

that you can easily see all the calculations that were occurring and there we go this is our first set of row iterations complete and you can see that all of our first column except for the first element is all zero as anticipated additionally we lucked out here and that our other value in Row 2 that we needed to turn to zero also did that therefore since our Matrix is now an upper triangular form we are ready to begin solving using backward substitution we have Z equals minus four divided by minus six therefore Z is equal to 0.666 it is better to leave our variables as fractions to eliminate truncation error the error due to chopping off part of our numbers however to keep things simpler I'm just going to work out in decimals onto our next equation we can adjust our equation such that we have 3 plus 1.222 divided by 1.5 therefore Y is equal to 2.889 lastly we can now solve for our missing variable X we have two minus 2.889 minus 0.66 all divided by 2 is

equal to -1.78 with ghost elimination we can actually go back and quickly validate our answers using our initial linear equations we can just plug in our newly solved variables and if the left and right hand side of our equations don't equal then we know we made a mistake somewhere as you can see here this works out for all three equations therefore these variables do solve our system of linear equations as expected if your numbers are slightly off here in the validation stage that is likely due to some truncation error that occurred during the process hi everyone in this video I want to talk to you about Lu factorization this is also known as Lu decomposition so I want to talk about why it is important what is it and how does it work then we'll go through a quick example to ensure that you understand so if you remember in Gauss elimination we transfer our augmented Matrix into an upper triangular Matrix then after our Matrix is in Upper triangular form we can

easily solve for all of our unknown variables however what if our B values were to change in our initial Matrix while the values of the a matrix remain the same well that would mean that all of our previous work solving our system of linear equations would now be useless so let's think maybe there is a way that we can ensure that as long as our a matrix is unchanged we can always find our unknown variable values even if our constant Matrix changes well if we think about what we did

during Gauss elimination we solely focused on eliminating the purple region of our a matrix therefore if we track what we do to our a matrix we can easily apply that to our new B values but how do we go about this you may ask well we do this by placing our scaling factors that we used in Gauss elimination into a lower triangular Matrix this is where the Lu and LU factorization comes from we have a lower triangular tracking our scaling factors used to transform our augmented Matrix

into an upper triangular Matrix so an Lu factorization we are creating two triangular matrices that when multiplied together give our original Matrix so let's quickly show how this works we begin with our original Matrix form Matrix a times our variable Vector equals to our constant vector then after performing our Gauss elimination we are left with an upper triangular Matrix times our variable Vector which is equal to our new constant vector since we must apply all the same changes

here that we did in each row of our Matrix now let's multiply both sides of this equation by our lower triangular Matrix which I will focus on more here shortly now we note that the Matrix U times our Vector variable is simply our new constant Vector therefore we are left with the following this allows us to easily use our Matrix L and our original constant Vector to easily solve for our new constant Vector using forward substitution then using our newly solved constant

Vector times our U Matrix we can easily solve for the unknown variables I recognize this can sound a little daunting however let's work through a quick example and you'll see it's not that awful and it's actually quite amazing at saving us time and work so let's take the following Matrix and solve it using Lu factorization so we must find our U and L triangles and our new constant Vector which will just be the result of solving for our U Matrix now let's start solving the problem liquidate Gauss elimination we must turn all the values in the purple triangle to zero this will result in our U Matrix once completed we perform the following formula for each of these three elements that we must turn to zero and for every element that we turn to zero we take the scaling factor and plug it into the corresponding element position in our L Matrix and that is how our L Matrix has built now we can just repeat this process for the remaining elements that must become

zero just be careful with the negatives in your scaling Factor as it can become very easy to make a sign error if you're working too quickly now that we have our L and U matrices and our new constant Vector we can solve our system so we take our L Matrix times a new constant Vector which equals our original constant vector then we simply use forward substitution and solve for our new constant vector then we applied this to our U Matrix times our unknown values Vector equal to our new constant vector and solve using backward substitution and there we go we have now to solve a system of linear equations using Lu factorization but why do we need this over Gauss elimination you may ask well there are several reasons typically the a matrix in a problem is going to stay constant but the constant values will change more often arranging our a matrix into a u Matrix configuration is the computation heavy portion of solving a Gauss elimination problem

this means it basically takes more calculations and time for our computer or us to solve that portion of the problem so through using Lu decomposition we only need to solve a once and then can apply those values that we find and plug into the L Matrix to solve for a constant Vector no matter what the values are this saves our computer lots of work and makes our programs much much quicker also if we wanted to calculate the determinant of a it is simply going to be the determinant of U times the

determinant of L and if you remember the determinant of any special matrices is just the product of the diagonals therefore finding the determinant of a is also super simple when using Lu decomposition in summary Lu factorization is not much more complicated than Gauss elimination and can allow for a simplified Matrix solution for whatever values we could enter into our constant Matrix which Gauss elimination just cannot do for us hey everyone in this video we're going

to be walking through how to solve an Lu decomposition example by hand if you missed our previous video on how Lu decomposition Works check out the video in the top right hand corner of your screen now or in the description down below so let's get right into this problem we are asked to solve the following Matrix using Lu decomposition in our first steps of solving a matrix using Lu decomposition we do not actually need our coefficient Matrix B so we'll just set that aside for later so we need to convert this a matrix into a u Matrix or an upper triangular Matrix while recording our applied scaling factors into a lower triangular Matrix which we call L getting started we're going to reduce all elements below our diagonal in the First Column to zero

we do this by using the following formula for each row in practice it works like this we want this element to become zero therefore we say Row 2 minus Row 1 times our scaling factor of this element over the element of our main diagonal in this column therefore we have Row 2 minus Row 1 times our scaling factor of three over one so let's do the same thing for Row three and we have Row three minus Row one times our scaling factor of two over one now we just need to complete the calculations you can do this any way you wish however just be cautious of sine errors as it can be very easy to make a mistake if you are working too quickly

at this point we can also begin constructing our L Matrix which looks like this and we have three spots to fill for a three by three Matrix and we actually have two of them already here as we are going to fill these spots with the scaling factors we've been finding all right so as you can see we now have our first column just how we want it now let's repeat the same process for our second column as you can see there is only one row that we need to conduct row operations on therefore we have Row three minus Row 2 times our scaling factor of -2 over minus seven and again just go ahead and complete these calculations here

we can also add the scaling Factor as our final missing piece of our L Matrix now there are U and L matrices are solved we can use the following formula to solve for our constant Vector values which as we learned in the Lu decomposition theory video we can use to solve for our a matrix so as you can see here once we write out all of our matrices the only thing we need to do is complete a quick forward substitution to find all of our missing constant values after solving you can see that C1 is equal to 1 C2 is equal to -1 and lastly C3 is equal to roughly 1.2857 after truncating our fraction for Simplicity our final step in completing our Lu decomposition example is solving for our unknown X variables as you can see here this is done by using backward substitution which I will go ahead and complete for you right now

there we go we have X3 is equal to 0.3214 X2 is equal to 0.14286 and X1 is equal to minus 0.07138 if you wish to validate your answers at this point you can plug these variables into your a matrix that we had earlier and this should solve your system of equations

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent