0:01

Hi, I'm Smriti Chopra.

Â I am a graduate student at Dr. Egerstedt's lab, and I will be your instructor for the

Â Glue Lectures, for the duration of this course, which is Control of Mobile Robots.

Â And just a quick idea: what are these Glue Lectures?

Â Basically, they're going to kind of connect, you know what you learn

Â with Dr. Egerstedt to the quizzes we are going to give you.

Â And give you helpful hints about the quizzes.

Â Clarify, repeat certain concepts.

Â By that I really mean we, you know, work out a few

Â examples, understand the math that goes behind some of the lectures, etc.

Â Just to help you guys move along the course.

Â And the format is going to be one Glue Lecture every week.

Â And the course is seven weeks, so seven Glue Lectures.

Â And on a side note Amy LaViers is a former

Â grad student in our lab, and she was last year's

Â instructor for the Glue Lectures.

Â So we will be reusing some of her lectures.

Â And so in the coming weeks, you know she and I are going to share.

Â Between the two of us, we're going to teach you guys, out of the seven lectures.

Â 1:19

This week with Dr. Egerstedt, you guys kind of, you

Â know, went through this introductory notion of what a model is.

Â And he tells you that really, a model is basically, you

Â know, something that describes how your system changes or evolves with time.

Â And your system could be a robot, for

Â example, and a model is just going to describe,

Â let's say, how the positions change with time,

Â or how the angle, angles change with time, etc.

Â And the whole idea behind controls

Â is that we're going to kind of try and influence this

Â change to make our system do something we want to do.

Â And we're going to do this by injecting controls.

Â But let's go really down to the basics. What really is a model?

Â And before we do that, let's do a little exercise in derivatives.

Â So here we have, let's say, position x, with

Â the respect to time, is given by this exponential function.

Â Now this is in its general form.

Â I'm saying that let's say me, for example, my position is x

Â of t, and I wake up at time t equal to 0.

Â I'm at position 10.

Â 2:28

That's okay.

Â That's simple.

Â And now I can take the derivative of this position with respect to time, right?

Â And I get what,

Â what is the velocity.

Â And you'll see this is actually 2x of t, really.

Â And then you can do this further on, and you can take

Â more derivatives, and now we have the acceleration, which is 4x of t.

Â One thing I want to point, point out really quick here is

Â that x dot of t equal to 2x of t, for example.

Â Now what is this?

Â This is really nothing but a differential equation.

Â Basically something that relates a variable x to

Â its derivatives, second, third whatever.

Â So in this case, x dot equal to 2x of t is a differential equation.

Â Something he mentioned in class, right?

Â Okay.

Â So this was just an exercise in derivatives.

Â You guys should be able to take exponentials and their derivatives, etc.

Â No problem.

Â We saw the graphs related to these, as well.

Â But in action, what does it really mean?

Â So I'm telling you that my position with respect to chi,

Â time changes like this: 10e to the power 2t.

Â What it really means is, let's say that's me, or that's a pink ball, whatever.

Â And now I draw this line, which is the x axis.

Â 3:37

And I start at 10, which is where I wake up, because you guys see, if we're here in

Â this equation, if you put x at time 0, you'll

Â get 10, e to the power 0, which is 10.

Â So at time 0, when I wake

Â up, I'm at 10. Right?

Â And now, the whole point is that let's say at

Â time t equal to 0, like I said, we wake up.

Â Now I say start, right?

Â And then I start moving.

Â And as my time increases, my position is going

Â to keep changing with respect to this function here.

Â And because it's exponential, let's say at time point 1, I'm here.

Â And then I

Â jump really high at point 2, and then even further.

Â because exponentially my position is changing.

Â So, so from graphs, all of a sudden we see

Â how it maps onto, these equations map onto actual motion.

Â 4:31

But now, instead, I tell you that, you know what, I'm

Â not going to tell you how x changes with respect to time.

Â I'm instead going to give you

Â this set of equations, which is a differential equation,

Â and then an initial condition where I wake up.

Â And now I want to find what my x of t is going

Â to be, given this, which is x dot of t and x of 0.

Â So in this case what do you do?

Â Well, what you do is, and this is what you did

Â in your lectures as well, just to see how you evolve

Â with res, with time, you discretize the world.

Â And real quick, let's say this is your time axis.

Â And I'm going to divide up this time axis into, you

Â know, delta t chunks, where each chunk is 0.5 seconds, or whatever.

Â So it's very simple.

Â I just divide up the axis.

