Lec 10 MIT 18.085 Computational Science and Engineering I

to go on lecture 10 so let me say what lecture 10 is about it's going to bring back it won't be entirely about uh what we did before but it's going to bring back these matrices you remember this was K4 in the from the first lecture with twos all the way along the diagonal and then T4 uh the one with a change at the top uh change that two to a one and then I don't know if I gave this one a name this is the one that where the changes down at the bottom and uh so it's really just it's very very closely related to this guy just the changes it's h maybe is for hanging because this was the the change came at the bottom when we had those Springs and masses hanging in a in a line where the change came at the Top If the top boundary was free so this is this is I'll use so this is fixed fixed fixed at both ends and this one is free at the top and fixed at the bottom and this one corresponds to fixed at the top and free at the bottom okay okay so one thing to do which we posed as an exer or or problem was to figure out what was going on with the inverses and these inverses are very pleasant and we can capture those very quickly and by the way everything I say about H is going to come very immediately from everything we say about t so uh those two are are really the same job but K provided uh a not so obvious appro uh question and I I opened the sort of to the on the web page the question of finding uh formula for the inverse Matrix and uh um suggested to like take the case the 3X3 or the 4x4 case as examples and um here uh let me see what the inverse is oh I've got it written down uh I remember the 1 and and so what does the five represent there in an inverse you're always dividing by the determinant and the determinant of the 4x4 Matrix is five and in general the determinant of the N byn Matrix is n + one so that part of the pattern we could spot but this was maybe not well this looks pretty clear along the top row and and the column and the row course turning it upside down isn't changing anything here where turning this one upside down converts to that one and turning that one upside down should convert to this one but now the numbers that came in here were not so the pattern there was to be discovered or guessed so one approach is guess and verify and several uh people did that quite successfully made made the made a good guess there or or they may have uh reached their formula by some systematic I shouldn't say they guessed because they may not they may have done done it differently but I couldn't see what was the best way so the question is how to find these inverses and I kind of puzzled about that for quite a while and then as I caught on to how to do it I I saw more uh of the pattern and I saw the connection between these equation these equations with matrices K or T and these equations with these differential equations that we looked at in a later lecture so the differential equation the differential equation that we looked at was remember what's the connection of minus what's the connection between that differential equation the left side and and these matrices let's see these matrices how do in words what what kind of matrices are we seeing we're seeing in a typical row of these matrices minus1 2 and minus one yeah and what do that those three numbers what jumps to mind when I see those three numbers it's a second difference where here we have a second derivative and we have a minus sign and actually we got a minus sign here too the the true second difference would be 1 - 2 1 and we've switched those signs okay now all right where should we start I I had several ways to to approach the inverse the question of the inverse uh so let me let let me take this easier one first uh to say how did we get to the inverse of that and and the way a good way to get to the inverse of that is starting with t of course and we got to get there of course every we could check it that it works but that doesn't seem quite Fair anymore so uh let me uh take that Matrix and Factor it you remember how it factored so so I'm going to concentrate on T for just a minute to give a direct way to deal with t in fact this will be slightly repetition that that Matrix T factored into like all all good matrices factored into uh upper triang you know we did elimination and we ended up with some upper triangular U and the lower it turned out to be U transpose U it turned out to be uh yeah best best to look at that again you transpose U you was one's on the diagonal the pivots all turned out to be ones and minus On's just above and then it's transpose has ones on the diagonal and minus one's just below and If I multiply those matrices I get T all right so then the idea was okay maybe we can invert those pieces and we can so let's now now so that was t then T inverse was the inverse of U times the inverse of U transpose and so if I now I want to invert this guy and put it here oh am I going to get huh okay what's uh yes what's the inverse of this one let me make it let me fill out it's it's I want to there's you so I want to put but its inverse comes first so I'm um we've done this before but do you remember what the inverse looked like Z I have here a triang upper triangular Matrix so what can you tell me about its inverse also upper triangular and this is a difference Matrix and its inverse will just be a sum Matrix so this is what turned out to be the inverse of that and then this the inverse of that was the transpose so it's now sums now good okay so th that's all quite quick to check I mean I'm doing it even more quickly here but it would be quick to check and that gives us our answer right when I take now if I do the multiplication to find T inverse I I just going to multiply those guys okay I get from that that I get the four and that times the next one gives me three ones produces the three then the two then the one that row times that column will be the three here I I'll get this formula no problem okay so that's all right so I I guess I feel that with t we uh could legitimately say yeah we not only got the discovered the inverse we we found a system to produce it now if I change over to K it was not so easy this method gives me triangular factors but their inverses would take a little patience not not to but they're quite quite attractive still but then multiplying them the two factors together takes even more patients so I'm I would like to think of another way to deal with K inverse so this is really my principal job how to deal with K inverse so one way would be the Triangular factors invert them multiply but but uh uh somehow we're not we wouldn't really see what was happening there okay so now um now so now I come to K all right now I have two two approaches to K so T was easy okay so one approach okay let me tell you the one approach that I I'll that I'm that I'll describe a little bit but then it will be an important step in the calman filter in updating least squares so it sort of links to the last topic on my outline here this is sort of this occurred to me on the airplane actually uh what's the difference but well first of all let me let me just figure out what the diff I want to compare the inverses of T and K if I compare let me first before the inverses if I compare those matrices what would you tell me about K minus t how how much have I changed one Matrix to get to the other one just one entry so so what would you tell me about that Matrix K minus t it's it's it's it's all zeros so it's incredibly uh small I mean incredibly simple except for that single one right up in the corner so what's the rank of that Matrix I'm interested in the rank it's just one yeah the The Matrix is just like this guy the K minus t yeah let me let me put out what K minus t is because that's so so simple K minus t is this is this obviously is just this Matrix with a one and all the rest zeros and and and if that's a rank one Matrix that should be write I should be able to write that Matrix which is rank is surely one as a single column times a single row and you can see how I how what column times what row would produce that Matrix well just what what shall I do for the column and what shall I do for the row just one in the first place yeah one z0 0 that's a good and and one 1 0 0 0 and and just the only interest in that example is just to remember that I can multiply this 4X one Matrix column times this 1 by4 Matrix and get a 4x4 absolutely following the rules Matrix and it's a rank one Matrix because it's just a row times a column every uh so the anyway it's it's it's it's a very special rank one Matrix because it's such a very special row and column there okay now the inverses the inverses so let me take T inverse minus K inverse and so I what I want to say is that if two matrices differ by a rank one Matrix their inverses are pretty differ by something special and I propose that we just figure out from this to try to see the pattern by um taking just doing the numbers for this example so this is one approach to to finding K inverse so my appro this approach to finding K inverse is to sort of compare with t and compare the inverse with t inverse because T inverse is simple so that's one way to do it another way will be more directly just go for K inverse and heck with t right okay but can we subtract T inverse from K subtract this from this it took me a couple of tries but we can do it here so what's the difference between those T inverse minus kers can you do that so I have four minus 4 FS well obviously I'm going to need a 1 15 Factor right I'm so I'm just doing this calculation to see something interesting because I I think it's more fun to discover stuff than than just announce it okay so so I have four minus four fifths is how many fifths just tell tell me the number of fifths 16 fifths right 20 of them minus four of them okay what goes next here I have three that's 15 fths and take away three what number how many fifths have I got here help help 12 yeah 12 sounds good I'm just subtracting this is the big one and that's the small one okay then I have 10 two which is 10 fths take away two of them how many fifths eight and finally I have five fifths take away 1/5 leaves me 4 fths okay good now let's let's see everything's symmetric right will you let me fill in this much without stopping okay now how about in the middle here I have 15 FS minus 6 fths is 9 and 10 FS - 4 fths is a six and 5 FS minus 2 fths is a three and again symmetric so I can be pretty sure that six and three uh would you want to predict uh the others and then 42 right let's put them in 42 and you want to predict the last one two 2 one okay and is what should we just check one of those and regard as safe okay is the one fifth correct yeah because I have 5 fifths take away four fifths does correctly give one F anyway that that's right and what's special about that uh about that Matrix tell me something special about that guy it's rank one yes it's rank is one again because H every row all the rows are multiple I mean if that's the bottom row that row is twice as much that row is three times as much actually it's rank one and with very special numbers what what would be the so I could make it 1 of well tell me the the the number there the the the the row and the column the column and the row that would 4321 would do it and and and because it's symmetric my two vectors can be the same rank one matrices in general have this form column time row and if they're symmetric the two vectors are the same okay so well well that's very pleasant and it and and and and then I thought ah must be a formula that would tell me that and it must be quite important so so the formula is what's the if if if I know one inverse so I know this I know this and I know all of these guys and I want to find that and so a formula for what is K inverse if you know T inverse yeah and so I write that formula down but then I won't pursue it right now if that's all right it's the key formula for all updating problems and estimation I I I guess I feel it's a key formula for for the kind of uh scientific problems that that uh math mathematical questions that would come up here at the lab because we're doing estimation yeah can I just continue my conversational part without the formulas I guess it seems to me that a key problem is we're doing Le squares we're doing estimation where is that uh that satellite or that missile and then we get another measurement so that's one more bit of information which updates gives us a correction to the estimated position and because that is just one more bit of information it's a like somehow there's it's a rank one change in our in our in our estimation problem and then we're looking for the change in the answer and that's what uh recursive lease squares or the kelman filter and filtering is all about is updating from new information updating the old answer with new information okay and that's what we're doing here we I guess I'm regarding here is T inverse is our old answer that we that we found because it was espcially easy and now I'm updating by that much and I'm looking for the new answer okay I'm just going to write down the formula then that we will see later so the new answer that I want is the old answer and then in comes can I yeah this K minus t has this has this is this rank one Matrix yeah maybe I'll just should I just keep keep it as K minus t I think maybe maybe here's the magic formula if I can do it without my eyes I think it it's got to involve only T inverses and uh K minus t and another T inverse that looks pretty good and now down below I think is something like one plus oh jeez oh I got to get a number here that was good uh down here oh so I have to say what these two this rank one Matrix splits into so I what name what name shall I give to that vector kind of call it little e or something it's a little e is that column vector and then this is the row Vector okay okay and so what shows up down here I think is T inverse oh maybe it's no it's the E the other side because I I have to end up with a number it's e transpose T inverse E I think I think that's right that I might not have all the signs right but do you see the beauty of that formula if it's right of course it's almost right if and and about about a hundred people have discovered this formula and they all thought wonderful and they all got their names attached to it so the formula so many names now I could mention oh somebody named Woodbury who uh um and uh then an Oldtimer named sure oh there I'll I'll when I do this formula properly I'll produce more of the names but do you see that it has exactly the what we hope because what we know what do we know here we know T and T inverse so there's T inverses and we know K and this is a rank one Matrix and this is just a number down here so we know everything here and it gives us the inverse of the new one and if I did it right it would produce this correction this this whole stuff would be this correction term and we would have our answer okay now I don't know if that's entirely satisfying because that formula got produced out of thin air I I'm and quite thin air and uh what I want to say is just really looking ahead that that uh that this formula the if the change in The Matrix is some rank one Matrix then the change in the inverse is also rank one it's a more complicated looking thing but this guy is the rank one so the whole thing is rank one and uh and there it was in this particular particular instance okay so I was quite happy with that I thought okay that uh connects to later parts of the course in a beautiful Way shows our formula shows this formula from from later on to be act which will come in March uh to be actually very useful for this puzzle that we never really resolved but now I'm going to turn to a direct attack on this inverse because uh we can get it directly too and and getting it directly will be will connect to our differential equation so I'm I'm proposing to erase this if nobody objects I'll erase this this rank one and this wonderful formula because because I'll we'll see it we'll see it again I I'll just mention though I can't I hate to erase it totally uh let me let me let me tell you one one application of it one one because I spoke about these squares there yeah so let me let me complete that thought before I give up suppose I'm suppose I'm trying to find the position of this darn thing and what I'm given so suppose I I'm trying to solve this these squares problem Au equals some measurements B Okay now what's my a my a is going to be so I'm it's going to be rectangular and it's going to be a matrix with ones - one 1 -1 1 - one one so it has oops i' so far I've got and final guy minus one all right and and I'm looking for the positions of this let me say satellite and I measure B1 B2 B3 B4 and B5 okay wh what's up here that it shouldn't have does it four I hope four one two three four yeah it's good you thanks that's critical so let me say the problem in words I'm trying to this this this uh satellite is in uh you know it's moving along so I first measure its first position so I make a measurement U1 equal B1 is my first equation plus error okay so I know approximately where it is now the second equation is U2 minus U1 is some B2 plus error so what have I what have I measured there I've measured the difference how how much it moved right so I didn't know exactly where it was but the second measurement told me something about where it is now uh by measuring the relative error which of course everybody can think of applications where that would be the case and then the next the third equation would be a measurement of the next one and plus error and and the next and now I pretty well know I know something about u4 because it's approx well so what is a u4 is approximately what I guess if I just had those four measurements what would be my best guess for u4 I'd add those right if I wanted to know u4 out of these four measurements if I add those equations that would be give me u4 equal B1 plus B2 plus B3 plus B4 plus errors and that's like the best I could do that would be the best least squares now right now I've only used four okay and that's exactly so that exactly corresponds to this Matrix T if oh yeah so what you remember what to do with least squares how how do what's the equation so if I have a rectangular system as I do here there's not going to be a solution so I'm looking for Au approximately as close to B as I can get it and what what equation do I solve that a transpose a right so so that leads me to the A transpose a equation that for the best U is a transpose B that's the equation I actually solve now when I had only when it was 4x4 then I had four equations four unknowns actually The Matrix was completely invertible I could solve it directly and you you gave me the best answer u4 is the sum of the B's but now I get a fifth measurement and that fifth measurement is minus u4 equals some someplace B5 well basically it's a it's a measurement of plus errow it's a measurement of where that final guy is but it's got error in it now what's the best estimate for u4 let me ask you that what's the best measurement for the final position the best estimate of the final position u4 based on five data five data you might say okay the last measurement was measuring u4 exactly couldn't do better than that but you can cuz you had information previously and you're not going to throw that away right there's there's error in this measurement so it's not exact and there's error in these measurements possibly greater error because it was like like compounded but still information is in there so the least squares method uses all the information you've got by Computing a transpose a so yeah so what's the connection with k and t are particular matrices it's exactly that's what a transpose a is the the 4x4 the four measurement case a transpose a was the T and the 5x4 problem the 5x4 case with this last guy a transpose a which now has a new thing oh it might have been the T or it might have been yeah it might have been the H it might have been the upside down T yep probably was but the 5x4 one is the K right so uh so that's the that's the Practical problem that's and I to me that seemed like a beautiful model problem to have information on the starting position on the relative chain on the the differences and then on the and then yes later to get a new information about the final position and then to update to to get to a different uat which which uses this from the old U hat which didn't know it that's exactly this this uh move from a transpose a being the being the T or the H to a a transpose a being the K if I took this Matrix and multiplied by uh yeah I guess if I took that as it stands and multiplied by its transpose I'd get K I'd get four right the the 4x4 example that we've done okay so I my point is that this is not just Matrix manipulation for the heck of it this lecture but that it connects directly to a typical model problem in lease squares and the key issue of updating the estimate when we update the data and that that update produces the change from T or maybe it was actually the upside down Matrix H to K all right so that's uh I hope that's like it's now uh permanently on the web so we can return to that when that lecture comes up okay now so the rest of this lecture is the direct attack on K inverse and at the same time we'll get T inverse okay so I'm going to make space for this direct attack okay that much space for now and then more space later okay okay so I'm given the Matrix K the fix fix Matrix and I'm looking for its inverse I still everybody recognizes I still have not written down the formula here so somebody suggested to me by email but I haven't written it down okay so I'm still looking for it I could create it out of the out of this uh update formula but uh I'm going to go directly okay so how do I find all right let let me let me uh prepare the way here I want to prepare the way do you remember in the differential equation case we prepared the way by introducing the Delta function the step function and the ramp function so those were Delta S and R the jump was at zero every the action happened at zero okay I just want to do the same for vectors I want to have a a a Delta Vector a step vector and a and a ramp vector and it's just going to be exactly what you think so let me graph the components say the vector will go forever so the components of the of the Delta Vector will be will be those the Delta Vector is going to be Delta I is going to be either one or zero one at there right okay then the step Factor it's going to be zero zero and then at at this position it jumps so that's the step Vector actually we could now everybody remembers these guys in The Continuous case now we're doing the discrete case so what's the step Vector uh I should have maybe filled in here the Delta Vector everybody every I mean it's the standard notation actually it's 1 for I equals tell me the Delta Vector here if I is zero delta0 is one and all other positions it's zero fine okay what's the step Vector the step Vector SI I is well zero for I negative and one for I one after that and finally the ramp Vector so this is I somehow I had never thought about this ramp Vector but of course I should have so it has a zero a zero a zero at position zero then it ramps up to one and to two so now here's the ramp Vector RI and what's the formula for RI always these two-part formulas to the left and to the right of the center point okay so the ramp Vector is zero to the left and what is it on the right hand side I I that was exactly right very quick yeah so it's going up so it's up one two 3 it's I for I greater or equal zero and notice it matches it agrees that I equals z i I agree so I get the answer zero okay so that's like preparing the way by just seeing these very satisfying Delta Vector step vector and ramp Vector okay now now for my direct attack on so what equation am I going to solve I want to solve I want to deal with this Matrix k u equals now what shall I take for the right hand side well my message is let the right hand side be a Delta function that was the message in the differential equation where I got beautiful simple two-part answers and it's the same message for the Matrix equation take the Delta function say Delta but I'm going to the point was the Delta function got moved wherever I wanted so the Delta Vector will get moved wherever I want so I'll move the Delta so this would be the Delta Vector moved over to spike at J so for so I have in other words I I'm going to solve it for several right hand sides The The J equal J equal one case I'll solve for this right hand side J equal to 2 case I'll solve for this right hand side Jal 3 I'll solve the right hand side will be that and Jal 4 will be that I'm taking those are the there are only four possibilities here where here a could be any number between Z and one I could move it wherever I mean it was continuous now why am I interested in those right hand sides that's the question what's interesting about those right hand sides with KU equal F they're The Columns of the of the identity yes they're The Columns of the identity and I so over here comes my K and now I have my four answers so let's put put in my four well I have to find those four answers but the reason I'm interested in those four answers is so here's answer one this is the answer for that right hand side so whatever it is this is the answer for that right hand side this is the answer for that one this is the answer for that one and now again why am I interested in doing this because that will give me the inverse right it'll be sitting right there because multiplication of matrices is by columns can be by columns good way to do it is by columns K * the First Column of the inverse gives the First Column of the identity K * the third column of the inverse gives the third column of the identity so if I can find those and and actually we see what they better be that First Column had better turn out to be 1/5 of 43 2 1 but let's figure out why that's why that's correct and that second column had better turn out to be 1/5 of 3642 why is that right and more than that what would it it be for n byn so I eventually I want to get to K N inverse that's my goal of course for specific four I can figure out the inverse or somehow get it okay so do you see why I want to why I'm interested in those problems in those four particular right hand sides okay and now I ask okay what are the solutions ha well now where does this ramp come so remember what's the doing the K is this is this remember what my K Matrix is it's up there it's it's got this minus1 2 minus1 stuff with a minus one kind of lost out there and min-1 2 minus one and minus1 2 with a minus one kind of lost out there the the K Matrix is a second difference Matrix which you told me before now now what's the answer what was the answer like what was the answer in the what was the answer you like in the uh in the differential equation you remember what was the second derivative was a Delta and what function had second derivative equal Delta ramp it was R so what do you think will be work in The Matrix equation the discret are the second difference so this is the great point then the second difference how how shall I write that Delta squar maybe for second difference instead of second derivative and maybe yeah equals the second difference of what well the second difference of the ramp equals the Delta Vector that's really what I want to do can can this is the the the key point that if I took this Vector the ramp vector and took its second differences what would I get all right can we just patiently do that what's the second difference at that point around that point so I'm taking one of those minus two of that plus one of that but of course it's just zero what's the second difference at this center point it's one of those minus two of those one of those which is one right because it's one of those and that's the one there no that's the one there right and what's the second difference around that point it's one of these minus two of these and one of these which is zero again right and around this point three - 2 twos plus a one zero so so I get all these zeros yeah so I mean you could say oh well big deal cuz it was exactly like like the differential equation but in a way uh it's easier to have like just one idea and uh and U see it appear in The Matrix case so the solution is going to be a ramp well what was the solution up here I have to remember again a little more it was a ramp plus what Conant plus a a constant yeah so the the solution up there the U of X solution was the ramp function well actually negative the ramp because it negative the ramp shifted over to a that was that solved the equation and then there was the other bit what else was in that solution this is remember that here's a second order differential equation we've got a particular solution we we move the ramp over to a and we reverse sign to take care of that what else what's the rest of the solution here ax plus b right ax plus b because second derivative this is the homogeneous solution the null space the second derivative of that is zero so that's got the two integration constants uh in it okay ready for this guy now what's this solution u i for this guy I'm I want the second difference of U to give me this Delta which is now centered at position J J being different in these different cases so I'm just going to copy this for the I'm going to say it's minus because I've got this K has got this minus in it and it's this R it's this it's this ramp Vector again shift it over to to Center to Center at J where the where the right hand side where the right side is centered and now what else you going to allow me to add on I could add on so what am I allowed to add on so now I've this solves the equation but I need a couple of constants to play with because I've got two boundary conditions that I I have to match so what will what's the analog of ax plus b in the in the discret case so X was our running variable it's just I I think if we just let we could just have a i any any multiple of I that'll be a uh and and and a any constant I believe that that's the solution the general solution to the equation because this solves with the right hand side and then this is the usual stuff we throw in constants of summation I guess would be the right word because when we when we have differences we invert by summing okay do you do you see that that's reasonable in fact it's okay so that now for each J we have to find these constants so that so what are our boundary conditions our boundary conditions I guess were those those were this was our fixed fixed problem with boundary condition zero U for u0o and zero for u5 those are the two guys that were were lost at the ends of the interval that those are the two displacements that were fixed if we were doing that line of Springs so I need to so I need to for each J I need to I need to plug that in uh for J equal 1 then for J equal 2 3 and four and plug in I equal Z oh yeah we could do that come on let's let's do it uh let me plug in I equal 0 and I = 5 n + 1 so what happens if I plug in I equals 0 this is quite Pleasant at at I equals 0 just the way we plugged x equals 0 into the differential equation now I plug I equals z into the into the discrete Vector case so and I'm supposed to get the answer zero so what do I get what do I get from that zero what do I get from this that's the ramp at 0 minus J that's the ramp off to the left it's zero so what do I learn B is zero got one of those constants nailed unfortunately it's zero okay so B is now gone I've used that boundary condition u0 equals z and now I'm ready to use u n + 1 equals z this is now I'm I'm I'm can I jump to the to the N byn problem so now n at n plus one so what's what's happening here at n plus one now plug in now I'm going to learn a I probably so I'm plugging in where am I plugging in n + one yes for I and I want the answer zero so I want zero to be now what's so what's minus what's the ramp function fun when I plug in N +1 well it's n plus one minus J right that's what was climbing that's what the ramp did it just climbed right up okay so so it's minus n +1 minus J and now plus a * n + 1 which which was the I so because I'm plugging in IAL n plus1 and I'm trying to get the answer z so I finally learn what a is I I I learn what a is here and now I'm ready to write down the uh now I've got the this is column J of the inverse Matrix I'm ready to write down the inverse so uh trumpets to sound at this point um Okay so so this direct approach by the Same by Perfect Analogy with the differential equation gave me the formula so let me write down it write it down again this is the inverse this UI with the with the with the um Source term at J is the inverse i j this is this is UI this is this is UI with Source at J okay now can I just write it down so it's minus this ramp what is that ramp thing plus a I know let me should I put a in first a is do you see what a is a is n + 1 - J / n + 1 that's the a a * I uh minus the ramp it's it's we're going to have it here so that was Ai and now minus this ramp so what do the ramp equal well it's got two parts so so now here I this was Ai and this is going to be minus this is going to be the ramp at n plus 1 minus J is that correct yes so what is um so if J oh is that right n plus one minus J yes oh that that n plus one sorry that n plus one was when I was plugging in N plus one it was it was I minus j i I only it became n+ one when I was figuring out this constant but generally it was I so this I just want ramp of IUS J okay we and we're done and thanks for patience here okay so what's the ramp thing equal ramp I minus J we get a zero if I is less or equal J and we get a IUS J if I is greater or equal J okay that is the inverse Matrix well hm we could I think to be strict to be uh on the safe side we ought to check it one one entry if Will you allow me just to like check one entry of the inverse and you can say which one okay here's the Matrix that that we that is really the inverse which one would you like me to check the six maybe that's the most sort of who where did that come from okay the six okay so that's I = to 2 J equal to 2 is that right n is four okay so I'm checking the 2 two entry and if that's right everybody has to concede that it's they're all right okay okay and and oh before I put in the numbers can I just say the pattern that that one should observe here you You observe that the numbers grow linearly starting from one in that last row and up the column and then they grow linearly here they so on one side of the diagonal 1 2 3 4 including the diagonal 2 46 36 4 we see linear growth right that's the pattern you should see and then symmetric on the other side of the diagonal so it's that pattern which people could notice guess the answer and better be in our formula in other words it better be linear which it is but separately this is above this is above the diagonal when the row number is smaller than the column number and this is below the diagonal so two different linear functions but both and and that's what we had up in the in the continuous case two different linear functions that met at the diagonal here okay now I promise to end by checking what did I say we're doing n = 4 we're doing I = 2 and we're doing J equal to two H so let's see four that'll be five - 2 over 5 3 fths of two 3 fths * 2 have I cheated yet no and what's this thing it's zero right because the one you asked me for was I equal 2 J equal 2 it's right on the diagonal where we get zero from both parts so the answer came out 6 fifths and that was the correct number would you want to do one more my my nerves are feeling better now I'm ready to do uh I'm ready to do an off diagonal one say here let's do that one where the answer should be 3 fifths so that's the case where J is four we're in the column four and I is three so can I switch to IAL 3 Jal 4 just and N is still four just for fun okay but the the key is that the the U is the key point of course is in this second approach the first approach was that rank one change that was important the key idea here is the the perfect analogy between differential equations and difference equations and between the solution of the differential equation and the solution of the difference equation that's that's with Delta functions on the right okay finally just this number let's C so I have 5 - 4 is 1 over 5 time I which is three and then oh what's this one Z oh it's zero again yeah above the diagonal three is smaller than four I'm above the diagonal zero so 3 fs and that was right okay so that completes probably more than you wanted to know about uh K inverse but I I really think it's the clearest model we could produce of second differences imitating second derivatives and in real problems in a way you could say okay the second differences part was Messier it was wasn't quite as clean as that one there and probably that's true in general that that that finite differences are to to analyze to get exact formulas the exact formulas are not as nice as the calculus formulas yeah yeah I mean that's sort of a fact that that if I add up the numbers 1 plus 2 plus 3 plus 4 plus 5 I get something and there is a nice formula for it but or adding up the squares one square yeah compare compare adding up the squares 1 squ + 2 square + 3 2 + 4 2 + 5^ 2 okay somebody's gaus has got have figured out what that was right but we don't need gaus to do the continuous case if you ask me the integral from 0 to 5 of X2 DX that's Child's Play right so the the the calculus problem is easier if you want to do it yourself so to speak but if you want the computer to do it if we're doing now if we switch to Scientific Computing then the Matrix problem is the easier one so the computer deals fine because it doesn't figure out any formula like this it just plows along and finds the inverse matrix by elimination steps and uh and ends up with something nice in this case in other cases not so nice but it gets the answer where if we give so we could give the going back to the pl's equation for the lecture before I can't give the computer Lassa differential equation on some strain shape and expect it to give me an answer but I can give it a finite difference equation or a finite element equation and it will certainly give me the answer to that which will be approximately the other answer so so it's those parallels between the applied math that we could do in detail with simp with nice formulas sometimes and the Computing that we could do always well matlb can do it and occasionally we get a nice formula when the problem is is as perfect uh analogy as this one with that okay so that's uh completes lecture 10 thanks very much for allowing me to

Comments

Popular posts from this blog

12. Ion Implantation and Annealing - Analytic Models and Monte Carlo

L17.4 Molecules and energy scales

Lecture 20 Maxwell Theory and its Canonical Quantization