Sei sulla pagina 1di 22

Experiment: 1

Aim:-To develop a program in Mat lab for information of Y-bus matrix for N bus system.

Software Required:- MATLAB 7.9

Programming:

Program for line data of formation of Y-BUS matrix of IEEE-6BUS system.


% Line Data for Y-Bus Formation.
function linedata = linedata6() % Returns linedata.

% | From | To | R | X | B/2 |
% | Bus | Bus | | | |
linedata = [ 1 2 0.10 0.20 0.02;
1 4 0.05 0.20 0.02;
1 5 0.08 0.30 0.03;
2 3 0.05 0.25 0.03;
2 4 0.05 0.10 0.01;
2 5 0.10 0.30 0.02;
2 6 0.07 0.20 0.025;
3 5 0.12 0.26 0.025;
3 6 0.02 0.10 0.01;
4 5 0.20 0.40 0.04;
5 6 0.10 0.30 0.03;];
% Program to form Admittance And Impedance Bus Formation....
function ybus = ybus(); % Returns ybus
linedata = linedata6(); % Calling "linedata6.m" for Line Data...
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...
y = 1./z; % To get inverse of each element...
b = i*b; % Make B imaginary...

nbus = max(max(fb),max(tb)); % no. of buses...


nbranch = length(fb); % no. of branches...
ybus = zeros(nbus,nbus); % Initialise YBus...
% Formation of the Off Diagonal Elements...
for k=1:nbranch
ybus(fb(k),tb(k)) = -y(k);
ybus(tb(k),fb(k)) = ybus(fb(k),tb(k));
end
% Formation of Diagonal Elements....
for m=1:nbus
for n=1:nbranch
if fb(n) == m | tb(n) == m
ybus(m,m) = ybus(m,m) + y(n) + b(n);
end
end
end
ybus; % Bus Admittance Matrix
zbus = inv(ybus); % Bus Impedance Matrix
Ques1: Why Y-Bus matrix is known as sparse matrix ?
Ans: Because it has zero elements.
Ques2: What is the difference between Y-Bus and Z-Bus matrix?
Ans: Y-Bus is a sparse matrix while Z-Bus is a full matrix.
Ques3: Why bus impedance matrix is used?
Ans: For short circuit studies.
Ques4: What off diagonal element shows in Y matrix?
Ans: Mutual admittance.
Ques5: What diagonal elements of Z-bus matrix shows?
Ans: Driving point impedance of the nodes.

Experiment: 2
Aim:- To develop a program for Load flow solution for a 3-bus system using Gauss- Seidel, Newton Raphson
and FDLF methods up to 3 iteration.

Software Required:- MATLAB 7.9

Programming:

Program for busdata for load flow analysis using GAUSS-SIEDEL Method for a
6BUS system.

% Bus data for Load Flow Analysis.


function busdata = busdata6() % Returns busdata.
% |Bus | Type | Vsp | theta | PGi | QGi | PLi | QLi | Qmin | Qmax |
busdata = [ 1 1 1.05 0 0.0 0 0 0 0 0;
2 2 1.05 0 0.5 0 0 0 -0.5 1.0;
3 2 1.07 0 0.6 0 0 0 -0.5 1.5;
4 3 1.0 0 0.0 0 0.7 0.7 0 0;
5 3 1.0 0 0.0 0 0.7 0.7 0 0;
6 3 1.0 0 0.0 0 0.7 0.7 0 0 ];

Program for convertion of Polar to Rectangular coordinates


% Polar to Rectangular Conversion

function rect = pol2rect(r,o) % r = magnitude, o = angle in radians.


rect = r*cos(o) + j*r*sin(o); % rect = real + j*imag

% Line Data for Y-Bus Formation.


function linedata = linedata6() % Returns linedata.
% | From | To | R | X | B/2 |
% | Bus | Bus | | | |
linedata = [ 1 2 0.10 0.20 0.02;
1 4 0.05 0.20 0.02;
1 5 0.08 0.30 0.03;
2 3 0.05 0.25 0.03;
2 4 0.05 0.10 0.01;
2 5 0.10 0.30 0.02;
2 6 0.07 0.20 0.025;
3 5 0.12 0.26 0.025;
3 6 0.02 0.10 0.01;
4 5 0.20 0.40 0.04;
5 6 0.10 0.30 0.03;];

