0% found this document useful (0 votes)
21 views4 pages

Experiment No.1 PSA

Uploaded by

bhaveshrajput491
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Experiment No.1 PSA

Uploaded by

bhaveshrajput491
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Experiment: 2 a

Formation of Bus admittance matrix – inspection method.

Bus admittance matrix is widely used in carrying out Load flow solution of a power system. The
advantages of YBUS are simplicity in data preparation, it can be easily formed and modified for any
changes in the network. It is also sparse matrix, which results in reduction of memory required and time.
It can be formed either by method of inspection or by singular transformation.

// Formation of Bus admittance matrix (Ybus) - inspection method


1. clc;
2. clear;
3. // F T Z HLC
4. linedata = [1 2 0.2*(%i) 0.03*(%i);
5. 1 4 0.25*(%i) 0.025*(%i);
6. 2 3 0.4*(%i) 0.02*(%i);
7. 2 4 0.5*(%i) 0.015*(%i);
8. 3 4 0.2*(%i) 0.01*(%i)];
// F- from bus number, T - To bus number, Z-line impedance, HLC -half line charging
admittance
// b- bus number , SC-shunt compensation at bus b
// from_bus- column matrix storing 'from' bus numbers
// to_bus-column matrix storing 'to' bus numbers
// Z-column matrix storing line impedances
// HLC-half line charging admittance
9. Sh=[4 0.02*(%i)]; // b-,
10. from_bus=real(linedata(:,1)); //
11. to_bus=real(linedata(:,2)); //
12. Z=linedata(:,3); //
13. HLC=linedata(:,4);
// nbus - stores the number of buses
// e - stores the number of lines
// initialize Ybus to zero
14. nbus=max(max(from_bus),max(to_bus));
15. e=length(from_bus);
16. Ybus=zeros(nbus, nbus);
// k takes values from 1 to maximum line number e
// p - From bus number of line k
// q - To bus number of line k
// z - Series impedance of line k
// hlc - Half line charging admittance of line k
// y = reciprocal of z
17. for k=1:e
18. p=from_bus(k);
19. q=to_bus(k);
20. z=Z(k);
21. hlc=HLC(k);
22. y=1/z;
// formation of the off-diagonal elements
// addition of -y to offdiagonal element Ybus(p, q))
23. Ybus(p,q)=Ybus(p,q)-y;
24. Ybus(q,p)=Ybus(p,q);
// formation of the diagonal elements
//addition of y and hlc to diagonal element Ybus(p,p)
//addition of y and hlc to diagonal element Ybus(q,q)
25. Ybus(p,p)=Ybus(p,p)+y+hlc; //
26. Ybus(q,q)=Ybus(q,q)+y+hlc; //
27. end
// Addition of shunt admittance data
// Bus no. at which shunt compensation is provided
28. p=Sh(1,1);
29. sh_compensation=Sh(1,2); // Shunt compensation
30. p=real(p);
31. Ybus(p,p)=Ybus(p,p)+sh_compensation ;
32. Ybus

Output:
Ybus = - 8.945i 5.i 0 4.i
5.i - 9.435i 2.5i 2.i
0 2.5i - 7.47i 5.i
4.i 2.i 5.i - 10.93i
Experiment: 2 b
Formation of bus admittance matrix (YBUS) by singular transformation

1. clc;
2. clear;
// FTZ HLC
3. linedata = [ 1 2 0.02+0.06*(%i) 0.03*(%i)
4. 1 3 0.08+0.24*(%i) 0.025*(%i)
5. 2 3 0.06+0.18*(%i) 0.02*(%i)
6. 2 4 0.06+0.18*(%i) 0.02*(%i)
7. 2 5 0.04+0.12*(%i) 0.015*(%i)
8. 3 4 0.01+0.03*(%i) 0.01*(%i)
9. 4 5 0.08+0.24*(%i) 0.025*(%i)];
// F- from bus number, T - To bus number, Z-line impedance, HLC -half line charging admittance
// from_bus- column matrix storing 'from' bus numbers
// to_bus-column matrix storing 'to' bus numbers
// Z-column matrix storing line impedances
// HLC-half line charging admittance
10. from_bus=real(linedata(:,1));
11. to_bus=real(linedata(:,2));
12. Z=linedata(:,3);
13. HLC=linedata(:,4);
// nbus - stores the number of buses
// e - stores the number of lines
14. nbus=max(max(from_bus),max(to_bus));
15. e=length(from_bus);
16. a=zeros(e,nbus); // initialize matrix A to zero
17. Zpri=zeros(e,e); // Zpri - primitive impedance matrix
// k takes values from 1 to maximum line number e
// p - From bus number of line k
// q - To bus number of line k
// z - Series impedance of line k
18. for k=1:e
19. p=from_bus(k,1);
20. q=to_bus(k,1);
21. z=linedata(k,3);
//Formation of Bus Incidence matrix
// Because, line k is connected from bus number p to bus number q
22. a(k,p)=1;
23. a(k,q)=-1; //
//Formation of the Primitive Impedance matrix
// diagonal elements of primitive impedance are made equal to line impedances (mutual
//impedances are not considered in)
24. Zpri(k,k)=z;
25. end
// Primitive admittance matrix is obtained by inverting primitive impedance matrix
26. Ypri=inv(Zpri);
// Formation of Ybus
27. Ybus=a'*Ypri*a;
//Addition of Half Line Charging Admittance to diagonal elements of Ybus
// Half line charging admittance of line k is added to diagonal elements corresponding to bus p and q
28. for k=1:1:e
29. p=from_bus(k,1);
30. q=to_bus(k,1);
31. hlc=HLC(k,1);
32. Ybus(p,p)=Ybus(p,p)+hlc;
33. Ybus(q,q)=Ybus(q,q)+hlc;
34. end
35. Ybus
output:

Ybus =
6.25 - 18.695i - 5. + 15.i - 1.25 + 3.75i 0 0
- 5. + 15.i 10.83 - 32.415i - 1.67 + 5.i - 1.67 + 5.i - 2.5 + 7.5i
- 1.25 + 3.75i - 1.67 + 5.i 12.92 - 38.695i - 10. + 30.i 0
0 - 1.67 + 5.i - 10. + 30.i 12.92 - 38.695i - 1.25 + 3.75i
0 - 2.5 + 7.5i 0 - 1.25 + 3.75i 3.75 - 11.21i

You might also like