Dear Prof. Zimmerman Thank you very much for your help.
I don't know what changes should be applied to the following code to have PF=0.95 for other generators. I cannot obtain the same power factor(0.95, I obtained 0.99 or other values). If it is possible please help me. Best Wishes Roberto On Fri, Mar 11, 2011 at 16:27, Ray Zimmerman <[email protected]> wrote: > Dirk's suggestion is fine for a simple power flow. But if you want to run > an OPF, where the generator dispatch is to be determined by the > optimization, but subject to a constant power factor constraint, then you > will need to supply an additional user-defined linear constraint. For > example, if you want to run case9 with a constant power factor constraint of > 0.95 on the first generator, you could do it like this ... > > 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(1) - Qg(1) = 0 > mpc.A = sparse([1; 1], [2*nb+1; 2*nb+ng+1], [QPratio; -1], 1, 2*nb+2*ng); > mpc.l = 0; > mpc.u = 0; > r = runopf(mpc); > resulting_pf = r.gen(1, PG) / sqrt(r.gen(1, PG)^2 + r.gen(1, QG)^2) > > The important part here is defining the A matrix properly, where the > columns correspond to voltage angles, voltage magnitudes, generator real > injections, and generator reactive injections (2*nb + 2*ng columns in all). > So the coefficients for our constraint co in the columns corresponding to > Pg(1) and Qg(1). > > -- > Ray Zimmerman > Senior Research Associate > 211 Warren Hall, Cornell University, Ithaca, NY 14853 > phone: (607) 255-9645 > > > > On Mar 11, 2011, at 9:50 AM, Dirk Van Hertem wrote: > > You model your generator as a load, so it is not represented in your gen > matrix. Of course, if you want model your generator in a unit commitment, > this may not be trivial... > > Dirk > > On 03/11/2011 12:32 PM, Roberto Carvalini wrote: > > Thank you > > How can I add? my problem is this > > Best Wishes > > Roberto > > > On Fri, Mar 11, 2011 at 12:22, Dirk Van Hertem <[email protected]>wrote: > >> You can just define them as a PQ bus with negative power... (negative >> load) >> >> Dirk >> >> >> On 03/11/2011 12:11 PM, Roberto Carvalini wrote: >> >>> Hi >>> >>> How can I define constant power factor in MAPOWER for example, for >>> generators PF=0.9? >>> >>> Please help me >>> >>> Regards >>> >>> Roberto >>> >>> >>> >> >> -- >> Dirk Van Hertem [email protected] >> Electrical Engineering Department http://www.esat.kuleuven.be/electa >> K.U. Leuven, ESAT-ELECTA GSM: +32-(O)498-61.74.98 >> 10, Kasteelpark Arenberg, B-3001 Heverlee fax: <%2B32-16-32.19.85> >> +32-16-32.19.85 >> >> >> > > > -- > Dirk Van Hertem [email protected] > Electrical Engineering Department http://www.esat.kuleuven.be/electa > K.U. Leuven, ESAT-ELECTA GSM: +32-(O)498-61.74.98 > 10, Kasteelpark Arenberg, B-3001 Heverlee fax: +32-16-32.19.85 > > > >