% Program for Gauss - Seidel Load Flow Analysis

% Assumption, Bus 1 is considered as Slack bus.


ybus = ybusppg(); % Calling program "ybusppg.m" to get Y-Bus.
busdata = busdata6(); % Calling "busdata6.m" for bus data.

bus = busdata(:,1); % Bus number.


type = busdata(:,2); % Type of Bus 1-Slack, 2-PV, 3-PQ.
V = busdata(:,3); % Initial Bus Voltages.
th = busdata(:,4); % Initial Bus Voltage Angles.
GenMW = busdata(:,5); % PGi, Real Power injected into the buses.
GenMVAR = busdata(:,6); % QGi, Reactive Power injected into the buses.
LoadMW = busdata(:,7); % PLi, Real Power Drawn from the buses.
LoadMVAR = busdata(:,8); % QLi, Reactive Power Drawn from the buses.
Qmin = busdata(:,9); % Minimum Reactive Power Limit
Qmax = busdata(:,10); % Maximum Reactive Power Limit
nbus = max(bus); % To get no. of buses
P = GenMW - LoadMW; % Pi = PGi - PLi, Real Power at the buses.
Q = GenMVAR - LoadMVAR; % Qi = QGi - QLi, Reactive Power at the buses.
Vprev = V;
toler = 1; % Tolerence.
iteration = 1; % iteration starting
while (toler > 0.00001) % Start of while loop
for i = 2:nbus
sumyv = 0;
for k = 1:nbus
if i ~= k
sumyv = sumyv + ybus(i,k)* V(k); % Vk * Yik
end
end
if type(i) == 2 % Computing Qi for PV bus
Q(i) = -imag(conj(V(i))*(sumyv + ybus(i,i)*V(i)));
if (Q(i) > Qmax(i)) || (Q(i) < Qmin(i)) % Checking for Qi
Violation.
if Q(i) < Qmin(i) % Whether violated the lower limit.
Q(i) = Qmin(i);
else % No, violated the upper limit.
Q(i) = Qmax(i);
end
type(i) = 3; % If Violated, change PV bus to PQ bus.
end
end
V(i) = (1/ybus(i,i))*((P(i)-1i*Q(i))/conj(V(i)) - sumyv); % Compute
Bus Voltages.
if type(i) == 2 % For PV Buses, Voltage Magnitude remains same, but
Angle changes.
V(i) = pol2rect(abs(Vprev(i)), angle(V(i)));
end
end
iteration = iteration + 1; % Increment iteration count.
toler = max(abs(abs(V) - abs(Vprev))); % Calculate tolerance.
Vprev = V; % Vprev is required for next iteration, V(i) =
pol2rect(abs(Vprev(i)), angle(V(i)));
end % End of while loop / Iteration
iteration; % Total iterations.
V; % Bus Voltages in Complex form.
Vmag = abs(V); % Final Bus Voltages.
Ang = 180/pi*angle(V); % Final Bus Voltage Angles in Degree.
Ques1: Which coordinates are utilized in GS method?
Ans: Rectangular coordinates.
Ques2: Which coordinates are utilized in NR method?
Ans: Polar coordinates.
Ques3: Which type of convergence is utilized in GS method?
Ans: Linear convergence.
Ques4: Which type of convergence is utilized in NR method?
Ans: Quadratic Convergence.
Ques5: Which type of convergence is utilized in FLDF method?
Ans: Geometric Convergence.

Experiment: 3

Aim:-Load flow solution for IEEE 6-bus and 30- bus system in Mat lab using Newton Raphson method.

Software Required:- MATLAB 7.9


Programming:

% Returns Initial Bus datas of the system...