Â And now, I'm going to say that my t is actually given by this k delta t.

Â This is how you discretize, right?

Â And k becomes a counter. Why?

Â Because when k is equal to 0, my time is 0.

Â And when k is 1, it's 0.5. When k is 2, I'm at one, etc.

Â So k becomes kind of like a counter, right?

Â All right. Now let's see how the ball is moving.

Â So we know that we discretized time.

Â What we want to see is now, as I move k from 0, 1, 2, 3, how does my ball move?

Â And sort of extract x

Â of t from it. Right?

Â Okay.

Â So again, this is our equation in continuous time.

Â So remember I told you I have given you only two things.

Â 6:10

These are the two things that I've given you.

Â Okay, so I know this guy here, that at time 0, I'm here.

Â And now I have the equation, the differential equation.

Â Well, you can discretize this differential

Â equation through something called Taylor's,

Â Taylor extension, which you guys did

Â with Dr. Egerstedt, which basically is given by this equation here.

Â 6:32

And a quick note.

Â What it really is doing is, it's kind of saying, x k plus 1 is

Â nothing but x times k plus 1 times delta t.

Â Right? And xk is nothing but

Â x at time k delta t.

Â So it's, by incrementing k, what we are doing is we are finding out at

Â the next time instant, discrete dimension where should

Â I be, depending on my previous time instant.

Â That's all this equation is really doing.

Â A good thing to note here, though, is that we will be using just the first

Â two terms of the Taylor expansion, which is

Â what you guys did in the lectures as well.

Â This expansion

Â is really an approximation, because you see these dot

Â dot dot here it just goes on and on.

Â You keep taking derivatives, and you keep going on, so obviously the more

Â terms you use, the better your approximation of x of t will be.

Â But as of now, we're just going to use the first two terms of the expansion.

Â So let's see.

Â Here we have x of t is 2x, delta t is 0.5, we know this, t is k

Â delta t, and now let's put this entire thing

Â into this equation of ours, the discrete time equation.

Â And we get this guy here, x k plus 1 is equal to 2xk.

Â You guys should do this yourselves. It's really simple.

Â But just, you know, plug in values. You get this one equation.

Â And this is now our discrete time update equation.

Â And how do we use this?

Â Well, we are simply going to say okay, so at k is equal to 0, x of 0 is 0, and now

Â xk plus 1, which is x1, will be 2 times x of 0, which is actually 20, right?

Â So we saw that at k is equal to 1, which

Â is actually time point 0.5, I jumped from here to here.

Â 8:41

For all you guys, you guys can kind

Â of see that this is really a linear approximation.

Â It's not changing exponentially, and like we thought it should,

Â because we know that it should change exponentially, but it's not.

Â And this is because, like I said, the more terms you

Â take in the Taylor series for

Â your approximation, the better the approximation.

Â So here, since we took just two terms, it's a kind of linear approximation.

Â If I take more terms and added, you know,

Â acceleration, etc, then your approximation would have been better.

Â 9:10

And so, what we actually just found out, was nothing more than

Â a dynamical model, and how you kind of solve it to see how

Â your system is evolving.

Â So your differential equation and an initial condition, or just a condition,

Â basically telling you this is where I am at a certain time.

Â These two things are more than enough to find out how your system

Â is evolving with respect to time, and what is your x of t.

Â 9:37

And in general, general form, this is, how you say, is your dynamical model.

Â Basically, it's an equation

Â x star of t.

Â That is a function of its, you know, state or time.

Â And later on, this is where you put in your control

Â input, you as well, when you guys go later into the course.

Â So you kind of, like I said, influencing the change x

Â dot of t, to make x of t do whatever you want.

Â Right now we're not dealing with control, so it's

Â just simply x dot of t is given by something.

Â And you have an equation here x t star is x star,

Â which is basically saying that at some time, I'm

Â going to tell you where you should be in space.

Â And with just this information, you should be able to evolve

Â x of t, and see how your state is changing with time.

Â So that was pretty simple.

Â Punchline.

Â This is the following dynamical model, which we've been solving all this while.

Â We know how x evolves.

Â But we know how x evolves numerically, right?

Â We discretize the world. And we

Â saw how x should evolve as we move the counter from 1, 2, 3, 4, etc.

Â But we didn't really get the equation out.

Â 10:47

You know, the mathematical expression for x of

Â t, which we know is the exponential 2t, 10.

Â We know that this was the actual solution, but

Â we really didn't get this equation, pretty equation out.

Â What we got was a

Â list of basically times, and where x should land up, numerical solutions.

