You are on page 1of 79

Exp.

No:
Date:

POWER FLOW ANALYSIS BY NEWTON-RAPHSON METHOD

Aim:

To develop Newton-Raphson (N-R) method for solving power flow equations.To


develop the expressions for the elements of Jacobian matrix. To demonstrate the iterative
process of N-R method using the given test system and to check the results with the available
load flow programs using MATLAB software.

Development of N-R Method:


Modeling Assumption
 Bus generation and demands are modeled by complex power injections.
 Lines and transformers are modeled by PI equivalent circuit.
 Shunt compensators by shunt susceptance.

Statement of Practical Power Flow Problem


Given
The network configuration, complex bus power injection at all the buses except slack
bus and the complex bus voltages at the slack bus.

To Determine
To determine the complex bus voltages at all the buses except slack bus.
Hence only the (n-1) complex power equations are taken and iteratively solved to get the (n-
1) unknown complex voltages.

Operating Constraints

 To maintain acceptable voltage profile it is necessary to maintain the voltage


magnitude of generator buses distributed throughout the system at values higher than
1.0 per unit.
 In practice “Voltage Control” is achieved by AVR’s and excitation system available
at each generating station. At these buses only P-injection and voltage magnitude are
specified and hence they are called P-V buses.
 While solving power flow problem the voltage magnitude at the P-V buses are
required to be held at specified value provided the reactive power generation at this
bus is within the reactive limits QGmax and QGmin.

1
Power Flow Model

The complex power balance at bus k is given by

(PIk + jQIk) = Pk + jQk (1)

Where the complex power injection at the kth bus (PIk + jQIk) is equal to the complex power
flowing into the network through all the lines connected to kth bus (PIk + jQIk). Since the bus
generation and demand are specified, the complex power injection is a specified quantity and
is given by

PIk (sp) + jQIk (sp) = (PGk (sp) – PDk (sp)) + j (QGk (sp) – QDk (sp)) (2)

The complex power (Pk + jQk) can be written as a function of state variables as
N
Pk + jQk = Vk Ik* = Vk ∑ Y*km V*m (3)
m=1
Substituting Vk =|Vk|∟δk and Ykm = |Ykm| ∟θkm, equation (3) becomes
N
Pk (δ, V) = |Vk| ∑ │Ykm││Vkm│cos (δk-δm-θkm) (4)
m=1
N
Qk (δ, V) = |Vk| ∑│Y km│ │Vm│sin (δk-δm-θkm) (5)
m=1
Substituting equations (2), (4) and (5) in equation (1) we get the following two power balance
equations for kth bus.

Pk (δ, V) - PIk (sp) = 0 (6)

Qk (δ, V) - QIk (sp) = 0 (7)

Load Flow model in real variable form is compiled by adopting the following rules:
(i) For every bus whose bus phase angle δ is unknown, include the respective real
power balance equation (6)
(ii) For every bus whose bus voltage magnitude |V| is unknown, include the respective
reactive power balance equation (7)

Thus for a system with a slack bus and M P-V buses, the number of real power balance
equation.NP is given by,
NP = N-1
and the number reactive power balance equations.NQ is given by,
2
NQ = N-M-1
Assuming that the buses are numbered with P-Q buses first, followed by P-V buses and then
by the slack bus, the Load Flow model for the system with M P-V buses is given by

fk = Pk(δ,V) – PIk(sp) = 0; k=1,2,……..NP (8)

fk+NP = Qk (δ,V) – QIk(sp) = 0; k =1,2,…..NQ (9)

Where expressions Pk (δ,V) and Qk (δ,V) are given by equations (4) and (5). Equations (8)
and (9) can be written in compact form as

F(X) = 0 (10)

Where X = state vector= (δ1, δ2 …δNP, V1, V2…V NQ) T and the number of nonlinear
equations in F in equation (10) is equal to (NP+NQ)
Compact power flow equation has to be solved using N-R method to obtain the state vector
through iterative process. Once the solution is obtained the unknown real and reactive
injections and power flow in each line can be computed.

Newton-Raphson Load Flow (NRLF) Algorithm

Let us assume a solution X0 to equation (10) and let the correct solution to (10) be X0
+ΔX. Expanding equation (10) by Taylor series at X0, and neglecting second and higher order
terms we get

F(X0 + ΔX) =0ᴝF(X0) + (𝜕F/𝜕X)|X0-ΔX (11)

Equation (11) can be written as

(𝜕F/ 𝜕X)|X0ΔX = -F(X0) (12)

The voltage correction scheme for Newton-Raphson method can be obtained by expanding
equation (12) as

𝐻 𝑁 ∆𝑉∆𝑃 ∆𝑃
( ) ( │) = ( ) (13)
𝐽 𝐿 │𝑉 ∆𝑄

Where H = (𝜕P/ 𝜕δ); N = (𝜕P/ 𝜕V|) |V|


J = (𝜕Q/𝜕𝛿); L = (𝜕Q/ 𝜕V|) |V| (14)

ΔP = real power mismatch vector = PI (sp) – P (δ, |V|) (15)


ΔQ = reactive power mismatch vector = QI (sp) – Q (δ, |V|) (16)

The updated state vector is given by

3
(17)
The elements of the Jacobin matrix are given below Off – diagonal elements:

Hkm = Lkm = |Vk | |Vm| (Gkm sinδkm – Bkm cosδkm) (18)

Nkm = -Jkm = |Vk| |Vm| (Gkm cosδkm + Bkm sinδkm) (19)

Diagonal elements:

Hkk = -Qk – Bkk |Vk| 2; Lkk = Qk – Bkk |Vk| 2 (20)

Nkk = Pk + Gkk |Vk| 2; Jkk = Pk – Gkk |Vk|2 (21)

Where Ykm = Gkm + jBkm

The following are the steps of NRLF algorithm:

1. Assume “flat start” for starting voltage solution


δ k (h) = 0.0; for h=0 ; k=1,……… NP (for all buses except slack k bus)
|Vk (h) | = 1.0; for h=0; k=1, 2…NQ (for all P -Q buses)
|Vk (h) | = |Vk|sch for all P-V buses and slack bus.

2. Compute mismatch vector using equation (15) and (16)

3. Compute Otherwise go to step 4.

4. Compute Jacobin matrix using equation (18), (19), (20), and (21)

5. Obtain state correction vector by solving equation (13) using optimally ordered triangular
factorization.

6. Update state vector using equation (17). Go to step 2.

4
Flowchart
Read Data: , , k=1,2 …N k=1,2,…NP

, , where , tolerance

Set Flat Start ;

Compute Mismatch Vector C,

Yes
Is

No

Compute Line Flow Line Losses


Compute Jacobian matrix
and Slack bus power
Compute Voltage Correction

Print Solution

Update state vector Stop

Set

Q limit check for P-V BUs

5
Q Limit Check for P-V bus

Compute

Set

Do

Yes
Is

No

Yes
Is

No
Switch bus k to P-Q bus

Switch bus k to P-Q bus Is bus k is at P-Q bus status


switch back to P-V bus status
change Change

Change

Set

6
B
Exercise

1. Perform the load flow study for the given system using Newton Raphson Method

G1 G2

T1 T2

Line charging
Line No Starting bus Ending bus Series line impedance
admittance
1 1 2 0.2+0.6j 0.05j
2 2 3 0.25+0.0125j 0.035j
3 3 1 0.02+0.28j 0.015j

