Вы находитесь на странице: 1из 21

NOVEMBER 9, 2013

POWER WORLD ASSIGNMENT 1-H


EE330A-FALL SEMESTER 2013

PRATIK SOMANI 11534


SWAPNIL UPADHYAY 11754
AMAN TIWARI 11072
ABHISHEK GUPTA 11025
CHIRAG JAIN 11226
MANU SETH 11412
SHRESHTH GANDHI 11694
ANSHUL KUMAR RAI 11126
RAKESH KUMAR 11581
ANURAG PRABHAKAR 11140
Contents
.................................................................................................................................................... 0
INTRODUCTION......................................................................................................................... 2
INITIAL STATE OF 3-BUS SYSTEM ............................................................................................... 3
CALCULATED VALUES FROM MATLAB ............................................................................... 4
AFTER OPENING LINE L(1,2) DUE TO FAULT ............................................................................ 5
CALCULATED VALUES FROM MATLAB ............................................................................... 6
PROPOSED SOLUTIONS ............................................................................................................ 7
1.)INTRODUCING A SHUNT CAPACITANCE ....................................................................... 7
1.1)SHUNT COMPENSATION AT GENERATORBUS OF 60 Mvar ..................................... 7
1.2) SHUNT COMPENSATION AT LOAD BUS OF 150 Mvar ............................................ 8
2.) INCREASING VOLTAGE OF SLACK BUS TO 1.06pu ...................................................... 9
CALCULATED VALUES FROM MATLAB ............................................................................. 10
3.) CHANGING VOLTAGE OF GENERATOR BUS TO 0.95pu ........................................... 11
CALCULATED VALUES FROM MATLAB ............................................................................. 12
CONCLUSION ......................................................................................................................... 13
APPENDIX: ............................................................................................................................... 14
MATLAB CODES: ................................................................................................................. 14
1.) CODE FOR TAKING BUS DATA (busdata.m) ..................................................... 14
2.) CODE FOR TAKING LINE DATA (linedatas.m)................................................... 14
3.) CODE FOR BUILDING Y-BUS MATRIX (ybusmatrix.m) ....................................... 14
4.) CODE FOR THE NEWTON-RAPHSON ITERATIONS (main.m) ............................ 15
5.) CODE FOR THE PRINTING THE LOADFLOW SOLUTION (loadflow.m) ............. 18

Page | 1
INTRODUCTION

Our problem involved solving the load flow for a 3 bus system using Newton-Raphson
method. The bus system is built in PowerWorld and is simulated to find the unknown
variables at the buses.The solution to the load flow obtained from PowerWorld is
compared with a simulation done in MATLAB.

The power injection equations that are solved by Newton-Raphson method are:

= . cos( + )
=1

= . sin( + )
=1

A fault is introduced at line L(1,2) and the computed and the new load-flow solution
is obtained. The requirement for the system is for the reactive power generation at
bus 2 to not exceed 150 MVAR.

Multiple solutions have been proposed to meet the given requirements.

The given data is:

Number Nom PU Angle Load Load Gen Gen B Shunt


kV Volt (Deg) MW Mvar MW Mvar Mvar
1 345 1 0 100 - - - 0
2 345 1.01 0 200 100 250 - 0
3 345 1 0 300 100 0 0 0

Line data:

From To Branch R X B
Number Number Device
Type
1 2 Line 0.01 0.05 0
1 3 Line 0.015 0.05 0
2 3 Line 0.015 0.05 0

Page | 2
INITIAL STATE OF 3-BUS SYSTEM
The initial state of the system with the given bus and line data is computed and the
following simulation results are obtained.

Bus Records
Number Name Area Nom kV PU Volt Volt Angle Load Load Gen Gen
Name (kV) (Deg) MW Mvar MW Mvar
1 Slack 1 345 1 345 0 100 0 359.3 14.02
2 generator 1 345 1.01 348.45 -2.26 200 100 250 218.29
3 Load 1 345 0.95243 328.589 -5.18 300 100

