So, which parameters should be changed or replaced with? Could you please let me know how can I put into A,l,u?
How can I convert it to inequality constraints? I will be very grateful if you can correct my mistake. Best regards, On Thu, Jan 9, 2014 at 2:08 PM, Ray Zimmerman <[email protected]> wrote: > No, this does not look correct to me. It looks like this creates the > constraint … > > QPratio * (Pg - Qg) = 0 > > … which means that Pg = Qg, which is clearly not what you want. Be sure > you understand the code you are attempting to modify before making changes. > First write down the constraints you want in terms of Pg and Qg (hint: they > are inequalities, not equalities), then put them into the A, l and u > parameters. > > -- > Ray Zimmerman > Senior Research Associate > B30 Warren Hall, Cornell University, Ithaca, NY 14853 > phone: (607) 255-9645 > > > > On Jan 9, 2014, at 6:36 AM, Dailan Xu <[email protected]> wrote: > > Dear Dr. Zimmerman, > > I am going to implement an OPF with variable power factor that is assumed > to vary between 0.8 leading to 0.8 lagging. So, I have written the > following code. In your idea, is it true? If not, could you please let me > know what modifications I have to apply? > > *nb = size(mpc.bus, 1);* > *ng = size(mpc.gen, 1);* > *pf = 0.8;* > *QPratio = sqrt(1/pf^2 -1);* > *mpc.A = sparse([1:ng 1:ng]', [2*nb+(1:ng) 2*nb+ng+(1:ng)]', > [QPratio*ones(ng,1); -QPratio*ones(ng,1)], ng, 2*nb+2*ng);* > *% mpc.A = mpc.A(3:12, :);* > *% mpc.l = zeros(ng-1-31, 1);* > *mpc.A = mpc.A(2:16, :);* > *mpc.l = zeros(ng-29-1, 1);* > *mpc.u = mpc.l;* > > *Best regards,* > > *D.Xu* > > >
