 programming problem using exterior penalty method. So, our problem statement is like this way minimize this function f of x, f of x is the non-linear function and it can be a get constant g of x also will be non-linear. So, our job is to solve this problem using the exterior penalty function method. So, the we construct first the penalty function as like this way that means whatever the constants are there that constant function that square you have to do the square and multiplied by a penalty coefficients. This one and then add with the objective function and this is the penalty function at the term associated with this one is called the penalty term and this tau of k is called the penalty coefficients. That this term mu j g j these values will be either 1 or 0. If the constants are that g i of just if these constants are satisfied in the other sense that if the point is on the feasible region then this value of mu j of this value will be 0. If the constant are outside the feasible region many infeasible region the value of mu j g is 1. So, that is what we have discussed last class this one. Let us take an example and explain how this problem can be solved by using the exterior penalty function methods. So, first thing that that what is called the penalty coefficients value how to select the penalty coefficient values are there. So, let us call this is the non-linear equation we have to minimize this one and subject to g 1 x is equal to 2 minus x less than equal to 0 another is x minus 5 is less than equal to 0. These two inequality constant can be retained into this form that x from here you can see both side you multiply by minus 1 that means minus 2 plus x is greater than equal to 0. So, x is greater than 2 from here x is both side you multiply x you see x is less than 5 that is this. So, these two constant equivalent to this if it is given one can write into a two constants x 2 minus x less than equal to 0 take x in this side and x minus 5 is less than equal to 0. So, if you plot this one it is a cubic function like this way when x is increasing x is 0 function will be 0 and x is increasing positive direction this function is strictly increasing of the power of x cube. Similarly, here also this function will be increasing like this way because x is equal to negative the function value is negative is you can say it is the odd function of this one. So, this is our x in the directions to our feasible region if you see lies between 2 to 5 this is our feasible region of that one. So, this that is what we are going to discuss last class. So, we can equivalently you can write it that one f of x is equal to if you see what we have defined f of x is the penalty term this term is this term is the penalty term f of x. So, that term I am just writing it now. So, f of x I can write it this equal to 2 minus x whole square if x is less than 2. That means, if x value is not in the feasible range then this f of x value is that one. Then if it is in the feasible region that f of value that means when x is less than equal to 2 and greater than equal to 2 less than equal to 5 that function value is 0 when it is because it is the exterior point penalty function method if you see by the things. So, when it is when this is greater than 0 means it is not in the feasible region that this m of f of x is g of x and more specifically if you see this expression that will be because when g of x is greater than 0 then maximum of this one. Maximum of this one means which one that g of x because g of x is positive quantity now. So, that what we are writing in other region we can write it x minus 5 whole square if x is greater than 5. So, this f of x is greater than 5 f of f of x function which is called penalty term penalty term can be region in infeasible region is nothing but a function square g 1 or square in this is another infeasible region this is g 2 square, but infeasible region f of x penalty term values is 0. So, this mathematically this two expression equivalently we have f of x is equal to max 2 minus x sorry 2 minus x comma 0 this whole square plus max x minus 5 0 whole square. Now, you see when it is in this region see here in this region when x is less than this quantity is positive maximum of that one you take, but whereas this one x less than 2 this quantity is negative maximum of this one is 0 this is not coming into the picture when x is less than this. Similarly, when x is greater than this this will come into the picture when this part will not come into the picture because this quantity is negative maximum of this one will be 0 this from only contribution is coming penalty term contribution is coming from this part. So, if you plot this curve now you see let us see this our if you look this one our feasible region is 2 to 5 and this is our x 2 to 5 is the infeasible region. Then when it is x is less than 2 in this region when it is less than 2 in this region then this value is what you see this value is this is a square term. So, this value when x is equal to this value is what when x is less than 2 1 point let us call 1.9 something that slowly it will increase and it is squarely it will go like this way because it is x minus 2 2 minus x whole square or x minus 2 like this way. Let us call this function weight is because that is multiplied by tau. So, if this tau value is tau 1 value is 1 then this is the expression now this tau value if I increase it then what will happen this is the same function increase means actually I am plotting it now tau of k f of x of k in the region x less than 2 I am plotting this one. So, tau of k I am considered 1 now tau of k I am increased by 2 let us call. So, this function value will be same only it is multiplied by 2 point by point. So, it will be like this way this is tau 2 is equal to tau 1 is equal to 2. Similarly, if you go on increasing it will be like this way and ultimately when tau is infinity this will come to a picture at this point it will be infinite values of that one. So, it will be like this way now similarly x is equal to when it is 5 x is equal to 5 this is 0 this is 0 that means this when x is greater than 5. That means when it is not in the feasible region similarly it will go like this way this is tau is equal to 1. Then you increase the value of tau increase the value of tau and this way and if you consider this is tau 1 this is tau 2 this one tau 2 this is tau 3 this is tau 4 then you can say that tau 1 tau 4 is greater than tau 3 is greater than tau 2 and greater than tau 1 then this is the curve. That means when tau is infinity then it becomes a what is called just at this way it will be very steep value of function value will come like this way. So, if you see this one when tau value is very smooth let us call tau is less than 1 it will be like this way similarly here tau is less than 1 it will be like this way. So, when you if you start the tau value very small value and approaching to in increasing it value and approaching to infinity then we are approaching from infeasible region to feasible region. Similarly, in this case when tau is this is the tau is let us call is 0.1 and tau is further increasing that means we are away from away from the feasible regions. If you increase the tau value we are approaching to the feasible value boundary boundaries of the feasible variables we are forming. So, in our iteration what will do tau value will start from a small value which is far away from the boundary layer boundary region and then next iteration we increase the tau value that means penalty coefficient value will increase it increase in an approach to the infinity in other sense it tells that we are approaching from infeasible region to feasible region and we are getting and then we are getting the optimal solution of that one. And in our example if you see this example it is straight forward it is straight forward what is the minimum value of the function in this region in this region if you see that one in this region what is the minimum value of this function just here. So, if you see this one what is the minimum value of the function at this in this region at x is equal to 2 we will get minimum value of this function agree x is equal to 2 because this region is 2 to 5 you increase the value x in this region function value is decreasing it is obvious from this figure and also you see you are approaching the values of tau from low value to increasing we are approaching to the optimum value of this functions at that at what point we will get the optimum value of the function that we are getting. So, let us work out some problems so before that I will just say because when you will solve this problem by analytically we have seen that we have to first find out the necessary condition what is the necessary condition for the non-linear problem. And then you find out the solution of this necessary condition a set of equation you will get it and from there you have to solve the values of that decision variables values. So, from the figure it is clear that f of x is really differentiable using chain rule now see this one this is a continuous function of this one so this function is differentiable. So, if you differentiate f dash of x this then what is this function see this I will do I will do the differentiation with respect to x then what will do this one then twice this will come twice then this differentiation if you do twice max 2 minus x 0 and the differentiation of that minus x this is a square differentiation minus x 0 and the differentiation of that minus x this is a square differentiation minus x is minus 1. So, it is a minus the procedure with minus 1 plus the second term differentiation the square 2 term will be coming to then differentiation of x minus 5 that means 1 that will come max of x minus 5 into 1. So, our values is now is like this way minus 2 max of 2 minus x that another bracket is there here max. So, this is not there so the max of this is this 0 here max of x minus 5 comma 0 bracket closed. So, this plus twice max bracket x minus 5 of 0 this one. So, this is the differentiation of that one that is the important relation when you are going to find out the non-linear problem solution linear problem solution we find the necessary condition first what is the necessary the gradient of that function when you will find out the gradient of this function this expression will come in the max expression of f of x that means what is called penalty terms this is the penalty terms. So, this so our if you recall our problem recall the penalty function what is this one p x tau of k is equal to f of x tau k penalty coefficient summation of how many inequalities condition is there j is equal to 1 to m inequality condition is there then max max g j x comma 0 this then this max whole square. So, this is our the penalty functions and this is the penalty term and this is the penalty coefficients. So, max of g out of this which one because our initial guess is the infeasible point. So, this value will be greater than 0 then and feasible region means x j of x is less than equal to 0. So, this and our problem is minimize this penalty function for x find out the value of x for which this is minimize, but tau k will supply the value of tau k from very small value. So, this is our problem. So, what is our algorithmic steps to solve such type of problems that non-linear algebraic problems with constraints using exterior penalty function method then what are the steps we have to follow and the steps are simple because first you have to take a one point which is outside the feasible region then infeasible region that point. And then you find out the necessary condition for this one second time necessary condition of this one solve it in terms of lambda sorry tau k. So, our first step is select an initial point solution x superscript 0 which is outside the feasible region which is outside and set tau 1, tau 1 value you set very low value. Let iteration starts with k is equal to 1 and next iteration k plus 1 by tau k this value is c with c greater than 1 say c value is 10. We have seen in this example if you see in this example when tau value is increasing this one this function value that is what is this function value that infeasible region agree that penalty function value is approaching to the optimal value functions that we have seen it. So, now you consider c is equal to 10 this one. So, first iteration tau k is equal to 1 tau 1 I have selected some small value then next iteration tau k plus 1 you select 10 times of tau 1 that is the first step is like this way. Next is step 2 use x superscript k minus 1 that first iteration what was the initial guess you have initial starting point you have considered use it that value use x k as the starting point to solve the unconstrained minimization problem UMP unconstrained minimization problem that means minimize x p x tau of k is f of x the objective function plus tau k you the penalty coefficient and summation of our inequality constraints. And that is written as max of g j g j of x this whole square this is the objective function minimize this one solve this minimization problems that optimization problems resulting if you solve this one resulting in a new solution let us call x superscript k you got it. So, now how you solve this one there are different ways already we have discussed our earlier lecture that if you have a non-linear problem is there with constant one can convert into a unconstrained optimization optimization problem then you can solve this problem unconstrained optimization problem by using steepest descent method Newton's method modified Newton's method and what is called the conjugate gradient method agree that different techniques you can solve this problem. So, after solving this problem step three that how you solve this one you know this function then you find out the necessary condition find out the gradient of this function agree because we have a n decision variables x 1 x 2 dot dot x n this x is a dimension is n cross 1. So, you will get n such type of equation n equation which is associated with max term agree each equation having a m max term because m max square term is that each equation. So, step three if all the constant are satisfied at x k that indicates then x k is a feasible solution and it also gives and it also and also the optimal solution of the original problem agree. So, that means if all the constants are satisfied all the constant means g 1 of g j of x less than equal to 0 because if it is not constant is satisfied indicates that we are now still we are in infeasible region then we have to do our iteration process we have to keep on doing until unless all the constants are satisfied. In other words until unless we have reached from infeasible region to a feasible region and that gives you the optimal solution of the problems. So, the whether we have reached or not one can check it that one function below f of x k that function below minus that is the stopping criteria f of this f of x k this mod this should be less than equal to epsilon and epsilon is the very small positive quantity. Another stopping criteria is there you find out the penalty function you find out the penalty function f of x. So, long it is in the feasible infeasible region that f of x value is positive agree. So, this value if it is less than some epsilon epsilon is greater than 0. That means if you see the or objective function or penalty function if this term is very small quantity agree if this term is very small quantity then you can stop the iterations of that one. That means this quantity f of x into tau sorry f of x into tau is small quantity then you can stop the iteration. That means you have reached the optimal solution that means whole thing is very small it is adding with the f x you see it is adding with the f x penalty function this is small whole quantity and then this is f x plus very small quantity adding. So, we have reached to the optimal value of the functions. So, this and last step suppose is this two criteria is not satisfied all the constraints are not satisfied not feasible region all points are not in the feasible region. Then what to do that means you are not reached to the optimal point then otherwise that means if the constraints are not satisfied at these are not satisfied then you do or this condition are not satisfied. Otherwise you do you go to step two go to go to step next step go to next step what is the next step go to next step what is the next step is you have to do because you have already got the values of input value of x 1 and x 2 that from the point which is furthest away from the feasible region. That is now approaching to the feasible boundary of the feasible region. So, what will do it now update the penalty coefficient for tau k plus 1 is equal to c tau k tau k you have assigned earlier you multiplied by c whose values is greater than 0 we have assigned c values is say say 10. So, 10 times you multiplied and start the process once again. So, regarding remarks that each of these iteration the constraints violates that the constraint violates the violation decreases. First remarks is the constraint violation constraint violations decreases at each iteration this is first because from each iteration constraint violation slowly it is decreasing means it is approaching to the feasible region. Second is in other words what is second is the solution is approaching from outside to the feasible region the solution is being approached from outside means infeasible region to the feasible region that is two things and ultimately the design approaches the design approaches the optimal values. Finally, design approaches the design approaches to the optimal value. So, this is the things first it is the iteration if we have gone increasing the iteration that it indicates that constraint violates decreases and next we can observe we are approaching from infeasible region towards the feasible region from infeasible region to towards the feasible region. And ultimately we will approach to the optimum value of the function or optimal at what point the optimal point will occur that will achieve. So, next is let us call we that solve this problems example or problem use the exterior penalty method to solve the problem non-linear problem solve the non-linear problem which what is the non-linear problem minimize f of x is equal to four one third x 1 plus 1 whole cube plus x 2 this subject to g 1 of x is equal to 2 minus 2 x 1 is less than equal to 0. And another constraints are there is minus 2 x 2 is less than equal to 0 our function f of x is a non-linear function and the two constraints are linear inequality constraints. If you see carefully what these two equation indicates this one our region is if you see carefully our region is here that this we can write it that minus 2 plus 2 x 1 is greater than equal to 0. So, x 1 is greater than equal to this implies this one is nothing but a x 1 greater than equal to 1 and that is one is with that x 2 is greater than equal to 0 this equivalently we can say this one is that this equivalently. So, if you see our region is x 1 value if you this is x 1 in this direction and this is x 2 then x 1 value is greater than equal to 1 in whole region is the feasible region and x 2 is greater than x 2 is greater than 0 that means the upper portion of this one is 0 that means our region feasible region is our that whole portion this whole portion x cannot be x 2 cannot be negative and x 1 varies x 1 value is greater than equal to 0 the whole region is this is our feasible region. But our problem is we have to solve the problem by using what is called penalty function method when exterior penalty function method then what you have to do this we have to convert into a what is called the standard penalty function form. So, our solution what is the standard problem. So, our penalty function is like this way x minus tau k is equal to objective function f of x plus there are two inequality constants are there tau k summation of j is equal to 1 to 2 there are two inequalities are there and this that is penalty terms we are taking into account max g j x 0 this whole thing square. When it is a when it is in the feasible region this portion g j is negative quantity and 0 maximum of this is 0. So, this term will come into picture when this g of j is greater than 0 g j is greater than 0 in other words it is in the infeasible region that means when it is in this region when it is in this region this is our infeasible region infeasible region when it is in this feasible region this term will come into the picture. If you write more other that more clearly that this one what is f of x this is our f of x the four one third x 1 plus 1 whole cube plus x 2 I have written the plus tau k what is the first term max i j is equal to 1 max i write it max g j means g 1 x comma g j 0 whole square the first term I mean in plus tau k max g 2 of x comma 0 this one whole square again. So, this is the two terms I have written like this way now next you see this one because if it is in the because we will start our exterior point means infeasible point we will take and in this situation this g value in infeasible minus exterior point g 1 of x value is positive g 2 value of this is positive. So, maximum of this and this g 1 x is 0. So, g 1 will write it and that square. So, this I will write it next is like this way. So, you can write it this g p x tau of k 4 then one third x 1 plus x cube plus x 2 this is this plus tau k tau k then if it is x 1 plus x 1 plus x 2. I am just writing same thing where the tau k this minus 2 x 1 just you say I am writing the value of g 1 k, because this I know in feasible region this value is greater than 0. So, maximum of this one will come g 1 value and what is g 1 value the max of this comma 0 out of this which one is maximum then that square plus tau k max then it is minus 2 x 2 0 then that square. So, that is our penalty functions we have to minimize that function with respect to x, because tau k is we have assigned some value very low value very small value of tau k not sorry very large value of tau k will assign initially, because we are starting from the far away from the feasible region that is what tau k is finality coefficient will start initially very large value. So, now you see this one analytically see that one tau value we are considering very low slowly you are increasing and approaching to the what is called feasible region. So, analytically the necessary condition the necessary condition. So, we have converted the non-linear optimization problem into a unconstrained constant non-linear optimization problem is a converted into a unconstrained optimization problem by employing the what is called by adopting the exterior point penalty function method. That means, we will take the initial guess the outside the feasible region exterior point and then slowly approach to the feasible region. So, our necessary condition is what del p dot del x 1, because lambda 1 is known to us this what is this values if you differentiate this with respect to x then what will this coming that this that before it will come x 1 plus 1 whole square first term, because you differentiate with x 2 will not be there. The second term will come twice tau k is constant then max 2 minus 2 x 1 comma 0 bracket this one. I am differentiating with respect to x into that it is minus 2, if you differentiate this minus 2 that equal to 0 there is this term there is no x. So, ultimately it is coming or 4 this is 2 to 4 cancelled. So, I will write x 1 plus 1 whole square minus this is minus tau k max this twice minus 2 x 1 twice minus 2 x 1 comma 0 this again. So, this is equal to 0. So, let us call this is equation number 1. So, you see here you see here that when it is a infeasible region this quantity this quantity is positive infeasible region means when x value is less than 1 when it x value is less than 1 this value will be positive quantity I will take this quantity only. So, let us now next is there are 2 decision variables are there del x 2 is equal to if you differentiate this with respect to x there will be a 4 x first term there is no x 2 term here x 2 is here then it is twice tau k max minus 2 x 2 0 then into minus 2 is equal to 0. So, again if you 4 you cancel it 1 minus tau k max minus 2 x 2 0 is equal to 0 let us call this is equation number 2. So, this is a necessary condition is this you got it then 1 can write it from equation 2 and 1 and 2. So, let us consider we are in the because we are started with a infeasible region means exterior point assume 2 minus 2 x 1 is greater than 0 this implies x 1 is less than 1. So, what is we can say this indicates that means this is our g 1 x is greater than 0 that means we are taking a point which is outside the infeasible region that is that whole thing. So, this implies that first constraint is not met is not met and this leads leading to max 2 minus 2 x 1 0 is equal to 1 2 minus 2 x 1 so this because this is a positive quantity in the infeasible region. So, max of this one is this. So, now from 1 from this equation from this equation what we can write I will write the value of this one is nothing but a 2 minus 2 x 1 only. So, from 1 I can write it x 1 plus 1 whole square from equation 1 from 1 minus see this one tau minus tau k into that one 2 minus 2 x 1 minus tau k 2 into 2 x 1 this equal to 0. So, this is known in the sense if you do iterative method this is known otherwise this is unknown then what is the I can easily find out the value of x 1 in terms of tau agree. And that tau slowly if you increase the value of tau k each iteration and when tau k is very large we will approach to the what is called the optimal solution that is what we have shown it here. If you see this one when tau is increasing we are approaching to the this called the optimal value of the function. So, now see this expression how x 1 can be written in terms of tau k. So, this is x 1 square plus twice x 1 plus 1 minus twice tau k plus 2 tau k x 1 is equal to 0. So, now you see x 1 square plus x 1 square plus 2 tau k square. So, if you take the 2 common 2 common if you take then 1 it will become 1 plus from this one and this one 1 plus tau k x 1 then what is the remaining part is left 1 minus 2 tau k is equal to 0. So, I can express x 1 in terms of tau k now. So, what is this one minus this one minus b 1 plus tau k plus minus this square means 4 1 plus tau k whole square minus 4 this coefficient is 1 4 and this is 1 minus 2 this if you take it common 1 minus 2 tau k divided by twice. So, 4 you take it out. So, it will ultimately will come 1 plus tau k plus minus then what will be there 4 this 4 cancel if you expand this one if you expand this one 4 and this 4 will be cancel from here you will get 8 from here 8 tau k here is plus 8 tau k agree. So, in total you will get it if you consider this one 4 plus 4 tau square tau k square plus 8 tau k minus 4 plus 8 tau k agree. So, this this cancelled and this 4 tau square 4 tau square minus 4 tau k. And this is the 8 what is this 2 8 and this is 4 into 2 8 plus 16. So, now we have taken this out 4 we have taken out agree. So, it is left with this is left with that one only 1 plus tau square plus 2 tau k minus 1 plus 2 tau k minus 1 plus 2 tau k minus 1 plus 2 tau k agree. So, ultimately I will get it this one is 1 minus 1 plus tau k plus minus if you tau square this this cancelled. So, tau square is there. So, tau k and you will get it root over 1 plus 4 2 8 plus 2 2 8 plus 2 2 8. So, 2 2 4 4 tau k agree now out of this plus minus sign which one we will consider note note the positive sign is closer to the feasible region rather than negative sign. So, we will consider the positive sign in this case. So, our x is equal to x 1 is equal to minus 1 plus tau k plus that you can write it tau k square plus 4 tau k. Suppose, if you go take it inside this if you take inside it is like this way. So, we have we have taken tau k in that sense means the plus sign if you consider the x 1 is closer to the hour what is called feasible region x 1 is closer to the feasible region rather than if you consider minus sign it is far away from the feasible region. So, similarly we can do similarly assume 2 x 2 is greater than 0. The second that is what g 2 x is greater than 0 means it is a infeasible region. So, if g 2 is greater than 0 the second constraint is not met. So, from equation 2 from equation 2 that one we just say that if you consider from this equation 2 that necessary condition from equation 2 we can write it 1 minus tau k because this quantity is positive. So, I will write it minus 2 k. So, into minus 2 x 2 is equal to 0 agree. So, this so that will be 1 plus 2 tau k x 2 is equal to 0 I do. So, this equal to x 2 is equal to minus 1 divided by tau k. So, let us call this equation number 4 this is equation number 2. Now, you see this one this and this when tau k approaching infinity very large values this merge to a 1. So, from 2 or from 3 equation from 3 tau k when tau k is tension infinity from 3 x 1 transform x 1 optimal value of this one is minus 1 plus tau k that is I am writing from 3 is tau k 1 plus 4 tau k half. So, if you expand this thing binomial expression because you cannot put tau is equal to infinity because one is negative one is sorry infinity 1 by infinity 0 that tau k is your infinity this. So, you cannot do it do this what is called binomial expansion. So, if you do this one it will be 1 plus tau k plus tau k 1 plus 4 tau k into half plus higher term. Now, you push it tau k. So, 1 plus tau k plus tau k then it is a 2 this this cancel to this and other terms when tau k tends to infinity this will be 0 other term will be infinity 0. So, this will ultimately it will be a 1 and similarly from 4 x 2 star is equal to if you see 1 minus 2 tau k is tau k tends to infinity this is 0. So, our optimal value of this one x star is equal to x 1 star x 2 star that value is equal to 1 0. So, this is the optimal solution by using the mathematical analytical expression using the necessary condition this one and express x 1 x 2 in terms of penalty coefficients. This is the solution this problem one can solve it by iterative method also that we will discuss next class.