>> Hello and welcome to our third Glue lecture. To sort of round out the third week of the course, today's Glue lecture is titled Systems, and I'm going to talk kind of how we think about systems in this course. And this will be helpful for quiz 3, we'll do 2 examples that are similar to questions on the quiz. So the goal of this lecture is to think about how inputs and outputs can define a system, and that's really How we are going to think of systems in this course. And then, I hope to kind of get you used to this matrix representsation, this states based form of systems by doing an example of putting a second order system into states based form. And to do a linearization of a non-linear second order system as well. So first, let's just think for a few minutes about what a system is. So, you know, in general, we might think of a satellite being a system, as a fancy technological device that, that does something that we design it to do. We might think of it as something that has this kind of confusing block diagram. Description. We might think of it as something in our car, right or a, or a interface which was, a technological interface that we, we interact with.. Of course there's also the solar system, that is somehow a system of planets that's working together. That we think of, or systems of the body, different organs that work together to perform basic functions. So the point of this slide is just the idea that the word system a lot and we might all have different ideas about what a system is and, you know, this course is really kind of all about systems. And so I kind of want to clarify what we'll mean, and, when we think about them, and the idea, really is that, in this course, we want to understand how inputs really relates to outputs. And so any of these systems, we can be considering different inputs, different parts of the system that we can control or actuate on and different outputs of the system, different things that we might be measuring for different goals. So you know, on, you know, a satellite, you might be controlling orientation. And so you might think of different inputs and outputs there, or you might be controlling altitude, and so now you have different actuators, different goals for the altitude than the orientation. So we could think of those really in this course, as, as distinct systems that have different control objectives. And so the picture that we're thinking about is really this idea that we have some input here that we're mapping to an output defined by these A, B and C matrices. And so getting into the first example, we're going to talk about how to move a dynamical equation that describes some system into this form that looks like this. And at first that can be a little bit tricky and so I want to go over it and of course remembering that both of these equations, have some initial condition. F of 0 equals f not. X of 0 equals x not. Keeping that in mind, we're just going to think right now about how to go between something that looks like this to something that looks like this. And, really that's just a matter of picking our state variables, de, deciding what our state is, and then to/g choosing these inputs and outputs. So which of these variables is what we're controlling and which of these is what we're measuring. And then we're going to write this second order differential equation as a pair of first order ones, so that our second order system is now represented In terms of two first order equations. And then, put these in terms of our x, our u, and our y, right? So first, for this example, we'll select our state to be f and f dot That's a pretty common choice for, for a state at not necessarily the only choice, but you'll see that it's convenient because when we think of x dot, x dot is going to look like this right? Oops, f double dot. And now we ha, we, we need to be able to know something about f double dot right to for this choice of state, and so of course we do, and so that's why you'll see that Often as the choice of the state. And now we pick our input to be this function p here, so this is somehow, someway that we're influencing what f, the, the various derivatives of f are doing, and now we'll chose our output to be f, but again this could be chosen as f dot, this could be chosen as both f and f dot, And that will determine the form of these a, b, and C matrices. So those choices are important and usually they are described in the problem setup. So now that we have chosen our state, our input and our output we need to write this equation in terms of two first order equations. So we can think of f-dot and f-double-dot. Well now we're going to write them in terms of our state variables x 1 x 2 in our input and our output. So, here we have f dot. Well that was x2, right? So we can directly relate f dot in terms of x2 and now, x2 of course is related to x1 through this, through this time derivative. And then for F double dot, well F double dot is x two dot, and this equation that we were given here. So where I'm dividing by everything by m, and now I'm writing remember X two is F dot, so I filled that in here, and here I'm filling in that X one is f. And here I'm filling in that u is p. So just rewriting this to this. And so now if we come back, this is exactly what I had on the last slide. X dot in terms of the other state variables as we renamed them in the first step. And so now it's just a matter of getting it to look something like a x plus b u, right? So I need to pull out, we need to, what I would like to do is write an empty matrix, and I know that I want that to be times x, right? So, I write x here, so that's the ax term. And, now it's time some other matrix, this one's going to be tall and skinny, times u. Okay, so here, I just need to kind of rearrange these terms. And here we'll have, so what, remember that this is x 1 dot, and x 2 dot, that we're trying to equal. So what does x 1 dot equal? Well, it equals x 2, so we just need no x 1 contribution, and 1 x 2 contribution, and then no u. >> So, now this first line, because, is correct, right? This x1 gets multiplied by the first entry of the matrix, x2 gets multiplied by the second. They get added together, so this all adds up to x2. Now, for x2 dot, well that equals this whole term. So now we have a contribution from x1, x2 and u. And that contribution for x one is beta over, and from x two is alpha over m. And now from u, we need to multiply u by c, to get this o, over m, to get this term tied up. So That ends up looking like this, right? Where this is our a matrix, and this is our b matrix. And we can do the same thing for y. Y equals c x, and since y was f, and f is x one, you get just a one in the, in the entry of the matrix that x one will be multiplied by. So this is how you work. Something that looks like this and to stay space form, So now we have that our system where we picked our state, our input, our output its represented by these three matrices A, B and C. So to pick up to get into example two. This is going to be an example of linearizing a non-linear system. So this is a system where we have this z squared term. Sorry let me fix my marker here. So now we have this z squared term, which means we can't do what I just did where I Wrote this empty a matrix and pulled out x and just filled in the indices right. We have this z squared term which means it's not going to fit into that abc form. And so what we do is we linearize it around some operating point, and here that point is going to be 0, 0. And so first what we need to do, of course, is just write this guy, the second order. Differential equation in terms of these 2 first order equations. So just I'm writing this kind so that you remember that x1 dot because of this twice that we;re given in the problem that x and z and z dot and our input u is tau. That this is how, that d dot and d double dot relate to x1 dot and x2 dot. And so now we have that x1 dot is x2, x2 dot is this whole thing because that's what d double dot is. Again writing it in terms of our state variables. But now, again we have this x1 squared, so we can't just write this in abc form. So the way we do it in this case is to just compute this A matrix, this linearization. So here we have f1, f and f2 which are going to be, here's our f1, here's our f2. And so we just have to compute these derivatives in terms of our stay variables. So this first, let's I'll write it out. For A, we have the derivative of this guy with respect to x1. That's 0. Now the derivative x2 with respect to x2. That's 1. Now we look at f2 to compute the second row. Derivative of x2 with respect to x1 is 2lx1, this term. Both of these other two terms go to zero, and now f2 in terms of x2 is just gamma, right, because here's the x2 term. And so now this is our a matrix evaluated at our operating point, right? So this term is going to go away, and this whole thing is going to equal zero, zero 0,1,0 gamma, for this choice of this operating point. So we're linearizing around that, around that point. In the case of the pendulum, when it's hanging down. Right? That we're just going to be able to control it around that hanging down position. So, in nicer text, this is what we have. And we do the same, a very similar process for the B matrix, where Now the b matrix has a different size, right? But we have the derivative f one in terms of u, and the derivative f two in terms of u. So that's these two equations again. And we get this, that this is zero c, and evaluated at any operating point this is actually going to be the same thing because it's not And a function of any of our state variables anymore. So now, the linearization of this system is given by these 2 matrices. And our output is going to be a similar process, that I think Dr. Iverson went over in lecture, as well. So with that, good luck on quiz 3, and I hope you're enjoying the course.