function busdt = busdatas(num)
% Type....
% 1 - Slack Bus..
% 2 - PV Bus..
% 3 - PQ Bus..
% |Bus | Type | Vsp | theta | PGi | QGi | PLi | QLi | Qmin | Qmax |
busdat14 = [1 1 1.060 0 0 0 0 0 0 0;
2 2 1.045 0 40 42.4 21.7 12.7 -40 50;
3 2 1.010 0 0 23.4 94.2 19.0 0 40;
4 3 1.0 0 0 0 47.8 -3.9 0 0;
5 3 1.0 0 0 0 7.6 1.6 0 0;
6 2 1.070 0 0 12.2 11.2 7.5 -6 24;
7 3 1.0 0 0 0 0.0 0.0 0 0;
8 2 1.090 0 0 17.4 0.0 0.0 -6 24;
9 3 1.0 0 0 0 29.5 16.6 0 0;
10 3 1.0 0 0 0 9.0 5.8 0 0;
11 3 1.0 0 0 0 3.5 1.8 0 0;
12 3 1.0 0 0 0 6.1 1.6 0 0;
13 3 1.0 0 0 0 13.5 5.8 0 0;
14 3 1.0 0 0 0 14.9 5.0 0 0;];

% Polar to Rectangular Conversion


% [RECT] = RECT2POL(RHO, THETA)
% RECT - Complex matrix or number, RECT = A + jB, A = Real, B = Imaginary
% RHO - Magnitude
% THETA - Angle in radians

function rect = pol2rect(rho,theta)


rect = rho.*cos(theta) + j*rho.*sin(theta);

% Returns Line datas of the system...


function linedt = linedatas(num)
% | From | To | R | X | B/2 | X'mer |
% | Bus | Bus | pu | pu | pu | TAP (a) |
linedat14 = [1 2 0.01938 0.05917 0.0264 1
1 5 0.05403 0.22304 0.0246 1
2 3 0.04699 0.19797 0.0219 1
2 4 0.05811 0.17632 0.0170 1
2 5 0.05695 0.17388 0.0173 1
3 4 0.06701 0.17103 0.0064 1
4 5 0.01335 0.04211 0.0 1
4 7 0.0 0.20912 0.0 0.978
4 9 0.0 0.55618 0.0 0.969
5 6 0.0 0.25202 0.0 0.932
6 11 0.09498 0.19890 0.0 1
6 12 0.12291 0.25581 0.0 1
6 13 0.06615 0.13027 0.0 1
7 8 0.0 0.17615 0.0 1
7 9 0.0 0.11001 0.0 1
9 10 0.03181 0.08450 0.0 1
9 14 0.12711 0.27038 0.0 1
10 11 0.08205 0.19207 0.0 1
12 13 0.22092 0.19988 0.0 1
13 14 0.17093 0.34802 0.0 1 ];

% Program for Newton-Raphson Load Flow Analysis..


nbus = 14; % IEEE-14..
Y = ybusppg(nbus); % Calling ybusppg.m to get Y-Bus Matrix..
busd = busdatas(nbus); % 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..
Qmin = busd(:,9)/BMva; % Minimum Reactive Power Limit..
Qmax = busd(:,10)/BMva; % Maximum Reactive Power Limit..
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);
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

% Checking Q-limit violations..


if Iter <= 7 && Iter > 2 % Only checked up to 7th iterations..
for n = 2:nbus
if type(n) == 2
QG = Q(n)+Ql(n);
if QG < Qmin(n)
V(n) = V(n) + 0.01;
elseif QG > Qmax(n)
V(n) = V(n) - 0.01;
end
end
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
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..
end
Ques1: What is the main disadvantage of NR method ?
Ans: Elements of Jacobian are to be computed in each iteration.
Ques2: What is the main advantage of NR method ?
Ans: Convergence is not affected by the choice of slack bus.
Ques3: Why NR method is generally utilized ?
Ans: Because of its high versatility , accuracy and reliability
Ques4: For which type of systems NR method is generally utilized ?
Ans: Small system.
Ques5: Which type of convergence is utilized in NR method?
Ans: Quadratic Convergence.
Experiment: 4

Aim:- Assessment of transient stability of a single machine system.

Equal Area Criterion

As in previous notes, all powers are in per‐unit. I want to show you the equal area criterion a little differently than
the book does it. Let’s start from Eq. (2.43) in the book.

Note in (1) that the book calls ωRe as ωR; however, we need to use 377 (for a 60 Hz system). We can also write (1)
as

