Академический Документы
Профессиональный Документы
Культура Документы
1
subdivisions.
1. Primary Distribution
consumer.
2. Secondary Distribution
conditions for voltage collapse to occur are easily derived form the
2
The complete simplification of equations involved are given in
Chapter 2.
1.1.1 Introduction
service switches. The bulk power sources are located in or near the
services.
3
The subtransmission circuits extend from the bulk power
the load area. They may be radial circuits connected to a bulk power
source at only one end or loop and ring circuits connected to one or
4
The area served by the distribution substation is also
primary feeder. The 3-φ primary feeder is usually run out from the
branches into three phase subfeeders and 1-φ laterals. The primary
feeders and laterals may be either cable (or) open wire circuits.
extensively to serve the light and medium density load areas where
the primary and secondary circuits are usually carried over head on
gets its name from the fact that the primary feeders radiate from
which extend into all parts of the area served. The distribution
5
transformers are connected to the primary feeders, subfeeders, and
system are simplicity and low first cost. These result from a straight
account for the wide spread by of the radial system they are not
system having a single path over which current may flow for a part
6
7
1.2.2. The Loop System
supply bulk loads such as small industrial plants and medium (or)
more reliability should be built into the system from the low-voltage
bus of the distribution substation back to the bulk power source (or)
loads supplied over the more reliable loop primary feeders. The
8
MODELING OF DISTRIBUTION SYSTEMS
difficult. Generally distribution networks are radial and the R/X ratio
networks.
magnitude. These three equations are very useful, since they deal
for load flow calculations and for deriving the condition for voltage
9
simplified making it most suitable for use in real time distribution
illustrated in this work is that all voltage terms are eliminated from
the equations for solving the load flows there by simplifying the
too long. The voltages at the far end of many such feeders are very
using the dist flow method. The data of various radial systems can
10
developed which captures and analyses voltages and currents on
archive and
11
a flexible combination of input channels.
+6% limits.
occurrence).
Advanced Education.
2.3 Methodology
Distflow Method
12
Consider the single line in fig. 1 which has the following
parameters.
Where
From fig. (1) the real and reactive power equations have been
derived as
i.e. P = I2r+PL
13
P 2 + Q2
I2 =
V2
P 2 + Q2
P = r + PL … (1)
V2
P 2 + Q2
Q = x + QL … (2)
V2
P 2 + Q2
From equations (1 and 2), we can eliminate the 2
terms.
V
P 2 + Q2
P = r + PL
V2
P 2 + Q2 P − PL
→ = … (3)
V2 r
P 2 + Q2
Q = x + QL
V2
P 2 + Q2 Q − QL
→ = … (4)
V2 X
From equations (3) and (4) the resultant equation can be written as
14
P − PL Q − QL P 2 + Q2
= =
r x V2
P − PL Q − QL
∴ =
r x
x(P − PL ) = r(Q-QL)
By rearranging…5
x(P − PL ) = r(Q-QL)
x
(Q-QL) = (P − PL )
r
x
Q = ( P − PL ) + Q L
r
x2 x
Q = Q + 2 ( P − PL ) 2 + 2 Q L ( P − PL )
2 2
L
r r
Q2 = Q2
L +
x2
r2
(P 2 + PL2 − 2PPL ) +
2xQL (P − PL )
r
P= P Q L +
V 2 r2
(
r 2 2 x 2 2
)
P + PL2 − 2PPL +
2xQL (P − PL )
r
+ PL
r 2 x2 2 x2 2 x2
= P +
PL2 P + P −
2PPL
2
V 2 2 L 2
r r r
15
2xQ L P 2xQ L PL
− + PL
r r
2 2
2 r + x
2P x 2 − 2rx Q x 2P 2 − 2rx Q L
Pr Q 2 + P − P L L + L +P −P = 0
L L
r r r
obtained as follows:
Finally we get,
( 2
)2
(
2x PL −2rxQ L +r − 2x PL −2rxQ L r
2
)
−4 r 2 + x 2 ( )
P =
2 r 2 +x 2( )
16
Similarly for the reactive power Q,
x( P − PL ) = r ( Q − Q L )
r
( P − P1 ) = ( Q − QL )
x
r
P = ( Q − QL ) + PL
x
Squaring on both sides,
r2
P 2 = PL2 + ( Q − Q L ) 2 + 2rPL ( Q − QL )
x2 x
r2 2
P 2 − PL2 +
x2
( L
r
)
Q + Q 2 − 2QQ L + 2xQL ( Q − Q L )
Q=
x 2 r 2 2
PL +
V 2 x2
(
Q + Q2
L − 2Q QL +
r
)
2xPL
(
Q − QL ) + Q2 + QL
2r 2QQ L
− + Q2 + QL
x2
x 2 2PL rQ r 2Q 2 2Q L PL r r 2Q 2L
= PL + + − +
V2
x x 2 x x 2
2r 2Q Q L
− + Q2 + QL
x2
x 2 r 2 + x2 2
− Q 2Q L r − 2rxPL
+
Q= PL + Q 2
V 2 x2 x2
17
r 2Q 2 − 2rxQ L PL
L + Q
L
x2
x 2 r 2 + x2 2
− Q 2Q L r − 2rxPL
+
PL + Q 2
V 2 x2 x2
x 2Q 2 − 2rxQ L PL
L + Q − Q = 0
L
x2
x Q 2 r 2 + x 2 Q 2Q L x 2 − 2rxPL
PL2 + − +
2 2 x 2 x
V V V
1 x Q L − 2rx Q L PL
2 2
+ Q − Q = 0
L
V 2 x
(Since V2=1).
r 2 + x2 2
x PL2 + Q 2 − Q 2Q L r − 2rxPL
x x
r 2Q 2 − 2rx Q L PL
L Q −Q = 0
+ x L
( ) ( ) ( )
xPL2 + Q2 r 2 + x 2 − Q 2QL r 2 − 2rxPL + r 2Q2L − 2rxQL PL + Q L x − Qx
=0
x
18
( ) (
xPL2 + Q 2 r 2 + x 2 − Q 2Q L r 2 − 2rxPL + r 2Q 2 ) ( )
L − 2rx Q L PL + xQL − xQ = 0
( ) (
Q2 r 2 + x 2 + Q Q2 2 2 2
) ( 2
L r − 2rxPL + x + x PL − 2rxQ L PL + rQ L + xQL = 0 )
This is the quadratic equation interms of Q.
From the above equation, the expression fro reactive power Q can
be obtained as
(
2
) (
2 2
2r QL − 2r x PL + x − 2r QL − 2r x PL + x −
)
( )( )
4 r 2 + x 2 x 2PL2 + r 2Q2L − 2r x PL QL + x QL
… (7)
Q=
( 2
2r + x 2
)
2.3.2. Power Flow Equations:
19
Fig. 4: Online Diagram of a radial Network
P2 + Q 2
Pi − ri i
i
Pi +1 = V2 - PLi +I … (8)
P 2 + Q2
Q i +1 = Qi − x i i i
- PLi +I … (9)
V2
P 2 + Q2
V
i +I 2 = ( )
Vi2 − 2 ( ri Pi + x i Q i ) + ri2 + x 2i i
V2
i
… (10)
i
20
1 2
Pi
Pi + ri
( ) ( )
2
+ Q1i
Pi −1 = + PLi … (11)
Vi2
1
( ) ( )
1 2
Pi + Q i
Qi + x i
Q i +1 = + Q Li … (12)
Vi2
) ( ) ( )
1 2 2
Q1i = Q i + Q Li
Start updating from the last node of the network assuming the
(12) and (13) successfully. Updating process ends at the first node
(i.e., at node 1) and will provide the new estimate of the power
Equivalent
21
In this section we will show how a given power distribution
The real and reactive power flows in any line are given by
P 2 + Q2
Pi +1 = Pi − ri i i
- PLi +1
V2
i
P 2 + Q2
Q i +1 = Qi − X i i i
- Q Li +1
V2
i
The real and reactive loss terms in the above equations are
P 2 + Q2
LP i = ri i i
… (14)
V2
i
P 2 + Q2
LQ i = xi i i
… (15)
V2
i
P 2 + Q2
ri +1 i +1 i +1
2
Vi +1
LP i +1
=
LP i P 2 + Q2
r1 i i
V2
i
(
ri +1 Pi2+1 + Q 2i +1 ) V2
i
=
(
ri Pi2 + Q 2i ) V2
i +1
… (16)
22
(P + P
Li +1 ) + ( Q i +1 + Q Li +1 )
P 2 + Q2 2 2
i i i +1
V2 =
i
Vi2+1
From the above equation the voltage ratio between branches i and
i+1 is
V2 Pi2 + Q2i
i
V2 = … (17)
i +1 ( Pi +1 + PLi +1 ) 2 + ( Q i +1 + Q Li +1 ) 2
of real losses
Pi +1 + Q i +1
2 2
LP i +1 r Pi2 + Q 2i
= i +1
(P + P
Pi2 + Q2i Li +1 ) + ( Q i +1 + Q Li +1 )
LP i 2 2
ri i +1
LP i +1 ri +1 Pi2+1 + Q 2i +1
=
LP i ri ( Pi +1 + PLi +1 ) 2 + ( Q i +1 + Q Li +1 ) 2
P 2 + Q2
x i +1 i +1 i +1
V 2
LQ i +1 i +1
= .
LQ i P 2 + Q2
xi i i
V2
i
(
x i +1 Pi2+1 + Q 2i +1 ) V2
i
=
(
x i Pi2 + Q 2i ) V2
i +1
LQ i +1 X i +1 Pi2+1 + Q 2i +1
=
… (19)
LQ i Xi ( Pi +1 + PLi +1 ) 2 + ( Pi +1 + PLi +1 ) 2
For a given distribution network the total injected real and reactive
23
powers are:
Q = ΣLQ i + ΣQ Li …
(21)
24
From the equation (18) and (19) it can be seen that the losses
Hence
P = (
req P 2 + Q 2 + ΣPLi) … (22)
Q = ( )
x eq P 2 + Q 2 + ΣQ Li … (23)
Since (V2 = 1)
Where
TLP
req =
(Pi2 + Q 2i ) … (24)
TLQ
xeq =
(
Pi2 + Q 2i ) … (25)
25
Where
TLP = Σ LPi is the total real power losses in the system with a
power injection of Pi + jQ i .
TLQ = Σ LQi is the total reactive power losses in the system with a
power injection of Pi + jQ i .
P
∴ p.f . =
2 (26)
P + Q2
q – is reactive power
26
REACTIVE POWER COMPENSATION
INTRODUCTION
of the Power Utility as well as power consumers. This article (in two
parts) amplifies on the advantages that accrue from using shunt and
compensation capacitors.
DISTRIBUTION SYSTEMS:
2
1
following facts. which is higher by a factor of
compared to
Cos φ
27
the minimum power loss attainable in the system.
1
i.e. compensating the load to UPF will release a capacity
Cosφ
28
case of uncompensated load. Under this condition, the
excitation losses.
29
peak demand thanks to the released capacity and lesser
power losses.
the system much more undesirable than the lagging p.f operation.
network.
30
conditions. But the voltage dips produced by DOL starting of large
loads, arc furnaces, welding units etc can not be improved by shunt
level. The voltage dips, especially in the case of a low short circuit
motor contactors due to U/V pick up, stalling of loaded motors etc
effectively.
DISTRIBUTION SYSTEMS:
everywhere upto the point where capacitors are located and all
transfer reactance between supply point and the load and thereby
31
improve the load sharing between parallel lines. Economic factors
32
Series capacitors, with their inherent ability to add a voltage
systems.
substations, located 4 to 8 Kms away from the heart of the city. Ref
Figs 3 & 4.
33
Absolute minimum power loss in this case will result when the
across the load or nearby on the feeder. But the optimum value of
analysis.
34
demand as shown in Fig 5.
required to meet the day time reactive load and another capacitor
with the other two banks will maintain the required compensation
CAPACITORS:
35
system component (generators, transformers, transmission and
energy sales.
36
when an individual distribution feeder compensation is in question,
distribution systems.
capacity:
1/ 2
Q2c Cos2 φ QcSin φ
∆S c = 1 − + − 1 Sc
S 2c S 2c
S
In general and ∆S c ≈ QcSin φ when QC < C
10
SC = Station Capacity
37
Cosφ = The P.F at the station before compensation :
MVA
38
3.4.2. Benefits due to reduced energy losses:
proceed as follows.
loss is (Ij2+ I22)R- The power loss due to reactive component is I22 R.
Compensating the feeder will result in a change only in I2. Hence the
section for the same period and FR is reactive load factor for T hours
39
by uniformly distributed load or discrete loading and total energy
savings can be found out for each period over the entire period by
hence the annual energy savings for the entire feeder can be
QC x
∆S F = where Qc is compensation (MVAR) employed, X
XSin θ + rCosθ
the P.F before compensation. The annual benefits due to this will be
40
respect to voltage, Let it be ∆ EC. Annual revenue increase due to
capacitor banks.
compensation levels.
loads.
KW).
41
CASE STUDY OF DIST FLOW METHOD
4.1 FLOW CHART
42
Calculate other parameters
required, eg. Voltages, line losses,
pf, form equations (8), (9), (10) &
(26)
43
4.2 ALGORITHM FOR DIST FLOW METHOD
1. Start the initial iteration by using the total real loads and
2. Sum all the real and reactive losses and find the equivalent
2.
44
KV and base MVA of 10.00
1 (2) 3 (4) 4 (5) 5 (6) 6 (7) 7 (8) 8 (9) 9 (10) 10 (11) 11 (12) 12 (13) 13 (14) 14 (15) 15 (16) 16 (17 17 (18)
(1)
2 (3)
45
4.3. SYSTEM DATA & NETWORKS
18 (19) 19 (20)20 (21) 21 (22) 25 (26) 26 (27) 27 (28) 28 (29) 29 (30) 30 (31) 31 (32) 32 (33)
Single line diagram of a 33 bus Network having a base voltage of 11
CASE STUDY – 2 (DATA & FIGURE)
Single line diagram of a 12 bus Network having a base voltage of 11
KV and base MVA of 10.00
(8)
(7) 7
8 (9)
(3) 3
(2) 2
1
(1)
46
INPUT DATA OF A 33 BUS SYSTEM HAVING A BASE VOLTAGE
OF 11KV AND BASE MVA OF 10.00
Active Reactive
Branc Sendin Receivin Resistanc Reactanc
Power Power in
h No. g Node g Node e in Ohms e in Ohm
in KW KVAR
1 1 2 .0922 .047 100 90
2 2 3 .493 .2511 90 50
3 3 4 .366 .1864 120 80
4 4 5 .3811 .1941 60 40
5 5 6 .819 .707 60 40
6 6 7 .1872 .6188 200 120
7 7 8 1.7114 1.2351 200 120
8 8 9 1.03 .74 160 120
9 9 10 1.044 .74 60 40
10 10 11 .1966 .065 45 30
11 11 12 .3744 .1238 60 35
12 12 13 1.468 1.155 60 35
13 13 14 .5416 .7129 120 80
14 14 15 . 591 .526 60 40
15 15 16 .7463 .545 70 40
16 16 17 1.289 1.721 60 40
17 17 18 .732 .574 90 50
18 2 19 .164 .1565 90 50
19 19 20 1.5042 1.3554 90 60
20 20 21 .4095 .4784 90 50
21 21 22 .7089 .9373 90 60
22 3 23 .4512 .3083 90 50
23 23 24 .898 .7091 320 180
24 24 25 .896 .7011 320 200
25 6 26 .203 .1034 60 250
26 26 27 .2842 .1447 60 100
27 27 28 1.059 .9337 60 50
28 28 29 .8042 .7006 120 70
29 29 30 .5075 .2585 100 60
30 30 31 .9744 .963 150 200
31 31 32 .3105 .3619 210 170
32 32 33 .341 .5302 100 70
47
MODIFIED INPUT DATA OF A 33 BUS SYSTEM HAVING A BASE
VOLTAGE OF 11KV AND BASE MVA OF 10.00
Active Reactive
Branch Sending Receiving Resistance Reactance
Power Power in
No. Node Node in Ohms in Ohm
in KW KVAR
1 1 2 .0922 .047 100 36.39
2 2 3 .493 .2511 90 1.751
3 3 4 .366 .1864 120 15.668
4 4 5 .3811 .1941 60 7.834
5 5 6 .819 .707 60 7.834
6 6 7 .1872 .6188 200 12.78
7 7 8 1.7114 1.2351 200 12.78
8 8 9 1.03 .74 160 34.224
9 9 10 1.044 .74 60 7.834
10 10 11 .1966 .065 45 5.8755
11 11 12 .3744 .1238 60 2.84
12 12 13 1.468 1.155 60 2.834
13 13 14 .5416 .7129 120 2.834
14 14 15 . 591 .526 60 15.668
15 15 16 .7463 .545 70 7.834
16 16 17 1.289 1.721 60 2.473
17 17 18 .732 .574 90 7.834
18 2 19 .164 .1565 90 1.751
19 19 20 1.5042 1.3554 90 1.751
20 20 21 .4095 .4784 90 11.751
21 21 22 .7089 .9373 90 1.751
22 3 23 .4512 .3083 90 11.751
23 23 24 .898 .7091 320 8.448
24 24 25 .896 .7011 320 28.448
25 6 26 .203 .1034 60 217.834
26 26 27 .2842 .1447 60 67.834
27 27 28 1.059 .9337 60 17.834
28 28 29 .8042 .7006 120 5.668
29 29 30 .5075 .2585 100 6.39
30 30 31 .9744 .963 150 119.58
31 31 32 .3105 .3619 210 62.419
32 32 33 .341 .5302 100 16.39
48
INPUT DATA OF A 12 BUS SYSTEM HAVING A BASE VOLTAGE
OF
11 KV AND BASE MVA OF 10.00
Active Reactive
Branch Sending Receiving Resistance Reactance
Power Power in
No. Node Node in Ohms in Ohm
in KW KVAR
1 1 2 0.203 0.1034 120 80
2 2 3 0.341 0.5302 60 40
4 4 5 1.059 0.9337 90 60
5 5 6 1.251 1.721 80 50
9 9 10 0.492 0.2513 60 40
10 10 11 0.769 0.582 45 30
11 11 12 0.203 0.1034 90 50
49
MODIFIED INPUT DATA OF A 12 BUS SYSTEM HAVING A BASE
VOLTAGE OF 11 KV AND BASE MVA OF 10.00
Active Reactive
Branch Sending Receiving Resistance Reactance
Power Power in
No. Node Node in Ohms in Ohm
in KW KVAR
1 1 2 0.203 0.1034 120 15.68
50
RESULTS AND CONCLUSIONS
5.1 RESULTS OF CASE STUDY – 1
BEFORE COMPENSATION
Receiving Node
SENDING
Sending Node
Real Reactiv
Injecting Receivin
B.No.
51
8 0
25 6 26 P[6]=0.03164 Q[6]=0.07497 0.94863 0.2644 0.1347 0.3888
26 26 27 P[26]=0.0878 Q[26]=0.0896 0.90356 0.2653 0.1351 0.6998
5 7
27 27 28 P[27]=0.0815 Q[27]=0.0677 0.90054 0.8286 0.7305 0.7693
8 5
28 28 29 P[28]=0.0753 Q[28]=0.0608 0.88801 0.5558 0.4842 0.7780
2 3
29 29 30 P[29]=0.0684 Q[29]=0.0583 0.87908 0.2824 0.1438 0.7614
9 2
30 30 31 P[30]=0.0559 Q[30]=0.0572 0.87502 0.4496 0.4443 0.6987
3 7
31 31 32 P[31]=0.0456 Q[31]=0.0564 0.86568 0.0789 0.0920 0.6286
5 8
32 32 33 P[32]=0.0302 Q[32]=0.0440 0.86326 0.0460 0.0715 0.5652
0 8
52
AFTER COMPENSATION
Receiving Node
SENDING
Sending Node
Real Reactiv
Injecting Receiving
B.No.
53
27 27 28 P[27]=0.0823 Q[27]=0.0623 0.91119 0.7527 0.6636 0.7972
3 5
28 28 29 P[28]=0.0760 Q[28]=0.0522 0.89946 0.4784 0.4168 0.8245
8 2
29 29 30 P[29]=0.0693 Q[29]=0.0465 0.89134 0.2094 0.1066 0.8302
3 6
30 30 31 P[30]=0.0568 Q[30]=0.0391 0.88773 0.2775 0.2743 0.8237
5 4
31 31 32 P[31]=0.0466 Q[31]=0.0330 0.88054 0.0315 0.0367 0.8161
4 3
32 32 33 P[32]=0.0313 Q[32]=0.0127 0.87919 0.0039 0.0061 0.9263
7 6
req=0.23637p.u xeq=0.09974p.u
54
5.2 RESULTS OF CASE STUDY – 2
BEFORE COMPENSATION
Receiving Node
SENDING
Sending Node
Real Reactiv
Receivin
B.No.
AFTER COMPENSATION
Receiving Node
SENDING
Sending Node
Real Reactiv
Receivin
B.No.
55
10 10 11 P[10]=0.0195 Q[10]=0.0276 0.98468 0.0475 0.0360 0.5764
3 9
11 11 12 P[11]=0.0134 Q[11]=0.0236 0.98265 0.0086 0.0044 0.4950
8 7
req=0.11229p.u xeq=0.14530p.u
56
5.3 COMPARISON OF TEST SYSTEMS
Voltage Voltage
before compensation after compensation
1 1
0.99584 0.9968
0.98846 0.98848
0.98055 0.98077
0.9695 0.97057
0.95363 0.95698
0.94837 0.95261
0.9381 0.9455
0.98605 0.98607
0.98446 0.98468
0.9818 0.98625
57
Voltage comparison of a 33 Bus system :-
Voltage Voltage
before compensation after compensation
1 1
0.99484 0.99523
0.97006 0.97257
0.95547 0.95959
0.94115 0.94694
0.90603 0.91656
0.89259 0.90706
0.85335 0.87735
0.83187 0.86221
0.81227 0.84939
0.81007 0.84777
0.80608 0.84488
0.77953 0.82938
0.76486 0.82198
0.75438 0.81692
0.744 0.812
0.71326 0.80022
0.70392 0.79661
0.99387 0.99426
0.98632 0.98732
0.98429 0.9857
0.981 0.98358
0.9652 0.96778
0.95561 0.95863
0.94863 0.95309
0.90356 0.91412
0.90054 0.91119
0.88801 0.89946
0.87908 0.89134
0.87502 0.88773
0.86568 0.88054
0.86326 0.87919
58
Power factor compensation of a 33 Bus system
59
CONCLUSION
total power loss in the system has been reduced after the
distribution systems.
The power factor of the system is also improved and reactive power
60
APPENDIX (Software)
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<graphics.h>
#define KVb 11.00
#define MVAb 10.00
#define h 1000
#define tn 33
int i,j,a,b,s,se[100],re[100],K,l,zz,z1,o,m;
int lt[15],rt[15];
int rts[15][15],rtr[15][15];
float E=0.0001;
double ppt,qqt,TR,TX,R[100],X[100],req,xeq,op[100],oop,ll,V[100],LR,LX,ttp,ttq;
double
oq[100],ooq,ip,iq,K1,K2,K3,K4,K5,K6[100],K7,K8[100],K9,pt,qt,po,qo,L,poo,qoo;
double
r[100],x[100],p[100],q[100],tp[100],tq[100],temp[50],temq[50],PR[50],QX[50];
double RL[100],XL[100],SI[100],TS,f,np[100],nq[100],pf,N2,N3,N4;
char ch;
FILE *f1,*fp1,*f2;
void main()
{
int w,pp;
char input[32],output[32];
static int z;
clrscr();
printf("enter the input file name: ");
scanf("%s",&input);
f1=fopen(input,"r");
do
{
printf("enter the output file name:");scanf("%s",&output);
fp1=fopen(output,"w");
for(i=1;i<tn;i++)
{
fscanf(f1,"%d%d%d%lf%lf",&i,&se[i],&re[i],&r[i],&x[i]);
printf(" %d\t%d\t%d\t%7.5lf\t%7.5lf\t",i,se[i],re[i],r[i],x[i]);
w=re[i];
r[i]=r[i]*MVAb/(KVb*KVb);
x[i]=x[i]*MVAb/(KVb*KVb);
fscanf(f1,"%lf%lf",&p[w],&q[w]);printf("%7.5lf\t
%7.5lf\n",p[w],q[w]);
p[w]=np[w]=p[w]/(MVAb*1000);
q[w]=nq[w]=q[w]/(MVAb*1000);
}
/* for(i=1;i<tn;i++)
{
printf("\n%2d\t%2d\t%2d\t%7.5lf\t%7.5lf\t",i,se[i],re[i],r[i],x[i]);
w=re[i];
printf("%7.5lf\t%7.5lf",p[w],q[w]);
getch();
} */
61
scanf("%lf",&f);
for(w=2;w<=tn;w++)
{
p[w]=f*np[w];
q[w]=f*nq[w];//printf("\n %7.5lf\t%7.5lf",p[w],q[w]);
}
for(s=0,i=1;i<(tn-1);i++)
{
pp=1;
rts[s+1][pp]=se[i];
rtr[s+1][pp]=re[i];
for(j=i+1;j<tn;j++)
if(se[i]==se[j])
{
pp++;
rts[s+1][pp]=se[j];
rtr[s+1][pp]=re[j];
}
if(pp>=2)
{
s++;
rt[s]=se[i];
lt[s]=pp;
if(s>=2)
for(a=1;a<s;a++)
if(rt[a]==rt[s])
{
rt[s]=0;
lt[s]=0;
s--;
}
}
}
printf(" repeated nodes are %d\n",s);
ttp=0;
ttq=0;
for(i=s;i>=1;i--)
{
temp[i]=0;
temq[i]=0;
LR=0;
LX=0;
for(j=1;j<=lt[i];j++)
{
K=1;
ppt=0;
qqt=0;
z=rtr[i][j];
a=z;
ppt=ppt+p[z];
qqt=qqt+q[z];
if(z>rt[s])
while(z<=tn)
{
if(se[z+1]==re[z])
{
z1=re[z];
ppt=ppt+p[z1];
qqt=qqt+q[z1];
62
z++;
b=z;
}
else
{
b=z;
ppt=ppt+p[z+1];
qqt=qqt+q[z+1];
ip=ppt;
iq=qqt;
tp[a]=ppt;
tq[a]=qqt;
while(z<100)
{
TR=0.0;
TX=0.0;
R[a-1]=(r[a-1])*((tp[a]*tp[a])+(tq[a]*tq[a]));
X[a-1]=(x[a-1])*((tp[a]*tp[a])+(tq[a]*tq[a]));
for(l=a;l<=b+1;l++)
{
tp[l+1]=tp[l]-R[l-1]-p[l];
tq[l+1]=tq[l]-X[l-1]-q[l];
R[l]=R[l-1]*(r[l]/r[l-1])*(((tp[l+1]*tp[l+1])+(tq[l+1]*tq[l+1]))/
(((tp[l+1]+p[l])*(tp[l+1]+p[l]))+((tq[l+1]+q[l])*(tq[l+1]+q[l]))));
X[l]=X[l-1]*(x[l]/x[l-1])*(((tp[l+1]*tp[l+1])+
(tq[l+1]*tq[l+1]))/(((tp[l+1]+p[l])*(tp[l+1]+p[l]))+((tq[l+1]+q[l])*(tq[l+1]+q[l]))));
TR=TR+R[l-1];
TX=TX+X[l-1];
}
req=TR/((tp[a]*tp[a])+tq[a]*tq[a]);
xeq=TX/((tp[a]*tp[a])+tq[a]*tq[a]);
K1=(2*xeq*xeq*ppt)-(2*req*xeq*qqt)+req;
K2=(2*((req*req)+(xeq*xeq)));
K3=((xeq*xeq*ppt*ppt)+(req*req*qqt*qqt)-
(2*req*xeq*ppt*qqt)+(req*ppt));
K4=((xeq*xeq*ppt*ppt)+(req*req*qqt*qqt)-
(2*req*xeq*ppt*qqt)+(xeq*ppt));
K5=((2*req*req*qqt)-(2*req*xeq*ppt)+xeq);
K6[K]=((K1*K1)-(2*K2*K3));
K7=(sqrt(fabs(K6[K])));
K8[K]=((K5*K5)-(2*K2*K4));
K9=(sqrt(fabs(K8[K])));
op[K]=K1/K2-K7/K2;
oq[K]=K5/K2-K9/K2;
ll=op[K]-tp[a-1];
if(fabs(op[K]-tp[a])>E)
{
tp[a]=op[K];
tq[a]=oq[K];
z++;
K++;
}
else
{
zz=rt[i];
temp[i]+=op[K];
op[a]=op[K];
temq[i]+=oq[K];
oq[a]=oq[K];
63
R[a]=(r[a-1])*((op[a]*op[a])+(oq[a]*oq[a]));
X[a]=(x[a-1])*((op[a]*op[a])+(oq[a]*oq[a]));
LR+=R[a];
LX+=X[a];
for(o=a;o<=b;o++)
{
op[o+1]=op[o]-R[o]-p[o];
oq[o+1]=oq[o]-X[o]-q[o];
R[o+1]=R[o]*(((r[o]/r[o-1])*((op[o+1]*(op[o+1])+
(oq[o+1]*oq[o+1]))/((op[o+1]+p[o])*(op[o+1]+p[o])+
(oq[o+1]+q[o])*(oq[o+1]+q[o])))));
X[o+1]=X[o]*(((x[o]/x[o-1])*((op[o+1]*(op[o+1])+
(oq[o+1]*oq[o+1]))/((op[o+1]+p[o])*(op[o+1]+p[o])+
(oq[o+1]+q[o])*(oq[o+1]+q[o])))));
TR+=R[o-1];
TX+=X[o-1];
}
break;
}
}
break;
}
}
}
zz=rt[i];
PR[a-1]=LR;
QX[a-1]=LX;
po=temp[i]+p[zz]+ttp;
qo=temq[i]+q[zz]+ttq;
R[zz]=(po*po+qo*qo)*r[zz-1];
X[zz]=(po*po+qo*qo)*x[zz-1];
TR=0;
poo=temp[i]+ttp;
qoo=temq[i]+ttq;
for(o=rt[i];o>rt[i-1];o--)
{
op[o]=poo+R[o]+p[o];
oq[o]=qoo+X[o]+q[o];
R[o-1]=R[o]*(((r[o-1]/r[o])*((op[o]+p[o])*(op[o]+p[o])+
(oq[o]+q[o])*(oq[o]+q[o])))/((op[o]*op[o])+(oq[o]*oq[o])));
X[o-1]=X[o]*(((x[o-1]/x[o])*((op[o]+p[o])*(op[o]+p[o])+
(oq[o]+q[o])*(oq[o]+q[o])))/((op[o]*op[o])+(oq[o]*oq[o])));
poo=op[o];
qoo=oq[o];
TR=R[o-1];
TX=X[o-1];
ttp=op[o];
ttq=oq[o];
}
}
V[1]=1;
TR=0;
TX=0;
ppt=0;
qqt=0;
for(i=1;i<tn;i++)
{
K1=2*(r[i]*op[i+1]+x[i]*oq[i+1]);
K2=(r[i]*r[i]+x[i]*x[i]);
64
K3=(op[i+1]*op[i+1]+oq[i+1]*oq[i+1])/(V[se[i]]*V[se[i]]);
V[i+1]=sqrt((V[se[i]]*V[se[i]])-K1+(K2*K3));
RL[i]=R[i+1]*h;
XL[i]=X[i+1]*h;
N2=((op[i]*op[i])+(oq[i]*oq[i]));
N3=sqrt(fabs(N2));N4=op[i];
pf=fabs(N4/N3);
printf("\n%d %d %d P[%d]=%7.5lf Q[%d]=%7.5lf
%7.5lf",i,se[i],re[i],se[i],op[i],se[i],oq[i],V[i]);
printf(" %8.4lf %8.4lf %8.4lf",RL[i],XL[i],pf);
fprintf(fp1,"\n%d %d %d P[%d]=%7.5lf Q[%d]=%7.5lf
%7.5lf",i,se[i],re[i],se[i],op[i],se[i],oq[i],V[i]);
fprintf(fp1," %8.4lf %8.4lf %8.4lf",RL[i],XL[i],pf);
TR+=R[i+1];
TX+=X[i+1];
ppt+=p[i+1];
qqt+=q[i+i];
getch();
}
req=TR/(op[2]*op[2]+oq[2]*oq[2]);
xeq=TX/(op[2]*op[2]+oq[2]*oq[2]);
printf("\nreq=%7.5lf\txeq=%7.5lf",req,xeq);
fprintf(fp1,"\nreq=%7.5lfp.u\txea=%7.5lfp.u",req,xeq);
printf("\nDo you want another input file with modified loads
(Y/N);");
fflush(stdin);
ch=getchar();
}
while(ch=='y'||ch=='Y');
}
65
BIBLIOGRAPHY
20
York.
wheeler publishing.
66