Dear Professor Zimmerman

Many thanks for your time and feedback.
 Sorry for the following long message. I've tried to shorten it as much as
possible.

    Regarding to your earlier reply *i.e., **Of course, there is no way for
me to know if the updates to X produced by your algorithm make sense or
lead to a convergent solution.,* I agree with you. However, I can point out
some hints that may clarify my question. I am running a multi objective
congestion management framework to mitigate congestion in power system. In
this framework, congestion is released by rescheduling of generations and
loads.   Rescheduling is modeled by considering up and down generation
shift and up and down load decrements and also load shedding. There are10
generation units and 19 loads in New England test case. Therefore we have
(2*10+2*19+19=77) design variables(Please note that the number 2 is added
to consider both up and down values, the last 19 variables are for load
shedding). For the sake of simplicity and conciseness, I explain the pseudo
code of e-constraint MMP method for solving this problem and show where
this updating of generation and load (described in first email) is applied.
Let's assume we have 2 objective function in this framework i.e.,
F1(.)=Cost of congestion, F2(.)=Stability index. F1 and F2 are both
explicit functions of [X1,X2,...X77]. where [X1,...,X10] and [X11,...X20]
are up and down generation shifts  i.e., for Unit j we have DP{j,up},
DP{j,down}. [X21,..X39]  and  [X40,..X58] represent the up and down
demand rescheduling,
for load K we have  DP{k,up} and DP{k,down} . Other elements of vector X
(58 to 77) are assigned for load shedding. (D indicates DELTA or difference)
So the cost function is expressed as follows:
F1(.)= B{j,up}*DP{j,up} + B{j,down}*DP{j,down}+B{k,up}*DP{k,up}
* B{k,down}*DP{k,down}+B{k,shed}*DP{Dk,shed}.
Where B is a vector that contains the corresponding  bids of each action.
For example the ISO must pay B{1,up} $ for asking unit 1 to increase the
generation per MW.
F2(.) is also defined explicitly with the design variables. Some constant
which are derived from sensitivity analysis are used to calculate this
security index.
F2(.)=Sum (  M(j) [DP{j,up} +DP{j,down}]  )
some constraints of this MMP problem i.e., bounds of design variables ,
are easily applied to solver (fmincon) of this MMP problem. But there are
some other constraints that cannot be easily calculated such as nodal
balance or min-max of buses voltage and line loadings. To consider these
implicit constraints I use MATPOWER power flow. and update generation and
load values for next iteration of fmincon solver.
Here is the pseudo code:
% e-constraint scheme
Minimize  F1(X)
Subject to: all constraints
                  F2(X)> e{i}  % i=1:5
This scheme is run for N times . Therefore, N solutions are obtianed.
So we can expand this pseudo code as follows:

for i=1:5
[X_temp,F_temp]=fmincon( 'F1',
Xstart,[];[];[];[];VLB,VUB,@(X)constraints(X,i))
end

function f=F(X)
F1(.)= B{j,up}*DP{j,up} + B{j,down}*DP{j,down}+B{k,up}*DP{k,up}
* B{k,down}*DP{k,down}+B{k,shed}*DP{Dk,shed}.
end

function [C Ceq]=constraints(X,i)
% first the explicit constraints are defined. like this:
 C(1)=    X(1)-X(11)-750;
% then implicit constraints are considered. for line loading we have:
define_constants;
 mpopt = mpoption('OUT_ALL', 0);
 load_set=[1,3:4,7:9,12,15:16,18,20:21,23:29]; % Buses that have loads.
 mpc.gen(1:10,PG)=mpc.gen(1:10,PG)+X(1:10)'-X(11:20)'; % This is where I
need to update the generation values (PG). In each iteration, DP{j,up}
and DP{j,down}
i.e., Up and Dpwn generation shift, are added to initial value of generator
active power.
 mpc.bus(load_set,PD)=mpc.bus(load_set,PD)+X(21:40)'-X( 41:59) % I ignored
load shedding for the sake of simplicity.
 RES=runpf(mpc,mpopt);
 flow_from = sqrt(RES.branch(:, PF).^2 + RES.branch(:, QF).^2);
 flow_to = sqrt(RES.branch(:, PT).^2 + RES.branch(:, QT).^2);
 flow = (flow_from + flow_to)/2;
 loading  = flow ./ RES.branch(:, RATE_A);
 max_loading=max(loading);
 C(2) = max_loading-1;  % Inequality
% At last e-constraint method constraint is considered.
  C(3)=F2(X)- e{i}  % the values of e1,e2,...,e5 are defined before.
end
----------------------------------------------------------------
Also, I wanted to know, is there any more efficient way to consider lines
loading and other implicit constraints?
In other word, how can I consider nodal balance constraint, Vmin<V<Vmax and
lines loading without running power flow?
For example the constraint of constraint of active power nodal balance for
all system buses is calculated this way in many related paper. (I couldnt
implement it )
 PGn -PDn=abs(V{j}) sum(abs[Y{h,n} .V{h}]*cos(d{n}-d{h}-tetha{n,h}))
where n is bus number. h is a set of all system buses. h is the bus that
connects Y to n.

