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*