Page | 3
CALCULATED VALUES FROM MATLAB

The values obtained from MATLAB simulation and PowerWorld agree with each
other.

Page | 4
AFTER OPENING LINE L(1,2) DUE TO FAULT
The line between bus 1 and 2 is opened and the resulting powerflow solution is
observed. It is seen that the reactive power generation at the slack bus has
increased, while the reactive power generation at the generator bus has lowered to
205 Mvar

Bus Records
Number Name Area Nom kV PU Volt Volt Angle Load Load Gen Gen
Name (kV) (Deg) MW Mvar MW Mvar
1 slack 1 345 1 345 0 100 0 362.53 36.72
2 generator 1 345 1.01 348.45 -7.05 200 100 250 205.05
3 load 1 345 0.95061 327.962 -7.6 300 100

Page | 5
CALCULATED VALUES FROM MATLAB

The values obtained from PowerWorld and from the MATLAB simulation are seen to
agree with each other.

Page | 6
PROPOSED SOLUTIONS
To limit the reactive power at bus 2 to 150 Mvar we may employ different strategies.
The reactive power generated by the generator at bus flows into bus 3 and bus 1.
Thus to reduce the reactive power generation at bus 2, we can either increase the
reactive power consumption at bus2, bus 3 or bus1. This can be accomplished by
introducing a shunt capacitance at bus2 or bus3. Since the reactive power is
directly proportional to the votage of the bus (in the first order) , the reactive power
consumption at bus 1 may be increased by increasing the voltage at the slack bus.
Similarly the generated Q at bus 3 may be lowered by reducing the bus voltage.

1.)INTRODUCING A SHUNT CAPACITANCE


1.1)SHUNT COMPENSATION AT GENERATORBUS OF 60 Mvar
We expect an increase in the Reactive Power Consumption of the Generator bus,
resulting in the lowering of Q generated by the generator at bus 2.

Page | 7
Bus Records
Area Volt Angle Load Load Gen Gen
Number Name Name Nom kV PU Volt (kV) (Deg) MW Mvar MW Mvar
1 slack 1 345 1 345 0 100 0 362.53 36.72
2 generator 1 345 1.01 348.45 -7.05 200 100 250 143.84
3 load 1 345 0.95061 327.962 -7.6 300 100

We observe that the Q generation at bus 2 has gone below 150 Mvar and the
proposed solution meets the given requirements.

1.2) SHUNT COMPENSATION AT LOAD BUS OF 150 Mvar


We expect that due to increased Q consumption at bus 3 (load bus), the Q
generation at bus 2 would reduce and it would meet the given specification. As the
Q generated at bus 2 flows out of bus2 to loads and to other buses as well, the
capacitive compensation required in this case is higher than in case 1.1.

Page | 8
Bus Records
Number Name Area Nom kV PU Volt Volt Angle Load Load Gen Gen
Name (kV) (Deg) MW Mvar MW Mvar
1 slack 1 345 1 345 0 100 0 360.9 -37.87
2 generator 1 345 1.01 348.45 -6.71 200 100 250 127.43
3 load 1 345 0.98921 341.278 -7.91 300 100

As expected we see a drop in the Q generation at bus 2, although the voltage at


bus 2 has risen to a high level and the slack bus is generating negative Q. Since
highly negative Q may cause end heating and several other detrimental effects, this
solution although valid, has some serious drawbacks.

2.) INCREASING VOLTAGE OF SLACK BUS TO 1.06pu


We expect an increase in Voltage at the slack bus to increase the Q generation at
bus 1 and thus reduce the requirement of Q from other lines and thus lower the Q
generation at bus2.

