Experiment No.1 PSA
Experiment No.1 PSA
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.
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