 So, this is what we want to do, we want to try this out as a control Lyapunov function for the new system ok and like I said the purpose of back stepping is to come up with a control Lyapunov function everything else is too easy right after that you know what to do ok great. So, this was the claim so I want to prove this claim how do I prove this claim basically I mean just take derivatives and so on and so forth ok. So, you will usually do this you know Lfv and Lgv and all that, but you know the simpler way just take the directional derivative and whatever term is multiplying the control is the Lgv and other term is the drift term ok Lfv ok. So, I will actually compute sorry v dot x comma psi and this is what this is partial of v0 with respect to x. So, I am taking I am just taking the derivative piece by piece yeah. So, I get the partial of v0 with respect to x and then I get what fx plus gx psi which is x dot right and then there is no partial of v0 with respect to psi because v0 is independent of psi so done. So, there is no partial with respect to psi now I take the partial of the second term right. So, this will give me psi minus k0 x transpose yeah. So, this is I am assuming this is the Euclidean norm the 2 norm. So, this is just psi minus k0 transpose psi minus k0 right. So, I am just taking the partial just like I would take the you know multi variable standard multi variable calculus. So, this is partial of psi. So, this will give me I am just going to write this as psi dot minus ok just like I take this differentials this is how we have defined v dot anyway ok alright. So, what do I just carefully expand things here continue to write this as fx plus gx psi plus psi minus k0 x transpose and I know that this psi dot is just u right psi dot is just u right. So, this is u minus del k0 del x times fx plus gx psi ok everybody is convinced this is fine yeah I have simply substituted for psi dot and x dot ok great great. Now, we start playing a fun tricks ok as of now what do I know from the previous page I know that partial of v0 with respect to x multiplied by f plus gk0 gives me a negative definite term yes ok and I am going to use that what am I going to do I know that I have partial of v0 with respect to x f plus g psi and I am going to write this as gk0. So, what do I get here partial of v with respect to x fx plus gx k0 x minus sorry plus partial of v0 with respect to x gx psi minus k0 x yeah this is just the first term broken into these two pieces yeah why because I know that this is something nice right. So, we always want to rely on something that is already nice right and then I have of course psi minus k0 x transpose u minus partial k0 with respect to x fx plus gx psi yeah alright great. So, this I am going to use the previous page to say that this is less than equal to minus wx yeah that is the first thing and then you can see that this term also has psi minus k0 x right. So, I can combine it with this term right how this is just a scalar notice is v0 was a scalar. So, every term in v0 dot is a scalar right just a scalar. So, transpose of the scalar is the same scalar. So, we use these things regularly by the way remember this write it down in your notebooks transpose of a scalar is a scalar I know this sounds ridiculous, but you will forget it you will think why these can be combined yeah. So, every time I get a term with psi minus k0 in the end and the same term in the beginning with the transpose all I have to do is take a transpose right end and beginning same thing right. So, I am going to and we use these tricks very very frequently So, I can combine these terms u minus partial k0 with respect to x fx plus dx psi and plus g transpose x del v0 del x transpose yeah because I have just taken the transpose and that it all shows up inside ok. So, now in order to claim so we already have. So, this is let me write it again v dot is less than equal to this quantity right. So, v dot is essentially what you want to prove negative definite right in some sense. Now, in order to claim that this is a control Lyapunov function what do we need anybody tell me what do I need to now show in the right hand side. So, v dot is obviously as you know that this is Lfv I will say Lf bar v yeah why I put the bars is because the drift is you know. So, in this case what would be f bar f bar would be fx plus g xi and 0 and g bar would be 0 and identity yeah because this is the drift vector field here basically terms multiplying the control and terms not multiplying the control as simple as that yeah. So, f bar is this guy and g bar is this guy yeah control only in the second very second state. So, identity here and drift only in the first state so 0 here ok. So, that is why I say this is Lf bar v plus Lg bar v u. So, what do I need what do I need now if you look at this expression what do I need to claim that this v is a CLF not g bar and f bar can you say that again carefully not g bar and f bar no nothing to do with g and f g bar and f bar or g and f at all I mean in the sense there is something more yeah yeah go ahead lg bar v equal to 0 means Lf bar v is less than 0 yeah not just g bar and f bar they have no role as such ok. So, this is what I need to claim. So, basically what so the right hand side is exactly the same thing by the way yeah let us not get too confused right hand side is exactly the same thing everything multiplying the control is the lg bar v ok and everything not multiplying the control is Lf bar v yeah. Obviously, these two are scalars in this case yeah because Lf bar v will always be a scalar because v is a scalar and lg bar v will be a scalar in this case because there is only one control ok. So, what is lg bar v in this case from the right hand side can you read out and tell me what is lg absolutely thank you very much. So, this guy is actually equal to lg bar v ok. So, lg bar v equal to 0 implies what so lg bar v equal to 0 implies psi is equal to k naught x yeah exactly the thing that we wanted anyway remember yeah somehow it came back ok. And this if psi is equal to k naught x you know that everything here goes to 0 by the way these were all drift terms also right I hope you believe that this this multiplied by this was also drift term was part of Lf bar v right, but because psi minus k 0 x goes to 0 or is equal to 0 if lg bar v is 0 all of these go away yeah. So, what am I left with this implies that Lf bar v is less than equal to minus Wx right which is negative definite by assumption ok negative definite by assumption ok I hope this is clear yeah this is how we test for CLF ok. All we see is that if the term multiplying the control is 0 then what happens to the terms that are not multiplying the control ok. So, in this case the term multiplying the control goes to 0 means this term goes away which means these terms also go away the only thing that is left is this guy all right and that is negative definite by assumption W was positive definite minus W is negative definite right and this is enough to claim that vx vx i is a CLF ok all right excellent ok everybody is clear yeah how we just constructed a CLF for a integrator system starting from a single system all right of course the questions on how do you get v 0 and W and k 0 all these remain yeah we will that we look at in examples of course, but it is a constructive way yeah all you did was kept constructed an error and you added the error square norm of error square ok. Now if I was to ask you what would be a choice of stabilizing controller for the system looking at this guy what would you say what would be a good stabilizing controller if I want to stabilize this system x i system what do you think can you use this expression this is what is called you know Lyapunov reshaping right that you take a Lyapunov function v is CLF is also Lyapunov function right. So, you take this v take the derivative and try to make the derivative negative definite right now yeah you said it CLF and all that stuff excellent and you can use the Sontag universal formula obviously that is obviously one choice, but suppose I ask ask you just look at this and tell me what is the stabilizing controller can you why what e to the parity no I want you to give me an expression for control you what will you do yeah what will you choose as you if I want to make v dot negative definite anything it so this expression you will make 0 ok. So, this entire thing gone ok great does that make v dot negative definite we are back there I ask again is v dot negative definite look very careful what is v a function of ok it is only semi definite why there is no x i you do not all states do not appear not negative definite. So, not enough to make this 0 something more what else what will you do great making 0 is a good idea we need something more. So, first step is cancel this good now add something more to the control what else you can get motivation from the expression of v itself right v is positive definite I hope you believe that right I mean ok we never by the way we never discuss this very carefully. So, maybe I should go back there do you believe that v is positive definite why v naught x is positive right great, but if you remember I we discussed this that if you have a sum of two states and square it if it is like x 1 plus x 2 square it is a problem right because for x 2 equal to minus x 1 it goes to 0. So, how do you claim if I ask you to claim a bit carefully not just because it is a norm square how will I claim that this is positive definite in x and psi remember correct. So, v naught is definitely no problem no never say that that is the same argument is saying that if this is not there it is positive definite is it positive definite if this is missing no has to be positive all variables have to be there ok. So, sure in x it is positive definite I mean there is nice positivity in x great what about the x i term you have to use the same test the test is still the same that it has to be positive everywhere, but at 0 at 0 it has to be 0 which it is v 0 0 is 0 k 0 is 0 is 0. So, psi 0 so no problem at 0 it is 0 ok if x and psi are non-zero in any combination then this has to be strictly positive is that true how do you prove it it is true of course it will make sense to construct this how would you claim it both are positive obviously so nothing can cancel each other right for it to be 0 both terms have to be individually 0. So, both terms have to be individually 0. So, the first term being 0 implies what x is 0 only way first term is 0 is f x is 0 if x is 0 k 0 x is 0. So, if the second term is 0 implies psi also has to be 0 that is the only way this is how you will justify whenever we ask about positive definiteness you have to be very careful in this argument first of all and again you look at how easily you get back to the old habit of saying oh it is because it is positive so it is positive definite as soon as I asked you said this is positive definite it is not. So, it is a very easy to slip to old habits where you say that even if not all variables appear it is positive definite it is not. So, that is the first thing all variables have to appear for a function to be definite otherwise it is not definite it is only semi definite keep this in mind. Second you have to do the usual test that for all non-zero states it has to be greater than 0. So, the only way v can be 0 because each of these is a non-negative term is that each term is 0. So, if the first term is 0 you know that x has to be 0 only choice because v 0 is assumed to be positive definite right now if x is 0 this guy goes away. So, this is just now half psi square. So, for this to be 0 psi has to be 0 therefore, the only way the second term is 0 and the first term is 0 is only if both x and psi are 0 ok. So, you have very clean evidence of positive difference excellent. Can you use the fact that this is positive definite to motivate how to choose the control here? What do you think? He has already suggested that you know you cancel these two terms which is good because I do not know anything about definiteness of these terms. So, it is the smart thing to do cancel these guys say that again. But this is already cancelled right I have already removed this using some parts of u. I mean I am going to basically I am going to make u as plus del k 0 del x fx plus g xi minus g transpose del v d 0 del x transpose. So, these two cancel out, but I can add more terms in u what more should I add in u? Absolutely you just introduce a minus psi minus k 0 x transpose ok. If you just introduce a psi minus k 0 x transpose what will I get? Minus norm psi minus k 0 x whole squared ok which is now the combination becomes negative definite ok the combination is now negative definite. So, what is a using just this is and this is the standard Lyapunov reshaping I am going to write it here now. Control law by Lyapunov reshaping is what is u equal to so I basically cancel minus del k 0 del x sorry plus del k 0 del x fx plus g x psi which is to cancel the first term then I cancel the second term this cancels the second term and then I introduce and you can verify the dimension, dimension will turn out well and this will give me v dot as less than equal to minus w x minus psi minus k 0 x whole square which I know is negative definite right because the first term this is already definite. So, both terms have to go to 0 individually which means that x goes to 0 and psi goes to 0 just by the same argument as before ok alright. So, this is a valid control law. In fact, this is how we design control laws most of the time yeah most of the time this is how we will design control laws by Lyapunov reshaping we do not usually go back to the Sontag universal formula mostly because the computations are very complicated yeah. Now, if I put all the square roots and stuff here with this expression right you see what is the notice in this case this was lg bar v great nice, but what was lf bar v lf bar v is this guy this guy this this and this put together ok this was lf bar v ok very very painful looking. So, if I wanted to use the Sontag universal formula of course it is a very painful calculation of course it is not I mean if you implement it numerically this is not a big deal yeah because you will just compute these as ax and dx and then you will just at every instant in time you compute ax in one place dx in another place and then you just compute this whatever this minus the universal formula ok that is pretty straightforward. But if I wanted to actually write it and show things with it it becomes very difficult that is all ok and in fact in this case I know very much that this is also because of this construction I actually use Lyapunov reshaping I know that this will turn out to be a smooth controller also ok whereas the universal controller will only be almost smooth yeah here I can guarantee that it is a smooth controller just by looking at these expressions all right. So, most of the time we use this kind of Lyapunov reshaping all right.