Page | 9
Bus Records
Number Name Area Nom kV PU Volt Volt Angle Load Load Gen Gen
Name (kV) (Deg) MW Mvar MW Mvar
1 slack 1 345 1.06 365.7 0 100 0 360.95 97.2
2 generator 1 345 1.01001 348.454 -5.28 200 100 250 139.27
3 load 1 345 0.98332 339.246 -6.38 300 100

CALCULATED VALUES FROM MATLAB

It is observed, both from MATLAB simulation and PowerWorld simulation that the Q-
generation at bus 2 is below 150 Mvar(equal to 139 Mvar) and meets the given
requirements. Also the total reactive power losses in the lines is lower in this solution,
compared to solution 1.1 and 1.2.

Page | 10
3.) CHANGING VOLTAGE OF GENERATOR BUS TO 0.95pu
Since Voltage difference is directly proportional to the Q generation, we expect that
lowering the voltage of bus 2 will lower the reactive power generation at the
generator.

Bus Records
Number Name Area Nom kV PU Volt Volt Angle Load Load Gen Gen
Name (kV) (Deg) MW Mvar MW Mvar
1 slack 1 345 1 345 0 100 0 362.51 97.74
2 generator 1 345 0.95 327.75 -6.08 200 100 250 143.95
3 load 1 345 0.91918 317.117 -7.29 300 100

Page | 11
CALCULATED VALUES FROM MATLAB

It is seen from the PowerWorld simulation as well as MATLAB computation that, the Q
generation at bus 2 is below 150 Mvar and the proposed solution meets the given
requirements. Although the line losses in this case is higher than in solution 2.

Page | 12
CONCLUSION

We explored several solutions for the proposed problem of a line in a power system
going out.

We first tried to put in a shunt capacitance to lower the Q generation at bus2.


We tried placing a shunt compensation at bus 2 and bus 3. It was observed
that placing a shunt compensation at bus 3 leads to a negative Q in the
generator at Slack bus. Since this may fall out of the safe operation area of
the generator capability curve, this solution is not suggested for use. Placing a
shunt compensation on bus 2 (PV bus) though, leads to acceptable results.
The compensation required at bus 2 ( 60 Mvar) is much lower than the
compensation required at bus 3 (150 Mvar) to achieve the same lowering in
Q generation.
We also explored changing the voltages at the buses to change the
corresponding values of reactive power consumption at the buses. One may
increase the voltage at the slack bus to 1.06 pu or lower the voltage of
generator bus to 0.95 pu to achieve similar results. There are some differences
in the line losses in the two solutions, lowering of voltage at bus 2 leads to
higher line losses than by increasing the voltage at the slack bus.

Thus keeping in mind the resource requirement, line losses and reactive power
limitations, we propose that increasing the slack bus voltage to 1.06pu or adding a
shunt compensation of 60 MVAR at the generator bus are the two most viable
solutions.

Page | 13
APPENDIX:

MATLAB CODES:

1.) CODE FOR TAKING BUS DATA (busdata.m)

% Returns Initial Bus datas of the system...

function busdt = busdatas()

% Type....
% 1 - Slack Bus..
% 2 - PV Bus..
% 3 - PQ Bus..

% |Bus | Type | Vsp | theta | PGi | QGi | PLi | QLi |


busdat14 = [1 1 1.00 0 0 0 100 0 ;
2 2 1.01 0 250 0 200 100 ;
3 3 1.00 0 0 0 300 100 ;];

busdt = busdat14;

2.) CODE FOR TAKING LINE DATA (linedatas.m)

% Returns Line datas of the system...

function linedt = linedatas()

% | From | To | R | X | B/2 |
% | Bus | Bus | pu | pu | pu |
linedat14 = [1 2 0.01 0.05 0
1 3 0.015 0.05 0
2 3 0.015 0.05 0 ];

linedt = linedat14;

3.) CODE FOR BUILDING Y-BUS MATRIX (ybusmatrix.m)

Program to for Admittance And Impedance Bus Formation....

function Y = ybusmatrix() % Returns Y

