Russ Patterson wrote:

Hi - I am still trying to hand calculate the flow into branch 2 from bus 1 to bus 2.  I can’t get my results to match MATPOWER.

 

I get Q into the banks from bus 1 of,

                Bank #1:    24.00 MVAR

                Bank #2:  -25.02 MVAr

 

Attached is my short calculation and the .m file.  Is there a way to have MATPOWER barf out the YBUS matrix?

>> help makeYbus

If buses are numbered consecutively starting from 1 in the bus table (see ext2int if not), simply type:

>> mpc = loadcase('mycase');
>> [Yb, Yf, Yt] = makeYbus(mpc)

To get all the relevant current injections in the solved case, simply do

>> mpc = runpf(mpc);
>> define_constants;
>> V = mpc.bus(:, VM) .* exp(1i * mpc.bus(:, VA)*pi/180);
>> Ibus = Yb * V
>> Ifrom = Yf * V;
>> Ito = Yt * V;

From there, compute power injections as

>> Sbusinj = V .* conj(Yb * V);
>> Sfrominj = V(mpc.branch(:, F_BUS)) .* conj(Yf * V);
>> Stoinj  = V(mpc.branch(:, T_BUS)) .* conj(Yt * V);

carlos.

Reply via email to