You simply replace the single equality constraint (per gen) with two inequality
constraints with the two corresponding QPratio values.
pf1 = 0.8;
pf2 = 0.9;
QPratio1 = sqrt(1/pf1^2 -1);
QPratio2 = sqrt(1/pf2^2 -1);
% then write the constraints for
% QPratio1 * Pg(i) - Qg(i) > 0
% QPratio2 * Pg(i) - Qg(i) < 0
I don't have time to work out the details for you, I think I got the
inequalities correct.
--
Ray Zimmerman
Senior Research Associate
419A Warren Hall, Cornell University, Ithaca, NY 14853
phone: (607) 255-9645
On Feb 6, 2012, at 9:13 AM, Roberto Carvalini wrote:
> Dear Ray,
>
> According to your reply to one of the posts as you specified a predefined PF
> as follow. Now, I want to have only a range of Power Factor, for example,
> between 0.9 and 0.8. What changes I have to do in the following program in
> order to have variable PF between 0.8 and 0.9.
>
> define_constants;
> mpc = loadcase('case9');
> nb = size(mpc.bus, 1);
> ng = size(mpc.gen, 1);
> pf = 0.95;
> QPratio = sqrt(1/pf^2 -1);
> %% add constraint that QPratio * Pg(i) - Qg(i) = 0, for i = 2 .. ng
> mpc.A = sparse([1:ng 1:ng]', [2*nb+(1:ng) 2*nb+ng+(1:ng)]',
> [QPratio*ones(ng,1); -ones(ng,1)], ng, 2*nb+2*ng);
> mpc.A = mpc.A(2:end, :);
> mpc.l = zeros(ng-1, 1);
> mpc.u = mpc.l;
> r = runopf(mpc);
>
> Regards
>
> Roberto
>
>
>
>
>
>