linedata = linedatas(); % Calling Linedatas...


fb = linedata(:,1); % From bus number...
tb = linedata(:,2); % To bus number...
r = linedata(:,3); % Resistance, R...
x = linedata(:,4); % Reactance, X...
b = linedata(:,5); % Ground Admittance, B/2...
z = r + i*x; % z matrix...

Page | 14
y = 1./z; % To get inverse of each element...
b = i*b; % Make B imaginary...

nb = max(max(fb),max(tb)); % No. of buses...


nl = length(fb); % No. of branches...
Y = zeros(nb,nb); % Initialise YBus...

% Formation of the Off Diagonal Elements...


for k = 1:nl
Y(fb(k),tb(k)) = Y(fb(k),tb(k)) - y(k);
Y(tb(k),fb(k)) = Y(fb(k),tb(k));
end

% Formation of Diagonal Elements....


for m = 1:nb
for n = 1:nl
if fb(n) == m
Y(m,m) = Y(m,m) + y(n) + b(n);
elseif tb(n) == m
Y(m,m) = Y(m,m) + y(n) + b(n);
end
end
end
%Y; % Bus Admittance Matrix
%Z = inv(Y); % Bus Impedance Matrix

4.) CODE FOR THE NEWTON-RAPHSON ITERATIONS (main.m)

% Program for Newton-Raphson Load Flow Analysis..


nbus=3;
Y = ybusmatrix(); % Calling ybusmatrix.m to get Y-Bus Matrix..
busd = busdatas(); % Calling busdatas..
BMva = 100; % Base MVA..
bus = busd(:,1); % Bus Number..
type = busd(:,2); % Type of Bus 1-Slack, 2-PV, 3-PQ..
V = busd(:,3); % Specified Voltage..
del = busd(:,4); % Voltage Angle..
Pg = busd(:,5)/BMva; % PGi..
Qg = busd(:,6)/BMva; % QGi..
Pl = busd(:,7)/BMva; % PLi..
Ql = busd(:,8)/BMva; % QLi..
P = Pg - Pl; % Pi = PGi - PLi..
Q = Qg - Ql; % Qi = QGi - QLi..
Psp = P; % P Specified..
Qsp = Q; % Q Specified..
G = real(Y); % Conductance matrix..
B = imag(Y); % Susceptance matrix..

pv = find(type == 2 | type == 1); % PV Buses..


pq = find(type == 3); % PQ Buses..
npv = length(pv); % No. of PV buses..
npq = length(pq); % No. of PQ buses..

Tol = 1;
Iter = 1;
while (Tol > 1e-5) % Iteration starting..

P = zeros(nbus,1);

Page | 15
Q = zeros(nbus,1);
% Calculate P and Q
for i = 1:nbus
for k = 1:nbus
P(i) = P(i) + V(i)* V(k)*(G(i,k)*cos(del(i)-del(k)) +
B(i,k)*sin(del(i)-del(k)));
Q(i) = Q(i) + V(i)* V(k)*(G(i,k)*sin(del(i)-del(k)) -
B(i,k)*cos(del(i)-del(k)));
end
end

% Calculate change from specified value


dPa = Psp-P;
dQa = Qsp-Q;
k = 1;
dQ = zeros(npq,1);
for i = 1:nbus
if type(i) == 3
dQ(k,1) = dQa(i);
k = k+1;
end
end
dP = dPa(2:nbus);
M = [dP; dQ]; % Mismatch Vector

% Jacobian
% J1 - Derivative of Real Power Injections with Angles..
J1 = zeros(nbus-1,nbus-1);
for i = 1:(nbus-1)
m = i+1;
for k = 1:(nbus-1)
n = k+1;
if n == m
for n = 1:nbus
J1(i,k) = J1(i,k) + V(m)* V(n)*(-G(m,n)*sin(del(m)-
del(n)) + B(m,n)*cos(del(m)-del(n)));
end
J1(i,k) = J1(i,k) - V(m)^2*B(m,m);
else
J1(i,k) = V(m)* V(n)*(G(m,n)*sin(del(m)-del(n)) -
B(m,n)*cos(del(m)-del(n)));
end
end
end

