 So, last class we are discussing about the linear quadratic regulator problem. Let us recall this problem, we have a dynamic system which is described by x dot is equal to A x plus B u and x is the state vector whose dimension is n cross 1, u is the input vector whose dimension is m cross 1 and y is the output vector. So, our problem is to find a control law u of t such that this performance index what we have described this one the performance index is minimized. In other words our problem is to find a control our aim is to find a control law that will drive the state x t 0 t is equal to t 0 that will drive the state at t is equal to t 0 to a finite time t is equal to t f near the optimal near the origin or near the 0 state. So, for that one what should be the choice of u so that it will satisfy the performance index not only this one it must satisfy our given dynamic equation 1 and 2 this one this is our problem. And we have seen this problem what we have considered the performance index if you see this one performance that interpretation of this waiting matrices. And the state waiting q is the state waiting matrix because it is associated with the state r is the input waiting matrix this is associated with that input. And we have a terminal cost that may at time t is equal to 0 t is equal to t f at finite time our state initial state will go to the near the origin not exactly origin, but near to the exogenous near to the origin at finite time t is equal to t f. So, this is the state terminal waiting matrix this one and if you do not consider the that in the performance index that input term that the control effort term. Then if you minimize this one will see or we can say that we do not have any control with the input effort. So, input effort may be extremely high which you cannot directly apply to the systems. So, in other words if you do not consider the state waiting matrix of that one quadratic performance index this part then our we do not have any control on the over the state this one. That is why we are taking the linear combination of state waiting matrix and input waiting matrix control. We are minimizing these two efforts that means control efforts as well as the state waiting matrix effort to this one. So, this is our basic step and the choice of q r what q should be a positive semi definite and r should be a what is called positive definite matrix. And in our linear quadratic regulator problem we have not considered that what will derive it now. We have not considered that is there is no constraint on the u as well as x that x and u are free that no constraint impose on x and u variables. Then when t is tends to infinity t tends to infinity instead of finite time t tends to infinity the state waiting matrix that is x t f it will be assigned to 0. Because it has no physical significance of t is equal to t f the function that is a state waiting matrix value is assigned to 0. Because it has no physical interpretation there because all the states will come to 0 asymptotically t tends to infinity. So, this type of problem when t f tends to infinity this is called this is infinity this is called the infinite horizon problems that also we will discuss later. So, let us see how we are going to derive the what is called l q r problem for finite time regulator problems. Regulator problems means our initial state r in equilibrium position if there is a initial disturbance in the state is there naturally this state will deviate from the equilibrium point. And it should come back to equilibrium point as quickly as possible with the application of control effort that we have to find out that control effort. So, that the performance index what we have considered that is minimized. So, next is we are considering the solution of l q r problem linear quadratic linear quadratic regulator problem for a finite time interval problem bracket finite time. That means once again we define our aim is a driving the state x is t is equal to t 0 to a final state t is equal to t f that means x t f final state t f near about the origin or 0. That is our problem for that one what should be the choice of our control and control input. So, that it satisfy our performance index including the terminal cost that performance index we have considered. So, let us call our problem is like this way x dot is equal to in general it is a x of t u of t and this and x t 0 is equal to x of 0. Since, we have described the system our dynamic system is described in the state piece form that is x dot is equal to a of t x t plus b of t u t and x t of 0 is equal to 0. We have assumed that our system matrices a and b are function of time time varying parameter matrices and if it is time invariant that a of t is constant all the elements of the matrix a of t is constant it does not change with time. So, our output equation this is the state equation state equation and this is the output equation this is the output equation and output equation c into x t plus or you write is simply c of x t. So, this dimension x dimension n cross 1 that u dimension number of inputs is m cross 1 and number of outputs you can p cross 1 though in your regulator problem this output will not come into the picture. We are assuming that we will show you later we are assuming all the state variable information x t are accessible to us or measurable to us or in the sense the information of state variable is known to us. So, then our problem is to find a u such that it will satisfy this power performing index. So, this is the terminal cost which is f t x of t this is the quadratic form in state, but at time t is equal to t f plus half t 0 to t f then x of t q of t x of t plus this is inside the bracket plus u transpose of t r of t plus u of t bracket close d of t. So, I told you earlier that why half is taken into account that in the performing index that this half when you find out the differentiation of Hamiltonian function with respect to u lambda or x then you will see this half and from there it will come to 2 and this 2 and half will be cancelled. Otherwise if you do not consider that 2 numerical value 2 will come through this expression to avoid that one we just multiply by half. So, at what point the optimal value of the function will get it that will not change that as we have seen in static optimization problem that if you multiply a performing index by constant or divided by a constant that what is called optimal point at which the function will be optimal that point does not change it that is we have seen it. So, this you can say as per our notation this is the final what is called terminal waiting matrix and this is the state waiting matrix which is greater than equal to 0 means positive definite. This is the control waiting matrix that value is positive definite matrix that we have discussed earlier. That must be from physical consideration also that must be positive definite matrix it cannot be positive definite because when if it is a positive semi definite control effort applied to the system will be 0 then this is that is why it is a positive definite matrix. So, let us form our that is if you just compare with this one that is nothing but our S f S t f and x of t f function and this whole thing is nothing but a this half you push it inside then half x transpose q x u transpose r this whole thing is nothing but a v that is integral part is v again. So, we can consider that whole thing that whole from here to here that part is v which is a function of x t u t and d t including half that is v as per our usual notation. So, this part is the integral part of that one. So, this whole thing I can write it t 0 to t f that one this whole thing that is what whole thing will be replaced by that one only you can say. So, let us see what is our Hamiltonian function we know at this moment that how to generate or form the Hamiltonian function form Hamiltonian function you know h is a function of x t u t lambda t and t and which is nothing but a our original system equation x dot is equal to x plus v u. So, I will write it that our integral part of this one integral part of the cost function that is half then your x transpose t u of t x t plus u transpose r of t u of t that part that means first is what integral part of the performance index v of x v f of x is nothing but a v dot x function of what is called u and t is nothing but this plus that in what is called Lagrange multiplier of this multiplied by our x of t x t plus v of u t v function of t this one. This is our Hamiltonian function which is free form x dot that we have discussed earlier that one or if you see more carefully it is nothing but our f of x t u t and this that whole thing is v of this if you see this is nothing but a v x of t u of t and t this one. So, where lambda wave t is a cost state vector cost of state vector of dimension that lambda is dimension n cross 1. So, this is the first step you form that linear quantity regular problem means the system description dynamic system description is given in state space form and corresponding performance index is given that terminal cost plus the integral of the quadratic form of in state and input matrix that is input vector this. So, from this information I can find out the Hamiltonian matrix next step is step to necessary condition condition for optimality. So, what is the necessary condition del h del u of t is equal to 0. So, what is del h of del this is this is you see del h del h with respect to u. So, the u term is involved here and u term is involved here and we know that if you have a x transpose p x if you differentiate with respect to x vector then results is twice p x. So, I will just apply that one that u transpose r t u t I am differentiate with respect to u t that result will be twice r t u t. So, this twice and half will be cancelled. So, it will be half as it is twice r of t u of t I am getting from this part again if there is a function of u of t here. So, it is a lambda transpose b u of t and we know the partial differentiation of a transpose x with respect to x agree that results is a. So, that I am applying here if you apply is here that one then it will come plus b transpose t of lambda t is equal to 0. Because this term you see this I can write it lambda transpose b u t I can write lambda transpose b I can write b transpose lambda whole transpose and I made it into this form a transpose then x means u this. So, this from there we are getting from there we are getting u of t our control input is equal to minus r inverse because r inverse b transpose of t lambda of t. Let us call our equation that Hamiltonian this is equation number one you give it this is equation number one and you give it this is equation number two. So, what in order to get this one what we have used it we have used this two things differentiation of this with respect to quadratic function with respect to x of t if you do this one this result is twice p x of t another we did it a transpose x of t this with respect to x of t is equal to a. So, this two things we have used in order to get equation number two. So, once we get it this one other two necessary conditions are this one if you see the step three. The state and costate equation state and costate equation are given as x dot of t is nothing but a del h del lambda of t. That means h is a scalar function I am differentiating with respect to lambda vector. So, that see this one the lambda is associated with this one only the second part. So, if you differentiate this one with respect to lambda. So, I can write it this is nothing but a a x plus b u this if you differentiating with respect to lambda you see this I am differentiate with respect to lambda. So, this agree so I can write it this is nothing but a whole transpose into lambda that because this is a scalar quantity this and this multiplied is scalar quantity. So, I can write it a x plus b u whole transpose into lambda agree. So, it is same because it is a h is a scalar quantity this part is a scalar quantity. So, if you differentiate this with respect to lambda I am getting this expression is a x a t x of t plus b t u of t. You have followed my point this thing is a scalar quantity what I will I take the transpose of that one multiplied by lambda of t. So, this will be same as this value then I am differentiating with respect to lambda t and that results is this one that using that property I mean that expression. So, I can write it now next equation costate equation lambda dot of t is equal to minus del h del x dot x of t not dot x of t. So, now I am differentiate this with respect to x. So, x is involved here x is involved here. So, from there I will set first one I will get if you differentiate with respect to x you will get twice q of t x t 2 2 cancel q of x t I will get it. So, this will get it minus q of t x t the first part then you see this one lambda transpose a x t. So, this I can write lambda transpose a x I can write it a transpose lambda whole transpose because this 2 I am writing a transpose lambda of t whole transpose is same as that part. So, I am differentiate with respect to x. So, it will be coming plus a transpose of t lambda of t. So, this and let us call this is equation number 3 and this is equation number 4 again. So, using equation number 2 means that one this expression you use in equation number 3 3 and with 4. That means using equation number 2 you replace your by this expression and then argument that equation with the costate equation and that will results that one. So, I am writing using 2 in equation 3 and with 4 using it 4 we have. So, x dot of t that means if you write equation number 3 in equation number 3 you are using the expression of u of t and then argument that u of t with then argument that equation 3. So, I am just doing this lambda dot of t is equal to this a of t then b of u t b is your b as it is u of t is what r inverse b transpose and lambda of t and that I am writing x of t and this is lambda of t. So, the lambda of t multiplied by the a x actually a x a into x b into u b as it is u I am writing minus r inverse b transpose lambda. So, this and the this it is as it is u of t say this is I am writing u of t minus a transpose a of minus a transpose of t. So, this dimension is since costate vector and state vector dimension are same each is n. So, this dimension n cross 1. So, now this is called is Hamiltonian matrix Hamiltonian matrix and this whole thing is called Hamiltonian system Hamiltonian system and this matrix dimension is 2 n cross 2 n. Now, look at this expression since our given system a t b of t q of t r of t is the designer choice. If you know the designer what is the designer has taken into consideration to design the l q r problem then this whole matrix is known to us. That means Hamiltonian matrix is known to us and we can find out the its Eigen values only difficulties is there the parameter is changing with time. So, naturally the Eigen values will also will change with time suppose if you consider a of t b of t r of t and q of t is fixed does not change with time. Then this is a constant matrix and Eigen values we can find out and this Eigen values is a closed loop system Eigen values agree the x dot is there lambda dot of t is there and we have a in addition to this there are n Eigen values are there which is closed loop Eigen values and another n Eigen values are there which is associated with the costate vectors. So, let us see what is this represent what is the Eigen values of this one what my main stress is here without calculating anything if you designer has selected r of t q of t and system matrix is known I can find out what is the closed loop system matrix Eigen values. So, this we can write it more compact rather simple form in the sense this I am replacing by another variables e of t plus minus q of t minus a transpose of t this equal to x of t dot lambda of t. So, let us call this is equation number 5 now I want to show you here with a similarity transformation that this Eigen values are nothing but a Eigen values of closed loop system Eigen values closed loop system Eigen values and other values Eigen values are Eigen values of that lambda dot costate vectors Eigen values of the system matrix of costate vectors. So, use a transformation and this transformation I have used it I 0 I p of t and p of t is a matrix whose dimension is n cross n is a matrix whose dimension is n cross n. That means this dimension is n this dimension is n this dimension is n naturally all matrix dimension you know and this is invertible by look this one this is invertible diagonal matrix blocks are unity and it is non zero that all columns are linearly independent columns are there. So, their inversion is exist. So, I am using that transformation x is transform to x bar lambda is transform to lambda bar of t and that is equal to x of t and lambda of t. So, if you differentiate this thing both side what we can write it first is I this p of t then x of t is equal to x of t lambda bar dot of t lambda bar sorry x bar dot of t this plus another term is differentiation of this block with respect to 0 then 0 then 0 then p dot of t. So, this is that one. So, this into that your x bar of t and x of t is equal to x of t and x of t is equal to lambda bar of t is equal to x dot of t right hand side x dot of t lambda dot of t. So, I know what is the lambda x bar dot of t lambda bar dot of t. So, I will put it this expression in this side and then we will make some manipulation and simplification. We will get it now this is the equation number we have given up to equation number 5. So, let us call this is the equation number 6. So, from 6 6 so from 5 and using 6 from 5 and using 6 what you can get it. So, what I told you that in place of lambda x dot lambda dot I will replace by this equation using 5 x dot lambda dot I will use that one. So, right hand side equation is x dot lambda dot is replaced by a of t dot partition e of t minus q of t sorry not transpose or you can write transpose because it is symmetric matrix minus a transpose of t. So, this equal to x of t lambda of t this is the right hand side I will retain and left hand side will be as it is as you have seen it I 0 p of t I then lambda bar dot of t lambda sorry x bar dot of t lambda bar dot of t plus 0 p dot of t and 0 this multiplied by x bar of t lambda bar of t and this I have written. So, after simplification this thing you bring it that side right hand side this part you bring it that side and x and lambda t you replace by transformation matrix that you what we have in a how they are related x of t lambda of t related to x bar of t lambda bar of t that we know with this expression. If you recollect this is the expression we have considered for transformation this is the transformation. So, replace x of t lambda of t by this one in the right hand side of this part and ultimately if you do it that what will get it that one I just after simplification lambda dot x bar of t lambda bar dot this is dot of t is equal to I 0 p of t I whole inverse. Then this multiplied by 0 0 p dot of t 0 then x bar of t lambda bar of t this is my because this term I have taken right hand side then this inverse I have taken both side I multiplied by inverse of that one. So, this is the that and this part will be what see this will be inverse of that I 0 p of t I 0 p of t I this is I whole inverse then a of t minus e of t minus q of t minus a transpose a transpose of t multiplied by this x and lambda t is replaced by x bar and this. So, if you replace by this one this will get it your I 0 I p of t multiplied by x bar of t and lambda bar of t this is the expression we got it x bar of t lambda bar of t. So, after just this and this you club together and if you take this common then this multiplied by this matrix this matrix multiplied by this matrix and result and you will get a matrix of 2 by 2. Before that I have to know inversion of this one I have to get it because I know the inversion is the exist because this matrix has a n linearly twice n linearly independent because from this structure you can say twice n linearly independent vectors are there. So, this inversion is exist. So, now using what is called matrix inversion lemma one can one can get this values are like this way matrix inversion lemma is what I am just writing it here matrix inversion lemma. So, if you have a matrix A suppose we have a matrix A B C D and their partition like this way and it is assume that A and D inverse is exist we have partition in such a way that this are the square matrix and their inversion is exist. So, you have to find out this inversion of that one. So, that is the inversion let us call it is p 1 that is p 2 let us p 1 2 p 2 1. So, what I we have a matrix A B let us call A matrix is partition the matrix into 4 block in such a way that A matrix this block and this block which will be a square matrix and inversion is exist. Then I can write p 1 is equal to A minus A this one C sequence A minus then B D inverse D inverse C p 2 p 2 p 2. So, this is corresponding D minus C then A inverse p A inverse then p 1 2 p 1 2 this one is equal to minus A inverse B A inverse minus A inverse B then p 1 2 minus A inverse B 2. When I have taken this p 1 2 you see p 1 2 I starts with A minus A inverse B then p 2 this one p 2 already I have calculated. Then p 2 1 tell me this one minus p 2 1 is this one minus p 2 1 I am finding out minus D inverse then C then p 2 1 minus p 2 1 so, this is the matrix inversion lemma. So, if you put the matrix inversion lemma here agree this places and similarly this one ultimately I will get it final expression I am writing x lambda bar dot of t this what I will get it I will just write it final expression please see the final expression what final expression this you use the matrix inversion lemma use the matrix inversion lemma then multiply this one multiply this and this this three matrices multiply and then this and this you add it. Then finally, you will get it this matrix A of t minus B or inverse B transpose B inverse B inverse B inverse B inverse B inverse B transpose of t p of t this is the first block you will get it and second block you will get it minus B transpose R inverse B B transpose B inverse B of t R inverse B transpose B of t. Then this you will get it p dot of t minus A transpose t p of t plus p of t plus A of t please remember that p is a symmetric matrix here we have just consider this p is a symmetric matrix the transformation what we have consider here this p is a symmetric matrix and say p is p is equal to p transpose of t. So, this plus plus this is inside the bracket this one plus p B R inverse of t B transpose of t into p of t plus q of t. So, this is the two one block then the two block what we will get it minus B inverse B inverse two block I am writing minus A of t minus B of t R inverse of t into this is continuation B of t R inverse of t into B transpose of t p of t. Now, you see this block A 1 1 block and A 2 block A 2 block is same as A 1 1 block preceded with a minus sign only. And other two A 1 2 block 1 2 block 2 2 block is this one that whole bracket multiplied by what x bar of t lambda bar of t. Now, this is the equation after transformation we got it this one. Now, I am telling you you this is the you see I you select p of t in such a way. So, that p dot of t minus of whole expression p A transpose p of t p of t A t all these things will be 0. So, you find out the p of t value in such a way. So, that this is assigned to a 0 it will be 0 or you can say I will assign this quantity is assigned to a 0 agree for that you find out what is the solution of p. That means this quantity I will assign to a null matrix of dimension n cross 1 agree this whole thing I will assign for that one you solve it p such that this equation is satisfied. So, if this is the so I can write it that A of t minus B of t R inverse of t A of t minus B of t B transpose of t p of t this is 0. And this is B of t R inverse of t B transpose of t agree this one and this one is minus of A of t minus B of t cross this is 0. This is the cross multiplication R inverse of t B of t and p of t p of t mind it this is just same as that one only p c d with minus. So, this whole thing I am writing this whole bracket after this because I have assigned this is 0 assigned to this is 0 in other words assign this one find out find out solution of that what is called matrix equation. So, that this expression will be satisfied find the solution of p for which this will be equal to 0. So, that whole thing multiplied by x bar of t that lambda bar of t agree. Now you see the this is the block diagonal form the Eigen values of this one this whole matrix Eigen values is nothing but Eigen values of this one and the block 2 to block Eigen values whatever the Eigen values of this block the Eigen values of this block will be same with opposite sign because it is special with a minus sign it will be opposite sign. So, this we can conclude this one that Eigen values of total state and costate vector Eigen values of this one is nothing but Eigen values of this block and union of Eigen values of this block and this Eigen values are same only difference is Eigen values of this one with preceded with a minus sign means opposite sign of that Eigen values will be here. So, let us call this is equation number 7 this is the equation number 7. Now we can see this one. So, we got it what we made it a conclusion that one that if you have a costate vector if you do the transformation of this one which we have seen the augmented cost state and costate vector can be represented into a upper block form the Eigen values of x star is nothing but Eigen values of this one Eigen values of lambda dot is nothing but a lambda is nothing but a Eigen values of that one with preceded with minus sign that is why we have seen it. So, our general boundary condition if you see boundary condition is given by H we refer our the terminal cost all this thing boundary condition t is equal to t f delta t f plus del s of del x t minus lambda of t this is minus lambda of t minus lambda of t this whole transpose t is equal to t f and delta x f is equal to 0. Since our what is called t f is specified since t f is specified because we have consider our problem that our aim is driving the our initial state x of t 0 to a final state x of t f t is equal t f near to the origin. So, t f is specified therefore, delta t f is 0 and our x t f near to the origin means x t f is not specified near to the origin and therefore, delta x f delta x f is arbitrary. So, then what is our boundary condition we are getting it here just see this one. So, this if you just put it here x delta s of this differentiate with respect to x t put t is equal to t f minus delta t is equal to t f this equal to 0. So, this therefore, we can write x t f is equal to if you differentiate this one if you see with x or if you go back to this one if you differentiate this thing that s term with respect to x and put t is equal to t f this you are differentiate. So, what will get it this one twice f x t and put t is equal to t f then it will be a it will come like this way. Therefore, lambda t f is equal to half twice f t f into x t f. So, this this cancel. So, f t f into x t f. So, if you do the block diagram representation of this one now we can find out our control law our control law if you see our control law is minus r inverse B transpose. Of lambda t solution of lambda t if you know it lambda t then I can find out the control law. Let us draw the our block diagram of this representation our reference input we have consider 0 because due to the initial condition what is this we are showing it this is B of t. So, this is our star and this is our integrated and this is x dot of t the output is x of t. Then this is coming is from here the state a of t and this is a if you just relate this one x dot is equal to a x a x plus B that must be u of t. Then this is this from there then this is this from there what is lambda u c lambda expression this is q of t. Then this is coming to here this is lambda dot of t lambda dot of t and you see the lambda dot of t what we got it here minus q x if you see this one lambda dot of t here lambda dot of t minus q x x t. So, x t is coming this sign is either you put it minus here or you put it minus here. So, this then a transpose lambda t. So, this is a integrated and integrated output is your lambda of t from there you are taking a signal a transpose minus a transpose of t. Then it is coming here or if you this agree. So, there is that lambda of t now coming here r inverse this is the r inverse of t agree this is the r inverse you see because what is this u of t. Just now we have calculated u of t by boundary condition not boundary condition u of t is equal to just we got it page number 3 that is u to t minus r inverse b transpose lambda of t. So, we have got lambda t r inverse b transpose. So, this is a minus sign if you keep it here agree if you keep it minus sign here or here it does not matter agree then this will be a u. So, that things are there. So, this is the our controller part if you see this is our controller part and this part is our system our given system and what is this one if you see this integrated we have a initial condition x t 0 is equal to x of t 0 sorry x of 0 x of 0 this one. We have a just now we have seen we know just now we have seen we know only what we know only our final costate vector final condition we know it just now we have seen it just now we have seen it this costate here this you see costate vector final condition we know it. That means we know lambda t f is equal to f t f x t f because we have we know x t f where we want to keep the final state agree near the origin near the our 0 that we near the origin we. So, x t f is the f t f that one. So, now this is corresponding to the costate system and this is corresponding to the state system state equation. So, now see this one how will you get the solution of this problem because we have to solve I told you that what we have to do it this now this. So, in order to solve this one we have to solve that final condition. So, note the final condition on lambda t and together with final condition on lambda t f on t final condition on lambda t together with x of t 0 and the Hamiltonian matrix to neon system. The Hamiltonian matrix to neon system what is the Hamiltonian system x dot of t and lambda dot of t that expressions at augmented system is the Hamiltonian system. Hamiltonian system of equation form that means final condition on this together with x t 0 initial condition of the state and Hamiltonian system form the 2.2 point boundary value problem. So, we have to now solve this equation knowing the lambda t and final condition on t f agree and together with the initial condition x t 0 and Hamiltonian system and Hamiltonian system is what x dot of this lambda dot of t from this augmented system what is the expression we got it with this we have to solve this. So, it is called 2 point boundary value problems. So, now look carefully see this one. So, how will you solve that one how you can solve that one that x t of that things because x lambda t f if the final condition of this one is known to you that lambda t f then we can solve this one in backward integration form. Now, see this one lambda t f t is equal to t f final condition t is equal to t f that if you know the lambda t f value lambda t f value then I can find out lambda t f minus the what is called previous state of that one that what is called if the step size is capital T f minus t I can find out by solution of differential equation in backward process and this whole thing is dependent on x 0 x t 0. If x t 0 is changed then it is also changed that solution of this one also change it. Now, how do you solve this one next question is how you will solve this problems that is our next. So, solution of this one is a if you see carefully this one this is a open loop solution in the sense it dependent on the solution of this one dependent of x t 0 x t 0 means x 0 of that one. So, now how to form it that remarks you can write it remarks that t p 2 point boundary value problem must be solved again if the initial condition change. If this initial condition is change we have to again you have to solve this one. Now, what is this one how you will get it this one x t f let us call the x t f is known where we want to keep our final state. Because I told you at t is equal to t is equal to t f it is specified that means we are looking for a control law u that will drive the initial state x t is equal to t 0 to a final time at t is equal to t f final time at t is equal to t f the state x is equal to t f will be near to the origin in final time. That is our problem so now question is this problem you have to solve in backward integration. If you know the x t f backward you have to integrate and solve this one and that solution depends on the x t 0. So, this is the if it is change. So, now we are looking for a closed form solution step 4 the closed loop optimal solution. So, how will you do this one we know how lambda is related at time t is equal to t f how lambda t f is related with x t f. So, assuming that structure of 8 we have what is the equation number we have given equation number let us call this is equation number 8 this is the equation number 8. Assuming the structure 8 lambda t f is equal to bracket you can write it that which one is x t f into x t f to relate the state and costate for all time for all time. We have lambda t is equal to f of p of t into x of t they are because they are at t is equal to t f is f of t f t f. So, you are telling that for all the time t is equal to f it is related with this one then at t is equal to f what should be the p t f same as f t f. At t is equal to t f p t f is same as f t f we know this relationship we got it from the boundary condition of that one. So, that is the boundary condition and that x t f will be near to the origin mean equilibrium point. So, if you consider this equation number 9 then differentiating this one both side we will get p dot of t into x of t plus p of t x dot of t put the value of x dot of t in the expression. Then we will get it lambda dot of t in that expression what is lambda dot of t it is nothing but a minus what is lambda dot of t we got it minus here lambda dot of t you see lambda dot of t from equation 3 possibly that you are 4 lambda dot t is nothing but a q of t into x of t minus a of t lambda of t. So, I will put it this values is there. So, it is q of t x t q of t x t minus a transpose of t lambda t again this equal to p dot p dot of t x t plus p of t and what is x dot a of t x t our system dynamic equation b of t u of t. So, after simplifying this one I can write it p of t after simplifying after simplifying we can write p dot of t plus p of t is equal to minus a transpose of t p of t plus p of t into a of t minus p of t b or inverse b transpose of p of t this product p of t plus q of t is that one this after simplifying we get that expression. Now, you see the solution of this one is not dependent on the initial condition of that one the solution of this one is not dependent on the initial condition. Whereas, when you have found out that this one lambda t f this one when you will solve this one when you will solve this equation in the backward integration the solution of this u is dependent on the x t x of 0 this one. So, and this equation this whole equation is known as matrix differential Riccati equation. In short m d r e is equal to m d r e is matrix and it is a non-linear differential equation that our problem is solve this non-linear equation differential equation. So, we must know our terminal conditions we know p t f is equal to f t f terminal condition is given from there we have to get the solution. We will discuss the solution of what is called matrix differential equation in details next class. So, we will stop it here now.