Now multiply the left‐hand‐side by ω and the right‐hand side by dδ/dt (recall ω= dδ/dt) to get:

Substitution of (4) into the left‐hand‐side of (3) yields:

Multiply by dt to obtain:

Now consider a change in the state such that the angle goes from δ1 to δ2 while the speed goes from ω1 to ω2.
Integrate (6) to obtain:
Note the variable of integration on the left is ω2. This results in

The left‐hand‐side of (8) is proportional to the change in kinetic energy between the two states, which can be
shown more explicitly by substituting H=Wk/SB = (1/2)JωR2/SB into (8), for H:

Returning to (8), let ω1 be the speed at the initial moment of the fault (t=0+, δ=δ1), and ω2 be the speed at
the maximum angle (δ = δr), as shown in Fig. 1 below. Note that the fact that we identify a maximum angle δ = δr
indicates an implicit assumption that the performance is stable. Therefore the following development assumes
stable performance

.
Since speed is zero at t=0, it remains zero at t=0+. Also, since δr is the maximum angle, the speed is zero at this
point as well. Therefore, the angle and speed for the two points of interest to us are (note the dual meaning of δ1:
it is lower variable of integration; it is initial angle):

δ1=δ1 δ=δr

ω1=0 ω2=0

Therefore, (8) becomes:

We have developed a criterion under the assumption of stable performance, and that criterion is:

Recalling that Pa=Pm‐Pe, we see that (9b) says that for stable performance, the integration of the accelerating
power from initial angle to maximum angle must be zero. Recalling again (8b), which indicated the left‐hand‐side
was proportional to the change in the kinetic energy between the two states, we can say that (9b) indicates
that the accelerating energy must exactly counterbalance the decelerating energy. Inspection of Fig. 1 indicates
that the integration of (9b) includes a discontinuity at the moment when the fault is 6 cleared, at angle δ=δc.
Therefore we need to break up the integration of (9b) as follows:

Taking the second term to the right‐hand‐side:

Carrying the negative inside the right integral:

Observing that these two terms each represent areas on the power‐angle curve, we see that we have developed
the so‐called equal‐area criterion for stability. This criterion says that stable performance requires that the
accelerating area be equal to the decelerating area, i.e.,
Where

Figure 2 illustrates :

Figure 2 indicates a way to identify the maximum swing angle, δr. Given a particular clearing angle δc, which in
turn fixes A1, the machine angle will continue to increase until it reaches an angle δr such that A2=A1.

More severe stability performance


Stability performance become more severe, or moves closer to instability, when A1 increases, or if available A2
decreases. We consider A2 as being bounded from above by δm, because, as we have seen in previous notes, δ
cannot exceed δm because δ>δm results in more accelerating energy, not more decelerating energy. Thus
we speak of the “available A2” as being the area within Pe3 ‐ Pm bounded on the left by δc and on the right by
δm.Contributing factors to increasing A1, and/or decreasing available A2, are summarized in the following four
bullets and corresponding illustrations.

1. Pm increases: A1 increases, available A2 decreases


2. Pe2 decreases: A1 increases

3. Tc increases: A1 increases, available A2 decreases

4. Pe3 decreases: available A2 decreases


Instability and critical clearing angle/time

Instability occurs when available A2 < A1. This situation is illustrated in Fig. 7.

Consideration of Fig. 7 raises the following question: Can we express the maximum clearing angle for marginal
stability, δcr, as a function of Pm and attributes of the three power angle curves, Pe 1, Pe2, and Pe3.The answer is
yes, by applying the equal area criterion and letting δc = δcr and δr = δm. The situation is illustrated in Fig. 8.

Applying A1=A2, we have that


The approach to solve this is as follows;

1. Substitute Pe2 = Pm2 sinδ, Pe3 = Pm3sinδ

2. Do some algebra.

3. Define r1= Pm2 / Pm1, r2 = Pm3 / Pm1,, which is the same as r1 = X1 / X2 , r2 = X1 / X3.

4. Then you obtain :

Conclusion:

Equal area criteria and the effect of critical clearing angle on stability has been studied and different P - δ has
been shown.

Potrebbero piacerti anche