% J2 - Derivative of Real Power Injections with V..


J2 = zeros(nbus-1,npq);
for i = 1:(nbus-1)
m = i+1;
for k = 1:npq
n = pq(k);
if n == m
for n = 1:nbus
J2(i,k) = J2(i,k) + V(n)*(G(m,n)*cos(del(m)-del(n)) +
B(m,n)*sin(del(m)-del(n)));
end
J2(i,k) = J2(i,k) + V(m)*G(m,m);
else
J2(i,k) = V(m)*(G(m,n)*cos(del(m)-del(n)) +
B(m,n)*sin(del(m)-del(n)));
end

Page | 16
end
end

% J3 - Derivative of Reactive Power Injections with Angles..


J3 = zeros(npq,nbus-1);
for i = 1:npq
m = pq(i);
for k = 1:(nbus-1)
n = k+1;
if n == m
for n = 1:nbus
J3(i,k) = J3(i,k) + V(m)* V(n)*(G(m,n)*cos(del(m)-
del(n)) + B(m,n)*sin(del(m)-del(n)));
end
J3(i,k) = J3(i,k) - V(m)^2*G(m,m);
else
J3(i,k) = V(m)* V(n)*(-G(m,n)*cos(del(m)-del(n)) -
B(m,n)*sin(del(m)-del(n)));
end
end
end

% J4 - Derivative of Reactive Power Injections with V..


J4 = zeros(npq,npq);
for i = 1:npq
m = pq(i);
for k = 1:npq
n = pq(k);
if n == m
for n = 1:nbus
J4(i,k) = J4(i,k) + V(n)*(G(m,n)*sin(del(m)-del(n)) -
B(m,n)*cos(del(m)-del(n)));
end
J4(i,k) = J4(i,k) - V(m)*B(m,m);
else
J4(i,k) = V(m)*(G(m,n)*sin(del(m)-del(n)) -
B(m,n)*cos(del(m)-del(n)));
end
end
end

J = [J1 J2; J3 J4]; % Jacobian Matrix..

X = inv(J)*M; % Correction Vector


dTh = X(1:nbus-1); % Change in Voltage Angle..
dV = X(nbus:end); % Change in Voltage Magnitude..

% Updating State Vectors..


del(2:nbus) = dTh + del(2:nbus); % Voltage Angle..
k = 1;
for i = 2:nbus
if type(i) == 3
V(i) = dV(k) + V(i); % Voltage Magnitude..
k = k+1;
end
end

Iter = Iter + 1;
Tol = max(abs(M)); % Tolerance..

Page | 17
end
loadflow(nbus,V,del,BMva); % Calling Loadflow.m..

5.) CODE FOR THE PRINTING THE LOADFLOW SOLUTION (loadflow.m)

% Program for Bus Power Injections, Line & Power flows (p.u)...

function [Pi Qi Pg Qg Pl Ql] = loadflow(nb,V,del,BMva)

Y = ybusmatrix(); % Calling Ybus program..


lined = linedatas(); % Get linedats..
busd = busdatas(); % Get busdatas..
Vm = pol2rect(V,del); % Converting polar to rectangular..
Del = 180/pi*del; % Bus Voltage Angles in Degree...
fb = lined(:,1); % From bus number...
tb = lined(:,2); % To bus number...
nl = length(fb); % No. of Branches..
Pl = busd(:,7); % PLi..
Ql = busd(:,8); % QLi..

Iij = zeros(nb,nb);
Sij = zeros(nb,nb);
Si = zeros(nb,1);

% Bus Current Injections..


I = Y*Vm;
Im = abs(I);
Ia = angle(I);

