0:00

In this lecture, we're going to, dig a little bit deeper into the original non

Â linear models. And see, how do we produce linear models from them? And in fact, I

Â have a wonderful quote here. That says, classifying systems as linear and non

Â linear is like classifying objects in the universe. As bananas and non-bananas. What

Â this means is that if you're walking around in the universe, let's say your'e

Â on Jupiter and you pick up something, chances are it ain't going to be a banana.

Â Similarly, if you walk around and you pick up a system or a robot, chances are it

Â ain't going to be linear. What that means is that linear systems are really, really

Â rare. Yet, here I am, two lectures ago, bragging about how useful they are. So

Â something's gotta give here. And what it is, is that the non linear systems that

Â are everywhere. They act very much linear, at least around operating points. So the

Â linearization is a way of producing linear models from non linear models. Or

Â producing bananas from non-bananas, if you want. So what we're going to do in this

Â lecture is. Produce Linearizations or linear models from the non-linear models

Â that we start with. So, here is a general non-linear model . So, x dot is now not a

Â x plus bu with some general function f of x and u, and similarly y is not a simple

Â plus in cx, it's a non-linear function h of x. Okay.

Â So now, what we would like to do, is we would like to find some kind of local

Â description of what this system is doing. And this local description needs to be

Â linear, and what I mean by local, is that we have to pick an operating point. In the

Â pendulum we said, let's assume that the pendulum is hanging very close to straight

Â down, so straight down is the operating point and then what we do is we are going

Â to have to define a new variable. So, let's say that this is my operating point.

Â This in the pendulum case would be, the angle is zero, and I have no control

Â input. Well then, my actual state is going to be the operating point, plus some small

Â deviation in this state. Similarly my control input is going to be, well the

Â nominal operating Input point plus a small deviation. And, what we would like to do

Â somehow is describe these small variations. And in fact, the new equations

Â of motion that we care about well, we're going to care about how Delta x. This

Â deviation from the operating point behaves. Well, delta x is x minus x

Â operating point. Right? So delta x dot is x dot minus xl dot. Well, this thing is

Â equal to zero, because it's a constant, right? So this is just zero. So, here's my

Â zero. So, delta x dot is the same. As x dot. Well, I know what x dot is, it's

Â this. So, now delta x dot becomes this. Okay, let's see if we somehow can simplify

Â this. So this is my model, now luckily for me there's is something known as a tail or

Â expansion that's allows me to write this On a simpler form. So this thing can be

Â written as f evaluated at the operating point, times this partial derivative of f

Â with respect to x, also evaluated at the operating point, this is known as . And

Â then, you have the same partial derivative, but now with respect to u,

Â evaluated at the operating points. And, we multiply this with Delta u here, and delta

Â x here. And then I have something that I call HOT, which stands for higher order

Â terms. So this is where, we're saying that the higher order terms. Where, when delta

Â x and delta u become large, these matter. But for small delta x and delta u, they

Â really don't matter. Well why is this useful? Well, first of all lets assume

Â that we have picked operating points, so that f of x0, u0 is zero which that we're

Â holding the state steady, x dot is zero at this point which means that this thing

Â goes away. Now. Let's call these guys A and B. Why is

Â that? Well, these are just matrices because I'm plugging in some constant

Â value here. Similarly then I'm plugging in a constant value. So, these partial

Â derivatives are just matrices. Well, let's call them A and B. And now let's do the

Â same thing with Y. Y was the output. We want to kn ow what it looks like around

Â this operating point. Well, we have the same thing here, plus this term, plus high

Â order terms. So, let's assume that thing is zero, so let's assume that we pick an

Â operating point that kills the output at that operating point. So, the output is

Â zero at that point. Well, then, let's call this thing c. Right? Now I have a, b, and

Â c. And in fact, let's summarize what we just did. If I have this non-liner model,

Â and I pick an operating point, so that these two assumptions are satisfied. And

Â then I look at small deviations from the operating point. Then I can write delta x

Â dot. That's a delta x plus b delta u. Which is linear. And y is c delta x, where

Â these a, b, and c matrices are given by these partial derivatives, also known as

Â Jacobians. So this, ladies and gentlemen, is how you obtain linear models from non

Â linear systems. Well, let's actually do some computations here, just to know

Â what's going on. So let's assume that x is in Rm. u is an Rm, y is an Rp and we have

Â f and a being given by these things, but really what we have is f1 over x or is

Â actually a function of x1 to xn of u1 to up right, no sorry Alright.

Â So when I just write f1, that's what's a really mean. Okay.

Â Then, df, dx. This Jacobian that we talked about. The first one we need. Well, it has

Â this form. First component is the derivative of f1, with respect to x1. Then

Â it's f1 with respect to x2, and so forth. And the reason why I'm writing this is not

Â because I enjoy producing complicated PowerPoint slides. It's just, we need to

Â know what the different entries are. And it's important to do this right because

Â otherwise your dimensions don't line up when you produce your A, B, and C

Â matrices. So that's df dx or, as we now know it, A. This is my A matrix. Well,

Â similarly, B is df du, right? And again, the first component is df1 du1. This

Â component is the f1, the Here, we have the f and the u1. All the way to the f and the

Â So this is a n by m matrix, which is what we needed. And, in fact , this is the b

