Beruflich Dokumente
Kultur Dokumente
NO:-
DATE:-
AIM:
SYSTEM DATA:
G1 G2
1 2
LINE DATA:
1
Algorithm:
Step 1: Start
Step 2: read the number of buses, number of lines and line data.
Step 4: Form the Y bus matrix using the algorithm Yij = Yij, j=1 where Yii= diagonal
element.
Step 6: Stop.
2
Flowchart
Start
Line number =1
Is this the
last line?
Stop
3
PROGRAM:
# include<iostream.h>
# include<complex.h>
# include<fstream.h>
# define NB 3+1
# define NL 3+1
void main()
{
int i,j,k,l,m,nb,nl,lno[NL],sb[NL],eb[NL];
complex zl[NL],ybus[NB][NB],hlc[NL];
ifstream fin;
fin.open ("ybus.dat");
ofstream fout;
fout.open ("ybus.out");
fin>>nb>>nl;
fout<<"\n FORMATION OF Y-BUS MATRIX BY INSPECTION METHOD \n"
<<"==================================================\n"
<<"\n no.of buses:"<<nb
<<"\n no.of lines:"<<nl
<< "\n line no. SB \t EB \t line imp. \t HLC \n";
for (i=1;i<=nl;i++)
{
for (j=1;j<=nb;j++)
ybus[i][j]=complex(0,0);
}
for (i=1;i<=nl;i++)
{
fin>>lno[i]>>sb[i]>>eb[i]>>zl[i]>>hlc[i];
fout<<lno[i]<<"\t"<<sb[i]<<"\t"<<eb[i]<<"\t"<<zl[i]<<"\t"<<hlc[i]<<"\n";
l=sb[i];
m=eb[i];
ybus[l][l]+=1/zl[i]+hlc[i];
ybus[l][l]+=1/zl[i]+hlc[i];
ybus[l][m]=-1/zl[i];
ybus[m][l]=-1/zl[i];
}
cout<< "\n YBUS MATRIX================ \n";
for (i=1;i<=nb;i++)
{
fout<< "\n";
for (j=1;j<=nb;j++)
fout<<ybus[i][j]<<"\t";
}
}
4
INPUT FILE:
33
1 1 2 (0,0.2) (0,0.01)
2 1 3 (0,0.1) (0,0.02)
3 2 3 (0,0.25) (0,0.03)
OUTPUT FILE:
No.of buses: 3
No.of lines: 3
Line no. SB EB line imp. HLC
1 1 2 (0, 0.2) (0, 0.01)
2 1 3 (0, 0.1) (0, 0.02)
3 2 3 (0, 0.25) (0, 0.03)
RESULT: