Hello sir

I am a beginner in MATPOWER.  I wanted to solve a power flow problem using
the IEEE_30 bus system. I have Va, Pa, Qa in pu quantities.  I used Pa and
Qa as inputs and wanted to solve the AC power flow and check if I get Va.
I used the following code:

mpc=loadcase(case30);
mpc.bus(:,3)=Pa; % Input Pa in pu
mpc.bus(:,4)=Qa; % Input Qa in pu
mpc.bus(1,8)=1; % slack bus voltage
mpc.bus(1,9)=0; % slack bus angle
results=runpf(mpc); % stored the results
Vm1=results.bus(:,8); % output voltage magnitude
Va1=results.bus(:,9)*pi/180; %output voltage angles
% convert the voltage from polar to cartesian
for j=1:length(Vm1)
[Vr1(j),Vr2(j)]=pol2cart(Va1(j), Vm1(j));
Vc(j)=Vr1(j)+ 1i*Vr2(j);
end

Queries:
1. Is the way I have coded right? Or should I create a separate case format?
2. Can I input Pa and Qa in pu values?
3. The output Vc that I get is not same as Va.

Please help. Thanks
Lydia Edwin

Reply via email to