Â So if you had to, let's say, get the equation out, what do you do?

Â 11:20

For all of those, this is not important for the course, but

Â for all those people who want to see how you integrate and get,

Â you know, x of t, we can go over it really quick here.

Â 11:31

It's really nothing but, of course, an integration.

Â Let's say dx by dt is 2x.

Â You kind of separate the variables real quick.

Â So you say over x is equal to 2dt. Integrate both sides.

Â This is actually your logx is equal to two t plus c, c is your constant.

Â And now this is an equation

Â you've got in which you're going to plug in your initial condition.

Â So log10 is equal to c.

Â 11:58

And from here you say, okay, so let me put all this back into my main equation.

Â Logx becomes two t plus log10. And now you kind of, you know, shift

Â terms here and there, and you get x is equal to 10e to the power 2t, x of t.

Â So now you guys even saw that,

Â you know, if you don't want to do the whole discretizing the

Â world and kind of simulating where you should be, instead you can integrate.

Â And a word of caution here, that

Â you cannot always integrate and find the solution.

Â Sometimes you have to rely on numerical methods,

Â because analytical solutions may not even exist, you know?

Â You may not get pretty equations for dynamical models, etc.

Â But here, just to kind of show you that, you know, you can do it.

Â Just integrate, and

Â you'll get the answer.

Â Again, it's not important for the course, but woo, we got it.

Â But what is

Â 12:50

important for the course is that even though maybe, okay, we won't ask you

Â to integrate, what we'll do instead is we'll say, okay, here is your model.

Â And I'm going to give you what I call a candidate

Â solution, x of t should be 10e to the power 2t.

Â And now what you need to do is figure out,

Â is this indeed a solution to the model or not.

Â And for that, there are just two simple steps that you do.

Â First is called the initial condition check.

Â What does that mean?

Â It basically means that

Â 13:18

I'm given this candidate solution, and then

Â within the solution, I'm going to kind of put

Â in my initial condition x of 0 and see if I actually get 10 or not.

Â And here I do get 10, so it satisfies this equation, my x of t.

Â And then the second check is the differential equation check.

Â And what is that?

Â That is really nothing but okay, again I have my candidate

Â solution, but I'm going to now take the derivative of that candidate solution.

Â 13:43

And 2e

Â to the power of 2t, which is really my

Â 2 times x, and see if it satisfies this equation.

Â And it does.

Â So this is another technique.

Â So in case, you know, given a model, you don't want to

Â find out through integration or numerical methods what your x of t should

Â be, but instead I'm telling you what it should be, this is

Â how you check or confirm that it is indeed a solution or not.

Â 14:18

made you sort of comfortable with the idea of, you know, models.

Â And for example, you have something like this, right?

Â Okay, then how do we solve them?

Â We solve, one we can do by numerical solving,

Â which is numerically discretize the world and solve it.

Â And then, another is analytically, through integration, right?

Â And then the third thing, which is very important, is that I give

Â you the model and then I say okay, this is the candidate solution.

Â You check the solution through two checks, the

Â first being initial condition, second being differential equations.

Â And sort of try and verify that

Â this candidate solution is indeed satisfying the model.

Â And this is a homework

Â assignment for you guys.

Â For this model, see if you can numerically,

Â analytically, and this whole checking thing, whether, you

Â know, you can kind of solve it and see if you get this equation or not.

Â And before we wrap up this lecture, there's just one

Â concept more, which is the equilibrium point concept, which I want to introduce.

Â Which is really nothing but basically this concept that if my state x wakes

Â up here at this point, or at this

Â position, or at this value, it stays there.

Â As simple as that.

Â So it's really not anything more than saying that

Â my x dot of t is going to be 0.

Â 15:41

So to find an equilibrium point, you do simply x dot

Â of t equal to 0, and find the value of x.

Â And like I said, now if, if I was to wake up here, or if at, let's say, time

Â t is equal to 0 I or 3, or whenever I wake up, I am at this equilibrium point.

Â Because my x dot of t is 0 and there's no change, my change is basically 0.

Â I will stay there. So it's really simple.

Â So in our case, in the dynamical

Â model case, x is equal to negative 1 by 3 is your equilibrium point.

Â So if you're asked, you know, find an equilibrium point, simply

Â just put x dot equal to 0, or whatever function you

Â have here equal to 0, and find the values of your

Â state, x in this case, and that will be your equilibrium point.

Â And also, with that check the forums.

Â Good luck with Quiz One. And bye bye.

Â