Re: Question about CPF
See below. Thanks, Shri From: on behalf of W Ruoyu Reply-To: MATPOWER discussion forum Date: Monday, July 1, 2019 at 5:35 PM To: MATPOWER discussion forum Subject: Re: Question about CPF Hi, Thanks for the reply ! That really helps. But I still have a little questions. To output the maximum active power at the Nose Point for each bus, I think I should use results.bus( : , PD) rather than results.gen( : , PG), is that correct? On running the continuation power flow via results = runcpf(mpcb, mpct, mpopt); MATPOWER returns a struct ‘results’ which is a superset of the MATPOWER case struct with some additional data specific for the continuation power flow. Please take a look at the format of the MATPOWER case struct (https://matpower.org/docs/ref/matpower5.1/caseformat.html) to know about the different values available. If you want to use the real power load at each bus then use results.bus(:,PD), for real power generation use results.gen(:,PG).. Cause when I use results.gen( : , PG) for buses that no generators are connected to, it shows Index in position 1 exceeds array bounds (must not exceed 3). But if I use results.bus( : , PD) for buses 4 & 6 & 8 for ‘case9’, the output P_max is 0. Could you please help me with that? results.bus in a matrix of size nbus X nbuscol where nbus is the number of buses in the system and nbuscol is the number of columns in the bus matrix. Similarly, results.gen is matrix of size ngen X gencol where ngen is the number of generators in the system define_constants; mpopt = mpoption('out.all',0,'verbose',2,'out.bus',1); mpopt=mpoption(mpopt,'cpf.stop_at','NOSE','cpf.step',0.2); mpopt=mpoption(mpopt,'cpf.plot.bus',6,'cpf.plot.level',2); mpcb = loadcase('case9'); % load base case mpct = mpcb; % set up target case with mpct.gen(:,[PG QG]) = mpcb.gen(:,[PG QG])*2 mpct.bus(:,[PD QD]) = mpcb.bus(:,[PD QD])*2 results = runcpf(mpcb, mpct, mpopt); Vm = results.bus(6,8) % 8 means Vm in idx_bus P_max = results.bus(6,3) % 2 means PG in idx_gen.m ; 3 means PD in idx_bus.m And could you please tell me how to set the indicator(like cps.step or the multiple-factor) for the target case? You can change the step-size and other CPF options by setting the appropriate options in the mpopt struct. See help mpoption for the available options. For setting the CPF step size, do mpopt = mpoption; mpopt.cpf.step = Cause I have tried to write the target case for case4gs and case5, it always shows that Corrector did not converge in 10 iterations, How should I change it? I think the step-size you are using above, 0.2, is probably too large. I tried the default step-size, 0.05, and the CPF do not see any convergence issues. You can also increase the number of corrector iterations via mpopt.pf.nr.max_it = . Thank you Regards, Cynthia >> 在 2019年7月1日,20:33,Ray Zimmerman mailto:r...@cornell.edu>> 写道: Hi Cynthia, See responses to your questions below … Ray On Jun 30, 2019, at 5:06 PM, W Ruoyu mailto:cynthiaw1...@hotmail.com>> wrote: Could you please tell me the meaning of Vm = results.bus(:,8)? Why would it output the voltage magnitude at the nose point for all the buses? This is simply to demonstrate how to extract the vector of bus voltage magnitudes at the nose point, in case you were interested in that information. and how could I output the maximum real power at the nose point? When setting the cpf.stop_at option to 'NOSE' (and yes, case does matter), the results struct contains the solution at the nose point where the continuation procedure terminates. So you can get the vector of power generation from results.gen(:, PG). If the final result I need is (maximum P - initial P)/(maximum P), should I use the maxloadlim function? The maxloadlim() function is another approach to finding the nose point, via OPF instead of CPF, so there’s no need to use it if CPF is finding the nose point without trouble. You would simply use something like … initP = sum(mpc.gen(:, PG)); maxP = sum(results.gen(:, PG)); desired_result = (maxP - initP) / maxP;
Re: Question about CPF
Hi, Thanks for the reply ! That really helps. But I still have a little questions. To output the maximum active power at the Nose Point for each bus, I think I should use results.bus( : , PD) rather than results.gen( : , PG), is that correct? Cause when I use results.gen( : , PG) for buses that no generators are connected to, it shows Index in position 1 exceeds array bounds (must not exceed 3). But if I use results.bus( : , PD) for buses 4 & 6 & 8 for ‘case9’, the output P_max is 0. Could you please help me with that? define_constants; mpopt = mpoption('out.all',0,'verbose',2,'out.bus',1); mpopt=mpoption(mpopt,'cpf.stop_at','NOSE','cpf.step',0.2); mpopt=mpoption(mpopt,'cpf.plot.bus',6,'cpf.plot.level',2); mpcb = loadcase('case9'); % load base case mpct = mpcb; % set up target case with mpct.gen(:,[PG QG]) = mpcb.gen(:,[PG QG])*2 mpct.bus(:,[PD QD]) = mpcb.bus(:,[PD QD])*2 results = runcpf(mpcb, mpct, mpopt); Vm = results.bus(6,8) % 8 means Vm in idx_bus P_max = results.bus(6,3) % 2 means PG in idx_gen.m ; 3 means PD in idx_bus.m And could you please tell me how to set the indicator(like cps.step or the multiple-factor) for the target case? Cause I have tried to write the target case for case4gs and case5, it always shows that Corrector did not converge in 10 iterations, How should I change it? Thank you Regards, Cynthia >> 在 2019年7月1日,20:33,Ray Zimmerman mailto:r...@cornell.edu>> 写道: Hi Cynthia, See responses to your questions below … Ray On Jun 30, 2019, at 5:06 PM, W Ruoyu mailto:cynthiaw1...@hotmail.com>> wrote: Could you please tell me the meaning of Vm = results.bus(:,8)? Why would it output the voltage magnitude at the nose point for all the buses? This is simply to demonstrate how to extract the vector of bus voltage magnitudes at the nose point, in case you were interested in that information. and how could I output the maximum real power at the nose point? When setting the cpf.stop_at option to 'NOSE' (and yes, case does matter), the results struct contains the solution at the nose point where the continuation procedure terminates. So you can get the vector of power generation from results.gen(:, PG). If the final result I need is (maximum P - initial P)/(maximum P), should I use the maxloadlim function? The maxloadlim() function is another approach to finding the nose point, via OPF instead of CPF, so there’s no need to use it if CPF is finding the nose point without trouble. You would simply use something like … initP = sum(mpc.gen(:, PG)); maxP = sum(results.gen(:, PG)); desired_result = (maxP - initP) / maxP;
Re: Question about CPF
Hi Cynthia, See responses to your questions below … Ray > On Jun 30, 2019, at 5:06 PM, W Ruoyu wrote: > > > Could you please tell me the meaning of Vm = results.bus(:,8)? Why would it > output the voltage magnitude at the nose point for all the buses? This is simply to demonstrate how to extract the vector of bus voltage magnitudes at the nose point, in case you were interested in that information. > and how could I output the maximum real power at the nose point? When setting the cpf.stop_at option to 'NOSE' (and yes, case does matter), the results struct contains the solution at the nose point where the continuation procedure terminates. So you can get the vector of power generation from results.gen(:, PG). > If the final result I need is (maximum P - initial P)/(maximum P), should I > use the maxloadlim function? The maxloadlim() function is another approach to finding the nose point, via OPF instead of CPF, so there’s no need to use it if CPF is finding the nose point without trouble. You would simply use something like … initP = sum(mpc.gen(:, PG)); maxP = sum(results.gen(:, PG)); desired_result = (maxP - initP) / maxP;
Question about CPF
Hi, So sorry to bother you with these basic questions, but I’m really struggling to output the maximum real power and critical voltage at the nose point of the PV curve. I have searched and find this example: define_constants; mpopt = mpoption('out.all',0,'verbose',2); mpopt = mpoption('cpf.stop_at','nose','cpf.step',0.2); mpopt = mpoption(mpopt,'cpf.plot.level',2); mpcb = loadcase('case9'); % load base case mpct = mpcb; % set up target case with mpct.gen(:, [PG QG]) = mpcb.gen(:, [PG QG])*2.5 mpct.bus(:,[PD QG]) = mpcb.bus(:,[PD QG])*2.5 results = runcpf(mpcb, mpct, mpopt); Vm = results.bus(:,8); % Voltage magnitude at the nose point for all the buses. Could you please tell me the meaning of Vm = results.bus(:,8)? Why would it output the voltage magnitude at the nose point for all the buses? and how could I output the maximum real power at the nose point? If the final result I need is (maximum P - initial P)/(maximum P), should I use the maxloadlim function? Thanks in advance. Best wishes, Cynthia