| Hi José, It looks like there are two things that you are missing. 1. The values in the GS and BS columns of the bus matrix are admittances conductance and susceptance values, which correspond to power at 1 p.u. voltages. To get the actual power you must compute it at the solved bus voltage. 2. The branch series losses and line charging reactive injections are handled separately by get_losses(). See help get_losses for details. Put the attached display_power_balance.m in your MATLAB path and try the following. Here’s what I get … >> load test_network >> mpc = loadcase(test_network); >> mpopt = mpoption('out.bus', 0, 'out.branch', 0, 'verbose', 0); >> r = runpf(mpc, mpopt); Converged in 0.01 seconds ================================================================================ | System Summary | ================================================================================ How many? How much? P (MW) Q (MVAr) --------------------- ------------------- ------------- ----------------- Buses 41 Total Gen Capacity 9999.0 -9999.0 to 9999.0 Generators 1 On-line Capacity 9999.0 -9999.0 to 9999.0 Committed Gens 1 Generation (actual) 5.4 -4.3 Loads 7 Load 4.9 0.0 Fixed 7 Fixed 4.9 0.0 Dispatchable 0 Dispatchable -0.0 of -0.0 -0.0 Shunts 9 Shunt (inj) -0.1 3.6 Branches 41 Losses (I^2 * Z) 0.39 1.56 Transformers 8 Branch Charging (inj) - 2.3 Inter-ties 0 Total Inter-tie Flow 0.0 0.0 Areas 1 Minimum Maximum ------------------------- -------------------------------- Voltage Magnitude 0.893 p.u. @ bus 18 1.098 p.u. @ bus 3 Voltage Angle -4.61 deg @ bus 18 1.46 deg @ bus 17 P Losses (I^2*R) - 0.13 MW @ line 17-27 Q Losses (I^2*X) - 0.43 MVAr @ line 14-12 >> display_power_balance(r) Active Power Generation (Pg) = 5.366418 Load (Pd) = 4.882000 Shunt Inj (Psh) = -0.094979 Branch Loss (Ploss) = 0.389439 Reactive Power Generation (Qg) = -4.312679 Load (Qd) = 0.036000 Shunt Inj (Qsh) = 3.640204 Branch Loss (Qloss) = 1.559847 Branch Charging (Qchg) = 2.268322 Active Power Mismatch, | Pg - Pd + Psh - Ploss | = 0.000000 Reactive Power Mismatch, | Qg - Qd + Qsh - Qloss + Qchg | = 0.000000 Individual Branch Balance, max(| Sf + St + Schg - Sloss |) = 0.000000 Everything is consistent. Feel free to look at how I’m computing things “by hand” in the attached function. Hope this clears everything up for you, Ray |
display_power_balance.m
Description: Binary data
|
