SDS Laboratory Manual1
SDS Laboratory Manual1
Submitted To:
Submitted By:
Enrolment No.:
Academic Session:
INDEX
5 To find load flow solution of the given power system using Gauss-Seidel
method theoretically for one iteration and obtain full solution using
MATLAB.
6 To find dynamic response of the given single area load frequency control
problem theoretically and to plot and verify the results in SIMULINK.
8 To find Ferranti effect of a 5000 kM transmission line and to plot the locus
of voltage for the given problem and verify results in MATLAB.
9 SIMULINK model for evaluating transient stability of single machine
connected to infinite bus
10 To find dynamic response of the given two - area load frequency control
problem theoretically and to plot and verify the results in SIMULINK.
EXPERIMENT NO. 1
AIM:- To learn basic operations and matrix manipulations in MATLAB and write
simple scripts for performing given tasks.
Theory of Experiment:
Basic Commands:
Some basic MATLAB commands are given as follows. Type these at the command
prompt to verify.
a=[1 2 3 4 6 4 3 4 5]
a= 1 2 3 4 6 4 3 4 5
Now let's add 2 to each element of our vector, a, and store the result in a new vector.
Notice how MATLAB requires no special handling of vector or matrix math.
Adding an element to a Vector:
b=a+2
b= 3 4 5 6 8 6 5 6 7
MATLAB can use symbols in plots as well. Here is an example using stars to mark the
points. MATLAB offers a variety of other symbols and line types.
plot(b,'*')
axis([0 10 0 10])
Creating a matrix:
One area in which MATLAB excels is matrix computation. Creating a matrix is as easy as
making a vector, using semicolons (;) to separate the rows of a matrix.
A = [1 2 0; 2 5 -1; 4 10 -1]
A=
1 2 0
2 5 -1
4 10 -1
Adding a new Row:
A(4,:)=[7 8 9]
ans=
1 2 0
2 5 -1 4
10 -1 789
Adding a new Column:
A(:,4)=[7 8 9]
ans=
1 2 0 7
2 5 -1 8
4 10 -1 9
Transpose:
We can easily find the transpose of the matrix A.
A = [1 2 0; 2 5 -1; 4 10 -1]
A' =
1 2 4
2 5 10
0 -1 -1
Matrix Multiplication:
Now let's multiply these two matrices together. Note again that MATLAB doesn't require
you to deal with matrices as a collection of numbers. MATLAB knows when you are
dealing with matrices and adjusts your calculations accordingly.
A = [1 1 1; 2 2 2; 3 3 3]
B = [4 4 4; 5 5 5; 6 6 6]
C =A*B
C=
15 15 15
30 30 30
45 45 45
Instead of doing a matrix multiply, we can multiply the corresponding elements of two
matrices or vectors using the’.* ‘operator.
C =A.*B
C=
4 4 4
10 10 10
18 18 18
Inverse:
Let's find the inverse of a matrix
A = [1 2 0; 2 5 -1; 4 10 -1]
X=inv(A)
X=
5 2 -2
-2 -1 1
0 -2 1
... and then illustrate the fact that a matrix times its inverse is the identity matrix.
I=inv(A)*A
I=
1 0 0
0 1 0
0 0 1
VIVA QUESTIONS:-
EXPERIMENT NO. 2
AIM: Generate various signals and sequences (Periodic and aperiodic), such as Unit
Impulse, Unit Step, Square, Saw tooth, Triangular, Sinusoidal, Ramp, Sinc.
Theory: If the amplitude of the signal is defined at every instant of time, then it is called
continuous time signal. If the amplitude of the signal is defined at only at some instants of
time, then it is called discrete time signal. If the signal repeats itself at regular intervals, then
it is called periodic signal. Otherwise, they are called aperiodic signals.
EX: ramp, Impulse, unit step, sinc- Aperiodic signals square, sawtooth, triangular sinusoidal
– periodic signals.
Ramp sinal: The ramp function is a unitary real function, easily computable as the mean
of the independent variable and its absolute value. This function is applied in engineering.
The name ramp function is derived from the appearance of its graph.
0 else
Unit impulse signal: One of the more useful functions in the study of linear systems is the
"unit impulse function. "An ideal impulse function is a function that is zero everywhere but
at the origin, where it Is infinitely high. However, the area of the impulse is finite
=0 other wise
Unit step signal: The unit step function and the impulse function are fundamental functions
in engineering, and it is strongly recommended that the reader becomes very familiar with
both functions.
u(t)= 0 if t<0
1 if t>0
½ if t=0
if and sinc(0) =1
PROCEDURE:-
➢ Open MATLAB
➢ Open new M-file
➢ Type the program
➢ Save in current directory
➢ Compile and Run the program
➢ For the output see command window\ Figure window
PROGRAM:
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
t1=-1:0.01:1
y1=(t1==0);
subplot(2,2,1);
plot(t1,y1);
xlabel('time');
ylabel('amplitude');
title('unit impulse signal');
stem(t1,y1);
xlabel('n');
ylabel('amplitude');
title('unit impulse sequence');
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
plot(t2,y2);
xlabel('time');
ylabel('amplitude');
title('unit step signal');
stem(t2,y2);
xlabel('n');
ylabel('amplitude');
title('unit step sequence');
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
t=0:0.002:0.1;
y3=square(2*pi*50*t);
figure;
subplot(2,2,1);
plot(t,y3);
axis([0 0.1 -2 2]);
xlabel('time');
ylabel('amplitude');
title('square wave signal');
stem(t,y3);
axis([0 0.1 -2 2]);
xlabel('n');
ylabel('amplitude');
title('square wave sequence');
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
y4=sawtooth(2*pi*50*t);
subplot(2,2,3);
plot(t,y4);
stem(t,y4);
axis([0 0.1 -2 2]);
xlabel('n');
ylabel('amplitude');
title('sawtooth wave sequence');
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
y5=sawtooth(2*pi*50*t,.5);
figure;
subplot(2,2,1);
plot(t,y5);
axis([0 0.1 -2 2]);
xlabel('time');
ylabel('amplitude');
title(' triangular wave signal');
subplot(2,2,2);
stem(t,y5);
axis([0 0.1 -2 2]);
xlabel('n');
ylabel('amplitude');
title('triangular wave sequence');
%generation of sinsoidal wave signal
y6=sin(2*pi*40*t);
subplot(2,2,3);
plot(t,y6);
axis([0 0.1 -2 2]);
xlabel('time');
ylabel('amplitude');
title(' sinsoidal wave signal');
ylabel('amplitude');
title('ramp signal');
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EXPECTED OUTPUT:
VIVA QUESTIONS:-
1. Define Signal?
2. Define continuous and discrete Signals?
3. State the relation between step, ramp and Delta Functions?
4. Differentiate saw tooth and triangular signals?
5. Define Periodic and aperiodic Signal?
EXPERIMENT NO. 3
AIM: To obtain the Ybus matrix for the given power system using Direct inspection method
and to verify the same using MATLAB.
Find the Ybus matrix for the given power system data using Direct inspection method
Sending end
1 2 j0.15
2 3 j0.10
1 3 j0.20
1 4 j0.10
4 3 j0.15
clc;
close all;
clear all;
zdata=[1 2 0 0.15; 1 3 0 0.2;
1 4 0 0.1;
2 3 0 0.1;
3 4 0 0.15];
nl=zdata(:,1);
nr=zdata(:,2);
R=zdata(:,3);
X=zdata(:,4);
nbr=length(zdata(:,1));
nbus = max(max(nl), max(nr));
Z = R + j*X;
y= ones(nbr,1)./Z;
Ybus=zeros(nbus,nbus);
for k = 1:nbr; % formation of the off diagonal elements
% Sending end bus % Receiving end bus % Resistance
% Reactance
%branch impedance %branch admittance
% initialize Ybus to zero
if nl(k) > 0 & nr(k) > 0
Ybus(nl(k),nr(k)) = Ybus(nl(k),nr(k)) - y(k); Ybus(nr(k),nl(k)) = Ybus(nl(k),nr(k));
end
end
for n = 1:nbus % formation of the diagonal elements
for k = 1:nbr
if nl(k) == n | nr(k) == n Ybus(n,n) = Ybus(n,n) + y(k); else
end end
end Ybus
§ y bus is the command used to obtain the admittance matrix for the given system data
using direct inspection method.
§ z data matrix consists of four columns in which
§ 1st column represent sending end
§ 2nd column represents receiving end
§ 3rd column represents resistance between the sending and receiving end
§ 4th column represents reactance between the sending and receiving end
Expected Output:
EXPERIMENT NO.4
AIM: To obtain the Zbus matrix for the given power system using Zbus building algorithm
and to verify the same using MATLAB.
PROBLEM ON FORMATION OF Zbus: Find the bus impedance matrix using Zbus
building algorithm for the given power system whose reactance values are as follows.
clc
clear all
close all
linedata=[0 1 0 0.05
0 2 0 0.075
1 2 0 0.75
1 3 0 0.30
2 3 0 0.45];
nl = linedata(:,1); nr = linedata(:,2); R = linedata(:,3);
X = linedata(:,4);
nbr=length(linedata(:,1)); nbus = max(max(nl), max(nr)); ZB = R + j*X;
Zbus = zeros(nbus, nbus);
tree=0; %%%%new
% Adding a branch from new bus to an existing bus while tree < nbus %%% new
for n = 1:nbus
nadd = 1;
if abs(Zbus(n,n)) == 0
for I = 1:nbr
if nadd == 1;
if nl(I) == n | nr(I) == n if nl(I) == n
k = nr(I); elseif nr(I) == n
k = nl(I); end
if abs(Zbus(k,k)) ~= 0 for m = 1:nbus
if m ~= n
Zbus(m,n) = Zbus(m,k); Zbus(n,m) = Zbus(m,k);
k = nl(I);
end
DM = Zbus(n,n) + Zbus(k,k) + ZB(I) - 2*Zbus(n,k); for jj = 1:nbus
AP = Zbus(jj,n) - Zbus(jj,k);
for kk = 1:nbus
AT = Zbus(n,kk) - Zbus(k, kk); DELZ(jj,kk) = AP*AT/DM; end
end
Zbus = Zbus - DELZ; ntree(I) = 2;
else, end
else, end
end end
Zbus
ACTUAL OUTPUT:
EXPERIMENT NO.5
Aim:- To find load flow solution of the given power system using Gauss-Seidel method
theoretically for one iteration and obtain full solution using MATLAB.
PROBLEM
For the sample power system shown below, the generators are connected at all the four
buses, while loads are at buses 2 and 3. Values of real and reactive powers are listed in the
table. All buses other than the slack are PQ type. Assuming a flat voltage start, find the
voltages and bus angles at the three buses at the end of first GS iteration.
Input data:
MATLAB PROGRAM:
EXPECTED OUTPUT:
EXPERIMENT NO.6
AIM: To find dynamic response of the given single area load frequency control problem
theoretically and to plot and verify the results in SIMULINK.
OBJECTIVE: Simulink Model of Single Area Load frequency Control without and with
PI Controller
PROBLEM:
An integral controller with gain Ki=0.09 is now used to reduce steady state error. What is
the dynamic response of the system with and without the controller? Obtain the dynamic
response of the system with and without the PI controller by developing a SIMULINK
model and verify the responses
EXPECTED OUTPUT:
EXPERIMENT NO. 7
AIM: To find the parameters of the given transmission line using short-line and
PROBLEM:
A 50 Hz transmission line 300km long has a total series impedance of 40+j 125
ohms and a total shunt admittance of 10-3 mho. The receiving-end load is 50 MW
at 220kV with 0.8 lagging power factor. Find the sending-end voltage, current,
power and power factor using (a) short line approximation, and (b) nominal-pi
method. Compare the results and comment.
clc
clear all
f=50;L=300;z=40+i*125;y=i*1e-3;
PR=50e6/3;VR=220e3/(sqrt(3));Pfload=0.8;IRR=PR/(VR*Pfload);IR=IRR*(0.8-
i*0.6);
z=z/L;y=y/L;k=1;
for i=10:10:600,
%short line aproximation
VS_shortline(k)=VR+((z*i*IR));
IS_shortline(k)=IR; spf_shortline(k)=cos(angle(VS_shortline(k))-
angle(IS_shortline(k)));
spower_shortline(k)=3*abs(VS_shortline(k))*abs(IS_shortline(k))*spf_shortline(k)
; %nominal pi method
A=1+(y*i)*(z*i)/2;
B=z*i;
C=y*i*(1+(y*i)*(z*i)/4);
D=A;
VS_nominalpi(k)=A*VR+B*IR;
IS_nominalpi(k)=C*VR+D*IR; spf_nominalpi(k)=cos(angle(VS_nominalpi(k))-
angle(IS_nominalpi(k)));
spower_nominalpi(k)=3*abs(VS_nominalpi(k))*abs(IS_nominalpi(k))*spf_nominal
pi( k);
point(k)=i;
k=k+1;
end
%plots of short line in red and nominal pi in red
figure(1); plot(point,abs(VS_shortline),'r',point,abs(VS_nominalpi),'g') figure(2);
plot(point,abs(IS_shortline),'r',point,abs(IS_nominalpi),'g') figure(3);
plot(point,abs(spf_shortline),'r',point,abs(spf_nominalpi),'g') figure(4);
plot(point,abs(spower_shortline),'r',point,abs(spower_nominalpi),'g')
EXPECTED OUTPUT:
EXPERIMENT NO. -8
AIM: To find Ferranti effect of a 5000 kM transmission line and to plot the locus of voltage
for the given problem and verify results in MATLAB.
PROBLEM:
The resultant voltage at 200 km from the receiving end. Solve the problem theoretically.
Vary the length of the long transmission line in steps of 10 KM from zero (receiving
end) to 5000KM (sending end), and plot the sending end voltage phasor using
MATLAB.
MATLAB PROGRAM:
EXPECTED OUTPUT:
EXPERIMENT NO. -9
PROBLEM:
THEORETICAL SOLUTION:
This experiment is solution of swing equation of experiment 7 implemented in SIMULINK.
SIMULINK MODEL:
SUBSYSTEM DETAILS:
SUBSYSTEM1 DETAILS:
EXPECTED OUTPUT:
AIM: To find dynamic response of the given two - area load frequency control problem
theoretically and to plot and verify the results in SIMULINK
PROBLEM:
The parameters for load frequency control of a two area are:
SIMULINK MODEL:
EXPECTED OUTPUT: