Now Lyapunov's Direct Method, why do we use this? [LAUGH] To apply these definitions directly, you really have to solve these equations of motion. In a very general form, for any initial conditions, so you come up with these bounds, and many equations of motion are not analytically solvable. So you could use numerical stuff but then how do you prove that for any inital condition these wiggles are always going to stay within that bound and they don't eventually leave again like they do in the. It would require infinite integration time to do it completely rigorously. So this method is going to save you tons of headache and issues. What we're doing now is, this is going to be an energy-based method. We're going to write these energy like functions. And energy's nice it's a scalar. If you're not moving, it's zero. And that's typically our equilibrium. If I am moving, I'm looking at the partial motions. So I can look at it in an energy kind of a sense, I might always losing energy. And if I'm losing energy, where do I settle? To what minimum energy state do I settle? And it works for linear systems, but in particular, it works also for very non-linear systems as well. So this becomes a huge building block for many non-linear control theories. The question is always what are these functions? Now, more definitions, you staying awake? I know, have a little sleep too, more definitions. So let's look at these, because these are things that are going to, everyone of these lectures are going to be dense with this stuff. We're going to start using it, after this lecture, please go back before Thursday, go over these definitions again. Come back Thursday, bring your review as we always do, we will be asking you, what is Lagrange stability, what is the Oppenhoff stability, what is other one, which ones depend on initial states, which ones don't? Practice beforehand, it's going to sink in, you're going to fly through this material much better. So, here's a definition; positive definite functions. And the negative definite is almost the same except for one little bracketed term, that's why I'm just, instead of having two statements, I'm making it one statement. But if it's negative definite, then instead of being locally positive, you replace positive with negative and you're fine. And this argument instead of v being bigger than 0, it has to be v negative than 0. So I've got two definitions in one. But essentially what positive definite function means is you're locally positive definite about xr if as the reference we have to be 0. So you think of energy, if this is my equilibrium, everything's at rest, my energy would be 0. If I'm up here, actually it has potential energy. So that would be non zero right? I have a moving, I have kinetic energy that is non zero. It doesn't literally have to be energy but energy is a nice analog in this mathematics. So at our desired state, x is equal to xr. We're tracking our path, I need the function to be 0. Anyway a way of within a neighborhood around that state, so you want to be here but within plus or minus 2 meters. This function gives you a measure of that's locally positive. So this now excludes the reference with this notation. This is always what you see if you look at the math and say, wait a minute, this neighborhood includes this point x = xr, wouldn't it be greater than or equal to? The way they've defined this in control theory is, positive definite means it has to be zero at the reference. And just say it's positive within this neighborhood, it's implied that you're not considering that one point where it had to be 0. So I like figures. So when I think of this stuff. So let's look at a simple function, kinetic energy could be mass over to v squared. So if no velocity you are at zero, any velocity it grows, right? What is the neighborhood for which this function is positive definite? What do you think? >> [INAUDIBLE] >> Yeah, the whole, everything. This would actually be globally. So if your initial neighborhood delta is everything, then it's actually global in that sense, right? Which is nice, great. So let's take different lines, that was easy. So let's say we have another one and I do this. Is this one positive definite in any sense? Matt, what do you think? >> Yes. >> So it's 0 where it has to be 0. I missed it by a smidgen, but let's pretend I hit it, right? So up to what point is this, what's the neighborhood? >> That's other place where 0 is noninclusive. >> Noninclusive perfectly, right? That was my next question, then. So here, it's up to these points inside of that, at the boundary you're 0 again and that require you to be bigger than zero not zero anywhere else, good. Let's do another one then, so let's have this one. This one does this and it comes out and then it just pretend it asymptotically approaches that axis. So it never reaches zero. Now is this function positive definite, and if yes, about which neighborhood? Mendor. >> [INAUDIBLE] >> Yeah, everything actually. It never quite gets to zero. It gets really, really close but it never touches zero. That's the key thing we have in these arguments, good. Let's see, we've got more colors, so let's do a few more. Let's say I do a function that's like this. Would this be a positive definite function? No, right? Definitely down, okay? So I moved it down, so about this point, there's not region where this works. Let's say I do another one and draw it up here. Is that a positive definite function? Evan. Why not? >> Right, we do need this to depend to zero. But, if you get this kind of function, you're on to something, right? What could you do to make this positive definite? Right. Well, essentially, at this point here, this is there. But this reference instead of calling this zero, you can always do a change of coordinates that makes that your reference, right? If you have a function right here, here my energy is a zero. But everything works well from that. I can always redefine your height to be one and a half meters plus whatever you do. So a shift in coordinate systems is often done, and that gives you the properties you're looking for. And then at the end, you unshift it again to get the overall arguments you're doing, right? So you could make it but as it is, you're absolutely correct. It doesn't satisfy that first criteria that it's zero. But you're onto something because then it grows everywhere else. So let's see, what other colors do we have? Purple, there we go. Let's say I have this function, x cubed, that always comes up, is x cubed positive definite? Andre. >> I would say for the right half of it, it is. >> Okay, good, I'm glad you said that. Completely wrong, but I'm glad you said it because many students do this. I mean researchers do this. If you go back to the definition, we talked about balls. So around that reference, so what is the circle that you can draw around the origin that guarantees every point in that circle. And here, a circle in one of these is just going to be a bounded set of two points, right? That is always positive. And you can't do that, right? So there some homeworks you're getting into. And it hey, for these things argue, is locally pause a definite, negative definite, globally, all these kind of stuff, you have to think about those. And some students always go well x cubed, well, it's positive definitely if I only consider right handed disturbances. But all over a sudden, if you bump it negative, then you're unstable, right? So any perturbations around them, you can't just say look I'm only going to fall to the left, never to the right. So therefore, the system would be unstable as a whole. But you have regained some extra insights with this kind of function. You go actually maybe if I do fall to the right, it might recover, maybe I can take advantage of that and other stuff. But as a system, it is unstable. because you can't draw a ball within which this function is there. And you can't just say only consider disturbances along this plane of my state space, right? You have to be able to draw a continuous sphere, that's how we're defining these things, okay? So lots of wiggles. But pause it definite is basically a function. It's like being strictly positive away from zero. And that's what we're looking at. Yes. >> A cubic function like that, could you draw a reference shift like you did for the yellow one? >> How would I do that? >> And shift your origin down so that most of your cubic is above zero? >> But you have to be zero, at zero, right? And that would be the hard part. Now, so you're saying to shift it down to here where everything is positive and then this is just a neighborhood that you could come up within a ball. In this case it has to be a symmetric x-axis neighborhood. But no, but then you don't have this behavior being zero. And that wouldn't work either. Yes, Nathaniel. >> Just out of curiosity, can you also do rotation? So you could draw a diagonal line. >> Uh-huh. >> That would, your cubic would always be- >> Yeah, I can. Because this axis, let me just label the axis. This is my states phase. I'm just using a single variable right now. And then this is the function of that state space. So if you have a multidimensional, x1 and x2, there'll be a plane. And yes, there might be rotations and stuff, but then still you'd have to think of the balls. And balls for 1D become just symmetric line segments, 2D it's circles, 3D it is a ball, 4D it's hyperballs. That's where it goes. And so now, good, good question. So work with this, this will, again, with this class I'm kind of showing you the core things needed. If you want to get really in depth, take a class in nonlinear dynamics as well. It'll help strengthen lots of other stuff we can talk about. Following on that, positive semi definite functions is almost the same definition. The only thing added is instead of being greater than or equal to zero, or greater than zero, it says greater than or equal to zero. Again, we are ignoring this point in that argument. So if we looked at these plots that we've already done, like Matt was talking about, this blue one here, it was everything up to where it crossed zero then, but only included that one. If you're talking semi-definite, you could include those points and it would still be good. So a simple example could be you have a function that kind of grows, and does this, touches zero again and then grows again. And then just repeat this curve if you can on the other side, right? This would be something that is now, for example, globally positive semi-definite. I'm always positive or I'm zero. And semi-definite is away from the zero part. Yes, Matt? >> Does the ball have to be [INAUDIBLE] so like the x cubed, for example? Instead of the ball or it has to be definite? >> No, it has to be finite, yeah, because otherwise you're talking about the equilibrium. You've just discovered that page. Hey this is good if I have zero disturbances. That is what the ball being zero would mean. And for stability we have to look at finite epsilon disturbances. Yep, it can be really, really small but it has to be finite. Very good question. Okay, good. So you could see, there's things we could play, but there's nice visual representations. That's always positive, this could be positive or zero, right? And they could be local or it could be global. Then simple examples could be things like these where often have these kinds of functions. Where if this were mass, this would be like potential energy of a spring, k times x squared over 2 would be potential energy, this could be kinetic energy. So potential and kinetic energy, what happens there, that's an example? So with more than just one, you can create these functions. This function v is only 0 if x is 0 and x square is 0. If either of them is perturbed, this function is non-zero, all right? But it is positive. So this would actually be a globally positive definite function. This function also never goes to zero away from the origin. It doesn't do that bend down and then go up again and stuff. So it's not semi definite, it's actually globally positive definite in a sense. So you can do it on functions. Yes, Marta? >> In all of these examples, xr is origin, like the equilibrium is origin. What if it's not 0,0? What if it's not- >> Then you do a coordinate change. And xr would be, for example, assume we had the linearization we said. We took x minus xr and then the new coordinates were delta u or delta x actually in that case. That is the departure motion about the reference. If you have a tracking problem, that's why I always have these xrs, that's my reference. Reference could be an equilibrium and then you could define your frame to be at that equilibrium so everything drives to zero. So you can always do that. But for the tracking problem, your reference keeps moving, I want to be here then I have to be here. So now, you define your state relative to this time varying things. So, that is a delta x. So, if you did tracking problem, for example, down here, all you would have to do is replace x with delta x. And now you have a positive definite function in terms of your tracking errors, my tracking position errors and tracking rate errors. If I had delta x squared and delta x dot squared. Now, great. You guys are thinking ahead. Now, there's a common way we might matrix stuff as well. And you hear, you can go to open a Wiki and look and figure out what does it mean for matrix k to be positive definite, but it basically boils down to this math here. If you could prove that for any states x, times this matrix of numbers. So you x transpose this times x. It's like 3 times x squared. For scalars we know, well, 3, there's a positive number times x squared, that is actually positive definite function in the sense because it's 0 at 0 and positive everywhere else times 3 doesn't change that result. If I had minus 3 times x squared, it would not be positive definite because it would flip the whole sign, right? You can do that now, just for scalars, you can do it for matrices. You can come up with conditions on these matrices such that x transposes matrix times x. It is going to be positive. And we've seen one such matrix already, your inertia tenser. One of the requirements for this to be positive definite is your eigenvalues have to positive. And for any real spacecraft like this, rigid spacecraft, you do your inertial tensers, we know the principle, inertia is all going to be three real eigenvalues. So inertial tenser will use it a bunch, is a positive definite matrix. If you can go to zero sometimes, that means you had a zero eigenvalue somewhere. But it's still positive. Semi-definite and if somewhere it goes negative or negative definites, different combinations of the stuff, all right? So, I'll let you look at that. But what we'll use this form a lot. Instead of general functions, we will create this, this way. And we'll have our definitions.