Dear Mr. Zimmerman,

I'm trying to calculate the AC PF for a system with two Slack Busses. When I'm 
running the PF, I get an error message in line  97 of pfsoln.mat

>> Subscripted assignment dimension mismatch.
>> Error in ==> pfsoln at 97
>> gen(on(refgen(1)), PG) = real(Sg(refgen(1))) * baseMVA + bus(ref, PD);  %% 
>> inj P + local Pd

Because of the two Slack Busses the dimension of bus(ref, PD) is 2 x 1, but the 
dimension of real(Sg(refgen(1))) and gen(on(refgen(1)), PG) is only 1 x 1.


When I change the line 97 to

>> gen(on(refgen(:,1)), PG) = real(Sg(refgen(:,1))) * baseMVA + bus(ref, PD);  
>> %% inj P + local Pd

it seems to work fine.

Would you be so kind to give me a short reply if it is a misconfiguration or 
not?


Best regards,
Steffen Nicolai

Reply via email to