Matrix Differential Equations
Transcript
foreign so I have been in the studio all day today it is getting late but I have stuck with it here because I am super excited about this next lecture uh we're going to start solving these generic systems of equations x dot equals ax using eigenvalues and eigenvectors so I'll just put that up solving x dot equals ax with eigenvalues
and eigenvectors eigenvectors and I'd say this is one of the culminations of all of kind of introductory applied math linear algebra and differential equations is going to be covered in this and the next two lectures where we really break down how to solve Matrix Systems of differential equations using eigenvalues and eigenvectors specifically I am actually going to derive the eigenvalue and eigenvector equation as a necessary coordinate transformation to simplify this differential equation so this lecture is going to end on kind of deriving from scratch the equation from which we obtain eigenvalues and eigenvectors specifically to solve this this system okay so I'm going to write out the objective I'm going to solve a simple case and then we're going to jump into eigenvalues and eigenvectors so we basically want to solve we want
to solve a generic system of equations a general General system of ordinary differential equations x dot equals ax system of equations equations uh and specifically X is a vector of States now there are multiple you know X1 X2 X3 X4 multiple components of this Vector x a is a matrix and this is a system of coupled first order linear ordinary differential equations first order because we only have one derivative in time coupled because presumably these derivatives depend on all of the other states in this Vector X and linearly linear because this derivative x dot is a linear combination of the states in X that's literally what a matrix times a vector means that's a linear combination okay
um and so what I'm going to do is I'm going to start off with the simplest possible case where this a matrix is diagonal meaning that the Dynamics are decoupled okay so uh kind of case one case one is where what we have what we call decoupled Dynamics decoupled decoupled Dynamics I'll tell you what that means so remember when we had um kind of our first example of a differential equation x dot equals Lambda X the example we introduced was the population of bunnies and Bunny populations grow exponentially what I mean by decoupled Dynamics is going to be let's say that the state X refers to the populations of different animals but they are kind of in a zoo so they're each cordoned off into different zones and so that they don't interact
that's what I mean by decoupled so we're going to have the populations of like bunnies and wolves tools and Antelope and so I'm going to have a state Vector with multiple populations and they're each going to behave linearly but they're only going to depend on themselves they're not going to be coupled yet so I like to call this kind of you know my example I think about is a different animals in a zoo and it's a zoo that's big enough where they can grow exponentially it's kind of like a Hilbert's zoo or something like that okay so the populations are separate that's the key things that the populations are separate and so I'm going to write down this differential equation so we have let's say our state Vector X has a bunch of components X1 X2 dot dot dot all the way to X N let's say I have n animals in N different zones in this zoo and I'm taking D DT
of this state Vector that's just this is just x dot where X is a big Vector containing all of these components and we're going to say that this equals in the case of decoupled Dynamics this is again a matrix a times X1 X2 dot dot dot xn but now what we're going to have is that this is going to be a diagonal matrix so X1 dot is only going to be a function of X1 we're going to call that let's say you know Lambda 1 0 dot dot dot zero the second animal let's say X1 or bunny population
let's call that our wolves X2 dot is only going to be a function of X2 because they live in their own you know room in this big Zoo so they actually are not interacting with the bunnies so they have no influence X1 has no influence on on X2 X2 dot is only equal to uh com to a number times X2 we're going to call that number Lambda 2. so X2 dot equals Lambda 2 x 2 and that's the only uh these are decoupled so you know the wolves are alone the bunnies are alone dot dot dot it's very
lonely I actually think they're fine with uh you know all the bunnies together and then um kind of every term is like this and now the X N Dynamics the nth population whatever uh only depends on the X N population with this Lambda n proportionality so this is really really simple um in some case I didn't even need to write this as a system of differential equations in a matrix form I could have literally just written this as so before I forget I'm going to call this Matrix
D because it's diagonal and decoupled okay so this is a special case of an a matrix where it's diagonal and decoupled I didn't even have to write it like this I could have literally just written down you know X One Dot equals Lambda 1 x 1 x 2 dot equals Lambda 2 x 2 dot dot dot x n dot equals Lambda n x n and of course we already know the solution of this we can just solve them each independently we could say that X 1 at time T is e to the Lambda 1 T times X1
my initial condition X1 naught and x 2 at time T is equal to e to the Lambda 2 t times that initial wolf population X2 knot all the way down to xn at time T equals e to the Lambda n t times x n not the initial population of that nth uh you know animal population and so these are really easy because my Dynamics are decoupled it's almost trivial for me to solve the system of equations and if I like I can write this solution
again in Matrix form I can just say you know this is um X 1 x 2 dot dot dot x n this big Vector X at time T is equal to and now I have a diagonal matrix of of exponentials I have e to the Lambda 1 t 0 dot dot dot zero I have zero e to the Lambda 2 T dot dot dot zero so this should be pretty you know intuitive at this point zero zero e to the Lambda n t times my initial conditions times you know X1 X2 dot dot dot X and this Vector evaluated at Time Zero and so this is
really really simple this uh if this Matrix here was d a diagonal matrix then this Matrix here is e to the diagonal matrix T okay it's literally a diagonal matrix where I exponentiate all of the diagonal elements times T this is e to the D T I haven't defined what a matrix exponential is yet I'll Define that in a couple of lectures it's really easy you literally take the Taylor series for you know e to the X and you just plug in a matrix for x and you work it out that's how you take Matrix exponentials and this is what you get for decoupled Dynamics okay so this is really really really easy to solve my system of equations x dot equals ax if a is a diagonal matrix d good so I hope I've convinced you that that's really really easy okay this is the full solution
well they're not going to be nice and diagonal like this you know you're not going to be dealing with animals in a zoo you're going to be dealing with the populations of bunnies and wolves and Antelope in the wild and they're not going to be separated they're going to be interacting with each other so there's going to be cross terms in this Matrix and in general a is not going to be diagonal it's going to be a full gnarly Matrix and it's not going to be easy to solve it like this okay and so that's where eigenvalues and eigenvectors are going to come in what we're going to try to do is we are going to try to find a coordinate transformation that turns this system into a diagonal decoupled system I'm going to erase this and then write that out one second
okay so we now know that it's easy to solve these Matrix systems of equations if the Matrix a relating all of my derivatives to all of my States is diagonal and decoupled so now the objective here is going to be for this generic system for a general system for a general system x dot equals a x what we're going to try to do we want a change of coordinates we want a new coordinate system or a change of coordinates a change of coordinates and I'm going to write this as X equals t
times Z so T is going to be a matrix an invertible Matrix a matrix that has non-zero determinant so you can compute its inverse so I can go from X to Z or Z to X by multiplying by The Matrix t or its inverse so I want a change of coordinates into a new coordinate system Z that diagonalizes my ordinary differential equation that diagonalizes diagonalizes diagonalizes my ode
specifically what I want in this z-coordinate system I want Z Dot to equal a diagonal decoupled matrix times Z Okay, that's my entire objective now: If I have a generic system -- if someone hands me a system, and they say "Hey Steve, can you model this system?" I'm going to first try to find a coordinate transformation T that goes back and forth from from x coordinates into a z coordinate system where in this coordinate system my dynamics are
decoupled and diagonal, because here I could easily solve this. We know how to solve this: "z" as a function of time, is e^Dt times my initial conditions. I know how to solve this. This is easy to solve... we just did it. So now I'm going to try to find this coordinate transformation that diagonalizes my system. Specifically we're going to do this and we're going to derive the eigenvalue and eigenvector equation.
So I'm going to take the time derivative of both sides of this thing maybe I'll go orange here for a minute So I'm going to take the time derivative of both sides and I'm going to take T z-dot, that equals x-dot and x-dot equals Ax, so that equals A x and so that implies that T z-dot = Ax and specifically x equals Tz so here I can plug it in... I'm trying to get an equation for z... So I can basically say that T z-dot=Ax and that's A * T * z this equals
A * T * z and now we'll remember to put all of these as matrices and vectors... so big capital letters generally I use to mean matrices... so A and T are matrices. z and x are vectors that's my the state of my system x, and z is the state of my system in some different coordinate system... and I'll tell you what I mean by a different coordinate system in a minute. So now this is starting to get somewhere... now we have a differential equation only in z but I have this pesky T out here so I'm going to try to invert this T and and multiply on both sides by that
so that gives me z-dot=T^{-1} A T z and remember I'm specifically trying to find this matrix T... that's what I mean by a coordinate transformation, it's just a matrix T... linear coordinate transformations are matrix multiplication, that's what linear algebra tells us, and so specifically I'm trying to find a T matrix so that this quantity here is a diagonal matrix, so that z-dot equals this stuff here is diagonal times z. And so specifically we can write this pretty simply: we want We want a T matrix so that
T-inverse A T equals this diagonal matrix... okay that's what we want. Okay writing all these double under bars is getting a little tedious but I'm going to stick with it because I think it's important. So we want a T so that this is true. We had this system, we want to find a coordinate transformation that diagonalizes our dynamics and if we had a T so that T-inverse A T equals the diagonal matrix we've done it. And so the last step is actually very simple. The last step here is: I'm just going to multiply both sides again on the left by T to kill this T -inverse and so that is going to give me
AT=TD. I multiplied the left by T on both sides so I get AT=TD. These are matrices. This is the eigenvalue and eigenvector equation. T his is the this is the eigenvalue equation I'm going to put some big exclamation marks because this is a huge deal. Literally the diagonal elements of D are the eigenvalues of A. And the columns of T are the eigenvectors of A. of a okay D is a matrix a is a matrix so I haven't shown you how to solve for T and D that's a whole
another lecture I'm going to do that next we're going to we're going to show how for a specific a matrix we can find these eigenvalues in D and the eigenvectors in t but this is the equation the equation that I'm solving for T is so that my Dynamics become diagonal those T are the eigenvectors of a that's exactly what this means this is the eigenvalue eigenvector equation so for me I always found it very counterintuitive that you take a linear algebra class and they write down all this abstract kind of algebra and they write down here's what an eigenvalue and eigenvector is without motivating it for me this is why we care about eigenvalues and eigenvectors in the first place this is why I care about eigenvalues and eigenvectors because eigenvectors of a matrix change are a change of coordinates so that it becomes diagonal these eigenvectors provide a change of coordinates in these eigenvector coordinates my
Dynamics are diagonal that's huge that means I can solve any linear system of equations okay so I'm almost done I think what I'm going to do now is I'm literally going to draw a picture of this for you so I'm going to say I'm going to draw a picture of this eigenvalue equation and then I'm going to you know end this lecture and in the next lecture we're going to figure out how do you compute these things and then how do you use these T's and D's specifically to solve this equation and then to go back and write it in terms of my original x coordinates which is where you know I probably measured things and where I actually care about things Okay so so um I have my a matrix here I'm just going to draw it as a big Square matrix it's an N by n Matrix okay that's a this T Matrix has columns you know T1 T2 dot dot dot all the way up to TN these are column vectors where each column vector is an eigenvector of a and this is equaling
now I maybe Drew this just a tiny tiny tiny bit too tall that's going to be a problem okay these are the eigenvectors of a let's give myself a little more room here so a times t equals T times d so this is going to equal again T1 T2 dot dot dot all the way up to T N this is again my T Matrix times D my my diagonal matrix okay and my diagonal matrix again just had these these lambdas these eigenvalues um sometimes in my notes I call them D1 D2 D3 I'm here I'm just going to call them Lambda 1 Lambda 2 Lambda 1 Lambda 2 dot dot dot Lambda n zeros everywhere else and here's what I want to point out is that
if I take this um a column of this so if I want to multiply this matrix by this Matrix what I do is I take the First Column of D and I kind of knock it over on its side and multiply it by every row of t that's my first column then I take the second column of d i knock it over on its side and I multiply it by all of the rows of T that's my second column and so on and so forth but if you take let's say this Lambda 2 you know this column here and I knock it over on its side and multiply
it because it's zeros everywhere else it's only going to multiply the t2 eigenvector so this is a very useful property of this diagonal matrix this literally is going to equal Lambda 1 T1 that vector Lambda 2 T2 that Vector dot dot dot Lambda n t n that Vector okay and so what we're basically going to find is that a times T1 is going to equal Lambda 1 t 1. a times T2 the second column of this product is going to equal Lambda 2 T2 and so on and so forth I'm going to get a bunch of of equations that look like a times T equals Lambda times T okay like for the kth eigenvector and the kth eigenvalue this is going to be true okay so you can write it in this Matrix system of equations or you can write it for
a specific eigenvector t or eigenvalue Lambda now here TK is just a a single eigenvector corresponding to that particular eigenvalue these come in pairs is what I'm trying to say okay let's take a big step back uh we want to solve these systems generically they are not going to be diagonal we know that we like diagonal systems because they're easy to solve but generically they're not going to be diagonal so we try to find a coordinate transformation t a matrix T that can map me into a new coordinate system like literally you know Z is going to equal T inverse of X so I can go from X to this new coordinate system Z so that Z has diagonal decoupled Dynamics so it's easy to solve my Dynamics in z now if I go through some algebra we find that this is the condition so if Z dot these are the Dynamics in my Z coordinates and so if I want these to be diagonal then this has to be true and I can rewrite that in terms of my eigenvalue equation
so this is the equation I solve to get that eigenvector coordinate transformation T that diagonalizes my Matrix a and given that we're going to be able to solve generic systems that are really nasty in terms of easy easy easy linear algebra okay and that's all coming up next in the next lecture I'm going to show you how do you actually compute eigenvalues and eigenvectors and in the lecture after that I'm going to show you how do you use that to actually solve these differential equations that we want all right thank you foreign

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