Reactive
Line No Starting bus Voltage magnitude Angle Real power
power
1 1 1.04 0 0 0
2 2 1 10.69 0 0
3 3 1.05 20 0 0

2. Verify the result using MATLAB

7
PROGRAM

clc
clear all
sb=[1 1 2]; %input('Enter the starting bus = ')
eb=[2 3 3]; % input('Enter the ending bus = ')
nl=3; %input(' Enter the number of lines= ')
nb=3; %input(' Enter the number of buses= ')
sa=[1.25-3.75j 5-15j 1.667-5j]; %input('Enter the value of series impedance =')
Ybus=zeros(nb,nb);
for i=1:nl
k1=sb(i);
k2=eb(i);
y(i)=(sa(i));
Ybus(k1,k1)=Ybus(k1,k1)+y(i);
Ybus(k2,k2)=Ybus(k2,k2)+y(i);
Ybus(k1,k2)=-y(i);
Ybus(k2,k1)=Ybus(k1,k2);
end
Ybus
Ybusmag=abs(Ybus);
Ybusang=angle(Ybus)*(180/pi);
% Calculation of P and Q
v=[1.06 1 1];
P=[0 0 0];
Q=[0 0 0];
del=[0 0 0];
Pg=[0 0.2 0];
Pd=[0 0 0.6];
Qg=[0 0 0];
8
Qd=[0 0 0.25];
for p=2:nb
for q=1:nb
P(p)=P(p)+(v(p)*v(q)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q)));
Q(p)=(Q(p)+(v(p)*v(q)*Ybusmag(p,q)*sin(del(p)-angle(Ybus(p,q))-del(q))));
Pspe(p)=Pg(p)-Pd(p);
Qspe(p)=Qg(p)-Qd(p);
delP(p)=Pspe(p)-P(p);
delQ(p)=Qspe(p)-Q(p);
end
end
P;
Q;
Pspe;
Qspe;
delP;
delQ;
%Calculation of J1
P2=[0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
P1=2*v(p)*Ybusmag(p,q)*cos(angle(Ybus(p,q)));
for j=1:nb
if (j~=p)
P2(q)=P2(q)+v(j)*Ybusmag(q,j)*cos(del(q)+angle(Ybus(q,j))-del(j));
PV(p,q)=P1+P2(q);
end
end
9
else
PV(p,q)=v(p)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q));
end
end
end
PV;
% Calculation of J2
Pdel=[0 0 0;0 0 0;0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
for j=1:nb
if(j~=p)
Pdel(p,q)=Pdel(p,q)-v(j)*v(q)*Ybusmag(q,j)*sin(del(q)-angle(Ybus(p,j))-del(j));
end
end
else
Pdel(p,q)=-v(p)*v(q)*Ybusmag(p,q)*sin(del(p)+angle(Ybus(p,q))-del(q));
end
end
end
Pdel;
%Calculation of J3
Q2=[0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
Q1=2*v(p)*Ybusmag(p,q)*sin(-angle(Ybus(p,q)));
for j=1:nb
10
if (j~=p)
Q2(q)=Q2(q)+v(j)*Ybusmag(q,j)*sin(del(q)-angle(Ybus(q,j))-del(j));
QV(p,q)=Q1+Q2(q);
end
end
else
QV(p,q)=v(p)*Ybusmag(p,q)*sin(del(p)-angle(Ybus(p,q))-del(q));
end
end

end
QV;
%Calculation of J4
Qdel=[0 0 0;0 0 0;0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
for j=1:nb
if(j~=p)
Qdel(p,q)=Qdel(p,q)+v(j)*v(q)*Ybusmag(q,j)*cos(del(q)+angle(Ybus(p,j))-
del(j));
end
end
else
Qdel(p,q)=-v(p)*v(q)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q));
end
end
end
Qdel;

11
%Jacobian matrix
PV(1,:)=[ ];
PV(:,1)=[ ];
Pdel(1,:)=[ ];
Pdel(:,1)=[ ];
QV(1,:)=[ ];
QV(:,1)=[ ];
Qdel(1,:)=[ ];
Qdel(:,1)=[ ];
J=[PV Pdel;QV Qdel]
%Find the change in v&del
delP(1:1)=[];
delQ(1:1)=[];
delpq=[delP';delQ']
vdel=inv(J)*delpq
%Find new v&del
for i=1:nb-1
for j=2:nb
vnew(i)=v(j)+vdel(i);
delnew(i)=del(j)+vdel(i+2);
end
end
VNEW=[v(1) vnew]
DELNEW=[del(1) delnew]

12
OUTPUT:
Enter the number of buses: 3
Enter the number of lines: 3
Enter the number of starting bus: [1 1 2]
Enter the number of ending buses: [2 3 3]
Enter the details of series line impedance: [0 -0.2-0.6j -0.02-0.28j; -0.2-0.6j 0 -0.25-0.0125j; -
0.02-0.28j -0.25-0.0125j 0]
Enter the details of line impedance: [0 -20j -66.67j; -20j 0 -28.57j; -66.67j -28.57j 0]
Ybus =
-0.2538 -63.1167i 0.5000 - 1.5000i 0.2538 - 3.5533i
0.5000 - 1.5000i -3.9900 -28.3705i 3.9900 - 0.1995i
0.2538 - 3.5533i 3.9900 - 0.1995i -3.9900 -28.3705i
Enter the voltage magnitude of bus1:1.04
Enter the angle of bus1:0
Enter the real power of bus1:0
Enter the reactive power of bus1:0
Enter the voltage magnitude of bus2:1
Enter the angle of bus2:10.69
Enter the real power of bus2:0
Enter the reactive power of bus2:0
Enter the voltage magnitude of bus3:1.05
Enter the angle of bus3:20
Enter the real power of bus3:0
Enter the reactive power of bus3:0
The jacobian matrices are:
1.6531 -0.6879 -10.7867 -4.1860
0.2717 -2.1082 -4.1380 -16.4133
-2.8067 4.1860 55.0879 0.6879
4.1380 -7.6153 -0.2717 64.6651
The voltage magnitudes are: 1.04 0.52354 0.54972
The phase values are: 0 16.5966 17.564

13
Result:

Load flow for the given test system is carried out by Newton Raphson method and the
results have been verified by the MATLAB programs.
14
Exp.No:
Date:

POWER FLOW ANALYSIS BY FAST DECOUPLED METHOD

Aim:

To develop Fast Decoupled (FDPF) method for solving power flow equations. To
demonstrate the iterative process of FDPF method using the given test system and to check
the results with the MATLAB software

Development of FDPF Method:

FDPF improves the speed and reliability of convergence and to reduce storage
requirements.

Decoupling Process

 There is a loose physical interactions between the real and reactive power flow in the
power system
 Values of elements of sub matrix and are relatively small when compared to
the sub matrix and .
 The first step in decoupling process is to neglect the coupling sub matrix and .

(1)

(2)
(3)
Where
(4)

(5)

(6)

(7)
and where
(8)

Assumptions:

Physically justifiable assumptions can be made which are always valid

 is very small and hence and

15
Invoking the following in (7) and (8)
(9)
(10)
 Assuming all values of to be equal to and comparing the value of with
it is found and hence
(11)
 and can be expressed in
matrix form as
(12)
(13)
in (12) and (13) is negative bus susceptance matrix.
 Three step process to improve decoupling
o Divide the ith equation of (12) and (13) by thereby removing the L.H.S
terms to the denominator of the R.H.S terms.
o Remove the influence of Q-flow on the calculation of
 By setting all the R.H.S terms to in (12)
 By omitting shunt reactance’s and off nominal tap ratio from in
(12)
 By neglecting series resistance while calculating in (12) which
makes it a D.C load flow matrix.

FDPF Method

(a) Omitting from [B’] the representation of those network elements that
predominantly affect MVAR flows, i.e shunt reactances and off- nominal in-phase
transformer taps (tap ratio istaken as 1 p.u.)

(b) Omitting from [B”] the angle shifting effects of the phase shifters (phase shifter
ratio taken as 1.p.u

With the above approximations, the final FDPF model becomes

[B’] Δδ = ΔP/|V| (14)

[B”] ΔV| = ΔQ/|V| (15)

Both B’ and B” are real, sparse matrices and have the structures of [H] and [L] respectively

16
Q Limit Check for P-V bus

17
Read Data: Assume “Flat start” for ; ;

Compute: . Factorize and compute sensitivity


factors

Compute mismatch vector

Is Ye
s

No

Compute and update

No Yes

Compute mismatch vector

Is Ye
s

No

Compute and update

No Yes

B
A Converged.
PV bus adjustment Compute and Print
solution
18

10
Exercise:

1. Perform the load flow study for the given system using Fast Decoupled Method

G1 G2

T1 T2

Line
Line Starting Ending Series line Real Reactive
charging Voltage
No Bus Bus Impedance Power Power
Admittance

1 1 2 0.02+0.04j 0.05j 1.05 0 0

2 2 3 0.01+0.03j 0.025j 1 0.2 0

3 1 3 0.0125+0.02j 0.025j 1 0.3 0.002

2. Verify the result using MATLAB


.

19
PROGRAM

% clear all;
busd = Bus_Data;
nbus = max(busd(:,1));
Y = ybusppg(nbus, Line_Data); % Calling ybusppg.m to get Y-Bus Matrix..
BaseMVA = 100; % Base MVA..
bus_num = busd(:,1); % Bus Number..
bus_type = busd(:,2); % Type of Bus 1-Slack, 2-PV, 3-PQ..
V = busd(:,3); % Specified Voltage..
theta = busd(:,4); % Voltage Angle..
Pgen = busd(:,5)/BaseMVA; % PGi..
Qgen = busd(:,6)/BaseMVA; % Qgeni..
Pload = busd(:,7)/BaseMVA; % Ploadi..
Qload = busd(:,8)/BaseMVA; % Qloadi..
Qmin = busd(:,9)/BaseMVA; % Minimum Reactive Power Limit..
Qmax = busd(:,10)/BaseMVA; % Maximum Reactive Power Limit..
dPbyV = (-Pgen+Pload)./abs(V); % Pi = Pgeni - Ploadi..
dQbyV = (-Qgen+Qload)./abs(V); % Qi = Qgeni - Qloadi..
Pspec = dPbyV; % P Specified..
Qspec = dQbyV; % Q Specified..
G = real(Y); % Conductance matrix..
B = imag(Y); % Susceptance matrix..

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


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

Tol = 1;
Iter = 1;

%Calculate B^-1 matrix


slack_bus = find(bus_type==1);
B_P = B;
B_P(:,slack_bus) = [];
B_P(slack_bus,:) = [];

B_Q = B;
for i=1:npv
B_Q(:,pv(i)-i+1) = [];
B_Q(pv(i)-i+1,:) = [];
end

BMva = 100; % Base MVA..

while (Tol > 1e-5 && Iter < 10) % Iteration starting..

dPbyV = zeros(nbus,1);
20
dQbyV = zeros(nbus,1);
% Calculate P and Q
for i = 1:nbus
for k = 1:nbus
dPbyV(i) = dPbyV(i) + V(k)*(G(i,k)*cos(theta(i)-theta(k)) + B(i,k)*sin(theta(i)-
theta(k)));
dQbyV(i) = dQbyV(i) + V(k)*(G(i,k)*sin(theta(i)-theta(k)) - B(i,k)*cos(theta(i)-
theta(k)));
end
end

% Checking Q-limit violations..


if Iter <= 7 && Iter > 2 % Only checked up to 7th iterations..
for n = 2:nbus
if bus_type(n) == 2
QG = dQbyV(n)*V(n)+Qload(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 = Pspec-dPbyV;
dQa = Qspec-dQbyV;

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

deltaTh = (-B_P)\dP;
deltaV = (-B_Q)\dQ;

% Updating State Vectors..


theta(2:nbus) = deltaTh + theta(2:nbus); % Voltage Angle..
k = 1;
for i = 2:nbus
if bus_type(i) == 3
V(i) = deltaV(k) + V(i); % Voltage Magnitude..
21
k = k+1;
end
end

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

end

22
OUTPUT

Piter Qiter

0 0 1 0.0 0.65 -

1 0 1 -2.2345 - 0.480400

1 1 0.9679 - 0.075759 -

2 1 - -1.965 - 0.006451

2 2 0.9675 - 0.008923 0.012617

23
Result:

The FDPF for the given test system is carried out ant the results have been verified by using
MATLAB

24
Exp. No:
Date:
ECONOMIC DISPATCH WITHOUT LOSSES USING LAMBDA-ITERATION
METHOD

AIM:
To compute the optimal economical scheduling of the generators with & without considering
the network losses for the given system

THEORY:

ECONOMIC DESPATCH WITHOUT LOSSES:

Consider a system of N – generating units connected to a single bus bar serving a


received electrical load Pload. The input of each unit, Fi represents the cost rate (Rs./Hr). The
output of each unit Pi is the electrical power generated by that particular unit. The total cost
rate (FT) subject to the constraint that the sum of the output powers must equal the reactive
load.

 
N
Objective Function: in FT   F Pi
i 1 i
Where Fi =αi + βiPi + γiPi2

Subjected to the following constraints,


Equality Constraint,
N
PLOAD   Pi , Where FT  F1  F2  .............  FN
i 1
N – Number of generating units
Here the transmission losses are neglected
In Equality Constraint,
Pi, min  Pi  Pi, max

25
Pi, min_--- Minimum Power generation from plant i.
Pi, max -- Maximum Power generation from plant i.
N
Let   PLOAD   Pi  0
i 1
By making use of Lagrangian multiplier the auxiliary function is obtained as
 N 
L  FT   , i.e, L  FT    PLOAD   Pi 
 
 i 1 
  Lagrangian Multiplier
Differentiating L wrt Pi and equating to zero
L Fi Pi  
   (0  1)  0
Pi Pi
Fi

Pi
the condition for optimum operation is

F1 F2 F
  ..........................  N  
P1 P2 PN
Fi
is the Incremental production cost of the unit i.
Pi
ALGORITHM FOR ECONOMIC DISPATCH METHOD:

WITH OUT CONSIDERING LOSSES:

1. Find the initial value of λ by using the formula given below,

λ=

2. Find the value of power output of all the generators by using the formula given below
Pi =
3. Check the value of power residue .If it is zero then stop the iteration and print the optimal
schedule otherwise go to next step.
ΔP= Pload -

4. Calculate the change in λ and update the value of λ by using the equations given below,
Δλ =

λ new= λ + Δλ

5. Go to step 2

26
PROBLEM:
1. The given cost function of the 3 Generating units are given below,
C1 = 561+7.92+0.001562P12 Rs/Hr
C2 = 310+7.85P2+0.00194P22 Rs/Hr
C3 = 78+7.97P3+0.00482P32 Rs/Hr

Where P1, P2, P3 are in MW. The total system load is PD = 975MW. The MW limits of the
generating units are given below,
150 P1 600
100 P2 400
50 P3 200
The fuel cost of all the unit is 1 Rs/MBtu.The generating units contributes to satisfy a load
demand of 850 MW. The loss expression is given as
Ploss=0.00003P12 +0.0000982P22+0.00012P32 in MW.

Write the program in C/ MAT Lab to calculate the optimum dispatch scheduling for the
above problem

27
PROGRAM

clear all
clc
n=3;
demand=925;
a=[.0056 .0045 .0079];
b=[4.5 5.2 5.8];
c=[640 580 820];
pmin=[200 250 125];
pmax=[350 450 225];
x=0;y=0;
for i=1:n
x=x+(b(i)/(2*a(i)));
y=y+(1/(2*a(i)));
lamda=(demand+x)/y
ptotal=0;
for i=1:n
pg(i)=(lamda-b(i))/(2*a(i));
pgtotal=sum(pg);
end
pg
for i=1:n
if(pmin(i)<=pg(i)&&pg(i)<=pgmax(i));
pg(i);
else
if(pg(i)<=pmin(i))
pg(i)=pmin(i);

28
else
pg(i)=pmax(i);
end
end
pgtotal=sum(pg);
end
pg
if pgtotal~=demand
demandnew=demand-pg(i)
x1=x1+(b(i)/(2*a(i)));
y1=y1+(1/(2*a(i)));
end
lambdanew=(demandnew+x1)/y1
for i=2:n
pg(i)=(lambdanew-b(i)))/(2*a(i)));
end
end
end
pg

29
OUTPUT

Enter the number of generating units3

Enter the details for unit 1

Enter the coefficient of Pg^2 0.001562

Enter the coefficient of Pg7.92

Enter the coefficient 561

Enter the Pmin value150

Enter the Pmax value600

Enter the fuel cost1

Enter the details for unit 2

Enter the coefficient of Pg^20.00194

Enter the coefficient of Pg7.85

Enter the coefficient 310

Enter the Pmin value100

Enter the Pmax value400

Enter the fuel cost1

Enter the details for unit 3

Enter the coefficient of Pg^20.00482

Enter the coefficient of Pg7.97

Enter the coefficient 78

Enter the Pmin value50

Enter the Pmax value200

Enter the fuel cost1

FLAPC =

30
9.7922 9.4010 9.3240

FLAPC =

9.3240 9.4010 9.7922

psmin =

300 150 50

psmax =

1200 600 200

Enter the initial value of lambda7

Enter the Pd value850

For the combination 3

Total Fuel Cost=

8.1944e+003

At the end of Iteration=

100

Power of the units

122.2264 334.6038 393.1698

lambda=

9.1483

31
32
RESULT:
The optimal economical scheduling of the generators without losses are obtained for
the given system.

Exp. No:4
Date:
ECONOMIC DISPATCH WITH LOSSES USING LAMBDA-ITERATION METHOD

AIM:
To compute the optimal economical scheduling of the generators with considering the
network losses for the given system.

Theory:

ECONOMIC DESPATCH WITH LOSSES:


Consider a system of N – generating units connected to a single bus bar serving a
received electrical load Pload. The input of each unit, Fi represents the cost rate (Rs./Hr). The
output of each unit Pi is the electrical power generated by that particular unit. The total cost
rate (FT) subject to the constraint that the sum of the output powers must equal the reactive
load.

TRANSMSSION N/W
WITH LOSSES
PLOSS

 
N
Objective Function Min FT   F Pi
i 1 i
Subjected to the following constraints
Equality Constraint,
N
PLOAD  PLOSS   Pi
i 1
N – Number of generating units
PLOAD -Total load of the system

33
PLOSS -Total Network losses of the system.
In Equality Constraint,
Pi, min  Pi  Pi, max
Pi, min_--- Minimum Power generation from plant i.
Pi, max -- Maximum Power generation from plant i.
The Lagrangian function was formulated by adding the constraints to the objective
function by using lagrangian multiplier and is given below,
N
Let   PLOAD  PLOSS   Pi
i 1
PLOSS is the total system loss
Making use of the Lagrangian multiplier, the auxiliary function is
L  FT  
 N 
L  FT   PLOAD  PLOSS   Pi 

 
 i 1 
Differentiating L wrt Pi and equating to zero

L Fi P P N P
   ( LOAD  LOSS   i )  0
Pi Pi Pi Pi i 1 Pi
Fi  P 
   0  LOSS  1  0
Pi  Pi 
 
Fi  P 
   LOSS         Coordination Equation
Pi  P 
 i 
PLOSS
= Incremental Transmission loss at plant i
Pi
 = Incremental production cost (Rs/MWHr).
ALGORITHM FOR ECONOMIC DISPATCH METHOD:

WITH CONSIDERING LOSSES:


1. Find the initial value of λ by using the formula given below,

λ=

2. Find the value of power output of all the generators by using the formula given below
Pi =
3. Check the value of power residue .If it is zero then stop the iteration and print the optimal
schedule otherwise go to next step.
ΔP= Pload - +

4. Calculate the change in λ and update the value of λ by using the equations given below,

34
Δλ =

λ new= λ + Δλ
1. Go to step
PROGRAM:

%lambda iteration

Clear all;

Clc;

n=input(‘enter the no:of units’);

a=input(‘enter the a coefficients’);

b=input(‘enter the b coefficients’);

pd=input(‘enter the power demand’);

B=input(‘enter the Bmn coefficients’);

for i=1:n

s1(i)=b(i)/(2*a(i));

s2(i)=1/(2*a(i));

end

nr=sum(s1);

dr=sum(s2);

lambda=(pd+nr)/dr;

lambda

for j=1:4

disp=(‘iteration’)

for i=1:n

p(i)=(lambda-b(i))/(2*a(i)+lambda*B(i,i));

end

g=sum(p);

p1=((p(1)^2)*B(1,1))+((p(2)^2)*B(2,2))+(2*B(1,2)*p(1)*p(2));

delp=pd+p1-g;

if delp<1
35
p;

else

for i=1:n

c1(i)=a(i)+B(i,i)*b(i);

c2(i)=2*(a(i)+(lambda*B(i,i)))^2;

c(i)=c1(i)/c2(i);

end

z=sum(c);

dellambda=delp/z;

end

h=g-p1

ifh<pd

lambda=lambda+dellambda

else

lambda=lambda-dellambda

end

end

36
RESULT:
The optimal economical scheduling of the generators with & without losses are
obtained for the given system.
37
Exp.No: 5
Date:
ANALYSIS OF SWITCHING SURGE USING MATLAB: ENERGISATION OF A
LONG DIDTRIBUTED-PARAMETER LINE

AIM:

To study and understand the electromagnetic transient phenomenon in power system


caused by switching and fault by using MATLAB

Software Required:

MATLAB software

Theory:

Solution method for electromagnetic transient analysis Intentional and inadvertent


switching operations in EHV system initiate over voltages, which might obtain dangerous
value resulting in distinction of observation. Accurate Computation of these over voltages is
essential for proper sizing co ordination of insulation of various equipments and specification
of protection devices.

The Models of equipment must be detailed enough to reproduce actual condition


successfully an important aspect where a general purpose digital computers program source
are transient network analysis. Any network which consists of inter connection of resistance,
Inductance circuits distributed parameters line and other certain elements can be solved.

Intentional and inadvertent switching operations in EHV system initiate over voltages,
which might obtain dangerous value resulting in distinction of apparatus. Accurate
Computation of these over voltages is essential for proper sizing co ordination of insulation
of various equipments and specification of protection devices. Meaningful design of EHV
system is dependent on modeling philosophy built in to a computer program.

38
Simulation:

39
OUTPUT:

40
41
RESULT:

The study of transient due to energization of a long distributed parameter line has
been performed.

42
Exp.No: 6
Date:
SIMULATION AND IMPLEMENTATION OF VOLTAGE SOURCE INVERTER

Aim:

To study and understand the voltage source inverter by using MATLAB.

Software Required:

MATLAB software

Theory:

A. single phase voltage source inverter:

B.THREE PHASE VOLTAGE SOURCE INVERTER:

Three-phase Current Source Inverter (CSI) has distinct advantage over Voltage Source
Inverter (VSI) drives primarily due to following reasons:
1. The drive is current sensitive. Torque is directly related to stator current and rather
nonlinearly with stator voltage.
2. The drive is regenerative. Hence the control of current ensures the direct and precise
control of the electromagnetic torque. Pulse width modulation (PWM) current source inverter
(CSI) fed ac motor drives are often used in high power (1,000–10 000 hp) applications. The
CSI drive has the features of simple structure:
1. Reliable short circuit protection
2. Four quadrant operation capability and nearly sinusoidal outputs.
3. Low output dv/dt resulting from filtering effect of output capacitors.
4. In addition, the switching device [symmetrical GTO or gate commutated thyristor
(GCT)] used in the CSI can be easily connected in series, which makes the CSI drive
particularly suitable for implementation at medium voltage (2300 V–7200 V) levels.
These advantages outweigh the other disadvantages of the CSI topology.
The Current Source PWM Rectifier can be used as the front end as a DC link source. The
rectifier can be operated at unity power factor. As compared with VSI there is intense need
for developing modulation and control strategies for CSI. The performance of CSI in very
high power applications still holds good essentially due to the ruggedness and ability to meet
load demands easily.
The six-step or square wave inverters switching leads to large amount of harmonics in
load voltage and current, the widespread application of this inverter has been curbed.

43
In complying with Kirchhoff’s voltage (KVL) and current (KCL) law, the VSI is
restricted in the sense that both the devices in a leg cannot be on at the same, else it would
result in shorting of the DC link capacitor. But it does allow the shorting of the adjacent legs.
Similarly for CSI it is mandatory that only one device in the top and only one in the bottom is
on at a time, else the output capacitors will be shorted but it does allow the shorting of the
same leg. Table gives the switching states available in a voltage source converter.
Switching states of VSI:

From the VSI states the occurrence of the null states causes a train of shorting pulses hence
the main issue arising here is the distribution of these shorting pulses in the given cycle. In
order to have minimum harmonics on the output waveform, the distribution has to be
symmetric. It is known that in a three- phase system each phase voltage is maximum
/minimum for 120° in every cycle. If the line-line voltages are considered, then the
maximum/minimum is 120° but distributed 60° in a cycle. This 60° distribution is essential
for generation of symmetric output current waveforms. For example, Vap has its maximum
occurring in sector I for 60° and VI for 60°, thus the effective period for which the amplitude
of Vap is maximum is 120° but it is distributed by 60° in a cycle. It is also known that this
sequence can be achieved using the absolute maximum of the line-line voltages of the
reference signals.

44
Generation of distribution logic for the NULL states:

Switching modes of the three-phase voltage source inverter and corresponding


stationary reference frame qdo voltages:

45
Simulation of single phase inverter:

46
Output:

47
Simulation of three phase inverter:

48
OUTPUT:

49
RESULT:
The experiment of implemented and simulated results is obtained for voltage source
inverter.
50
EXP.NO:7

DATE:
TRANSIENT STABILITY ANALYSIS OF SINGLE MACHINE
INFINITE BUS SYSTEM USING CLASSICAL MACHINE MODEL

AIM:
To become familiar with various aspects of the transient stability analysis of Single-
Machine Infinite Bus (SMIB) system using classical machine model.

SOFTWARE REQUIRED:
MATLAB software

THEOREM:
Stability problem is concerned with the behavior of power system when it is subjected
to disturbances and is classified into small signal stability problem if the disturbances are
small and transient stability problem when the disturbances are large. The description of the
problems are as follows.
When a power system is under steady state, the load plus transmission loss equals to
the generation in the system. The generating units run at synchronous speed and system
frequency, voltage, current and power flows are steady. When a large disturbance such as
three phase fault, loss of load, loss of generation etc., occurs the power balance is upset and
the generating units rotors experience either acceleration or deceleration. The system may
come back to a steady state condition maintaining synchronism or it may break into
subsystems or one or more machines may pull out of synchronism. In the former case the
system is said to be stable and in the later case it is said to be unstable.

Mathematical Modeling For Transient Stability


Consider a single machine connected to an infinite bus shown in figure. An infinite
bus is a source of invariable frequency and voltage.

Single machine connected to infinite bus system

51
The equivalent circuit with the generator represented by classical model and all resistances
neglected is shown in figure below.

Equivalent circuit

Reduced equivalent circuit

E’ = Et + jX’ dIt
X = X’ d +XE where XE = Xtr + X1 || X2

Where

E’ = e.m.f behind machine transient reactance


= rotor angle with respect to synchronously rotating phasor Eb L00.
E leads Eb by δ
ω= synchronous speed of rotor
Pe = electrical power output of generator in p.u

52
Swing Equation:
During any disturbance in the system, the rotor will accelerate or decelerate with
respect to synchronously rotating axis and the relative motion begins. The equation
describing the relative motion is called as swing equation.
The following assumptions are made in the derivation of swing equation
1. Machine represented by classical model.
2. Controllers are not considered.
3. Loads are constants.
4. Voltage and currents are sinusoids.
The fundamental equation of motion of the rotor of the synchronous machine is given
by

ωo= synchronous angular velocity rad/sec

Changing rotor speed in to per unit and introducing damping torque, equation (6.7) become

Where
= rotor speed deviation in p.u
Pm = mechanical input in p.u
KD = damping co-efficient in p.u

Numerical Integration Techniques:


The differential equations (6.8) are to be solved using numerical techniques. There are
several techniques available and two of them are given below.

53
Modified Euler Method:

Runge - Kutta Algorithm for Computation of Swing Curves:

Runge - Kutta method of fourth order is one of the best numerical method's used for the
purpose of solving the swing equation. The damping of the rotors must also be taken into
account to get the results in an accurate form.

According to this algorithm, the total transient period is typically of the order of one second
is divided into a large number of small intervals, each of t second duration. During each t
duration, the value of parameters K1, K2, K3, K4, and l1, l2, l3, l4, are calculated. Thus, these
parameters are used to determine the changes in I , i.

I( 0 ) = value of  of the ith machine at the end of previous interval t .

f = nominal system frequency.

i = number of the machine.

f 0
Ii  ( Pmi1  Pei1 (0)  Di  i )t
1
1
where,
H i

HI' = per - unit inertia constant of the ith machine referred t the system base.

Pmi' = per - unit mechanical power of the ith generator.

Pei' = per - unit electrical power supplied by the ith generator.

i'  (i (0)  2f 0 ) / 2f 0 = per - unit disturbance velocity of the ith machine

K 2i  i (0)  I i / 2  2f 0 ]t