%Line Current Flows..


for m = 1:nl
p = fb(m); q = tb(m);
Iij(p,q) = -(Vm(p) - Vm(q))*Y(p,q); % Y(m,n) = -y(m,n)..
Iij(q,p) = -Iij(p,q);
end
Iij = sparse(Iij);
Iijm = abs(Iij);
Iija = angle(Iij);

% Line Power Flows..


for m = 1:nb
for n = 1:nb
if m ~= n
Sij(m,n) = Vm(m)*conj(Iij(m,n))*BMva;
end
end
end
Sij = sparse(Sij);
Pij = real(Sij);
Qij = imag(Sij);

% Line Losses..
Lij = zeros(nl,1);
for m = 1:nl
p = fb(m); q = tb(m);
Lij(m) = Sij(p,q) + Sij(q,p);
end

Page | 18
Lpij = real(Lij);
Lqij = imag(Lij);

% Bus Power Injections..


for i = 1:nb
for k = 1:nb
Si(i) = Si(i) + conj(Vm(i))* Vm(k)*Y(i,k)*BMva;
end
end
Pi = real(Si);
Qi = -imag(Si);
Pg = Pi+Pl;
Qg = Qi+Ql;

disp('#####################################################################
####################');
disp('---------------------------------------------------------------------
--------------------');
disp(' Newton Raphson Loadflow Analysis ');
disp('---------------------------------------------------------------------
--------------------');
disp('| Bus | V | Angle | Injection | Generation |
Load |');
disp('| No | pu | Degree | MW | MVar | MW | Mvar |
MW | MVar | ');
for m = 1:nb
disp('-----------------------------------------------------------------
------------------------');
fprintf('%3g', m); fprintf(' %8.4f', V(m)); fprintf(' %8.4f',
Del(m));
fprintf(' %8.3f', Pi(m)); fprintf(' %8.3f', Qi(m));
fprintf(' %8.3f', Pg(m)); fprintf(' %8.3f', Qg(m));
fprintf(' %8.3f', Pl(m)); fprintf(' %8.3f', Ql(m)); fprintf('\n');
end
disp('---------------------------------------------------------------------
--------------------');
fprintf(' Total ');fprintf(' %8.3f', sum(Pi)); fprintf('
%8.3f', sum(Qi));
fprintf(' %8.3f', sum(Pi+Pl)); fprintf(' %8.3f', sum(Qi+Ql));
fprintf(' %8.3f', sum(Pl)); fprintf(' %8.3f', sum(Ql)); fprintf('\n');
disp('---------------------------------------------------------------------
--------------------');
disp('#####################################################################
####################');

disp('---------------------------------------------------------------------
----------------');
disp(' Line FLow and Losses ');
disp('---------------------------------------------------------------------
----------------');
disp('|From|To | P | Q | From| To | P | Q |
Line Loss |');
disp('|Bus |Bus| MW | MVar | Bus | Bus| MW | MVar |
MW | MVar |');
for m = 1:nl
p = fb(m); q = tb(m);
disp('-----------------------------------------------------------------
--------------------');
fprintf('%4g', p); fprintf('%4g', q); fprintf(' %8.3f',
full(Pij(p,q))); fprintf(' %8.3f', full(Qij(p,q)));

Page | 19
fprintf(' %4g', q); fprintf('%4g', p); fprintf(' %8.3f',
full(Pij(q,p))); fprintf(' %8.3f', full(Qij(q,p)));
fprintf(' %8.3f', Lpij(m)); fprintf(' %8.3f', Lqij(m));
fprintf('\n');
end
disp('---------------------------------------------------------------------
----------------');
fprintf(' Total Loss ');
fprintf(' %8.3f', sum(Lpij)); fprintf(' %8.3f', sum(Lqij));
fprintf('\n');
disp('---------------------------------------------------------------------
----------------');
disp('#####################################################################
################');

Page | 20