Psslab Manual
Psslab Manual
SIMULATION
LABORATORY MANUAL
LIST OF PROGRAMS
6. UNIT COMMITMENT
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 2: Load the given inputs and length of the transmission line.
STEP 3: If the Length L<80 Calculate the parameters of short line and Go-to
Step6
STEP 4: If the Length 80<L<200 Calculate the parameters of medium line and
Go-to Step6
STEP 5: If the Length L>200 Calculate the parameters of long line and Go-to
next step
STEP 7: Stop
PROGRAM:
clc;
clear all;
f=50;
L=input('enter the length of transmission line L=');
VRll=input('enter receiving end voltage Vrll=');
R=input('enter resistance per phase R=');
X=input('enter the reactance X=');
Y=input('enter value of susceptance Y=');
rpf=input('enter receiving end power factor rpf=');
P=input('enter receiving end power P=');
Z=R+1j*X;
VR=VRll/sqrt(3);
PR=P*rpf;
QR=P*(sqrt(1-rpf^2));
SR=PR+1j*QR;
IR=conj(SR)/(3*conj(VR));
if(L<=80)
disp('PARAMETERS FOR SHORT TRANSMISSION LINE');
A=1;
B=(Z*L);
C=0;
D=1;
VS=VR+B*IR;
IS=IR;
VSll=sqrt(3)*abs(VS);
Spf=cos(angle(VS)-angle(IS));
SS=3*real(VS)*abs(IS)*Spf;
regulation=((VSll-VRll)/VRll)*100;
efficiency=(real(SR)/real(SS))*100;
elseif (80<L&& L<200)
disp('PARAMETERS FOR MEDIUM TRANSMISSION LINE');
A=1+((Y*L)*(Z*L))/2;
B=Z*L;
C=Y*L*(1+((Z*L)*(Y*L))/4);
D=A;
VS=A*VR+B*IR;
VSll=sqrt(3)*abs(VS);
IS=C*VR+D*IR;
Spf=cos(angle(VS)-angle(IS));
SS=3*real(VS)*abs(IS)*Spf;
regulation=((VSll-VRll)/VRll)*100;
efficiency=(real(SR)/real(SS))*100;
else
disp('PARAMETERS FOR LONG TRANSMISSION LINE');
Zc=sqrt(Z/Y);
gamma=sqrt(Z*Y);
A=cosh(gamma*L);
B=Zc*sinh(gamma*L);
C=(1/Zc)*sinh(gamma*L);
D=cosh(gamma*L);
VS=A*VR+B*IR;
IS=C*VR+D*IR;
VSll=sqrt(3)*abs(VS);
Spf=cos(angle(VS)-angle(IS));
SS=3*real(VS)*abs(IS)*Spf;
regulation=((VSll-VRll)/VRll)*100;
efficiency=(real(SR)/real(SS))*100;
end
disp(‘A=’);
disp(A)
disp(‘B=’);
disp(B)
disp(‘C=’);
disp(C)
disp(‘D=’);
disp(D)
disp(‘Sending end voltage VS=’);
disp(VSll)
disp(‘Sending end Current IS=’);
disp(IS)
disp(‘Sending end power factor SPFF=’);
disp(Spf)
disp(‘Sending end power SS=’);
disp(SS)
disp(‘Regulation=’);
disp(regulation)
disp(‘Efficiency=’);
disp(efficiency)
INPUT:
For a short transmission line:
Length of line=40
Resistance per phase=0.15
Reactance per phase=0.4166
Susceptance=0
Receiving end voltage=220KV
Receiving end power=381MW
Receiving end power factor=0.8
For a medium transmission line:
Length of line=150
Resistance per phase=0.19
Reactance per phase=0.4533
Susceptance=2.67x10^-6i
Receiving end voltage=132KV
Receiving end power=75MW
Receiving end power factor=0.8
For a long transmission line:
Length of line=200
Resistance per phase=0.2
Reactance per phase=0.4085
Susceptance=2.82x10^-6i
Receiving end voltage=230KV
Receiving end power=50MW
Receiving end power factor=0.8
OUTPUT:
RESULT:
STRING EFFICIENCY OF OVERHEAD INSULATORS
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 3: Calculate the voltages at across each insulator in the string and
Efficiency
STEP 6: Stop
PROGRAM:
clc;
clear all;
s=0;
v(1)=1;
for i=2:n
s=s+v(i-1);
v(i)=v(i-1)+(s/m);
end
x=sum(v);
v(1)=V/x;
for i=2:n
v(i)=v(i)*v(1);
end
for i=1:n
disp(v(i))
end
eff=(V/(n*v(n)))*100;
disp('efficiency');
disp(eff)
a=zeros(n,n);
for k=1:m
for i=1:(n-1)
for j=1:n
if i= =j
a(i,j)=k+1;
end
if j= =(i+1)
a(i,j)=-k;
end
if j< i
a(i,j)=1;
end
end
end
a(n,i)=1;
b=zeros(n,1);
b(n,1)=V;
x=zeros(n,1);
x=inv(a)*b;
se(k)=(V/(n*x(n,1)));
end
k=1:m;
plot(k,se)
INPUT:
Number of insulators=5
OUTPUT:
RESULT:
BUS ADMITTANCE MATRIX YBUS OF POWER SYSTEM
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 6: Calculate Ybus matrix and obtain magnitude and angle of YBus
STEP 8: Stop
PROGRAM:
clc;
clear all;
load bus.dat;
load ln.dat;
nline=bus(1,2);
n=bus(1,1);
%Initialising admittance values to zero
y=zeros(n,n);
%Calculation of line admittances
for k=1:nline
y(ln(k,1),ln(k,2))=1/complex(ln(k,3),ln(k,4));
y(ln(k,2),ln(k,1))=y(ln(k,1),ln(k,2));
end
%Initialising Y bus matrix to zero
Y=zeros(n,n);
%Formulating Y bus matrix
for i=1:n
for j=1:n
if(i~=j)
Y(i,j)=-y(i,j);
end
Y(i,i)=y(i,j)+Y(i,i);
end
Y(i,i)=Y(i,i)+complex(0,ln(i,5));
end
%to obtain magnitude of Y bus matrix
Ymag=abs(Y);
%to obtain angle of Y bus matrix
Yangle=angle(Y);
disp(‘Line admittance y=’);
disp(y)
disp(‘YBUS=’);
disp(Y)
disp(‘Ymag=’);
disp(Ymag)
disp(‘Yangle=’);
disp(Yangle)
INPUT:
bus data:
bus.dat
%nl nb nt ns
3 3 0 0
line data:
ln.dat
% from to r x bsh
OUTPUT:
RESULT:
GAUSS SEIDEL METHOD
AIM: To obtain the load flow solution for a the given system using Gauss-
Seidel Method.
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 8: Stop
PROGRAM:
clc;
clear all;
load gauss.dat;
a=gauss;
nb=a(1,1);
nl=a(1,2);
y=zeros(nb,nb);
for i=1:nl
i=i+1;
y(a(i,1),a(i,2))=1/complex(a(i,3),a(i,4));
disp(y(a(i,1),a(i,2)))
end
for i=2:4
i=i+3;
s(a(i,1))=(a(i,2)+1i*(a(i,3)));
v(a(i,1))=a(i,4);
end
disp(v)
iter=0;
for i=1:7
iter=iter+1;
v(2)=((conj(s(2))/conj(v(2))+(y(1,2)*v(1))+(y(2,3)*v(3)))/(y(1,2)+y(2,3)));
v(3)=((conj(s(3))/conj(v(3))+(y(1,3)*v(1))+(y(2,3)*v(2)))/(y(1,3)+y(2,3)));
disp([iter,v(2),v(3)])
end
disp('line currents=');
I12=y(1,2)*(v(1)-v(2))
I21=-I12
I13=y(1,3)*(v(1)-v(3))
I31=-I13
I23=y(2,3)*(v(2)-v(3))
I32=-I23
disp('line flows=');
s12=v(1)*conj(I12)*100
s21=v(2)*conj(I21)*100
s13=v(1)*conj(I13)*100
s31=v(3)*conj(I31)*100
s23=v(2)*conj(I23)*100
s32=v(3)*conj(I32)*100
disp('line losses=');
s1221=s12+s21
s1331=s13+s31
s2332=s23+s32
INPUT:
Gauss.dat
3 3 0 3
%from to R X
1 2 0.02 0.04
1 3 0.01 0.03
2 3 0.0125 0.025
%bus P Q Vm
1 1 1 1.05
2 -2.566 -1.102 1
3 -2.386 -0.452 1
OUTPUT:
RESULT:
ECONOMIC DISPATCH OF THERMAL UNITS
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 8: Stop
PROGRAM:
clc
clear all
load dt.dat
load co.dat
for i=1:ng
a(i)=co(i,1);
b(i)=co(i,2);
c(i)=co(i,3);
end
X=0;
Y=0;
for i=1:ng
X= X+(b(i)/(2*c(i)));
Y= Y+(1/(2*c(i)));
end
lemda=(pd+X)/Y;
P=zeros(1,ng);
delp=10;
while (abs(delp>=0.001))
for i=1:ng
P(i)=(lemda-b(i))/(2*c(i));
end
Pall=zeros(1,ng);
for i=1:ng
Pall=Pall+P(i);
end
delp=pd-Pall;
if(delp>=0.001)
dellemda=delp/Y;
lemda=lemda+dellemda;
end
end
ct=0;
for i=1:ng
ct=ct+(a(i)+(b(i)*P(i))+(c(i)*P(i))*P(i));
end
disp(ct)
disp(P)
disp('lemda:');
disp(lemda)
INPUT:
co.dat
%a b c
dt.dat
% ng pd
3 800
OUTPUT:
RESULT:
ECONOMIC DISPATCH OF THERMAL UNITS
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 2: Read the input data Ng,Pd, cost coefficients (a,b,c) , lemda and loss
coefficients
STEP 4: Calculate Generation, Total generation (Pt) Total losses (Plt) and
∆P=Pd+Plt-∑Pg
STEP 8: Stop
PROGRAM:
clc
clear all
load coeff.dat
load bc.dat
load dat.dat
for i=1:ng
a(i)=coeff(i,1);
b(i)=coeff(i,2);
c(i)=coeff(i,3);
end
for i=1:ng
for j=1:ng
B(i,j)=0;
B(i,i)=bc(i,i);
end
end
lemda=dat(1,3);
count=0;
while(count<4)
for i=1:ng
P(i)=(lemda-b(i))/(2*(c(i)+(lemda*B(i,i))));
end
pt=0;
for i=1:ng
pt=pt+P(i);
end
for i=1:ng
pl(i)=B(i,i)*P(i)*P(i);
end
plt=0;
for i=1:ng
plt=plt+pl(i);
end
delp=pd+plt-pt;
diffp=0;
for i=1:ng
X(i)=c(i)+(B(i,i)*b(i));
Y(i)=2*(c(i)+(lemda*B(i,i)))^2;
diffp=diffp+(X(i)/Y(i));
end
dellemda=(delp/diffp);
lemda=lemda+dellemda;
count=count+1;
end
ct=0;
for i=1:ng
ct=ct+(a(i)+b(i)*P(i))+(c(i)*P(i)*P(i));
end
disp(P)
disp('lemda:');
disp(lemda)
INPUT:
coeff.dat
%a b c
Generator Data:
dat.dat
% ng pd lemda
3 150 8
Loss Matrix:
bc.dat
% b1 b2 b3
0.000218 0 0
0 0.000228 0
0 0 0.000179
OUTPUT:
RESULT:
UNIT COMMITMENT
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 8: Stop
PROGRAM:
clc;
clear all;
% alpha and beta arrays denote alpha beta coefficients for given generators
Pgmin=[1 1 1 1];
Pgmax=[12 12 12 12];
min=inf;
cost=0;
unit=[0 0 0 0];
for i=0:n
for j=0:n
for k=0:n
for l=0:n
unit=[0 0 0 0];
if i~=0
unit(1,1)=i;
cost=cost+0.5*alpha(1)*i*i+beta(1)*i ;
end
if j~=0
unit(1,2)=j;
cost=cost+0.5*alpha(2)*j*j+beta(2)*j ;
end
if k~=0
unit(1,3)=k;
cost=cost+0.5*alpha(3)*k*k+beta(3)*k ;
end
if l~=0
unit(1,4)=l;
cost=cost+0.5*alpha(4)*l*l+beta(4)*l ;
end
cunit=unit;
min=cost;
else
cost=0;
end
end
end
end
end
end
disp('cunit:');
disp(cunit)
disp('cost of generation:');
disp(min)
end
OUTPUT:
RESULT:
OPTIMAL SCHEDULING OF THERMAL POWER UNITS
AIM: To obtain economic dispatch of thermal units with considering losses and
Generator limits
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 2: Read the input data Ng. Pd, cost coefficients, Pmax, Pmin, loss
coeffficients
STEP 4: Calculate P(i) and check whether P(i)>Pmax and set P(i)=Pmax
clc;
clear all;
load coeff.dat;
load bc.dat;
load dat.dat;
Pmax=[85 80 70];
Pmin=[10 10 10];
for i=1:ng
a(i)=coeff(i,1);
b(i)=coeff(i,2);
c(i)=coeff(i,3);
end
for i=1:ng
for j=1:ng
B(i,j)=0;
B(i,i)=bc(i,i);
end
end
lemda=dat(1,3);
count=0;
while(count<4)
for i=1:ng
P(i)=(lemda-b(i))/(2*(c(i)+(lemda*B(i,i))));
if P(i)>Pmax(i)
P(i)=Pmax(i);
if P(i)<Pmin(i)
P(i)=Pmin(i);
end
end
end
for i=1:ng
pl(i)=B(i,i)*P(i)*P(i);
end
pt=0;
for i=1:ng
pt=pt+P(i);
end
plt=0;
for i=1:ng
plt=plt+pl(i);
end
delp=pd+plt-pt;
diffp=0;
for i=1:ng
X(i)=c(i)+(B(i,i)*b(i));
Y(i)=2*(c(i)+(lemda*B(i,i)))^2;
diffp=diffp+(X(i)/Y(i));
end
dellemda=(delp/diffp);
lemda=lemda+dellemda;
count=count+1;
end
ct=0;
for i=1:ng
ct=ct+(a(i)+b(i)*P(i))+(c(i)*P(i)*P(i));
end
disp(ct)
disp(P)
disp(plt)
disp('lemda:');
disp(lemda)
INPUT:
coeff.dat
%a b c
Generator Data:
dat.dat
% ng pd lemda
3 150 8
Loss Matrix:
bc.dat
% b1 b2 b3
0.000218 0 0
0 0.000228 0
0 0 0.000179
OUTPUT:
RESULT:
ROTAR ANGLE AND FREQUENCY CHARACTERISTICS OF SINGLE
AIM: To obtain the rotor angle and frequency characteristics of SMIB system.
SOFTWARE: MATLAB
ALGORITHM:
STEP 1: Start
STEP 8: Stop
PROGRAM:
clc;
clear all;
E = 1.35, V= 1.0; H= 9.94; X=0.65; Pm=0.6; D=0.138; f0 = 60;
Pmax = E*V/X % Max. power
d0 = asin(Pm/Pmax)
Ps = Pmax*cos(d0) % Synchronizing power coefficient
wn = sqrt((pi*60/H)*Ps) % Undamped frequency of oscillation
z = (D/2)*sqrt(pi*60/(H*Ps)) % Damping ratio
wd = wn*sqrt(1-z^2),
fd = wd/(2*pi) %Damped frequency oscillation.
tau = 1/(z*wn) % Time constant
th = acos(z) % Phase angle theta
Dd0 = 10*pi/180; % Initial angle in radian
t = 0:.01:8; %time scale
Dd = Dd0/sqrt(1-z^2)*exp(-z*wn*t).*sin(wd*t + th);
d = (d0+Dd)*180/pi; % Load angle in degree
Dw = -wn*Dd0/sqrt(1-z^2)*exp(-z*wn*t).*sin(wd*t);
f = f0 + Dw/(2*pi); % Frequency in Hz
%to plot characteristics
figure(1), subplot(2,1,1), plot(t, d), grid
xlabel('t, sec'), ylabel('Delta, degree')
subplot(2,1,2), plot(t,f), grid
xlabel('t, sec'), ylabel('f, Hz')
subplot(111)
OUTPUT:
RESULT:
STEP RESPONSE OF SMIB SYSTEM USING SIMULINK
SOFTWARE: MATLAB
PARAMETERS:
Frequency=60,
Generator Excitation= 1.35per unit
Infinite bus voltage V=1pu
Real power =0.6pu at 0.8 pf lagging
Inertia Constant H=9.94MJ/MVA
Transient reactance XdI = 0.3pu
Damping power coefficient D=0.138 ∆δ=16.790.
Change in power input ∆P=0.2
State space model vector A=[0 1; -37.705 -2.617] ∆u = 3.79
PROCEDURE:
1. Open Simulink-File-New-Model
2. Open simulink library and browse required components
3. Connect the components as per circuit diagram.
4. Set the required parameters.
5. Simulate the block diagram.
6. Plot the waveforms
OBSERVATIONS:
The response shows that the oscillation subsides in approximately 3.1 Seconds and a
new steady state operating point is attained at δ0 = 22.50.
RESULT:
TWO AREA LOAD FREQUENCY CONTROL
SOFTWARE: MATLAB
PARAMETERS:
A two-area system connected by a tie-line has the following parameters on
1000-MVA common Base.
AREA 1 2
Speed Regulation R1= 0.05 R2 =0.0625
Frequency-sens Load D1=0.6 D2=0.9
Coefficient
Inertia Constant H1=5 H2=4
Base Power 1000MVA 1000MVA
Governor Time Constant Tg1 =0.2sec Tg2 =0.3sec
Turbine Time Constant Tt1 =0.5sec Tt2 =0.6sec
Integrator Gain Constant KI1 = 0.3 KI2 = 0.3
The two units are operating inparallel at the nominal frequency of 60Hz. The
synchronizing power coefficient is PS = 2.0 p.u. A load change of 187.5MW
occurs in area1.
PROCEDURE:
1. Open Simulink-File-New-Model
2. Open simulink library and brose required components
3. Connect the components as per circuit diagram.
4. Set the required parameters.
5. Simulate the block diagram.
6. Plot the waveforms
OBSERVATIONS:
The simulation diagram returns the vector ∆P , containig t, ∆Pm1 , ∆Pm2 and
∆P12 as seen in fiure 1. As we can see from the fig 2 that frequency deviation
returns to zero with settling time of approximately 20seconds. Also the Tie-line
power change reduces to Zero, and the increase in Area1 load is met by the
increase in generation ∆Pm1.
RESULT: