Thank you ray. You are very helpful. it indeed works. Thanks so much. -BH
On Wed, Mar 4, 2015 at 3:45 AM, Ray Zimmerman <[email protected]> wrote: > In a situation like this, I suggest you spend a few minutes looking > through the code (like I just did). It’s clear from the line in printpf() > that prints the total you are looking for, that it must explicitly sum over > only the rows of the bus matrix corresponding to buses that are not > isolated. > > nzld = find((results.bus(:, PD) | results.bus(:, QD)) & results.bus(:, > BUS_TYPE) ~= NONE); > total_load = sum(results.bus(nzld, PD)) > > Also, the total_load() function should handle all of this for you. You > claim “it doesn’t work”, but you haven’t given any specifics of how it > fails. If it’s broken, please give us the details so we can fix it. > > Ray > > > On Mar 3, 2015, at 2:14 PM, Bijay Hughes <[email protected]> wrote: > > Dear Shri, > > Thanks so much for help. However with results.bus(:,3) I get the same > total load output in each iteration, even though the total load is > different. For example, in the next iteration I have the following summary > table: > > Bus Voltage Generation Load > # Mag(pu) Ang(deg) P (MW) Q (MVAr) P (MW) Q (MVAr) > ----- ------- -------- -------- -------- -------- -------- > 1 1.060 0.000x 0.00 0.00 - - > 2 1.000 -4.980 115.90 0.00 21.70 0.00 > 3 1.000 -15.665 0.00 0.00 94.20 0.00 > 4 1.019 -10.330x - - 47.80 0.00 > 5 1.020 -8.780x - - 7.60 0.00 > 6 1.070 -14.220x 0.00 0.00 11.20 0.00 > 7 1.062 -13.370x - - - - > 8 1.090 -13.360x 0.00 0.00 - - > 9 1.056 -14.940x - - 29.50 0.00 > 10 1.051 -15.100x - - 9.00 0.00 > 11 1.057 -14.790x - - 3.50 0.00 > 12 1.055 -15.070x - - 6.10 0.00 > 13 1.050 -15.160x - - 13.50 0.00 > 14 1.036 -16.040x - - 14.90 0.00 > -------- -------- -------- -------- > Total: 115.90 0.00 115.90 0.00 > > I should get 115.90 with results.bus(:,3), no? And of course I update > results in each iteration. There is not problem with it. Why is the command > results.bus(:,3) > refering to my original case struct in each iteration? Its weird. Do you > see the problem? > > Thanks, > > BH > > On Wed, Mar 4, 2015 at 2:08 AM, Abhyankar, Shrirang G. < > [email protected]> wrote: > >> results=rundcpf(mpc); >> >> In the above command, mpc is the input MATPOWER case struct and results >> is the output MATPOWER case struct. Each MATPOWER case struct has the >> fields bus, gen, branch, area, gencost, and other utility fields. Please >> read the MATPOWER manual for the format of each of these fields. >> Now, results.mpc(:,3) is incorrect since you are trying to access the >> ‘mpc’ field in ‘results’ struct. You should use results.bus(:,3) instead >> and then do a sum over it to get the total load. >> >> Shri >> >> From: Bijay Hughes <[email protected]> >> Reply-To: MATPOWER discussion forum <[email protected]> >> Date: Tuesday, March 3, 2015 at 11:59 AM >> To: MATPOWER discussion forum <[email protected]> >> Subject: Extracting Total Load >> >> Dear Ray and Matpower Users, >> >> I want to be able to extract total load in each iteration. In each >> iteration, I am removing certain number of branches. My question is: what >> is the matpower command to extract total load in my system? I used >> total_load() but it doesn't work. >> >> For example: >> >> Bus Voltage Generation Load >> # Mag(pu) Ang(deg) P (MW) Q (MVAr) P (MW) Q (MVAr) >> ----- ------- -------- -------- -------- -------- -------- >> 1 1.000 0.000* 219.00 0.00 - - >> 2 1.000 -5.012 40.00 0.00 21.70 0.00 >> 3 1.000 -12.954 0.00 0.00 94.20 0.00 >> 4 1.000 -10.584 - - 47.80 0.00 >> 5 1.000 -9.094 - - 7.60 0.00 >> 6 1.000 -14.852 0.00 0.00 11.20 0.00 >> 7 1.000 -13.907 - - - - >> 8 1.000 -13.907 0.00 0.00 - - >> 9 1.000 -15.695 - - 29.50 0.00 >> 10 1.000 -15.974 - - 9.00 0.00 >> 11 1.000 -15.619 - - 3.50 0.00 >> 12 1.000 -15.967 - - 6.10 0.00 >> 13 1.000 -16.140 - - 13.50 0.00 >> 14 1.000 -17.188 - - 14.90 0.00 >> -------- -------- -------- -------- >> Total: 259.00 0.00 259.00 0.00 >> >> Isn't there a way to extract the highlighted number (total load)? What >> matpower command shall I use? I tried sum(results.mpc(:,3)) but it doesn't >> work, where results=rundcpf(mpc). And 3 is the column of the load. >> >> Reg. >> >> BH >> >> > >