to calculate each point (considering e1,..e5, we have 5 points here),
fmincon should call 'constraint' sub-function many times(500). Hence, the
power flow is run in each calling and this impose a lot of computational
burden to this problem (it takes hours to find all 5 points).
This computation time doesn't make sense in mathematical programming (how
ever in heuristic methods it is the normal way of considering nodal balance
and ... ).

Also, I think I should not be worry about nodal balance constraint provided
that I use power flow already to check lines loading. is that right?


Thanks in advance.






On Mon, Apr 6, 2015 at 5:30 PM, Ray Zimmerman <[email protected]> wrote:

> I don’t see any issues with the way you are calculating the line loading
> constraint, except that any branch(:, RATE_A) entries equal to zero,
> indicating and unconstrained branch, would cause problems. Of course, there
> is no way for me to know if the updates to X produced by your algorithm
> make sense or lead to a convergent solution.
>
>     Ray
>
>
> On Apr 3, 2015, at 11:17 PM, Electric <[email protected]>
> wrote:
>
> Dear Manish Thapa
> No. This is not about modeling a battery. I am trying to solve a multi
> objective optimization problem which have 3 objective functions. first
> objective function is Cost of congestion management and the other objective
> functions are security indexes.
> All of these 3 objective functions are functions of a design vector
> [X1,X2,...X77]. where [X1,...,X10] is up generation shifts of unit j i.e.,
> DP{Gj,up}. [X11,..X20] is down generation shifts of unit j i.e.,
> DP{Gj,down}.[X21,..X40] represent the DP{Dk,up}. Other elements of vector X
> are assigned to DP{Dk,down}  and load shedding analogous parameters of V
> demand side bidding. (D represent Delta : Pold-Pnew
>  Cost1= B{Gj,up}*DP{Gj,up} * B{Gj,down}*DP{Gj,down} + B{Dk,up}*DP{Dk,up} *
> B{Dk,down}*DP{Dk,down} +B{Dk,shed}*DP{Dk,shed} .
> B sets are the cost of each actions. for example B{Gj,up} is cost of up
> generation shift for unit j.
> Other objective functions (security indexes) are also functions of these
> sets ,[X1,X2,...X80] or  [ DP{Gj,up}, DP{Gj,down}, DP{Dk,up},
> DP{Dk,down},DP{Dk,up}, DP{Dk,shed} .
> So, I have a set of mathematical equations to calculate objective
> functions. The constraints are also explicitly, functions of this design
> vector. But one of these constraint (Lines loading) is implicit function of
> the design vector. So I have to calculate the load flow based on the
> obtanied design vector ( calculated by a MMP method , epsilon constraint or
> weighted sum, with fmincon solver of matlab) to check the lines loading
> inequality constraint. So I have to update the design vector in each
> iteration.
>
> On Sat, Apr 4, 2015 at 4:04 AM, Manish Thapa <[email protected]>
> wrote:
>
>> Are you trying to model sort of a battery with this?
>>
>> On Sat, Apr 4, 2015 at 2:34 AM, Electric <[email protected]
>> > wrote:
>>
>>> I am running a Multi Objective Mathematical Programming (MMP) method to
>>> remove congestion (overloading of lines) in a power system.
>>> The objective function, and all constraints apart from one of them i.e,
>>> loading of lines, are scripted in Matlab, But I am using Matpower to
>>> consider loading of lines as an inequality constraint (Loading Lji<1). I
>>> am
>>> pretty sure that there is some problem in my code for considering the
>>> inequality constraint of lines loading.
>>>
>>> I am using the script bellow to to consider the inequality constraint of
>>> lines loading.
>>>
>>> function [C Ceq] = constraints(X,Dat,mpc)
>>> mpc = loadcase('case39_congestion');
>>> Ceq=[ ];
>>> %----- First we have some constraints that are not calculated by
>>> Matpower.
>>> % Then I have to consider lines loading.
>>> define_constants;
>>> mpopt = mpoption('OUT_ALL', 0);
>>> load_set=[1,3:4,7:9,12,15:16,18,20:21,23:29];
>>> mpc.gen(1:10,PG)=mpc.gen(1:10,PG)+X(1:Dat.SG)'-X(Dat.SG+1:2*Dat.SG)';
>>> mpc.bus(load_set,PD)=mpc.bus(load_set,PD)+...
>>>   X(2*Dat.SG+1: 2*Dat.SG+Dat.SD)'-X( 2*Dat.SG+Dat.SD+1 :
>>> 2*Dat.SG+2*Dat.SD)';
>>> RES=runpf(mpc,mpopt);
>>> flow_from = sqrt(RES.branch(:, PF).^2 + RES.branch(:, QF).^2);
>>> flow_to = sqrt(RES.branch(:, PT).^2 + RES.branch(:, QT).^2);
>>> flow = (flow_from + flow_to)/2;
>>> loading  = flow ./ RES.branch(:, RATE_A);
>>> max_loading=max(loading);
>>> C = max_loading-1;  % Inequality constraint
>>> end
>>>
>>> Where X is deign vector of the congestion management problem. X is
>>> changes
>>> by fmincon solver.
>>>
>>> max_loading after few iteration of fmincon appears to be in order of 100
>>> (134,150) which doesn't make sense (The loading of base case is 0.75).
>>>
>>> I am thinking the problem is about updating generator active power and
>>> demands Active power.
>>>
>>
>>
>
>

Reply via email to