POWER SYSTEM LABORATORY
DEPARTMENT OF ELECTRICAL AND ELECTRONICS
ENGINEERING NATIONAL INSTITUTE OF TECHNOLOGY,
TIRUCHIRAPPALLI.
Exp. 8 Dep: Electrical and Electronics Engineering Date: 21/3/2023
No.
Name: HARI VARSHAN Roll No.: 107120051
Load Flow Analysis
AIM:
SOFTWARE USED: MATLAB R2021b
ALGORITHM FOLLOWED IN STEPS:
STEP – 1: Start
STEP – 2: Read the given data and initialize it as variables.
STEP – 3: Build an Admittance Bus.
STEP – 4: Start iteration process for Fast Decoupled method.
STEP – 5: Use the obtained values to calculate the Power supplied by each bus, and Power flow in
the lines.
STEP – 6: Using the Power flow in the lines calculate the Power losses in the line.
STEP – 7: Stop.
PROGRAM (CODE) :
fprintf('---------------------------------------------------------------\n');
fprintf('FAST DECOUPLED METHOD :\n');
fprintf('---------------------------------------------------------------\n');
n = input("ENTER THE NUMBER OF BUS : ");
Ybus = zeros(n,n);
InputData = [1 2 0 0.02 ;1 3 0 0.045 ;2 3 0 0.02 ;]; %input("ENTER THE INPUT DATA : "); %
for i = 1 : size(InputData)
data = InputData(i,:);
B1 = data(1);
B2 = data(2);
R = data(3);
X = data(4);
Y = (1 / (R + 1i*X) );
Ybus(B1,B1) = Ybus(B1,B1) + Y;
Ybus(B2,B2) = Ybus(B2,B2) + Y;
Ybus(B1,B2) = Ybus(B1,B2) - Y;
Ybus(B2,B1) = Ybus(B2,B1) - Y;
end
fprintf('YBUS :\n');
disp(Ybus);
fprintf('\n');
YbusMag = zeros(n,n);
YbusAng = zeros(n,n);
for i = 1 : n
for j = 1 : n
YbusMag(i,j) = abs(Ybus(i,j));
YbusAng(i,j) = angle(Ybus(i,j));
end
end
% GIVEN
tolerance = 0.0001;
Base = 100 ;
P2 = -390 / Base;
Q2 = -190 / Base ;
P3 = 290 / Base ;
V = [ 1.025 , 1 , 1.03] ; %input("ENTER THE BUS VOLTAGE MAGNITUDE : "); %
S = [ 0 , 0 , 0]; %input("ENTER THE BUS VOLTAGE ANGLE : "); %
iter = 1;
while 1
Matrix = zeros(2,2);
Matrix(1,1) = Matrix(1,1) + (abs(V(2)) * abs(V(1)) * YbusMag(2,1) * sin ( YbusAng(2,1) + S(1) - S(2)) );
Matrix(1,1) = Matrix(1,1) + (abs(V(2)) * abs(V(3)) * YbusMag(2,3) * sin ( YbusAng(2,3) + S(3) - S(2)) );
Matrix(1,2) = -1 * abs(V(2)) * abs(V(3)) * YbusMag(2,3) * sin ( YbusAng(2,3) + S(3) - S(2)) ;
Matrix(2,1) = -1 * abs(V(3)) * abs(V(2)) * YbusMag(3,2) * sin ( YbusAng(3,2) + S(2) - S(3)) ;
Matrix(2,2) = Matrix(2,2) + abs(V(3)) * abs(V(1)) * YbusMag(3,1) * sin ( YbusAng(3,1) + S(1) - S(3)) ;
Matrix(2,2) = Matrix(2,2) + abs(V(3)) * abs(V(2)) * YbusMag(3,2) * sin ( YbusAng(3,2) + S(2) - S(3)) ;
MatrixQ = 0;
MatrixQ = MatrixQ - abs(V(1)) * YbusMag(2,1) * sin ( YbusAng(2,1) + S(1) - S(2)) ;
MatrixQ = MatrixQ - abs(V(3)) * YbusMag(2,3) * sin ( YbusAng(2,3) + S(3) - S(2)) ;
MatrixQ = MatrixQ - 2*abs(V(2)) * YbusMag(2,2) * sin ( YbusAng(2,2) + S(2) - S(2)) ;
dMatrix = [ 0 ; 0];
dMatrixQ = 0;
for i = 1 : 3
dMatrix(1,1) = dMatrix(1,1) + abs(V(2)) * abs(V(i)) * YbusMag(2,i) * cos (YbusAng(2,i) + S(i) - S(2));
end
for i = 1 : 3
dMatrix(2,1) = dMatrix(2,1) + abs(V(3)) * abs(V(i)) * YbusMag(3,i) * cos (YbusAng(3,i) + S(i) - S(3));
end
for i = 1 : 3
dMatrixQ = dMatrixQ - abs(V(2)) * abs(V(i)) * YbusMag(2,i) * sin (YbusAng(2,i) + S(i) - S(2));
end
dMatrix(1,1) = P2 - dMatrix(1,1) ;
dMatrix(2,1) = P3 - dMatrix(2,1) ;
dMatrixQ = Q2 - dMatrixQ ;
delta = Matrix\dMatrix ;
deltaQ = MatrixQ\dMatrixQ;
S(2) = S(2) + delta(1,1);
S(3) = S(3) + delta(2,1);
V(2) = V(2) + deltaQ;
fprintf('ITERATION : %d\n',iter);
fprintf('BUS VOLTAGE MAGNITUDE : ');
disp(V);
fprintf('\n');
fprintf('BUS VOLTAGE ANGLE : ');
s = S;
for i = 1 : 3
s(i) = mod(s(i),pi);
end
disp(S);
fprintf('\n');
if delta(1,1) < tolerance && delta(2,1) < tolerance && deltaQ < tolerance
break;
end
iter = iter + 1;
end
i = 1i;
V1 = V(1)*cos(S(1)) + V(1)*sin(S(1))*i;
V2 = V(2)*cos(S(2)) + V(2)*sin(S(2))*i;
V3 = V(3)*cos(S(3)) + V(3)*sin(S(3))*i;
I12 = -1*Ybus(1,2) * ( V1 - V2) ;
I23 = -1*Ybus(3,2) * ( V2 - V3) ;
I13 = -1*Ybus(1,3) * ( V1 - V3) ;
S12 = V(1) * conj(I12);
S21 = V(2) *conj(-1* I12);
S23 = V(2) * conj(I23);
S32 = V(3) *conj(-1* I23);
S13 = V(1) * conj(I13);
S31 = V(3) *conj(-1* I13);
fprintf('POWER FLOW IN LINE 12 :\n');
disp(S12);fprintf("\n");
fprintf('POWER FLOW IN LINE 23 :\n');
disp(S23);fprintf("\n");
fprintf('POWER FLOW IN LINE 13 :\n');
disp(S13);fprintf("\n");
fprintf('LOSS IN LINE 12 :\n');
disp(S12 + S21);fprintf("\n");
fprintf('LOSS IN LINE 23 :\n');
disp(S23 + S32);fprintf("\n");
fprintf('LOSS IN LINE 13 :\n');
disp(S13 + S31);fprintf("\n");
K = 0;
vv = [V1,V2,V3];
for i = 1 : 3
K = K + conj(V1) * Ybus(i,1) * vv(i);
end
fprintf('P1 :%d\n', real(K));
fprintf('Q1 :%d\n', -1*imag(K));
MATLAB OUTPUT:
OBSERVATION:
● The values of voltages of each bus approaches a value for successive iterations.
● This method is a little time consuming but can provide better results. Its process of convergence
can be sped up by using voltage correction methods.
INFERENCE:
● Load flow studies are the computational procedures (numerical algorithms) required
to determine the steady-state operating characteristics of a power system network
from the given line data and bus data.