Transcript

and lift off on differential equations so this section is about how to solve a system of first order first derivative constant coefficient linear equation and if we do it right it turns directly into linear algebra the the key idea is the solutions to constant coefficient linear equations are exponentials so if you look for an exponential then all you have to find is what's up there in the exponent and what multiplies the exponential and that's the linear algebra so and the result one thing we will find it's it's completely parallel to powers of a matrix so the last lecture was about how would you compute a to the k or a to the 100 how how do you compute High powers of a matrix now uh it's not Powers anymore but it's exponentials that's the natural thing for differential equation okay but can I begin with an example and I'll just go through the mechanics how would I solve the differential equ two differential equations so I'm going to make it I'll have a 2X two Matrix and the coefficients are min-1 2 1 minus 2 and I better give you some initial condition so suppose it starts U at time zero this is U1 U2 let it let it suppose everything is in U1 at time zero so orig at at the start it's all in 1 but what happens as time goes on du2 DT will will be positive because of that U1 term so flow will move into the U2 component and it will go out of the U1 component so we'll just follow that movement as time goes forward by looking at the igen values and igen vectors of that Matrix that's the first job before you do anything else find the find the Matrix and its igen values and ion vectors so let me do that okay so here's our Matrix maybe you can tell me right away what what are the igen values and I and I values anyway uh and then we can check but can you spot any of the igen values of that Matrix we're looking for two igen values do you see I mean if I just wrote that Matrix down what what do you notice about it it's singular right that that's a singular Matrix that tells me right away that one of the igen values is Lambda equals zero I can that's a singular Matrix the the second column is min-2 times the First Column the determinant is zero it's it's singular so zero is an i value and the other I value will be from the trace I look at the trace the sum down the diagonal is minus three that has to agree with the sum of the IG value so that second value better be minus three I could of course I could compute why don't I over here compute the determinant of a minus Lambda I the determinant of this Min -1 - Lambda 2 1 - 2 - Lambda Matrix but we know what's coming when I do that multiplication I get a Lambda squar I get a 2 Lambda and a one Lambda that's a three Lambda and then the now I'm going to get the determinant which is 2 minus 2 which is zero so there's my characteristic polinomial this determinant and of course I factor that into Lambda * Lambda + 3 and I get the two igen values that we saw coming what else do I need the IG vectors so before I even think about the differential equation or what how to solve it let me find the IG vectors for this Matrix okay so take Lambda equals z so that that's the first igon value Lambda 1 equals 0 and the second igon value will be Lambda 2 = -3 by the way I I already know something important about this the igen values are telling me something you'll see how it comes out but let me point to these numbers are this igen value a negative igen value is going to disappear there's going to be an e to the minus 3T in the answer that e to Theus 3T as time goes on is going to be very very small the other part of the answer will will will involve an e to the 0 t but e to the 0 t is one and that's a constant so I'm expecting that this solution will have two parts an e to the 0o T part and an e to the minus 3 T part and the and as time goes on the second part will disappear and the first part will be a steady state it won't move it will be at the end of as T approaches Infinity this part disappears and this is the the the e to the zero T part is what I get and I'm very interested in these steady stat so that's I I get a steady state when I have a zero IG value okay what about those IG vectors so what's the igon vector that goes with IG value zero okay the Matrix is singular as it is the Vector is is the guy in the null space so what Vector is in the null space of that Matrix uh let's see I guess I probably give the free variable the value one and I realize that if I want to get zero I need a two up here okay so ax1 is 0x1 ax1 is 0x1 fine okay what about the other igen value Lambda 2 is -3 okay how do I get the other I value then for the moment can I mentally do it I subtract minus three along the diagonal which means I add three can I I'll just do it with an erase erase for the moment so I'm going to add three to the diagonal so this minus one will become a two and I'll make it in big loopy letters and when I add three to this guy the minus two becomes well I can't make one very loopy but how's that okay uh now that's a minus 3 I A+ 3 I sorry that's a + 3 I it's supposed to be singular right if if if things if I did it right this Matrix should be singular and the X2 the I Vector should be in its null space okay what do I get for the null space of this maybe minus1 one or 1 minus one doesn't matter those are both perfectly good right that's in the null space of this now I'll because a * that Vector is 3 * that Vector ax2 is - 3 X2 good okay can I get a again so we see that correctly that was a minus one and that was a minus two good okay that that's the first job I values and igen vectors and already the igen values are telling me the most important information about the answer but now what is the answer the answer is the solution will be U of T okay now now I use those igen values and igen vectors the solution is some there are two I values so so there are going to be two special Solutions here two pure exponential Solutions the first one is going to be e the Lambda 1T X1 and the SEC so that solves the equation and so does this one they both are solutions to the differential equation that's the general solution the general solution is a combination of that pure exponential solution and that pure exponential solution can I just see that those guys do solve the equation so let me just check check on this one for example check I want to check that the my equation let's remember the equation du DT is au I plug in e to the Lambda 1 tx1 and let's just see that that the equation's okay I believe this is a solution to that equation so just plug it in on the left hand side I take the time derivative so the left hand side will be Lambda 1 e to the Lambda 1 tx1 right the time derivative this is the term that depends on time it's just just ordinary exponential its derivative brings down a Lambda 1 on the other side of the equation it's a * this thing a * e the Lambda 1 tx1 and does that check out do we have equality there yes because e to the Lambda 1 T appears on both sides and the other one is ax1 equal Lambda 1x1 check do so we've come to the first point to remember these Pure Solutions those Pure Solutions are the those pure exponentials are the differential equations analog of last time we had pure Powers last time so so last time the the analog was Lambda Lambda 1 to the K power X1 some amount of that plus some amount of Lambda 2 to the K power X2 that was our formula from last time I put it up just so you your eye compares those two formulas powers of Lambda in the in the difference equation that this was in the this was for the equation u k + 1 = a UK that was for the finite step stepping by one and we got powers now this is the one we're interested in the exponentials so so that's that's the solution what are C1 and C2 then we're through what are C1 and C2 well of course we know these actual things let me just let me come back to this C1 is we haven't figured out yet but e to the Lambda 1 T the Lambda 1 is zero so that's just a one * X1 which is 21 so it's C1 time this one that's not moving times the vector the I Vector 21 and C2 times what's e to the Lambda 2 T Lambda 2 is minus 3 so this is the term that has the minus 3T and its I Vector is this 1 minus one so this Vector solves the equation and any multiple of it this Vector solves the equation if it's got that factor e the minus 3T we've got the answer except for C1 and C2 so so everything I've done is immediate as soon as you know the igen values and igen vectors so how do we get C1 and C2 that has to come from the initial condition so now I now I use U of0 is given as one Z so this is the initial condition that we'll find C1 and C2 so let me do that on the board underneath at T equals z then I get C1 times this guy plus C2 and now I'm at time zero so that's a one and this is a one -1 and that's supposed to agree with U of 0 1 0 okay that should be two equations that should give me C1 and C2 and then I'm through so what are C1 and C2 let's see I guess we could actually spot them by I or we could solve two equations in two unknowns uh let's see if these were both ones so I'm just adding then I would get three zero so what's this what's the solution then if if if C1 and C2 are both ones I get three Zer so I want like one3 of that because I want to get one zero so I think it's C1 = A3 C2 equal A3 so finally I have the answer let me keep it in the in this board here finally the answer is 1/3 of this plus 1/3 of this do you see what what's actually happening with this flow this flow started out at the solution started out at one Z started at one Z then as time went on people moved essentially some fraction of this one moved here and and in the limit there's there's the limit as right as T goes to Infinity as T gets very large this disappears and this is the steady state so the steady state is so the steady state U we could call it U at Infinity is 13 of 2 and one it's it's 2/3 1/3 so that's the we really I mean you're getting like total uh insight into the behavior of this solution what the differential equation does of course we don't wouldn't always have a steady state sometimes we would approach zero sometimes we would blow up can we straighten out those those cases the igen values should tell us so when do we get uh so so let me ask first when do we get stability that's U of T going to zero when when would the solution go to zero no matter what the initial condition is negative igen values right negative igen values but now I have to I have to ask you for one more step suppose the igen values are complex numbers because we know they could be then we want stability this this we we want we need all these e to the Lambda T is all going to zero and somehow that asks us to have Lambda negative but suppose Lambda is a complex number then what's the test what if Lambda is a complex number like uh suppose Lambda is negative plus an imaginary part say Lambda is -3 + 6 I what what happens then can we just like do a a case here if if this Lambda is -3 + 6 i t how big is that number does this does this imaginary part play a play a play a role here or not but how big is what's the absolute value of that of that quantity it's just eus 3 T right because this other part this the the the magnit the this e to the 6 i t what that that has absolute value one right that's just this cine of 6t + I sin of 6t and the absolute value squared will be cos s + sin 2 will be 1 this is this complex number is running around the unit circle this com this the it's the real part that matters this is what I'm trying to do real part of Lambda has to be negative if Lambda is a complex number it's the real part the minus three that either makes us go to zero or doesn't uh or let or or blows up the imaginary part won't will just like oscillate between the the two components okay so that's stability and what about uh what about a steady state when would we have uh a steady state always in the same direction so let me I'll take this part away when so that was like checking that it's that it's the real part that we care about uh now we have a steady state when when Lambda one is zero and the other I values have what so I'm looking like that example was like perfect for a steady state we have a zero I value and the other IG values we want those to disappear so the other en values have real part negative and we blow up for sure we blow up if any real part of Lambda is positive so if I if I reverse the sign of a of the Matrix a suppose instead of the Matrix I had the a that I had I changed it I changed all its signs what would that do to the igen values and igen vectors well if I if if I know the IG values and IG vectors of a tell me about minus a what happens to the IG values for minus a they'll all change sign so I'll have blow up this instead of the e to the minus 3T if I change that to minus if I change the signs in that Matrix I would change the trace to plus three I would have an e to the plus 3 T and I would have blow up of course the zero I value would stay at zero but the other guy is taking off in if I reversed all the signs okay so this is this is the the stability picture and for a 2X two Matrix uh we can actually pin down even more closely what that means can I can I do that let me do that I want to for a 2 by two Matrix I can tell whether the real part of the igen values is negative well let me let me tell you what I have in mind for that so 2x two stability let me this is just a little comment 2 by two stability so my Matrix now is just a b c d and and I'm looking for the real parts of both igen values to be negative okay what how can I tell from looking at the Matrix without Computing its igen values whether the two L values are negative or at least their real parts are negative what would that tell me about the trace so so the trace that's this a plus d what Can you tell me about the trace in the case of a 2X two stable Matrix that means the igen values are negative or at least the real parts of those igen values are negative then when I take the when I look at the Matrix and and find its Trace what what do I know about that it's negative right this is the sum of the this equals this equals Lambda 1 + Lambda 2 so it's negative the two I values by the way will have if they're complex will have plus 6 I and minus 6 I the complex parts will will be conjugates of each other and disappear when we add and the trace will be negative okay the trace has to be negative is that enough is a negative Trace enough to make the Matrix stable shouldn't be enough right can I can you make what's a matrix that has a negative Trace but still it's not stable so it it has a blow it still has a blow up factor and uh and a and a Decay one so what would be so just just to see maybe I just put that here uh this now I'm looking for an example where the trace could be negative but still blow up of course yeah let's just take one oh look let me let me make it -201 okay there's a case where that Matrix has negative Trace I know it's values of course they're minus 2 and one and it blows up it's got It's got A plus one I value here so there'll be an e to the plus T in the solution and it'll blow up if it has any second component at all I need another condition and it's a condition on the determin and and what's that condition if I know that the two I values suppose I know they're negative both negative what does that tell me about the determinant let me ask again if I know both the I values are negative then I know the trace is negative but the determinant is positive cuz it's the product of the two I vales so this determinant is Lambda 1 * Lambda 2 this is this is Lambda 1 * Lambda 2 and if they're both negative the product is positive so positive determinant negative Trace I can easily track down the this condition also for the if if there's an imaginary part hanging around okay so that's a like a small but quite useful uh because 2 by two is always important uh uh comment on uh stability okay so uh let's just look at the picture again okay the main part of my lecture the the one thing you want to be able to like just do automatically is this step of solving the system find the igon values find the IG vectors find the coefficients and notice what what's the Matrix in this linear system here I can't help if if I if I have equations like that that's that's my equation's column at a time what's the Matrix form of that equation so so this this uh system of equations is is some Matrix multiplying C1 C2 to give U of Zer one Z what's the Matrix well it's obviously 21 1 minus one but we have a name or at least a letter actually a name for that Matrix what what Matrix are we are we are we dealing with here in this step of finding the C's its letter is s it's the I Vector Matrix of course these are the I vectors they're in The Columns of our Matrix so this is SC equals U of 0 is the is the uh that step where you find the actual uh coefficients you find out how much of each uh pure exponential is in the solution by getting it right at the start then it stays right forever you're you're seeing this picture that that each each pure exponential goes on its own way when once you start it from U of0 so you start it by figuring out how much each one is present in U of0 and then off they go okay so um so that's a system of two equations in two unknowns coupled uh the The Matrix sort of couples U1 and U2 and the igen values and igen vectors uncouple it diagonalize it actually okay now can I can I think in terms of s and Lambda so I want to write the solution down again in terms of s and Lambda okay I'll do that on this far board okay so I'm coming back to I'm coming back to our equation DT equals AU now this this Matrix a couples them the whole point of I vectors is to uncouple so one way to see that is introduce set u equal a not a It's s the I Vector Matrix that uncouples so I'm I'm taking this equation as I'm given coupled with with a has is probably full of nonzeros but I'm by uncoupling it I mean I'm diagonalizing it if I can get a diagonal matrix I'm I'm in okay so I plug that in this is a SV and this is s dvdt s is a constant it's this is the I Vector Matrix this is the IG Vector Matrix okay now I'm going to bring s inverse over here and what have I got that combination s inverse as s is Lambda the diagonal matrix that's that's the point that that in if I'm using the igen vectors as my basis then my system of equations is just diagonal each there's no coupling anymore dv1 DT is Lambda 1 V1 so let's just write that down dv1 DT is Lambda 1 V1 and so on for all n of the equations it's a system of equations but they're not connected so they're easy to solve and why don't I just write down the solution V well V is now some e to the Lambda 1 t uh well okay I guess my idea here now is to use uh the natural notation V of t is e to the Lambda t v of0 and U of T will be s e to the Lambda t s inverse U of zero this is the this is the uh formula I'm headed for this this Matrix s e to the Lambda t s inverse that's my exponential that's my e to the a t is this s e to the Lambda t s inverse so my my job really now is to explain what's going on with this Matrix up in the exponential what does that mean what do it mean to say e to a matrix this ought to be easier because this is e to a diagonal matrix but still it's a matrix what what do what do we mean by e to the a t because really e to the a t is my answer here my my answer to this equation is this U of T this this is my this is my e to the A T U of zero so it's my my job is really now to to say what what does that mean what's the exponential of a matrix and why is that formula correct okay so I'll put that on the board underneath what's the exponential of a matrix let me come back here so I'm talking about Matrix exponentials e to the a t okay how are we going to define the exponential of a of of something the trick the the idea is the the thing to go back to is exponential there's a power series for exponentials that's how you you the good way to define e to the x is the power series 1 + x + 12 x^2 6 x cubed and we'll do do it now when the when we have a matrix so the one becomes the identity the x is a the x squ is a t^ 2ar and I divide by two the the cube the X cube is a cubed over 6 and what's the general term in here a to the N power divided by and it goes on but what do I divide by so you see the pattern here I divided by one here I divided by one by two by six those are the factorials it's n factorial that was like the the the one beautiful tayor series the one beautiful tayor series well there are two there are two beautiful tayor Series in this world the tayor series for e x is the sum with X to the N Over N factorial and all I'm doing is doing the same thing for matrices the other beautiful tailor series is just the sum of x to the N not divided by n factorial can you do you know what function that one is so if I take this is the series all these sums are going from zero to Infinity what what function have I got this is like a side comment this is 1 + x + x^2 + x Cub + x 4 not divided by anything what what's that function 1 + x + x^2 + x Cub + X4 forever is 1 over 1 - x it's the geometric series the nicest power series of all so actually of course there would be a similar thing here uh if I if I wanted IUS a t inverse would be now I've got matrices I've got to have matrices everywhere but it's just like that series with and just like this one without the divisions it's I + a t + a t^ 2 plus a cubed and forever so that's actually a a reasonable way to find the inverse of a matrix if I chop it off well it's reasonable if T is small if T is a small number then then t^2 is extremely small T Cub is even smaller so approximately that inverse is I + a t i can keep more terms if I like do you see what I'm doing I'm just saying we can can do the same thing for matrices that we do for ordinary functions and the good thing about the exponential Series so in a way this series is better than this one why because this one always converges I'm dividing by these bigger and bigger numbers so whatever Matrix a and however large T is that series these terms go to zero the series adds up to a finite sum e to the a is a is is completely defined whereas the second guy could fail right if a t is Big somehow if a has an igen value larger than one then when I Square it it'll have that IG value squared when I Cube it the I value will be cubed that series will blow up unless the I values of a are smaller than one so when the igen values of a are smaller than one so I better put that in the all IG values of at below one then that series converges and gives me the inverse okay so this is the guy I'm I'm chiefly interested in and I wanted to connect it to oh okay what's how do I how do I get this is my like main thing now to do how how do I get e to the a t how do I see that e to the a is the same as this in other words I can find e to the a by finding s and Lambda because now e to the Lambda T is easy Lambda is a diagonal matrix and we can write down e to the Lambda T and will right in a minute but how do you see what do you see that we're hoping for a we're hoping that we can compute e to the a from s and Lambda and I have to look at that definition and say okay how how do I get an s in a Lambda to come out of that okay can do you see how I I I want to connect that to that from that definition so let me erase this uh the geometric series which isn't part of the differential equations case and get the S and the Lambda into this picture oh okay uh here we go um so identity is fine now all right you you you can see how how how am I going to get a replaced by S and S's and lambdas well I use the fundamental formula of this whole chapter a is s Lambda s inverse and then times T that's a t okay what's a 2 T I can I've got to divide by two I've got the t^2 and I've got an A Squared all right so I've got to there's a there's a now Square it so what happens when I Square it we've seen that before when I Square it I get S Lambda squared s inverse right when I square that thing the the there's an S an S cancels out an S inverse I'm left with the S on the left the S inverse on the right and Lambda squar in the middle and so on the next one will be S Lambda cubed s inverse * T Cub over 3 factorial and now what do I do now I want to pull an S out from everything I want an S out of the whole thing oh look I better write the identity how I I want to be able to pull an S out and an S inverse out from the other side so I just write the identity as s * s inverse so I have an S there and an S inverse from this side and what have I got in the middle if I pull out an S and an S inverse what have I got in the middle I've got the identity a Lambda t a Lambda 2 t^2 over 2 I've got e to the Lambda T that's what's in the middle that's my formula for E to the a t oh now I have to ask you does this formula always work this formula always works well except it's an infinite series but what do I mean by always work and this one doesn't always work and I just have to remind you of what assumption is built into this formula that's not built into the original the assumption that a can be diagonalized you remember that there are some small some subset of matrices that don't have an independent igon vectors so we don't have an S inverse for those matrices and the whole diagonalization breaks down we could still make it triangular I'll tell you you about that but diagonal we can't do for those particular degenerate matrices that don't have enough independent igen vectors but otherwise this is golden okay so that's the formula that's the Matrix exponential now it just remains for me to say what is e to the Lambda T can I just do that let me just put that in the corner here what is the exponential of a diagonal matrix remember Lambda is diagonal Lambda 1 down to Lambda n what's the exponential of that diagonal matrix because our whole point is that this ought to be simple our our whole point is that when to take the exponential of a diagonal matrix ought to be completely decou it ought to be diagonal in other words and it is it's just e to the Lambda 1 t e to the Lambda 2T e to the Lambda n t all zeros so so if we have a diagonal matrix and I plug it into this exponential formula everything's diagonal and the diagonal terms are just the ordinary scalar exponentials e to the Lambda 1T okay so that's that's in a sense I'm doing here on this board with with like formulas what I did on the in in the first half of the lecture with specific Matrix a and specific igen values and igen vectors the so let me show you the formulas again but the so you I guess what should you know from this M from this lecture you should know what this Matrix exponential is and like when does it go to zero tell me again now the answer to that when does e to the a t approach get smaller and smaller as T increases well the S and the S inverse aren't moving it's this one that has to get smaller and smaller and that one has this simple diagonal form and it goes to zero provided every one of these lambdas I I need to have each one of these guys go to zero so I need every real part of every I value negative right if the real part is negative that that takes the exponential that Force the exponential goes to zero okay so that that's really the the difference if I can just uh draw the here here's a picture of the of the this is the complex plane here's the real axis and here's the imaginary axis and where do the ion values have to be for stability in differential equations they have to be over here in the left half plane so the left half plane is this plane real part of Lambda Less Than Zero where do the M where do the igen values have to be for powers of the Matrix to go to zero powers on The Matrix go to zero if the igen values are in here so this is the stability region for Powers this is the region absolute value of Lambda less than one that's the stability for that tells us that the powers of AO to Z this tells us that the exponential of a goes to zero okay one final example let me just write down how to deal with a with a final example let's see so my final example will be a single equation uble prime plus a Buu Prime + kuu equal Z one equation second order how do I and maybe I should have use I'll use I prefer to use y here because that's what you see in differential equations and I want you to be a vector so how do I change one second order equation into uh 2x two first order system just the way I did for Fibonacci I'll let U be y Prime and Y what I'm going to do is I'm going to add uh an extra equation Y Prime equals y Prime so I take this so by so using this as the vector unknown now my equation is is U Prime my first order system is U Prime that'll be y Prime y Prime the derivative of U okay now the differential equation is telling me that y Prime is so I'm I'm just looking for what's this Matrix y Prime y I'm looking for the Matrix a what's the Matrix in case I have a single first order equation and I want to make it into a 2X two system okay simple the the first row of the Matrix is given by the equation so y Prime is - b y Prime - k y no problem and what's the second row of the Matrix then we're done the second row of the Matrix I want just to be the trivial equation Y Prime equals y Prime so I need a one and a zero there so matrices like these the the general case if I had a 5x five if I had a fifth order equation and I wanted a 5x5 Matrix I would see the coefficients of the equation up there and then my four trivial equations would put ones here this is the the kind of Matrix that goes from a fifth order to uh 5x5 first order so the and the igen values will come out in a natural way connected to the differential equation okay that's differential equations uh the a parallel lecture compared to powers of a matrix we can now do exponentials thanks