I 2i 
f 0
Hi
P mi
' ' '

 Pei (0)  D I ( I  I I / 2 2f 0 t

Where,

54
Pei' ( 0 ) = electrical power of the ith generator calculated using i at the end of previous t.

K 3i   i (0)  I 2 I / 2  2f 0 ]t

I 2i 
f 0
Hi
P
mi
' '' '

 Pei (0)  D I ( I  I I / 2 2f 0 t

Where,

Pei'' (0) = electrical power of the ith generator calculated by using i ( 0 ) + K2 / 2

K 4i  i (0)  I 3I   2f 0 ]t

I 4i 
f 0
H '
i
P mi
'
 Pei (0)  DI ( I  I 3I / 2 2f 0 t
'' '

Where,

Pei'' ( 0 ) = electrical power of the ith generator calculated by using i ( 0 ) + K3

i ( new ) = i ( 0 ) + 1/ 6 * ( Ki + 2K2I + 2K3i + K4i )

I( new ) = I( 0 ) + 1/ 6 * ( li + 2l2i + 2l3i + l4i )

Determination of Critical Clearing Time:


Critical clearing time is the maximum allowable time between the occurrence of a
fault and clearing of the fault in a system for the system to remain stable. For a given load
condition and specified fault, the critical clearing time for a system is found out as follows.
Choose a large clearing time say 30 cycles and decrease the clearing time in steps of say two
cycles and check for stability at each time step until the system just becomes unstable. Vary
the clearing time around this point in small step till you find the clearing time which is just
critical. The clearing time margin for a fault may be defined as
Clearing time margin = critical clearing time – clearing time specified
= tc (critical) - tc (clearing)
Consider that the machine connected to infinite bus delivers Po MW (Fig. 6.3) and a
seconds.Suppose the MW output of the machine is increased in steps and stability is checked
for each step of load with the same clearing time and fault, then the system becomes just
stable at a loading say Pm and a small increase in load beyond Pm causes instability; then the
MW stability margin is defined as Ps = Pm – Po.Critical Clearing Time and Clearing Angle
From Equal Area Criteria,This method can be used for quick prediction of stability but is
applicable only to single machine connected to infinite bus. The fundamental concepts and
principles of stability can be explained very well. Consider the system shown. and its model.
The terminal power is given by equation 6.1 and the power angle curves for various operating
condition is given.

55
ALGORITHM:

1. Read inertia constant, machine transient reactance, tie - line reactance, voltages at
generator buses, bus powers, system frequency, type of fault.
2. Conduct load flow analysis.
3. Calculate the machine currents.
4. Calculate the voltage behind transient reactance E' is given by
E' = Vt + j It Xd

5. Assume mechanical powers are constant since governor action is not taken into
consideration.
6. The angle for E' is taken as initial value of  and initial value of  = 2fo .
7. Compute reduced YBUS for faulted and post faulted systems.
8. Calculate first estimates of phase angle K1 and speed l1
 d 
k1    | 0t   i (0)  2f 0 t ----------- (1)
 dt 

 d 
I1    | 0t  f 0 / H ( Pm  Pe (0)) t ----------- (2)
'

 dt 

9. To calculate second estimate K2 and l2

K 2  ( (0)  I 1 / 2)  2f 0 t ----------- (3)

 
I 2  f 0 / H Pm  Pe1 (0) t ----------- (4)

10. To calculate third estimate K3 and l3

K 3  ( (0)  I 2 / 2)  2f 0 t ----------- (5)

 
I 3  f 0 / H Pm  Pe" (0) t ----------- (6)

11. To calculate fourth estimate K4 and l4

K 4  ( (0)  I 3 / 2)  2f 0 t ----------- (7)

 
I 4  f 0 / H Pm  Pe" (0) t ----------- (8)

12. Find the phase angle and speed at the end of the first interval

 ( t ) =  ( t - 1 ) + 1/ 6 ( K1 + 2K2 + 2K3 + K4 ) ----------- ( 9 )

( t ) = ( t -1 ) + 1/ 6 ( l1 + 2l2 + 2l3 + l4 ) ----------- ( 10 )

13. Repeat from step (8) and calculate the phase angle and speed during the subsequent time
interval till t = 0.3seconds. All these calculations should be done using reduced YBUS matrix
corresponding to faulted system.

56
14. Repeat the steps (8) to (12) for t =0.3seconds upto t = 1.0seconds by using reduced YBUS
matrix corresponding to faulted system.

15. Plot the swing curves and state the system is stable or not.

57
Flowchart for transient stability analysis

START

READ THE DATA

PERFROM LOAD FLOW ANALYSIS

COMPUTE E AND δ GENERATOR

COMPUTE REDUCED YBUS.FOR FROMULATED SYSTEM AND POST FALUT


SYSTEM

t=0.01

CALCULATE 1ST2ND3RD &4TH ESTIMTE OF


ANGLEAND SPEED

FIND δ(t) AND ω(t)AT THE END OF INTREVAL

NO
t=t+ IS t|< tC

YES

FIND δ(t) AND ω(t)AT THE END OF INTREVAL

PRINTALL THE RESULTS AND

PLOT THE CURVE

STOP 58
PROGRAM

%Transient Stability Analysis


clear all;
clc;
pt=input('Enter the steady state power:');
pm1=input('Enter the power before fault:');
pm2=input('Enter the power during fault:');
pm3=input('Enter the power after fault:');
h=input('Enter the inertia constant:');
f=input('Enter the value frequency:');
t=input('Enter the time interval:');
dt=input('Enter the change in time:');
n=input('Enter the number of intervals:');
dlor(1)=asin(pt/pm1);
dlod(1)=dlor(1)*(180/3.14);
k1=pm2/pm1
k2=pm3/pm1
a=asin(sin(dlor(1))/k2);
b=(a*180)/3.14;
dlmd=180-b;
dlmr=(dlmd*3.14)/180
cdcr=(sin(dlor(1))*(dlmr-dlor(1))+k2*cos(dlmr)-k1*cos(dlor(1)))/(k2-k1);
dcr=acos(cdcr)
tcr=sqrt((2*h*(dcr-dlor(1)))/(3.14*f*pt))
m=(pt*h)/(180*f)
w(1)=0;
for i=1:n
pa(i)=(pt-pm2*sin(dlor(i)))/2;
alp(i)=pa(i)/m;
dw(i+1)=alp(i)*dt;
w(i+1)=w(i)+dw(i+1);
ddl(i+1)=w(i+1)*dt;
ddr(i+1)=ddl(i+1)*(3.14/180);
dlor(i+1)=dlor(i)+ddr(i+1);
dlod(i+1)=dlor(i+1)*(180/3.14);
end
dlor
del=[dlod]
plot(t,del)
title('SWING CURVE');
xlabel('time in seconds');
ylabel('angle in degres');

59
OUTPUT

Enter the steady state power: 1

Enter the power before fault: 1.75

Enter the power during fault: 0.4

Enter the power after fault: 1.25

Enter the inertia constant: 4

Enter the value frequency: 50

Enter the time interval: [0 0.5 0.1 0.15 0.2 0.25 0.3]

Enter the change in time: 0.05

Enter the number of intervals: 6

k1 = 0.2286

k2 = 0.7143

dlmr = 2.2127

dcr = 0.9009

tcr = 0.1221

m= 4.4444e-004

dlor =

0.6082 0.6461 0.7212 0.8324 0.9781 1.1567 1.3663

del =

34.8676 37.0372 41.3420 47.7165 56.0715 66.3059 78.3229

60
SWING CURVE

SWING CURVE
80

75

70

65
Angle in degres

60

55

50

45

40

35

30
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35
Time in Seconds

61
RESULT:

The Transient stability analysis has been carried out and simulated on a given power system
network.
62
Exp. No: 8
Date:
UNIT COMMITMENT: PRIORITY-LIST SCHEMES

AIM:
To obtain the optimal Unit commitment schedule by priority listing method for the
given problem using MATLAB/C program

ALGORITHM:

Priority-List Method:

It consist of a simple shut-down rule obtained by an exhaustive enumeration of all


unit combinations at each load level or obtained by noting the full-load average production
cost of each unit The full-load average production cost is the net heat rate at full load
multiplied by the fuel cost .Various enhancements can be made to the priority-list scheme by
the grouping of units to ensure that various constraints are met.

Typical shut-down rules:


1. At each hour when load is dropping, determine whether dropping the next unit on the
list leaves sufficient generation to supply the load plus the spinning-reserve
requirements

2. If the supply is not sufficient, keep the unit committed.

3. Determine the number of hours before the unit is needed again.

4. If the time is less than the minimum shut-down time for the unit, keep it committed.

5. Perform a cost comparison for the sum of the hourly production costs for the next
number of hours with the next unit to be dropped being committed and the sum of the
restart costs for the next unit based on the minimum cost of cooling the unit or
banking the unit ‘

THEORY:

Unit Commitment, further abbreviated as UC, refers to the strategic choice to be made
in order to determine which of the available power plants should be considered to supply
electricity. UC is not the same as dispatching. Dispatching consists of fitting a given set of
power plants into a certain electric demand. UC appoints the set of plants from which
dispatching can choose. The difference between both issues is time. In dispatching decisions,
there is no time to rapidly activate a power plant because the inertia of most plants will not
allow this. UC therefore prepares a set of plants and stipulates in which time period they have
to be on-line and ready for dispatching.

63
UC chooses plants taking into account a wide variety of parameters, technological
aspects (such as minimal operation point, minimum up and down time and transient behavior)
as well as economical considerations (such as start-up costs and operational costs) and social
elements (such as availability of staff and work-schemes). UC optimization enables utilities
to minimize electricity generation costs.

THREE EXISTING METHODS:

Many strategies have already been developed to tackle the UC economic


optimization.

Brute Force Method: The most evident method is what we call brute force in which
all possible combinations of power plants to provide a given demand are calculated. The
possibilities conflicting with the boundary conditions are struck off the list. Finally, the most
economic of all remaining possibilities is withheld. This method is not only scientifically
clumsy but will also amount in the largest possible calculation time.

DP Method:
Dynamic programming (DP) is a name used for methods in which a-priori impossible
or improbable possibilities are left out. This Method starts from a previously determined
optimal UC planning and gradually adds power plants to obtain optimal solutions for higher
demand.
Decomposition Method:
In this method the main problem is decomposed into several sub-problems that are
easier to solve. In order to take into account uncertainties combine the DP with fuzzy logic.
The neural networks can be used to enable the model to learn from previously made
decisions. · It is possible to decompose UC into a master problem and sub-problems that can
be solved separately. The master problem is optimized (minimal cost), linking the sub-
problems by Lagrange multipliers.
Priority Listing Method:
A very simple method is based on Priority Listing in which power plants are logically
ranked. Originally, the plants were ranked according to full load cost. All plants are initially
activated. Then they are shut down one at a time to check whether or not the overall costs are
reduced.
Next to these conservative methods, also some unconventional methods like genetic
algorithms can be used. This is a stochastic adaptive search based on "survival of the fittest".

64
Exercise:

Obtain the optimal Unit Commitment for the given generators using Priority list technique

Unit1:Pmin=150MW ;Pmax=600MW

Fuel Cost function H1=510+7.2P1+0.00142P12 MBtu/Hr

Unit2:Pmin=100MW ;Pmax=400MW

Fuel Cost function H2=310+7.85P2+0.00142P22 MBtu/Hr

Unit1:Pmin=150MW ;Pmax=600MW

Fuel Cost function H3=78+7.97P3+0.004822P32 MBtu/Hr

With

Fuel cost 1=1.1 R/MBtu

Fuel cost 2=1.0 R/MBtu

Fuel cost 3=1.2 R/MBtu

65
PROGRAM

clc;
clear all;
n=input('Enter the number of generating units');
for i=1:n
disp('Enter the details for unit');
disp(i);
a1(i)=input('Enter the coefficient of Pg^2');
b1(i)=input('Enter the coefficient of Pg');
c1(i)=input('Enter the coefficient ');
pmin(i)=input('Enter the Pmin value');
pmax(i)=input('Enter the Pmax value');
k(i)=input('Enter the fuel cost');
a(i)=(k(i)*a1(i));
b(i)=(k(i)*b1(i));
c(i)=(k(i)*c1(i));
end
for i=1:n
FLAPC(i)=(k(i)*(c1(i)+(b1(i)*pmax(i))+(a1(i)*pmax(i)^2)))/pmax(i);
end
FLAPC
for i=1:n
for j=i+1:n
if FLAPC(j)<FLAPC(i)
temp1=FLAPC(i);
FLAPC(i)=FLAPC(j);
FLAPC(j)=temp1;
temp2=pmin(i);
pmin(i)=pmin(j);
pmin(j)=temp2;
temp3=pmax(i);
pmax(i)=pmax(j);
pmax(j)=temp3;
temp4=a(i);
a(i)=a(j);
a(j)=temp4;
temp5=b(i);
b(i)=b(j);
b(j)=temp5;
temp7=c(i);
c(i)=c(j);
c(j)=temp7;
end
end
end
FLAPC
u=n;
for i=1:n
66
m1=0;
m2=0;
for k=1:u
m1=m1+pmin(k);
m2=m2+pmax(k);
end
u=u-1;
psmin(i)=m1;
psmax(i)=m2;
end
psmin
psmax
lam=input('Enter the initial value of lambda');
pd=input('Enter the Pd value');
u=n;
for i=1:n
if psmax(i)>pd
delp=-1;
iteration=0;
while delp~=0
pp=0;
x=0;
for i=1:u
p(i)=(lam-b(i))/(2*a(i));
if p(i)<pmin(i)
p(i)=pmin(i);
end
if p(i)>pmax(i)
p(i)=pmax(i);
else
p(i)=p(i);
end
x=x+(1/(2*a(i)));
pp=pp+p(i);
end
for i=1:u
for j=i+1:u
if FLAPC(j)<FLAPC(i)
temp6=p(i);
p(i)=p(j);
p(j)=temp6;
end
end
end
for k=1:u
f(k)=(c(k)+(b(k)*p(k))+(a(k)*p(k)^2));
end
tot=0;
for k=1:u
67
tot=tot+f(k);
end
delp=pd-pp;
dellam=delp/x;
lam=lam+dellam;
if iteration==100
break;
end
iteration=iteration+1;
end
u=u-1;
end
disp('For the combination ');
disp(i);
disp('Total Fuel Cost=');
disp(tot);
disp('At the end of Iteration=');
disp(iteration);
disp('Power of the units');
disp(p);
disp('lambda=');
disp(lam);
p=zeros(1,n);
lam=0;
tot=0;
end

68
OUTPUT

Enter the number of generating units3

Enter the details for unit 1

Enter the coefficient of Pg^2=0.006

Enter the coefficient of Pg=7

Enter the constant coefficient=600

Enter the Pmin value=100

Enter the Pmax value=400

Enter the fuel cost=1.1

Enter the details for unit 2

Enter the coefficient of Pg^2=0.01

Enter the coefficient of Pg=8

Enter the constant coefficient=400

Enter the Pmin value=50

Enter the Pmax value=300

Enter the fuel cost=1.2

Enter the details for unit 3

Enter the coefficient of Pg^2=0.008

Enter the coefficient of Pg=6

Enter the constant coefficient=500

Enter the Pmin value=150

Enter the Pmax value=500

Enter the fuel cost=1

FLAPC = 11.9900 14.8000 11.0000

FLAPC = 11.0000 11.9900 14.8000

u= 3

psmin = 300 250 150

psmax = 1200 900 500


69
Enter the PD value 800

Enter the starting value of lambda 8

At the end of combination 3

iteration= 3

Power of the unit= 313.8298 335.1064 151.0638

lamda= 11.0213

Total cost= 8.6271e+003

70
RESULT:

Thus the optimal unit commitment Schedule is obtained using priority listing method

71
EXP NO:10
DATE:
CONTINGENCY ANALYSIS: GENERATOR SHIFT FACTORS AND LINE
OUTAGE DISTRIBUTION FACTORS
AIM:
To write a program in MATLAB to perform contingency analysis of the given 3- bus
system and to calculate the distribution factors for various line outages.
ALGORITHM:
STEP1: Start the program.
STEP2: Get the various values of line reactance, generated power, power demand,
base MVA values.
STEP3: Calculate the B coefficient matrix.
STEP4: Determine the line flows for the three bus system.
STEP5: Calculate the generation shift factors using

Ali =

Xmi= mth element from from Δδ vector.


Xni = nth element from from Δδ vector.
xl = Line reactance for the line.

STEP6: Calculate the generation outages of various lines using

Ll,k =

STEP7: Calculate the new line flows after the various generation outages as
Pnm = Pnm(old)+ ali * p
STEP8: Conduct the DC load flow to check the generation values match the
calculated line flows.

72
Theory:
The contingency analysis allow system to be operated defensively. Many of the
problems that occur on a power system can cause serious trouble which is often the case with
cascading failures. In this analysis, certain programs are used that model possible system
troubles before they arise. These programs are based on a model of a power system and are
used to study outage events and alarm the operators about any potential over loads or out of
limit voltages.
A simple and fast method of contingency analysis is based on network and linear
sensitivity analysis namely,
 Generator shift factors
 Line outage distribution factor
Generator shift factor:
The generator shift factors are designated as ali and have the following definition:
ali = fl / pi
where,
l=line index
i=bus index
fl=change in MW power flow on line l,when a change in generation pi occurs at
bus i.
pi=change in generation at bus i.

Line outage distribution factor:


The outage flow on each line can be compared to its limit and those exceeding their
limit flaged for alarming. This implies that loss of generator and bus I would result in an
overload on the line. The generator shift sensitivity factors are linear estimates of the change
in flow with a change in power at a bus. The effect of simultaneous changes on several
generating buses can be calculated using superposition theorem.
If the system being modeled is part of a large interconnected network, the lost
generation will be picked up by a large number of generating units outside the system’s
immediate control area. When this happens, the pickup in generation is seen as an increase in
flow over the lines to the neighbouring systems to model this, we can build a network model
of our own systems plus an equivalent network of our neighbour’s systems and place the
swing bus or refernecebus in the equivalent.
A generator outage is then modeled so that all lost generation is picked up on the
swing bus, which then appears as an increase on the time flow. The approximation modeling
the generation loss interconnected. If however the system of interest is not interconnected,
then the loss of generation must be shown as a pickup in output on the other generation units
within the system.

73
Problem:
Calculate the generation shift factors, line outages, generator outages for the given circuit
diagram. Take base MVA as 100.

74
PROGRAM

clear all;
clc;
r1=input('enter the reactance between bus 1 and 2');
r2=input('enter the reactance between bus 2 and 3');
r3=input('enter the reactance between bus 1 and 3');
limp=[(r1+r3) r1 r3;r1 (r1+r2) r2;r3 r2 (r3+r2)];
pg=input('enter the generated power');
pd=input('enter the power demand');
b=input('enter the base');
bo=[(1/r1)+(1/r3) -(1/r1);-(1/r1) (1/r1)+(1/r2)];
bo;
xo=inv(bo)
p=[(pg/b) -(pd/b)];
po=transpose(p);
del=(xo*po)
%line flows
del(3)=0;
p=[0 0 0;0 0 0;0 0 0];
for i=1:3
for j=1:3
if(i~=j)
p(i,j)=(del(i)-del(j))/limp(i,j);
end
end
end
p
%generation shift factors
a=[0 0 0;0 0 0;0 0 0];
xo(3)=0;
for i=1:3
for j=1:3
if(i~=j)
a(i,j)=(xo(i)-xo(j))/limp(i,j);
end
end
end
a
xo=inv(bo)
r1
r2

75
r3
L12=(xo(1,1)-xo(2,1))*r3/((r3-xo(1,1))*r1)
L23=(xo(2,1)*r3)/((r3-xo(1,1))*r2)
%outage of line 1-2
L13=(xo(1,1)-xo(1,2))*r1/((r1-((xo(1,1)-xo(1,2))-(xo(2,1)-xo(2,2))))*r3)
L23=-(xo(2,1)-xo(2,2))*r1/((r1-((xo(1,1)-xo(1,2))-(xo(2,1)-xo(2,2))))*r3)
%Outage of line 2-3
L12=(-(xo(1,2)-xo(2,2))*r2)/((r2-xo(2,2))*r1)
L13=(xo(1,2)*r2)/((r2-xo(2,2))*r3)
%The new line flows after outage of generator 1'
delp=-.4;
P12=p(1,2)+a(1,2)*delp
P13=p(1,3)+a(1,3)*delp
P23=p(2,3)+a(2,3)*delp
%'dc load flow'
po=[0;-1.3]
xo
del=xo*po
limp
p12=(del(1,1)-del(2,1))/limp(1,2)
P13=del(1,1)/limp(1,3)
P23=del(2,1)/limp(2,3)

76
OUTPUT

enter the reactance between bus 1 and 20.6

enter the reactance between bus 2 and 30.4

enter the reactance between bus 1 and 30.8

enter the generated power40

enter the power demand130

enter the base100

xo =

0.4444 0.1778

0.1778 0.3111

del =

-0.0533

-0.3333

p=

0 0.4667 -0.0667

-0.4667 0 -0.8333

0.0667 0.8333 0

a=

0 0.4444 0.5556

-0.4444 0 0.4444

-0.5556 -0.4444 0

xo =

0.4444 0.1778

0.1778 0.3111

r1 = 0.6000

r2 = 0.4000

r3 = 0.8000
77
L12 = 1.0000

L23 = 1.0000

L13 = 1.0000

L23 = 0.5000

L12 = 1.0000

L13 = 1.0000

P12 = 0.2889

P13 = -0.2889

P23 = -1.0111

po =

-1.3000

xo =

0.4444 0.1778

0.1778 0.3111

del =

-0.2311

-0.4044

limp =

1.4000 0.6000 0.8000

0.6000 1.0000 0.4000

0.8000 0.4000 1.2000

p12 = 0.2889

P13 = -0.2889

P23 = -1.0111

78
RESULT:
Thus the program to perform contingency analysis of the given 3- bus system and to
calculate the distribution factors for various line outages was completed.

79

You might also like