Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Expt.No:
Date
:
OBJECTIVES
(i)
(ii)
SOFTWARE REQUIRED
(i)
1.
MATLAB
INTRODUCTION TO MATLAB
MATLAB
is a high performance language for technical computing. It integrates
computation, visualization and programming in an easy-to-use environment where problems and
solutions are expressed in familiar mathematical notation.
MATLAB is numeric computation software for engineering and scientific calculations.
MATLAB is primary tool for matrix computations. MATLAB is being used to simulate random
process, power system, control system and communication theory.
MATLAB comprising lot of optional tool boxes and block set like control system,
optimization, and power system and so on.
1.1.
MATLAB is a widely used tool in electrical engineering community. It can be used for
simple mathematical manipulation with matrices for understanding and teaching basic
mathematical and engineering concepts and even for studying and simulating actual power system
and electrical system in general. The original concept of a small and handy tool has evolved to
become an engineering work house. It is now accepted that MATLAB and its numerous tool boxes
replace and/or enhance the usage of traditional simulation tool for advanced engineering
applications.
Engineering personnel responsible for studies of electrical power system, control system
and power electronics circuits will benefit from the MATLAB. To expertise in Electrical System
Simulation one should have a basic understanding of electric circuits, power system and power
electronics.
1.2.
To open the MATLAB applications double click the Matlab icon on the desktop. This will
open the MATLAB window space with Matlab prompt as shown in the fig.1.
Overloaded methods
help sym/sqrt.m
1.3
MATLAB WORKSPACE
The workspace is the window where you execute MATLAB commands (Ref. figure-1). The
best way to probe the workspace is to type whos. This command shows you all the variables that
are currently in workspace. You should always change working directory to an appropriate
location under your user name.
Another useful workspace-like command is
>>clear all
It eliminates all the variables in your workspace. For example start MATLAB and execute
the following sequence of commands
>>a=2;
>>b=5;
>>whos
>>clear all
The first two commands loaded the two variables a and b to the workspace and assigned
value of 2 and 5 respectively. The clear all command clear the variables available in the work
space. The arrow keys are real handy in MATLAB. When typing in long expression at the
command line, the up arrow scrolls through previous commands and down arrow advances the
other direction. Instead of retyping a previously entered command just hit the up arrow until you
find it. If you need to change it slightly the other arrows let you position the cursor anywhere.
Finally any DOS command can be entered in MATLAB as long as it is preceded by any
exclamination mark.
>>!dir
1.4
MATLAB Data Types
The most distinguishing aspect of MATLAB is that it allows the user to manipulate vectors
(like 5+j8) and matrices with the same ease as manipulating scalars (like5,8). Before diving into
the actual commands everybody must spend a few moments reviewing the main MATLAB data
types. The three most common data types you may see are,
1) arrays 2) strings 3) structures.
As for as MATLAB is concerned a scalar is also a 1 x 1 array. For example clear your
workspace and execute the commands.
>>a=4.2:
>>A=[1 4;6 3];
>>whos
Two things should be evident. First MATLAB distinguishes the case of a variable name
and that both a and A are considered arrays. Now lets look at the content of A and a.
>>a
>>A
Again two things are important from this example. First anybody can examine the
contents of any variables simply by typing its name at the MATLAB prompt. Second, when typing
in a matrix space between elements separate columns, whereas semicolon separate rows. For
practice create the matrix in your workspace by typing it in all the MATLAB prompt.
>>B= [3 0 -1; 4 4 2;7 2 11];
(use semicolon(;) to represent the end of a row)
>>B
Arrays can be constructed automatically. For instance to create a time vector where the
time points start at 0 seconds and go up to 5 seconds by increments of 0.001
>>mytime =0:0.001:5;
Automatic construction of arrays of all ones can also be created as follows,
>>myone=ones (3,2)
Note:
Any MATLAB command can be terminated by a semicolon, which suppressed any
echo information to the screen.
1.5
scalars.
Example:
>>clear all
>> a=4;
>> A=7;
>>alpha=a+A;
>>b= [1 2; 3 4];
>>B= [6 5; 3 1];
>>beta=b+B
Of course cannot violate the rules of matrix algebra which can be understood from the following
example.
>>clear all
>>b=[1 2;3 4];
>>B=[6 7];
>>beta=b*B
In contrast to matrix algebra rules, the need may arise to divide, multiply, raise to a
power one vector by another, element by element. The typical scalar commands are used for this
+,-,/, *, ^ except you put a . in front of the scalar command. That is, if you need to multiply the
elements of [1 2 3 4] by [6 7 8 9], just type...
>>[1 2 3 4].*[6 7 8 9]
1.6
Conditional Statements
1.7
>>for n=1:2:10
>>s=s+n^2
>>end
- Yields the sum of 1^2+3^2+5^2+7^2+9^2
PLOTTING
MATLABs potential in visualizing data is pretty amazing. One of the nice features is that
with the simplest of commands you can have quite a bit of capability.
Graphs can be plotted and can be saved in different formulas.
>>clear all
>>t=0:10:360;
>>y=sin (pi/180 * t);
To see a plot of y versus t simply type,
>>plot(t,y)
To add label, legend, grid and title use
>>xlabel (Time in sec);
>>ylabel (Voltage in volts)
>>title (Sinusoidal O/P);
>>legend (Signal);
The commands above provide the most plotting capability and represent several shortcuts
to the low-level approach to generating MATLAB plots, specifically the use of handle graphics.
The helpdesk provides access to a pdf manual on handle graphics for those really interested in it.
1.8
Functions
As mentioned earlier, a M-file can be used to store a sequence of commands or a userdefined function. The commands and functions that comprise the new function must be put in a
file whose name defines the name of the new function, with a filename extension of '.m'.A function
is a generalized input/output device. That is you can give some input.(arguments) and provides
some output. MATLAB functions allow you much capability to expand MATLABs usefulness.
We will just touch on function here as you may find them beneficial later.
We will start by looking at the help on functions :
>>help function
We will create our own function that given an input matrix returns a vector containing the
admittance matrix(y) of given impedance matrix(z)
z=[5 2 4;
1 4 5]
RESULT:
Expt. No:
Date:
Line Parameters
Transmission line has four electrical parameters - resistance, inductance,
capacitance and conductance. The inductance and capacitance are due to the
effect of magnetic and electric fields around the conductor. The shunt
conductance characterizes the leakage current through insulators, which is
very small and can be neglected. The parameters R, L and C are essential for
the development of the transmission line models to be used in power system
analysis both during planning and operation stages.
While the resistance of the conductor is best determined from manufactures
data, the inductances and capacitances can be evaluated using formula. The
student is advised to read any other text book before taking up the
experiment.
INDUCTANCE
The inductance is computed from flux linkage per ampere. In the case of the
three phase lines, the inductance of each phase is not the same if
conductors are not spaced equilaterally. A different inductance in each
phase results in unbalanced circuit. Conductors are transposed in order to
balance the inductance of the phases and the average inductance per phase is
given by simple formulas, which depends on conductor configuration and
PROCEDURE
Enter the command window of the MATLAB.
Create a new M file by selecting File - New M File.
Type and save the program in the editor window.
Execute the program by pressing Tools Run.
EXERCISE
1.A 500kv 3 transposed line is composed of one ACSR 1,272,000-cmil, 45/7 bittern
conductor per phase with horizontal conductor configuration as show in fig.1. The conductors
have a diameter of 1.345in and a GMR of 0.5328in. Find the inductance and capacitance per
phase per kilometer of the line and justify the result using MATLAB.
A
D12=35
D 23=35
D =70
Fig.1
2.The transmission line is replaced by two ACSR 636,000-cmil, 24/7 Rook conductors which
have the same total cross-sectional area of aluminum as one bittern conductor. The line
spacing as measured from the centre of the bundle is the same as before and is shown in fig.2.
The conductors have a diameter of 0.977in and a GMR of 0.3924in.Bundle spacing is 18in
.Find the inductance and capacitance per phase per kilometer of the line and justify the result
using MATLAB.
18 A
B
D12=35
C
D 23=35
D13=70
Fig.2
3.A 345- KV double circuit three- phase transposed line is composed of two ACSR,
1,431,000-cmil, 45/7 Bobolink conductors per phase with vertical conductor configuration as
shown in fig.3. The conductors have a diameter of 1.427in and a GMR of 0.564 in .the
bundle spacing in 18in. find the inductance and capacitance per phase per kilometer of the
line and justify the result using MATLAB.
a
S11=11m
c H12 = 7m
S22=16.5m
H12 = 6.5m
c
S33=12.5m
Fig.3
PROGRAM 1:
Dab= input('Enter Dab value);
Dbc= input('Enter Dbc value);
Dca= input('Enter Dac value);
GMD=(Dab*Dbc*Dca)^(1/3);
GMRL= input('Enter GMRL(GMR) Value in ft (inch/12): ');
disp('Value of L in mH/KM:);
L = 0.2*log(GMD/GMRL)
dia= input('Enter conductor diameter in in);
r=dia/2; GMRC=r/12;
disp('Value of C in F/KM:);
C = 0.0556/log(GMD/GMRC)
PROGRAM 2:
Dab= input('Enter Dab value:);
Dbc= input('Enter Dbc value:);
Dca= input('Enter Dac value:);
GMD=(Dab*Dbc*Dca)^(1/3);
dia=input('Enter conductor diameter in in);
r=dia/2;
d=input('Enter Bundle Spacing in inch);
Ds=input('Enter GMR(Ds) in inch);
GMRL=(sqrt(d*Ds))/12;
GMRC=(sqrt(d*r))/12;
disp('Value of L in mH/KM:);
L = 0.2*log(GMD/GMRL)
disp('Value of C in F/KM:);
C = 0.0556/log(GMD/GMRC)
PROGRAM 3 :
S = input('Enter row vector [S11, S22, S33] = ');
H = input('Enter row vector [H12, H23] = ');
d = input('Bundle spacing in inch = ');
dia = input('Conductor diameter in inch = '); r=dia/2;
Ds = input('Geometric Mean Radius in inch = ');
S11 = S(1); S22 = S(2); S33 = S(3); H12 = H(1); H23 = H(2);
a1 = -S11/2 + j*H12;
b1 = -S22/2 + j*0;
c1 = -S33/2 - j*H23;
a2 = S11/2 + j*H12;
b2 = S22/2 + j*0;
c2 = S33/2 - j*H23;
Da1b1 = abs(a1 - b1); Da1b2 = abs(a1 - b2);
Da1c1 = abs(a1 - c1); Da1c2 = abs(a1 - c2);
Db1c1 = abs(b1 - c1); Db1c2 = abs(b1 - c2);
Da2b1 = abs(a2 - b1); Da2b2 = abs(a2 - b2);
Da2c1 = abs(a2 - c1); Da2c2 = abs(a2 - c2);
Db2c1 = abs(b2 - c1); Db2c2 = abs(b2 - c2);
Da1a2 = abs(a1 - a2);
Db1b2 = abs(b1 - b2);
Dc1c2 = abs(c1 - c2);
DAB=(Da1b1*Da1b2* Da2b1*Da2b2)^0.25;
DBC=(Db1c1*Db1c2*Db2c1*Db2c2)^.25;
DCA=(Da1c1*Da1c2*Da2c1*Da2c2)^.25;
GMD=(DAB*DBC*DCA)^(1/3)
Ds = 2.54*Ds/100; r = 2.54*r/100; d = 2.54*d/100;
Dsb = (d*Ds)^(1/2); rb = (d*r)^(1/2);
DSA=sqrt(Dsb*Da1a2); rA = sqrt(rb*Da1a2);
DSB=sqrt(Dsb*Db1b2); rB = sqrt(rb*Db1b2);
DSC=sqrt(Dsb*Dc1c2); rC = sqrt(rb*Dc1c2);
GMRL=(DSA*DSB*DSC)^(1/3)
GMRC = (rA*rB*rC)^(1/3)
L=0.2*log(GMD/GMRL)
% mH/km
C = 0.0556/log(GMD/GMRC) % micro F/km
MANUAL SOLUTION:
(PROBLEM-1)
MANUAL SOLUTION:
(PROBLEM-3)
RESULT
Thus the positive sequence line parameters L and C per phase per kilometre of a three
phase single and double circuit transmission lines for different conductor arrangements were
determined and verified with MATLAB software.
The value of L and C obtained from MATLAB program are:
Case1: L=
C=
Case2: L=
C=
Case3: L=
C=
Expt. No:
Date:
The difference in voltage at the receiving end of a transmission line between conditions of
no load and full load is called voltage regulation and is expressed as a percentage of the receiving
end voltage.
The phasor diagram of the line for lagging load power factor is shown in Fig. (ii). From the
right angled traingle ODC, we get,
2
10
An approximate expression for the sending end voltage VS can be obtained as follows. Draw
perpendicular from B and C on OA produced as shown in Fig. 2. Then OC is nearly equal to
OF i.e.,
OC = OF = OA + AF = OA + AG + GF
= OA + AG + BH
VS = VR + I R cos R + I XL sin R
11
Fig.1
Let
The phasor diagram for the circuit is shown in Fig.2. Taking the receiving end voltage VR as
the reference phasor, we have,
Receiving end voltage, VR = VR + j 0
Load current, IR = IR (cos R - j sin R)
Fig.2
12
Nominal Method
In this method, capacitance of each conductor (i.e., line to neutral) is divided into two
halves; one half being lumped at the sending end and the other half at the receiving end as
shown in Fig.3. It is obvious that capacitance at the sending end has no effect on the line
drop. However, its charging current must be added to line current in order to obtain the total
sending end current.
Fig.3
IR = load current per phase
R = resistance per phase
XL = inductive reactance per phase
C = capacitance per phase
cos R = receiving end power factor (lagging)
VS = sending end voltage per phase
The phasor diagram for the circuit is shown in Fig.4. Taking the receiving end voltage as the
reference phasor, we have,
VR = VR + j 0
Load current, IR = IR (cos R - j sin R)
13
EXERCISE
A 220- KV, 3 transmission line is 40 km long. The resistance per phase is 0.15 per km
and the inductance per phase is 1.3623 mH per km. The shunt capacitance is negligible. Use
the short line model to find the voltage and power at the sending end and the voltage
regulation and efficiency when the line supplying a three phase load of
a) 381 MVA at 0.8 power factor lagging at 220 KV.
b) 381 MVA at 0.8 power factor leading at 220 KV.
14
15
16
RESULT
Thus the program for modeling of transmission line was executed by using
MATLAB and the output was verified with theoretical calculation.
The value of the voltage regulation and efficiency obtained from the MATLAB
program are
EFF =
EFF =
Efficiency
EFF =
18
Expt. No:
Date:
19
22
EXERCISE 3:
Determine Z bus matrix for the power system network shown in fig using
Bus building algorithm
MATLAB CODE:
clc
clear all
close all
g=[1.2 0.2 0.15 1.5 0.3];
z1=[g(1)];
disp(z1);
disp('TYPE I MODIFICATION')
z2=[g(1) g(1)
g(1) g(1)+g(2)];
disp(z2);
disp('TYPE II MODIFICATION')
z3=[g(1) g(1) g(1)
g(1) g(1)+g(2) g(1)+g(2)
g(1) g(1)+g(2) g(1)+g(2)+g(3)];
disp(z3);
disp('TYPE III MODIFICATION')
z4=[g(1) g(1) g(1) g(1)
g(1) g(1)+g(2) g(1)+g(2) g(1)+g(2)
g(1) g(1)+g(2) g(1)+g(2)+g(3) g(1)+g(2)+g(3)
g(1) g(1)+g(2) g(1)+g(2)+g(3) g(1)+g(2)+g(3)+g(4)]
z4=[z4];
disp(z4);
disp('Actual Zbus matrix is:')
n=4;
for i=1:1:n
for j=1:1:n
z4(i,j)=z4(i,j)-(z4(i,n)*z4(n,j)/z4(n,n));
end
end
29
z4(:,4)=[];
z4(4,:)=[];
disp(z4);
disp('TYPE IV MODIFICATION MATRIX')
l=4;
p=2;q=4;
for i=1:l-1
z4(l,i)=z4(p-1,i)-z4(q-1,i);
z4(i,l)=z4(l,i);
end
z4(l,l)=g(5)+z4(1,1)+z4(3,3)-2*z4(1,3);
disp(z4);
n=4;
for i=1:1:n
for j=1:1:n
z4(i,j)=z4(i,j)-(z4(i,n)*z4(n,j)/z4(n,n));
end
end
z4(:,4)=[];
z4(4,:)=[];
disp('THE REQUIRED ZBUS MATRIX IS:');
ZBUS=z4*1i;
disp(ZBUS);
30
RESULT
31
Figure shows the one line diagram of a simple three-bus power system with generators at buses 1 and
3. The magnitude of voltage at bus 1 is adjusted to 1.05 pu. Voltage magnitude at bus 3 is fixed at 1.04
pu with a real power generation of 200 MW. A load consisting of 400 MW and 250 Mvar is taken from
bus 2. Line impedances are marked in per unit on a 100 MVA base and the line charging susceptances
are neglected. Obtain the power flow solution by the Gauss- Seidal method including line flows and
line losses. Verify the results using available program.
PROGRAM:
y12=10-j*20;
y13=10-j*30;
y23=16-j*32;
y33=y13+y23;
V1=1.05+j*0;
format long
iter =0;
S2=-4.0-j*2.5;
P3 = 2;
V2=1+j*0;
Vm3=1.04;
V3=1.04+j*0;
for I=1:10;
iter=iter+1
E2 = V2;
E3=V3;
V2 = (conj(S2)/conj(V2)+y12*V1+y23*V3)/(y12+y23)
DV2 = V2-E2
Q3 = -imag(conj(V3)*(y33*V3-y13*V1-y23*V2))
S3 = P3 +j*Q3;
Vc3 = (conj(S3)/conj(V3)+y13*V1+y23*V2)/(y13+y23)
Vi3 = imag(Vc3);
Vr3= sqrt(Vm3^2 - Vi3^2);
V3 = Vr3 + j*Vi3
DV3=V3-E3
end
format short
I12=y12*(V1-V2); I21=-I12;
I13=y13*(V1-V3); I31=-I13;
I23=y23*(V2-V3); I32=-I23;
S12=V1*conj(I12); S21=V2*conj(I21);
S13=V1*conj(I13); S31=V3*conj(I31);
S23=V2*conj(I23); S32=V3*conj(I32);
I1221=[I12,I21]
I1331=[I13,I31]
I2332=[I23,I32]
S1221=[S12, S21 (S12+S13) S12+S21]
S1331=[S13, S31 (S31+S32) S13+S31]
S2332=[S23, S32 (S23+S21) S23+S32]
Expt. No:
Date:
(1)
(2)
(3)
(4)
(5)
(6)
The latest available voltages are used in the above expression,we get
Vi
new
=(1.0/Yii)[Pi-JQi / Vi * - YijVj
J=1
- Yij Vi ]
(7)
j=i+1
32
The above equation is the required formula .this equation can be solved for voltages in
interactive manner. During each iteration, we compute all the bus voltage and check for
convergence is carried out by comparison with the voltages obtained at the end of previous
iteration. After the solutions is obtained. The stack bus real and reactive powers, the reactive
power generation at other generator buses and line flows can be calculated.
ALGORITHM
Step1:Read the data such as line data, specified power ,specified voltages, Q limits at the
generator buses and tolerance for convergences
Step2: Compute Y-bus matrix.
Step3: Initialize all the bus voltages.
Step4: Iter=1
Step5: Consider i=2, where i is the bus number.
Step6:check whether this is PV bus or PQ bus . if it is PQ bus goto step 8 otherwise go to
next step.
Step7: Compute Qi check for q limit violation. QGi=Qi+QLi.
7).a).If QGi>Qi max ,equate QGi = Qimax. Then convert it into PQ bus.
7).b).If QGi<Qi min, equate QGi = Qi min. Then convert it into PQ bus.
Step8: Calculate the new value of the bus voltage using gauss seidal formula.
i=1
J=i+1
Adjust voltage magnitude of the bus to specify magnitude if Q limits are not violated.
Step9: If all buses are considered go to step 10 otherwise increments the bus no. i=i+1 and
Go to step6.
Step10: Check for convergence. If there is no convergence goes to step 11 otherwise go to
step12.
Step11: Update the bus voltage using the formula.
Vi
new
=Vi
old
+ (vi
new
-Vi
old
Step12: Calculate the slack bus power, Q at P-V buses real and reactive give flows real and
reactance line losses and print all the results including all the bus voltages and all the
bus angles.
Step13: Stop.
33
FLOW CHART:
34
MANUAL CALCULATION
35
39
RESULT
A program has been developed using MATLAB for the given power system by Gauss
Seidal method and the results are verified with model calculation.
EXERCISE
Figure shows the one line diagram of a simple three-bus power system with generators at buses 1 and
3. The magnitude of voltage at bus 1 is adjusted to 1.05 pu. Voltage magnitude at bus 3 is fixed at 1.04
pu with a real power generation of 200 MW. A load consisting of 400 MW and 250 Mvar is taken from
bus 2. Line impedances are marked in per unit on a 100 MVA base and the line charging susceptances
are neglected. Obtain the power flow solution by the Newton Raphson method including line flows &
line losses. Verify the results using available program.
MATLAB CODE:
V = [1.05; 1.0; 1.04];
d = [0; 0; 0];
Ps=[-4; 2.0];
Qs= -2.5;
YB = [ 20-j*50 -10+j*20 -10+j*30
-10+j*20 26-j*52 -16+j*32
-10+j*30 -16+j*32 26-j*62];
Y= abs(YB); t = angle(YB);
iter=0;
pwracur = 0.00025; % Power accuracy
DC = 10;
% Set the maximum power residual to a high value
while max(abs(DC)) > pwracur
iter = iter +1
P=[V(2)*V(1)*Y(2,1)*cos(t(2,1)-d(2)+d(1))+V(2)^2*Y(2,2)*cos(t(2,2))+ ...
V(2)*V(3)*Y(2,3)*cos(t(2,3)-d(2)+d(3));
V(3)*V(1)*Y(3,1)*cos(t(3,1)-d(3)+d(1))+V(3)^2*Y(3,3)*cos(t(3,3))+ ...
V(3)*V(2)*Y(3,2)*cos(t(3,2)-d(3)+d(2))];
Q= -V(2)*V(1)*Y(2,1)*sin(t(2,1)-d(2)+d(1))-V(2)^2*Y(2,2)*sin(t(2,2))- ...
V(2)*V(3)*Y(2,3)*sin(t(2,3)-d(2)+d(3));
J(1,1)=V(2)*V(1)*Y(2,1)*sin(t(2,1)-d(2)+d(1))+...
V(2)*V(3)*Y(2,3)*sin(t(2,3)-d(2)+d(3));
J(1,2)=-V(2)*V(3)*Y(2,3)*sin(t(2,3)-d(2)+d(3));
J(1,3)=V(1)*Y(2,1)*cos(t(2,1)-d(2)+d(1))+2*V(2)*Y(2,2)*cos(t(2,2))+...
V(3)*Y(2,3)*cos(t(2,3)-d(2)+d(3));
J(2,1)=-V(3)*V(2)*Y(3,2)*sin(t(3,2)-d(3)+d(2));
J(2,2)=V(3)*V(1)*Y(3,1)*sin(t(3,1)-d(3)+d(1))+...
V(3)*V(2)*Y(3,2)*sin(t(3,2)-d(3)+d(2));
J(2,3)=V(3)*Y(2,3)*cos(t(3,2)-d(3)+d(2));
J(3,1)=V(2)*V(1)*Y(2,1)*cos(t(2,1)-d(2)+d(1))+...
V(2)*V(3)*Y(2,3)*cos(t(2,3)-d(2)+d(3));
J(3,2)=-V(2)*V(3)*Y(2,3)*cos(t(2,3)-d(2)+d(3));
J(3,3)=-V(1)*Y(2,1)*sin(t(2,1)-d(2)+d(1))-2*V(2)*Y(2,2)*sin(t(2,2))-...
V(3)*Y(2,3)*sin(t(2,3)-d(2)+d(3));
Expt. No:
Date:
ALGORITHM
Step1: Input the total number of buses. Input the details of series line impendence and line
charging admittance to calculate the Y-bus matrix.
Step2: Assume all bus voltage as 1 per unit except slack bus.
Step3: Set the iteration count as k=0 and bus count as p=1.
Step4: Calculate the real and reactive power pp and qp using the formula
P=vpqYpq*cos(Qpq+p-q)
Qp=VpqYpa*sin(qpq+p-a)
Evalute pp*=psp-pp*
Step5: If the bus is generator (PV) bus, check the value of Qp*is within the limits.If it
violates
40
DP = Ps - P;
DQ = Qs - Q;
DC = [DP; DQ]
J
DX = J\DC
d(2) =d(2)+DX(1);
d(3)=d(3) +DX(2);
V(2)= V(2)+DX(3);
V, d, delta =180/pi*d;
end
P1= V(1)^2*Y(1,1)*cos(t(1,1))+V(1)*V(2)*Y(1,2)*cos(t(1,2)-d(1)+d(2))+...
V(1)*V(3)*Y(1,3)*cos(t(1,3)-d(1)+d(3))
Q1=-V(1)^2*Y(1,1)*sin(t(1,1))-V(1)*V(2)*Y(1,2)*sin(t(1,2)-d(1)+d(2))-...
V(1)*V(3)*Y(1,3)*sin(t(1,3)-d(1)+d(3))
Q3=-V(3)*V(1)*Y(3,1)*sin(t(3,1)-d(3)+d(1))-V(3)*V(2)*Y(3,2)*...
sin(t(3,2)-d(3)+d(2))-V(3)^2*Y(3,3)*sin(t(3,3))
MANUAL SOLUTION:
the limits, then equate the violated limit as reactive power and treat it as PQ bus. If limit is
not violated then calculate,
|vp|^r=|vgp|^rspe-|vp|r
Qp*=qsp-qp*
Step6: Advance bus count by 1 and check if all the buses have been accounted if not go to step5.
Step7: Calculate the elements of Jacobean matrix.
Step8: Calculate new bus voltage increment pk and fpk
Step9: Calculate new bus voltage ep*h+ ep*
Fp^k+1=fpK+fpK
Step10: Advance iteration count by 1 and go to step3.
Step11: Evaluate bus voltage and power flows through the line .
PROCEDURE
Enter the command window of the MATLAB.
Create a new M file by selecting File - New M File.
Type and save the program in the editor Window.
Execute the program by pressing Tools Run.
View the results.
41
42
RESULT
A program has been developed using MATLAB for the given power system by Newton
Raphson method and the results are verified with model calculation
49
EXERCISE
Figure shows the one line diagram of a simple three-bus power system with generators at buses 1 and
3. The magnitude of voltage at bus 1 is adjusted to 1.05 pu. Voltage magnitude at bus 3 is fixed at 1.04
pu with a real power generation of 200 MW. A load consisting of 400 MW and 250 Mvar is taken from
bus 2. Line impedances are marked in per unit on a 100 MVA base and the line charging susceptances
are neglected. Obtain the power flow solution by the Fast decoupled method including line flows and
line losses. Verify the results using available program.
PROGRAM:
V1= 1.05; V2 = 1.0; V3 = 1.04;
d1 = 0; d2 = 0; d3=0;
Ps2=-4; Ps3 =2.0;
Qs2= -2.5;
YB = [ 20-j*50 -10+j*20 -10+j*30
-10+j*20 26-j*52 -16+j*32
-10+j*30 -16+j*32 26-j*62];
Y = abs(YB); t=angle(YB);
B =[-52 32; 32 -62]
Binv = inv(B)
iter=0;
pwracur = 0.0003; % Power accuracy
DC = 10;
% Set the max of power mismatch to a high value
while max(abs(DC)) > pwracur
iter = iter +1;
P2= V2*V1*Y(2,1)*cos(t(2,1)-d2+d1)+V2^2*Y(2,2)*cos(t(2,2))+ ...
V2*V3*Y(2,3)*cos(t(2,3)-d2+d3);
P3= V3*V1*Y(3,1)*cos(t(3,1)-d3+d1)+V3^2*Y(3,3)*cos(t(3,3))+ ...
V3*V2*Y(3,2)*cos(t(3,2)-d3+d2);
Q2=-V2*V1*Y(2,1)*sin(t(2,1)-d2+d1)-V2^2*Y(2,2)*sin(t(2,2))- ...
V2*V3*Y(2,3)*sin(t(2,3)-d2+d3);
DP2 = Ps2 - P2; DP2V = DP2/V2;
DP3 = Ps3 - P3; DP3V = DP3/V3;
DQ2 = Qs2 - Q2; DQ2V = DQ2/V2;
DC =[DP2; DP3; DQ2];
Dd = -Binv*[DP2V;DP3V];
DV = -1/B(1,1)*DQ2V;
Expt. No:
Date:
Pi = VpqYpq*cos(Qpq + p - q)
r
50
d2 =d2+Dd(1);
d3 =d3+Dd(2);
V2= V2+DV;
angle2 =180/pi*d2;
angle3 =180/pi*d3;
R = [iter d2 d3 V2 DP2 DP3 DQ2];
disp(R)
end
Q3=-V3*V1*Y(3,1)*sin(t(3,1)-d3+d1)-V3^2*Y(3,3)*sin(t(3,3))- ...
V3*V2*Y(3,2)*sin(t(3,2)-d3+d2);
P1= V1^2*Y(1,1)*cos(t(1,1))+V1*V2*Y(1,2)*cos(t(1,2)-d1+d2)+ ...
V1*V3*Y(1,3)*cos(t(1,3)-d1+d3);
Q1=-V1^2*Y(1,1)*sin(t(1,1))-V1*V2*Y(1,2)*sin(t(1,2)-d1+d2)- ...
V1*V3*Y(1,3)*sin(t(1,3)-d1+d3);
S1=P1+j*Q1
Q3
Step12: Calculate i
= i + i .
Step14: Test for convergence if max (Qi )<Q then set rv = 1 and do next step otherwise go to
step 17.
Step15: Check if rs=1 then go to step 19.
Step16: Otherwise advance the iteration count by 1 and go to step 8.
r
51
MANUAL SOLUTION:
57
RESULT
A program has been developed using MATLAB for the given power system by fast
decoupled method and the results are verified with model calculation.
60
Expt. No:
Date:
To become familiar with various aspects of the transient and small signal stability
analysis of Single-Machine-Infinite Bus (SMIB) system.
OBJECTIVES
The objectives of this experiment are:
1. To study the stability behavior of one machine connected to a large power system
subjected to a severe disturbance (3-phase short circuit)
2. To understand the principle of equal-area criterion and apply the criterion to study
the stability of one machine connected to an infinite bus
3. To determine the critical clearing angle and critical clearing time with the help of
equal-area criterion
4. To do the stability analysis using numerical solution of the swing equation.
SOFTWARE REQUIRED: MATLAB 7.7
THEORY
The tendency of a power system to develop restoring forces to compensate for the
disturbing forces to maintain the state of equilibrium is known as stability. If the forces
tending to hold the machines in synchronism with one another are sufficient to overcome the
disturbing forces, the system is said to remain stable.
The stability studies which evaluate the impact of disturbances on the behavior of
synchronous machines of the power system are of two types transient stability and steady
state stability. The transient stability studies involve the determination of whether or not
synchronism is maintained after the machine has been subjected to a severe disturbance. This
may be a sudden application of large load, a loss of generation, a loss of large load, or a fault
(short circuit) on the system. In most disturbances, oscillations are such magnitude that
linearization is not permissible and nonlinear equations must be solved to determine the
stability of the system. On the other hand, the steady-state stability is concerned with the
system subjected to small disturbances wherein the stability analysis could be done using the
linearized version of nonlinear equations. In this experiment we are concerned with the
transient stability of power systems.
61
MANUAL CALCULATION:
A method known as the equal-area criterion can be used for a quick prediction of
stability of a one- machine system connected to an infinite bus. This method is based on the
graphical interpretation of energy stored in the rotating mass as an aid to determine if the
machine maintains its stability after a disturbance. The method is applicable to a onemachine system connected to an infinite bus or a two- machine system. Because it provides
physical insight to the dynamic behavior of the machine, the application of the method to
analyze a single-machine system is considered here.
Stability: Stability problem is concerned with the behavior of power system when it is
subjected to disturbance and is classified into small signal stability problem if the
disturbances are small and transient stability problem when the disturbances are large.
Transient stability: 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.
Small signal stability: When a power system is under steady state, normal operating
condition, the system may be subjected to small disturbances such as variation in load and
generation, change in field voltage, change in mechanical toque etc., the nature of system
response to small disturbance depends on the operating conditions, the transmission system
strength, types of controllers etc. Instability that may result from small disturbance may be
of two forms,
(i) Steady increase in rotor angle due to lack of synchronizing torque.
(ii) Rotor oscillations of increasing magnitude due to lack of sufficient damping torque.
RESULT:
Thus the stability analysis of single machine infinite bus system is verified using the
MATLAB program.
62
Expt. No:
Date:
AIM
To obtain the frequency response and steady state frequency deviation of single and two
area power system using MATLAB.
SOFTWARE REQUIRED: MATLAB 7.7
THEORY
Active power control is one of the important control actions to be performed to be
normal operation of the system to match the system generation with the continuously changing
system load in order to maintain the constancy of system frequency to a fine tolerance level.
This is one of the foremost requirements in proving quality power supply. A change in system
load cases a change in the speed of all rotating masses (Turbine generator rotor systems) of
the system leading to change in system frequency. The speed change form synchronous speed
initiates the governor control (primary control) action result in the entire participating generator
turbine units taking up the change in load, stabilizing system frequency. Restoration of
frequency to nominal value requires secondary control action which adjusts the load - reference
set points of selected (regulating) generator turbine units. The primary objectives of automatic
generation control (AGC) are to regulate system frequency to the set nominal value and also to
regulate the net interchange of each area to the scheduled value by adjusting the outputs of the
regulating units. This function is referred to as load frequency control (LFC).
PROCEDURE
Enter the command window of the MATLAB.
Create a new Model by selecting File - New Model.
Pick up the blocks from the Simulink library browser and form a block
diagram. After forming the block diagram, save the block diagram.
Double click the scope and view the result.
EXERCISE 1
An isolated power station has the following
parameters Turbine time constant, T = 0.5sec
Governor Time constant, g = 0.2sec
Generator inertia constant, H = 5sec
81
MANUAL SOLUTION:
82
EXERCISE 2
A two area system connected by a tie line has the following parameters on a 1000MVA common
base.
Area
Speed Regulation
Frequency sens. load
Inertia Constant
Base Power
1
R1=0.05
D1=0.6
H1=5
1000MVA
2
R2=0.0625
D2=0.9
H2=4
1000MVA
g1= 0.2sec
T1=0.5sec
g2= 0.3sec
T2=0.6sec
The units are operating in parallel at the nominal frequency of 60Hz. The synchronizing power
coefficient is computed from the initial operating condition and is given to be P s = 2 p.u. A load
change of 187.5 MW occurs in area1.
(a) Determine the new steady state frequency and the change in the tie-line flow.
(b) Construct the SIMULINK block diagram and obtain the frequency deviation response for the
condition in part (a).
MANUAL SOLUTION:
83
85
RESULT
88
EXPT. NO
DATE
:
:
THEORY:
Power is allowed to vary within certain limits so as to meet a particular load demand with
minimum fuel cost. This is called the optimal power flow (OPF) problem. The OPF is used to
optimize the power flow solution of large scale power system. This is done by minimizing
selected the same distance from the centre of loads and their fuel costs are different. Also under
normal operating conditions, the generation capacity is more than the total load demand and
losses. Thus, there objective functions while maintaining an acceptable system performance in
terms of generator capability limits and the output of the compensating devices.
The simplest economic dispatch problem is the case when transmission line losses are
neglected. This is the problem model does not consider system configuration and line
impedances. In essence, the model assumes that the system is only one bus with all generation
and loads connected to it as shown in figure below.
C1
C2
P1
P2
Cn
Png
PD
Since transmission losses are neglected, the total demand PD is the sum of all generation.
A cost function Ci is assumed to be known for each plant. The problem is to find the real power
generation for each plant such that the objective function as defined by the equation,
Ct =
ng
i =1
Ci =
n
i =1
i + i Pi + vi Pi 2
89
PROGRAM:
clear
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)));
lambda=(demand+x)/y
Pgtotal=0;
for i=1:n
Pg(i)=(lambda-b(i))/(2*a(i));
Pgtotal=sum(Pg);
end
Pg
for i=1:n
if(Pmin(i)<=Pg(i)&&Pg(i)<=Pmax(i));
Pg(i);
else
if(Pg(i)<=Pmin(i))
Pg(i)=Pmin(i);
else
Pg(i)=Pmax(i);
end
end
Pgtotal=sum(Pg);
end
Pg
if Pgtotal~=demand
demandnew=demand-Pg(1)
x1=0;
y1=0;
for i=2:n
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
90
ng
i =1
Pi = PD
where, Ct is the total production cost, Ci is the production cost of ith plant, Pi is generation of the
ith plant, PD is the total demand and ng is the total number of despicable generating plants.
A rapid solution is obtained by the use of the gradient method (Lambda iteration).
Let f(2)= PD
Expanding the left hand side of the above equation in Taylors series about an operating point 2k
and neglecting the higher-order terms result in,
f ( ) k +
k =
df ( )
d
P k
df ( )
d
k = PD
P k
dPi
d
(or ) k =
P k
1
2vi
and therefore, k +1 = k + k
where, P k = PD
ng
i =1
Pi k
ALGORITHM:
1. Start the program.
2. Read the input data values
3. Start the iteration counter.
4. Check the test for convergence.
5. iter=iter+1
6. Calculate P,delp, J, dellambda and lambda.
7. Display the above values.
8. To find the total cost=sum(alpha+beta.*P+gamma.*P.
9. Print the value of total cost.
10. Stop the program.
91
PROGRAM:
clc;
clear all;
n = input('Enter the no. of Units : ');
a = zeros(n);
b = zeros(n);
c = zeros(n);
pmin=zeros(n);
pmax=zeros(n);
p = zeros(n);
sum = 0;
den = 0;
bm = zeros(n,n);
for i = 1:n
fprintf('Enter the unit %g data \n',i);
a(i) = input('Enter the value of a : ');
b(i) = input('Enter the value of b : ');
c(i) = input('Enter the value of c : ');
pmin(i)=input('Enter the MIN value of Generation : ');
pmax(i)=input('Enter the MAX value of Generation : ');
end
for i = 1:n
for j = 1:n
bm(i,j) = input('Enter B Coefficient : ');
end
end
pd = input('Enter the value of load demand : ');
for i = 1:n
sum = sum + (b(i)/(2*a(i)));
den = den + (1/(2*a(i)));
end
lambda = (pd + sum)/den;
t = 1;
while t >0
fprintf('\nLambda is %g\n',lambda);
for i = 1:n
p(i) = 0;
end
pg = 0; pl
= 0; deldde
= 0; nb =
0;
for i = 1:n
for j = 1:n
if i~=j
nb = nb + bm(i,j)*p(j);
end
end
end
100
92
for i = 1:n
p(i) = (1 - b(i)/lambda - nb)/(2*(a(i)/lambda + bm(i,i)));
fprintf('Optimal generation of unit %g is %g MW\n',i,p(i));
end
for i = 1:n
for j = 1:n
pl = pl + p(i)*bm(i,j)*p(j);
end
end
fprintf('Power Loss is %g\n', pl);
for i=1:n
if (p(i)>pmax(i))
p(i) = pmax(i);
elseif (p(i)<pmin(i))
p(i) = pmin(i);
else
p(i) = p(i);
end
end
for i = 1:n
pg = pg + p(i);
end
delp = pd + pl - pg;
fprintf('Change in load is %g\n', delp);
for i = 1:n
deldde = deldde + (a(i) + b(i)*bm(i,i))/(2*((a(i) + lambda*bm(i,i))^2));
end
dellambda = delp/deldde;
fprintf('Change in Lambda is %g\n',dellambda);
lambda = lambda + dellambda;
if delp<1
t = 0;
end
end
101
93
102
94
103
95
RESULT:
105
96
EXERCISE:
MATLAB CODE:
EXPT NO
DATE
:
:
FAULT ANALYSIS
AIM:
To conduct short circuit analysis of the given power system using MATLAB
software package and verify the same.
SOFTWARE REQUIRED: MATLAB
THEORY:
Symmetrical Faults:
The MATLAB Short circuit analysis program analyzer the effect of 3 phase
symmetrical
fault on electrical distribution systems. The program calculates the total short circuit current as
well as the distributions of individual motors, generators and utility in the system. Fault duties
are in competence with the latest conditions which calculates.
Unsymmetrical Faults:
The MATLAB short circuit analysis program also analyzes the effect of 3 phase
unsymmetrical faults like,
97
Solution:
99
100
101
RESULT:
Thus the fault analysis of the given power system using MATLAB software
package was experimented and the output was verified.
103
Ef=10000;
L=0.004;
Zc=400;
n1=[2*Ef 0];
d1=[1 Zc/L];
t=0:0.00001:0.0001;
Et=step(n1,d1,t);
plot(t,Et,'r');
Er=Et-Ef;
hold on;
plot(t,Er,'b')
Ef=10000;
C=0.000000009;
Zc=400;
n1=[2*Ef/(Zc*C)];
d1=[1 1/(Zc*C)];
t=0:0.00001:0.0001;
Et=step(n1,d1,t);
plot(t,Et,'r');
Er=Et-Ef;
hold on;
plot(t,Er,'b')
Ef=10000;
C=0.000000009;
Zc=400;
n1=[2*Ef/Zc 0];
d1=[1 1/(Zc*C)];
t=0:0.00001:0.0001;
It=step(n1,d1,t);
plot(t,It,'r');
hold on;
If=Ef/Zc;
Ir=It-If;
plot(t,Ir,'b')
Ef=10000;
L=0.004;
Zc=400;
n1=[2*Ef 0];
d1=[1 Zc/L];
tf(n1,d1)
t=0:0.00001:0.0001;
n2=[2*Ef/L];
d2=[1 Zc/L];
It=step(n2,d2,t);
plot(t,It,'r');
If=Ef/Zc;
Ir=It-If;
holdon;
plot(t,Ir,'b');
EXPT NO
1DATE
:
:
105
v1 (t ) v2 (t )
R
( 2)
For the inductance, a simple relationship is obtained by replacing the differential equation
di
v = L with a central difference equation:
dt
v(t ) + v(t t )
i (t ) i (t t )
=L
2
t
Applying the above relationship for the case of above figure,
v13 (t ) + v13 (t t )
i (t ) i13 (t t )
= L 13
2
t
Rewriting the above equation, we get
i13 (t ) i13 (t t ) =
t
t
v13 (t ) +
v13 (t t )
2L
2L
i13 (t ) =
t
t
v13 (t ) +
v13 (t t ) + i13 (t t )
2L
2L
i13 (t ) =
t
(v1 (t ) v3 (t ) ) + I13 (t t )
2L
t
v13 (t t ) + i13 (t t ) , the past history term with i13 computed
2L
from the values of the preceding steps.
where, I13 (t t ) =
I13 (t ) = i13(t t ) +
t
(v1 (t t ) v3 (t t ) )
2L
The derivation for the branch equation of the capacitance is analogous, and leads to
i14 (t ) =
2C
(v1 (t ) v4 (t ) ) + I14 (t t )
t
2C
(v1 (t ) v4 (t ) )
t
For the transmission line between nodes 1 and 5, losses are first ignored, then reintroduced later
on. Then the wave equations
107
v
i
= L'
x
x
i
v
= C'
x
x
where, L &C=inductance and capacitance per unit length, x=distance from sending end.
The well known solution due to de Alembert:
i = F ( x ct ) + f (a + ct )
(5a )
v = zF ( x ct ) zf ( x + ct )
Where, F(x-ct) and f(x+ct) are functions of the composite variables x-ct and x+ct, z is the surge
impedance and c is the velocity of propagation.
If the current in equation (5a) is multiplied by z and added to the voltage, then v+zi=2zF(x-ct)
(5b).
Note that the composite expression v+zi does not change if x-ct does not change. Imagine a
fictitious observer travelling on the line with wave velocity c. The distance travelled is x=x0+ct
(x0 location of the starting point), or x-ct = constant. If x-ct is constant, then the value v+zi,
measured by the observer, must also remain constant. With travel time
Line Length
c
An observer leaving node 5 at time t- will measure the value v5(t-)+zi15(t-), and upon arrival
at node 1 (after the elapse of travel time ), will measure the value v1(t)+zi15(t)(negative sign
because i15 has opposite direction of i51 ). But the value as measured by the observer must
remain constant, so these values must be equal, giving, after rewriting,
i15 (t ) =
v5 (t )
I 51 (t )
z
(6a )
Where the term I15 is again known from previously computed values
I 51 (t ) =
v5 (t )
i51 (t )
z
(6b)
RESULT:
Thus the electromagnetic transient phenomena in power systems caused due to switching
and faults are studied.
109