Está en la página 1de 5

1.

DEVELOP A PROGRAM FOR Y-BUS BY INSPECTION METHOD


Dt:-25-11-2015
AIM: To determine the Y-BUS of a given network by inspection method and
Develop a program using C-language.
APPARTUS: Personal computer, C-compiler installed, Manual.
Theory:

Derive YBUS for a 3-bus system with transmission line taken as a Model.
..

I1 Y11 Y12 Y13 V1




I 2 Y21 Y22 Y23 V2

I Y Y
3 31 32 Y33 V3
1) The diagonal elements are obtained by the adding all the branch admittances connected to that bus.
2) The off-diagonal elements are obtained as the negative of branch admittances between the two buses.
DO The Theoretical calculation for the below given problem and verify it by the output file .

ALGORITHM:
1. From The given problem tabulate the DATA of buses, Resistances and Reactances and off line charging
admittances and save it in the same folder where program file is saved.
Start the C-Program File.
2. Collect the DATA from the text file using a structural array.
3. Calculate the branch conductance and susceptance using the formulae
R
X
G 2
B 2
2
R X
R X2
4. Calculate the total no of buses.
5. Start Filling the Elements of the Y-bus, if the Element to be filled is a Diagonal Element then it is
obtained by adding all the branch admittances connected to that bus.
6. If the Element To be filled is a Off diagonal Element then it is obtained by taking negative of branch
admittances between the two buses.
7. Print the YBUS obtained .

FLOWCHART::
START
READ,
1. Total number of Buses
2. Total Number of lines
3. Data
from Bus, To Bus, Line Impedence, Half Line Charging Admittance

Compute Branch Admittances

yij

1
; i, j 1, 2, 3,.....buscount
zij

Initialize Elements of the YBUS Matrix as 0+0j

Set Row Count, i=0

Set Column Count, k=0

YES

NO
Is i==k

YBUS Elements=

Bi

i 1

y 'ik
2

yik
YBUS Elements=
(Transfer admittance)

K=K+1
No

Is BUS
COUNT B
reached
YES
i=i+1
If i=Bus Count

No

Yes
Print YBUS

STOP

PROGRAM
The Following program will work if the DATA has resistance, reactance, and half line charging
admittance and compensating Device admittance.
Problem:

Form The Ybus for the given DATA .


DATA file
1
2
1
4
1
5
2
3
2
4
2
5
2
6
3
5
4
5
5
6

0.08
0.05
0.1
0.05
0.05
0.15
0.09
0.15
0.25
0.15

0.2
0.25
0.25
0.2
0.15
0.2
0.25
0.3
0.4
0.28

0.018
0.03
0.03
0.025
0.015
0.02
0.025
0.03
0.035
0.025

Program File
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
FILE *fs;
int i=0;
int lic=0;
struct line
{
int fb,tb;
float res,rea,con,sus,lsus;
};
struct line l[50];
// DATA entry into memory of C variables
fs=fopen("data.txt","r");
printf("\n
from bus To bus \t impedence \t\t admittance \t \tlinesusc");
while( fscanf(fs,"%d%d%f%f%f",&l[i].fb,&l[i].tb,&l[i].res,&l[i].rea,&l[i].lsus)!=EOF)

{
l[i].con=l[i].res/(pow(l[i].res,2)+pow(l[i].rea,2));
l[i].sus=-l[i].rea/(pow(l[i].res,2)+pow(l[i].rea,2));
printf("\n%d\t%d\t%f+j%f\t%f%fj\t%f\n",l[i].fb,l[i].tb,l[i].res,l[i].rea,l[i].con,l[i].sus,l[i].lsus);
i++;
}
lic=i;
fclose(fs);
//DATA entry over
int tob;
tob=0;
//total no of buses
for(i=0;i<=lic;i++)
{
if(tob<l[i].fb)tob=l[i].fb;
if(tob<l[i].tb)tob=l[i].tb;
}
printf("\nThe total no of buses are=%d\n",tob);
////////
/// YBUS start
int j=0;
float ybusr[20][20],ybusi[20][20];
for(i=0;i<=tob;i++)
{
for(j=0;j<=tob;j++)
{
ybusr[i][j]=0;
ybusi[i][j]=0;
}
}
//start
for(i=0;i<lic;i++)
{// off diagonal entries
ybusr[l[i].fb][l[i].tb]+=-l[i].con;
ybusr[l[i].tb][l[i].fb]+=-l[i].con;
ybusi[l[i].fb][l[i].tb]+=-l[i].sus;
ybusi[l[i].tb][l[i].fb]+=-l[i].sus;
/////
//diagonal entries
ybusr[l[i].fb][l[i].fb]+=l[i].con;
ybusr[l[i].tb][l[i].tb]+=l[i].con;
ybusi[l[i].fb][l[i].fb]+=l[i].sus+l[i].lsus;
ybusi[l[i].tb][l[i].tb]+=l[i].sus+l[i].lsus;
//
}
printf("The final YBUS matrix is :\n\n");
for(i=1;i<=tob;i++)
{
for(j=1;j<=tob;j++)
{
printf("\t%f+%fj\t",ybusr[i][j],ybusi[i][j]);
}
printf("\n\n");
}
getch();
}
//YBUS IS FORMED.

Output File
from bus
1

To bus
2

impedance
0.080000+j0.200000

admittance
1.724138-4.310345j

linesusc
0.018000

0.050000+j0.250000

0.769231-3.846154j

0.030000

0.100000+j0.250000

1.379310-3.448276j

0.030000

0.050000+j0.200000

1.176471-4.705882j

0.025000

0.050000+j0.150000

2.000000-6.000000j

0.015000

0.150000+j0.200000

2.400000-3.200000j

0.020000

0.090000+j0.250000

1.274788-3.541076j

0.025000

0.150000+j0.300000

1.333333-2.666667j

0.030000

0.250000+j0.400000

1.123595-1.797753j

0.035000

0.150000+j0.280000

1.486620-2.775025j

0.025000

The total no of buses are=6


The final YBUS matrix is :
3.872679+-11.526774j
-1.724138+4.310345j

-1.724138+4.310345j

0.000000+0.000000j

-0.769231+3.846154j

-1.379310+3.448276j

0.000000+0.000000j

8.575396+-21.654303j

-1.176471+4.705882j

-2.000000+6.000000j

-2.400000+3.200000j

-1.274788+3.541076j

-1.333333+2.666667j

0.000000+0.000000j

0.000000+0.000000j

-1.176471+4.705882j

2.509804+-7.317549j

0.000000+0.000000j

-0.769231+3.846154j

-2.000000+6.000000j

0.000000+0.000000j

3.892826+-11.563907j

-1.123595+1.797753j

0.000000+0.000000j

-1.379310+3.448276j

-2.400000+3.200000j

-1.333333+2.666667j

-1.123595+1.797753j

7.722860+-13.747720j

-1.486620+2.775025j

0.000000+0.000000j

-1.274788+3.541076j

0.000000+0.000000j

0.000000+0.000000j

-1.486620+2.775025j

2.761408+-6.266101j

Note: Prepare well and come to LAB, you will have a viva during the first half an hour. Software engineers must try a different coding before coming to LAB.

También podría gustarte