Lecture 04

IIT Kanpur July 201
20 followers
Oct 23, 2023
Very good morning, welcome you all to the NPTEL course on economic operation and control
of power system and today we are going to talk about optimization preliminaries means
fundamentals section 1 of lecture 4.
So importantly when we are talking about power system most of the mathematical representations
as well as equations they are not purely linear sometime they are linear sometime
they are non-linear as well as we need to optimize the overall cost of generation to
meet the required load.
So when you talk about optimally utilize the generations to meet the load that means we
need to understand optimization.
So probably the detail of optimization direct application to power engineering we will talk
in due course of time but before that we need to understand what is optimization and
how that can be applied to economic operation and control of power system course.
Now when you talk about optimization let me go back to your plus 2 fundamentals.
So during plus 2 we have been taught that you know a function is you know to optimize
any function we take a function f of x then we differentiate equal to 0 then we go for
second differentiation and then we substitute those values if it is positive then that point
is minimum if it is negative that point is maximum that is what actually has been taught
to us during school days.
But now the scenario is almost same fundamental but we need to address many more complicated
problems today.
Now optimization process aims to minimize or maximize a certain objective to achieve
most optimal but feasible solutions.
Now you need to have a function which is normally called as objective function and that objective
function could be a linear or non-linear function most likely it is non-linear and that need
to be either minimized or maximized.
Now we need to have different limits imposed on the optimizing process are called constraints
for example if I am interested to know the generation output of a particular power plant
that is P and that value of P must be less than its maximum generation and more than
its minimum generation.
So many times I have told you that if there is a cost characteristic for example yeah
so just what I will do I will just demonstrate it yeah.
So if this is going to be my cost characteristic and if this is my P minimum and this is my
P maximum so probably within this range you have to change your P. So to me the P max
is the maximum limit and P min is the minimum limit and hence that is my constraint.
So P must be I can rewrite that P must be less than or equal to P maximum and greater
than or equal to P minimum all right.
So this is the equation is known as my constraint equation ok.
Now similarly we can also find out the reason bounded by constraint is known as feasible
reason the area within which for example if a space is given to you, you can identify
a zone in which my optimal point lies ok so that is my reason bounded by the constraint
is known as feasible reason for the optimizing process.
Now optimal solutions should lie at the border of a feasible reason means ideally they do
occupy a point which is mostly at the extreme point because you optimize it.
Now local optima is a very common term because there are few functions which are keep on
oscillating and probably they are not convex functions.
Let us say if I do talk about a function all right which is keep on oscillating and in
that if this is my point of operation the gradient at this point is certainly at that
optimal point is going to be 0 because it is just a constant point to me and the tangent
which is different there.
So at this optimal point the differentiation of any function equal to 0 there is no doubt
about it and that is also true at this point that is also true at this point that is also
true at this point.
So you will find many points where my difference is not equal to 0 or the gradient is something
different.
Now what happens if I take the starting point of my optimization is x then probably it will
keep on moving and the moment the gradient is 0 or the differentiation is 0 it will say
oh you are reached your optimal and the program exists ok.
So it will tell you the optimal point is this is my x dash is the optimal point.
However, there is another optimal point which is lying here all right.
So that is not visible to this fellow because if the starting point has chosen in such a
manner that it lie down at this point and accept oh this is my optimal point.
So this is my some sort of optimization, but it is known as local optimal ok.
But if you find many local optimal points if you would have started from here I could
have got this point.
If I would have started from here I could have got this point.
So now what is happening depending upon your starting point you get an optimization point,
but which is not necessarily to be optimum.
So that is my local optimum, but if you take all the local optimals of your function and
then take the best out of which will give me the global optimum.
So global optimum is defined as a point whose objective value is best among all the points
present in the feasible region and also the constraint functions and simple variables
limit are lumped under the term constraint.
So everything can be put in a constraint form and if the constraints are such that no such
region exists means if I do say that my p is of range a to b and I am not getting any
solution within that range.
So probably I will say there is no solution exist which means that there are no values
which satisfies all the constraints.
So it may so happen I may tell that ok just for an example the range within which you
have to find a point probably do not lead to an optimization and that is possible and
hence we say there is no feasible solution there is no reason exist to carry out optimization.
Now optimal problems you know they are different types one is unconstrained and the second
one is constrained.
Unconstrained means the whole space is yours and you choose a point which is less likely
in a practical problem.
So practical problems are always constrained, but in textbook for our understanding we solve
unconstrained optimization for learning constrained optimization.
So before you get into constrained optimization you need to understand what is unconstrained
optimization.
Now there are different type of unconstrained optimization problems one is single variable
or could be multivariable.
And those multivariable optimization problems and single variable optimization problems
could also be having equality constraint and it can also have inequality constraints.
Equality constraint means I may say my variable y which is equal to 5 or I may say my variable
y which is greater than or equal to 5.
So now what happens it could be one is equality the other is inequality and the function could
be f of x which is x square plus 3 is a function which is a non-linear function.
And if I do not have any constraint only I have to optimize this function then that is
my unconstrained optimization problem, but if I have to do this and put the variable
for example f of x equal to x square plus 3 and x must be less than or equal to 5.
So then that optimization problem become a constraint optimization problem of single
variable.
I can also have f of x which is x1 square plus x2 square plus 25 where x1 is less than
or equal to 3 and x2 is greater than or equal to 5.
So now it is a multivariable inequality constraint optimization problem.
So you can find many problems of this order.
Now to start with as fundamental what do you understand by unconstrained single variable
optimization problem.
So it is simple.
So you have a single variable which is x and the function which is f of x.
So first of all what you need to do you have to differentiate and equal to 0 that means
if the objective function is f of x you have to differentiate which is f dash x need to
be equal to 0 f dash equal to 0 you can see from equation number 4.1.
But now the question is when you make that equation equal to 0 how do I find the minimum
and maximum values that is the question because f dash x equal to 0 does not guarantee that
you are at optimal point but even if you are at optimal point it does not once again
assure you that are you at actually maximum point or minimum point.
For example if I draw a characteristic now at this point my f dash x equal to 0 at this
point also that f dash equal to 0.
Now my question is this leads to a minimal point and this leads to a maximum point.
So you need to identify.
So first condition f dash equal to 0 means you reach to you are going to reach to an
optimal point but you need to identify whether they are minimum or maximum points.
Now for that what you need to do you need to identify whether f dash x f double dash
x up to f n x exist and then f dash x f double dash x up to f n minus 1 x equal to 0 and
the last differentiation that is the nth differentiation must not be equal to 0 then
the following conclusion can be made.
So if the last differentiation that is the nth differentiation of the variable x if it
is not equal to 0 that means it is either positive or negative.
If it is positive then you are leading to a minimum point and if it is negative then
you are leading to a maximum point.
However if n is odd if however the n is odd and then x is a point of inflation and that
is very important because for even differentiation you can get maximum minimum but when n is
odd then the point x is leading to an inflation.
We will see a small example next slide.
Let us consider one simple example equation 4.2 f of x is x to the power 5 minus 5 x 4
plus 5 x cube plus 5 I will optimize it.
So this is a kind of assignment you can take up and what you have to do first you differentiate
simply and the 4.3 as you could see it talks about 5 x square into x minus 1 into x minus
3.
If I make this equal to 0 what will happen that means x equal to 0 I will get three values
x equal to 0, x equal to 1 and x equal to 3 is it okay.
So now when x equal to 0 you go for second differentiation now so that is been given
to an equation number 4.4 and you differentiate and substitute the value of x equal to 0 you
get second differentiation and then if you put the next value x equal to 1 you will get
another value when you put x equal to 1.
So probably this is going to be 20 minus 60 plus 30 is equal to minus 10 which is less
than 0 and hence x equal to 1 the point which is my maximum point.
Similarly if I put x equal to 3 the answer is actually 210 which is greater than 0 which
is positive and hence it is the minimum point.
So it has been given in a small box as you could see that by substituting x equal to
1 and x equal to 3 you get a negative value and you get a positive value and that shows
which is the maximum point and minimum point.
Now similarly if I extend this problem to a multivariable it is unconstrained but multivariable
instead of one variable you can have multivariables.
I will just tell you what is the importance you will be surprised to see it is a course
on power system, economic operation, control system and we are talking about optimization.
My dear friends when you try to solve a problem there are thousands of generators and those
generators you need to find the optimal power output of each generator and they are P1,
P2, P3 up to Pn.
So it become a multivariable problem.
So you cannot optimize one generator and say I have achieved optimized solutions no you
have to optimize not only P1 but you have to also optimize P2, P3 up to Pn and hence
all the power system optimization problems are constraint multivariable problems, constraint
as well as multivariable.
So now we are focusing on unconstrained multivariable.
So similar to unconstrained single variable you can solve the problem for multivariable
where you have to take the partial differentiation dou f of x upon dou x1 and dou f of x upon
dou x2 as well as dou f of x upon dou xn need to be made equal to 0, okay.
So it is a partial differentiation concept and you will also try to understand the sufficient
condition for minimum or maximum is similar to what we have discussed.
Now it says that assuming all the partial derivatives of f of x up to the order k to
be existing and continuous.
So in the neighborhood of a stationary point x if my d of f of x equal to 0, all right
but d of f of x is not equal to 0.
So this is my rth differentiation and this is my kth differentiation, all right.
Similar to the first and second difference this is the rth differentiation and kth differentiation
then the following holds good.
What it says if k is even x is relative maximum if dk of f of x is positive.
Similarly if k is even x is relative maximum if dk of actually x is negative.
So it is the same thing that k need to be even if it is positive leads to minimum if
it is negative lead to maximum.
But if dk of f of x equal to 0 then you cannot say it is maximum or minimum it is something
different.
Now if k is odd then x is not an extremum, okay and if dk of f of x takes both positive
and negative values then x is a subtle point which is a very very boundary oscillating
point of optimizing characteristics.
Now when you talk about constraint optimization I want your attention here very seriously
because all of our problems in power system that we are going to discuss are constraint
optimization problems.
So the one important part is method of Lagrangian multipliers being used to handle constraint
optimization.
I will tell you what is constraint optimization, how it has been handled.
Now let us say I do have a function f of x which is known to me and then I do have some
constraints, okay.
So f of x is my function objective function and whereas actually constraints let us say
they are actually you know kind of actually beta of x, okay.
So this is objective function and this is my constraint.
Now when you optimize you need to have a single function which need to be differentiated.
So what you ideally do this constraint function beta of x being merged with f of x through
a multiplier.
So you have the objective function f of x plus a multiplier times beta of x, okay become
my objective function, all right.
So then you are accommodating those constraints into your objective function through a multiplier
and mostly it is known as Lagrangian multiplier, okay.
So let us first concentrate on a problem of minimizing a function of two variables x1
and x2 with one equality constraint.
We will then generalize the method for any number of variables, okay to understand first
actually two variables and one constraint.
So what are those variables x1 and x2?
So what I am supposed to do?
I am supposed to minimize a function f of x1 and x2 subject to the constraint g of x1,
x2 equal to 0, all right.
So you have an objective function that need to be minimized, all right and there is a
constraint, equality constraint where a mixture of x1, x2 relationship equal to 0.
Now what did you do?
Simply differentiate dou f upon dou x1 and similarly dou f upon dou x2, there are two
variables.
If there are n variables, you have to differentiate n times but for two variables, you have to
differentiate two times.
So after differentiation, you equal to 0 and then the first differentiation once you get
it dou f that is dou f upon dou x1 into dx1 plus dou f upon dou x2 into dx2 which is equal
to 0.
Now the constraint g of x1, x2 is always maintained and hence we can also do it dou g which is
dou g upon dou x1 into dx1, dou g upon dou x2 into dx2 equal to 0 and assuming that dou
g upon dou x2 is not equal to 0 that is the constraint of the function.
So probably the same equation can be expressed as dou f upon dou x1 minus dou g upon dou
x1 upon dou g upon dou x2 times dou f upon dou x2 into dx1 equal to 0.
So this is the simplified version and since dx1 can be chosen arbitrarily, one can get
the following after rearranging, this equation you can launch at the end.
Now without delay, what we need to do a quantity lambda is now defined.
What is lambda?
Lambda is a constraint which talks about dou f upon dou x2 upon dou g upon dou x2, okay.
So this is what the lambda we have considered and when you substitute this value lambda,
my original equation that we have discussed, okay.
Now just a minute, just if I go to the previous one that 4.16, okay 4.16.
So this equation is basically 4.16, okay can be now rewritten as dou f upon dou x1 plus
lambda time dou g upon dou x2 equal to 0.
So this is a very very important expression for two variable constraint optimizing equation.
So what you have to do dou f the objective function with respect to x1 variable plus
lambda time the constraint with respect to x2 variable now equal to 0.
So finally, one can also rewrite that the equations, the overall equations now can be
represented as L of x1 x2 lambda.
Why we say x1 x2 lambda?
Because it is two variable x1 x2, but lambda is also a variable, okay.
So totally there are three variables.
In a two variable problem, you will have three variables including lambda which is nothing
but my objective function f of x1 x2 plus lambda time g of x1 x2.
So this is the objective function with Lagrangian multiplied.
Now if you talk about a simple unconstrained optimization problem, you can solve many problems
that is f of x1 x2 which is given as 0.25 x1 square plus x2 square and you can solve
this problem easily by taking different variables and you can differentiate with respect to
x1 and x2 equal to 0 and then you get the gradient of that equation and then you can
get the optimization value for both x1 and x2.
Now when you try to minimize a linear equation just for your understanding because I thought
of just touching upon all the solution processes available for optimization for your own benefit,
but we are not supposed to get too much detail into the optimization course here, but for
your own benefit if you like to minimize your function which is 0.25 x1 square plus x2 square
with a constraint of omega times x1 x2 equal to 0.
So then where omega x1 x2 equal to pi minus x1 minus x2.
So now we need to optimize this equation subject to your x1 x2 satisfy this one means if I
rewrite it, so this is nothing but pi which is equal to x1 plus x2.
So the condition is that you optimize the original equation 4.24 subject to x1 plus
x2 is always 5.
So it could be 4 plus 1, 3 plus 2, 2 plus 3, 4 plus 1 and 5 plus 0 any option is there.
So you could see through that actually you get a function where f equal to x1 equal to
4 and x2 equal to 1 and provides you the maximum value and you can substitute.
So 4 square into 0.25 is 4 and 1 square, so the object function is now 5.
So f of 5 is the function with x1 equal to 4 and x2 equal to 1 satisfies the maximum
point.
So this is how actually the optimization problems are solved and probably I will just take you
go through the different type of problems available to you.
So you can perhaps actually identify the gradient vectors of any function and that
will give an idea where the optimization points are lying.
So I will move further and then just to yes, so we will try to solve a simple problem for
our benefit.
So equality constraint simple optimization one numerical example let us solve.
So in the graphical method we saw how the solutions are lying at 4 and 1 but now let
us solve through Lagrangian multiplier.
So what has happened what is my objective function 0.25 x1 square plus x2 square and
as I told you lambda times the constraint.
So if my constraint was x1 plus x2 equal to 5 I can say 5 minus x1 minus x2 equal to 0
and that is nothing but this constraint.
So now you have a function with you.
So what you have to do you have to differentiate.
So there are 3 differential values one is actually dou L with respect you have to differentiate
with respect to x1 then you have to differentiate with respect to x2 then you differentiate
with respect to lambda because there are 3 variables.
So 3 variables and 3 equations, what are those equations as you could see the first equation
gives you 0.5 x1 minus lambda equal to 0 2 x2 minus lambda equal to 0 and then 5 minus
x1 minus x2 equal to 0.
So there are 3 equations and 3 variables and you have to solve and the solutions are x1
equal to 4, x2 equal to 1 and lambda.
So probably you could see either you use Lagrangian multiplier or even you from this equation
linear equality constraint equations you could see that they both are satisfying.
So but in power system we will try to solve most of our equations through this equation.
I will just try to emphasize little bit here in power system engineering what happens this
x1 and x2 are nothing but majorly my variables p1 and p2, p1 and p2 are nothing but the power
output of the plant 1 and 2 and it can go as maximum as pn and what are the constraints?
Constraint means for example p1 plus p2 for example equal to 300 megawatt.
So I want to meet the total power of 300 megawatt out of 2 generators.
So then you can form this equation that p1 plus p2 minus 300 equal to 0.
So that will appear in this zone and the objective function is nothing but my cost characteristics
which are nonlinear.
So they are ideally ap square plus bp plus c and similarly it could be p1 square bp p1
c or sometime it is p2 square plus bp 2 plus c.
So they are nonlinear equations will come in this zone.
So you have cost characteristics of the power plant to generate p amount of power how much
money you have to spend.
So my objective function will be now the summation of the cost characteristics of cost functions
plus lambda time the constraint and that will help me to understand what is p1 p2.
So once the objective function are known to me the constraints are known to me I can easily
calculate the value of power output of each and every power plant and that is why it is
important for you to understand what is simple optimization with equality constraint with
multiple units.
Then you can have many more complicated problems this is just a journey for all of you and
additional equality constraints.
So I request all of you to get into mathematical optimization sections or any optimization
text books linear optimization nonlinear optimization you can focus on to know much
better on the subjects.
So this is how the inequality constraints are being satisfied and then what is inequality
constraint.
So inequality constraint means you could see now previously used to say gi x which is equal
to 0 but now we are saying that gi x is less than or equal to 0 and then how do you handle
it.
So if I say my MVA flow in a particular line is less than or equal to 100 MVA this is the
line 1.
So this is some sort of my equality inequality constraint that also can be incorporated in
our optimizing problems.
So when we talk about Kuhn to Kohl conditions and then there are different applications
of those equality constraints and this is how the problem when we talked about inequality.
So you could see that this is my objective function and there is an equality constraint
as well as there is an inequality constraint.
So how do you optimize a function which has a equality constraint as well as inequality
constraint.
So you could see the functions which is my equality constraint characteristics and then
I have the inequality cost function characteristics and then I probably satisfying those both
I have to find my optimal points.
So you can take one numerical example.
So what you have done for example if this is my objective function and this is my equality
constraint with the inequality constraint.
So instead of lambda I have added one more variable that is mu.
So the first condition with equality and inequality constraints are the dou of L upon dou x1 must
be equal to 0 dou L upon dou x2 must be equal to 0 these are the two immediate differentiation
and then the second condition is 5 minus x1 minus x2 equal to 0 that is differentiation
with respect to lambda and then the third condition which is going to be this one and
the fourth condition which is very interesting here that the mu of this must be equal to
0.
So how do you solve that is a bigger challenge here.
So the first you have to find a solution with a test possibility.
So you have to substitute mu equal to 0 and then you get three solutions like x1 x2 lambda
and then you can keep on changing the value of mu to different values you get different
solutions and then when all the conditions are met then you conclude what is the value
of solution.
So here the solution optimal solutions are not easy as similar to your equality constraint.
So when you get into inequality so there is a iterative method through which you will
get your value of x1 x2 lambda and I strongly recommend all of you to get into wonderful
textbooks and the examples are put in Lohenberg and some other optimizing textbook to understand
both equality and inequality.
But nevertheless I tried my best to make you understand how to obtain those solutions when
the non-linear optimization with equality constraints as well as inequality constraints.
Thank you very much.