Â matrix, then. So it has the right dimension. And not surprisingly, we do the

Â same thing for our c matrix. and the reason again I wanted to show this is,

Â this is where the Jacobians come from. So if I write dhdx, this is what I mean.

Â Good. Let's do some examples. So let's start

Â with what's known as the inverted pendulum, which is a slightly more

Â complicated pendulum where what I have is, I have a moving base, my elbow in this

Â case. And then I have a pendulum pointing straight up. Or with some angle, and by

Â moving the base, the pendulum is going to swing, and in fact, it's going to fall if

Â I don't do anything very clever. But the dynamics of this can be written like this,

Â where theta double dot is g over l sin theta plus u cos theta. Okay.

Â Let's linearize this thing. the first thing we do is we pick our stakes. In this

Â case it's going to be theta and theta dot. And the reason I know that I have a

Â 2-dimensional system is I have two dot's up here. So, I have a 2-dimensional

Â system, x1 is theta and x2 is theta dot. Let's say they're measuring the angles, so

Â y is x1. Well, then I get my f to be this two vector. And I get my h of x to be x1.

Â Okay, fine. Let's pick the operating point where the

Â pendulum is pointing straight up, and I'm doing nothing. And in that case, well,

Â what is my a matrix? My a matrix becomes df1, dx1. So now I have to take the

Â derivative of this thing here, with respect to x1. There is no x1 there, so.

Â The first component is zero. Then I have to take the derivative of this thing with

Â respect to x2, which is 1. So this component is 1. Similarly, I have to take

Â the derivative of f2, with respect to x1. So now, I have to take derivative of this

Â guy here with respect to x1. Well, the derivative of this with respect to x1 is.

Â g over l times sine. The derivative of that is going to be g over l times cosine

Â x1. While the derivative of this, with respect to x1 is actually going to be

Â negative u, sine x1. But I didn't actually write this here, even though I should

Â have. Arguably. Because what I'm going to do is I'm going

Â to evaluate this at the operating point. And you know what? U is zero. And in fact,

Â x1 is zero. So this term actually goes away. So all I'm left with is this term,

Â evaluated at zero, zero. And cosine zero is 1. So after all these pushups, I end up

Â with g over l here, as the known zero term. Now, that's how you get the A

Â matrix. Again, I would encourage you to go home, and thus your already home when you

Â are watching this and actually perform these computations so you know where they

Â come from. Similarly B, you have to do the same computation and in this case you have

Â no U up here, so you don't get a U in the first component. Here you have U cosine

Â x1. Take a derivative of that with respect to U. We get cosine x1. We plug in the

Â operating point, zero, zero. And wind up with this elegant b vec-, b vector here. C

Â is particularly simple, right? Because h of x is x1. Which means that c is simply

Â 1, 0. So. That was how we would go about getting

Â these a, b, and c matrices. Okay, lets go to the unicycle the differental drive

Â robot that we have looked at that we saw in the previous lecture that we had a

Â little bit of an issue with. first of all lets figure out the state. Let's say that

Â x1 x now I'm having in the slight abuse of n notation right because x is also the

Â full statement. But this is the x component, x2 is y and x3 is theta and

Â then lets say that we're actually measuring everything. So y is this. Okay

Â We can control the translational velocity, or the speed and the angular velocity,

Â right? So my inputs would be u1 is v, and u2 is omega. Okay.

Â Let's compute, now, the linearization around x, operating point to zero. U,

Â operating point is zero. Okay. If you do that, what you actually end up

Â with, and I'm not going to show the different steps, you should do it

Â yourself, is first of all, an A matrix that's 0, a B matrix that looks like this,

Â and a C matrix that's dead end to the matrix, which is not surprising since we'

Â re measuring both the x y position and the orientation of, of the robot. Now, this is

Â a little bit weird. Because if I write down the, the dynamics for x2. Well, x2

Â dot it's going to be given by the second row of everything. Well, first of all,

Â it's zero, right? Because my a matrix is zero. Then I get zero, zero times u. So I

Â get plus zero, zero. I mean, times u, if you want. But this means that x2. is

Â actually eqaul to zero. Well x2 was the y direction, what this means is if I'm

Â pointing my robot straight in the x direction, then apparently I cannot

Â actually make the car drive in the y direction. That seems a little bit fishy

Â actually. what is going on here is that the linearization That we performed didn't

Â quite capture all the nitty gritty exciting things that were going on with

Â the non linear model. And this is an example where the non-linearities are so

Â severe, that the linearization as applied directly, doesn't entirely apply. Because

Â we lost control over the y direction. Even though.

Â >> If I have a car, I can clearly turn it. I can drive it and turn, and drive in the

Â Y directions. So, here's an example where the linearization actually doesn't give us

Â just what we wanted. And, the punch line here is that sometimes linearizations give

Â reasonable models, with inverted pendulum, for instance. And, sometimes they do not,

Â with the unicycle. and with a unicycle we have to be a little bit more care,

Â careful, but the fact that I want to point out though is that when they work. When

Â the linear stations work they are remarkably useful. Even though we're

Â finding them around the operating points they seem to work Better than what we

Â really theoretically have reason to believe, which is why we do a lot of

Â analysis of the linearizations rather than the non-linear models. And then take what

Â we learned from the linearizations and apply it to the, the non-linear models.

Â Thank you.

Â