import math
# Variables
#Conductor Pararmeters
r = 1.503;
xa = 0.609;
xd = 0.1366;
pf = 0.9;
Vb = 2400;
Vr = Vb;
x = xa+xd;
Kc = 0.01; #From the Curve
# Calculations
K = ((r*pf)+(x+math.sin(math.radians(math.acos(pf)))))*(1000./3)*100/(Vr*Vb); # In Percent
# Results
print 'a) The Value of Consmath.tant K is %g percent VDpu per kVA mile'%(K)
print 'b) From the precalculated per cent voltage drop Curve, It is found that the K is %g percent VDpu\
per kVA mile which is same as the answer obtained in part a'%(Kc)
# Variables
K = 0.01; #Percentage Value
Sn = 500; #Load in kVA
pf = 0.9; #Lagging
s = 1; #Length of the feeder
# Calculations
VD = s*K*Sn; #Voltage drop in percent
# Results
print 'The Percent Voltage drop in the Main is %g percent'%(VD)
# Variables
K = 0.01; #Percentage Value
Sn = 500; #Load in kVA
pf = 0.9; #Lagging
l = 1.; #Total Length of the feeder
# Calculations
s = l/2; #effective Length of the feeder
VD = s*K*Sn; #Voltage drop in percent
# Results
print 'The Percent Voltage drop in the Main is %g percent'%(VD)
# Variables
K = 0.01; #Percentage Value
Sn = 500; #Load in kVA
pf = 0.9; #Lagging
l = 1.; #Total Length of the feeder
# Calculations
s = l*2/3; #effective Length of the feeder
VD = s*K*Sn; #Voltage drop in percent
# Results
print 'The Percent Voltage drop in the Main is %g percent'%(VD)
# Variables
#Voltage Drops in Percentage
VDlumped = 5.;
VDuniform = 2.5;
VDincreasing = 3.333;
# Calculations
#Ratio of the percent voltage drops
Rlu = VDlumped/VDuniform;
Rli = VDlumped/VDincreasing;
Riu = VDincreasing/VDuniform;
# Results
print 'a) Percent VDlumped = %g Percent VDuniform'%(Rlu)
print 'b) Percent VDlumped = %g Percent VDincreasing'%(Rli)
print 'c) Percent VDincreasing = %g Percent VDuniform'%(Riu)
import math
from numpy import array,multiply,divide
# Variables
D = [500,500,2000,2000,10000,10000,2000,2000]; #Load Densities in kVA/sq.miles
TAn = [6,6,3,3,1,1,15,15]; #Substation Area in sq.miles
VD = [3,6,3,6,3,6,3,6]; #Maximum Total Primary Feeder Voltage drops in percentage
Vll = [4.16,4.16,4.16,4.16,4.16,4.16,13.2,13.2]; #Base Feeder Voltage in kV
TSn = multiply(D,TAn); #Susbstation Load
#From the Graphs of feeders vs load desity in the textbook; The Number of feeders are found to be
n = [4,2,5,3,5,4,6,5]; #No of feeders
# Calculations
#Also from the graph, The characteristic or the feeder is determined
#1-5, 7 are VDL feeders
#6 and 8 are TL feeders
Sn = divide(TSn,n); #Load Per Feeder
#To Determine the Load Current
Il = Sn/(math.sqrt(3)*array(Vll));
# Results
print 'a'
print 'The Substation Size is'
print (TSn)
print 'The Number of Feeders from the Curve is'
print (n)
print 'Also From the Curve%( 1,2,3,4,5,7 cases are VDL but 6 and 8 case are TL'
print 'a'
print 'The Load Current for 6th Case is %g A, which is less than the ampacities of the main but\
more than that of the lateral, Hence it is thermally limited but not the main feeder'%(Il[5])
print 'The Load Current for 8th Case is %g A, which is less than the ampacities of the main but more than that\
of the lateral, Hence it is thermally limited but not the main feeder'%(Il[7])
import math
# Variables
D = 1000.; #Load Density in kVA per sq miles
Vll = 4.16; #Line to Lien voltage in kV
#From The Tables and Curves from the Theory
K = 0.007;
#For TL
TLImax = 230.; #Maximum Feeder Current
TLSn = math.sqrt(3)*Vll*TLImax; #Maximum Load Per Feeder
TLn = 4; #No of Feeders
TLTSn = TLn*TLSn; #Substation Load
TLl4 = math.sqrt(TLSn/D); #Feeder Length
TLS = 2*TLl4; #Total Spacing
TLVDn = 2*K*D*(TLl4**3)/3; #TotalVoltageDrop in the main
# Calculations
#For VDL
VDLVDn = 3; #Percent Voltage Drop
VDLl4 = pow((3*VDLVDn/(2*K*D)),1./3); #Feeder Length
VDLS = 2*VDLl4; #Station size
VDLSn = D*(VDLl4**2); #Maximum Load Per Feeder
VDLn = TLn; #Number Of Feeders
VDLTSn = VDLn*VDLSn; #Susbtation Load
VDLImax = VDLSn/(math.sqrt(3)*Vll); #Ampere Rating of the Main
R = VDLImax/TLImax; #Ampere Loading
# Results
print 'a For Thermally Limited '
print 'i) The Substation Size = %g kVA'%(TLTSn)
print 'ii) Substation Spacing = %g miles'%(TLS)
print 'iii) Maximum Load Per Feeder = %g kVA'%(TLSn)
print 'iv) The Voltage Drop is %g percent'%(TLVDn)
print 'b For Voltage Drop Limited '
print 'i) The Substation Size = %g kVA'%(VDLTSn)
print 'ii) Substation Spacing = %g miles'%(VDLS)
print 'iii) Maximum Load Per Feeder = %g kVA'%(VDLSn)
print 'iv) Ampere Loading of the Main is %g pu'%(R)
#Note The Approximation to 750 kVA
import math
# Variables
DivF = 1.2; #Diversity Factor
DemF = 0.6; #Demand Factor
CL = 2000.; #Connected Load Density in kVA per sq.miles
DD = DemF*CL/DivF; #Diversified Demand
A = 4.; #Area of the Substation
TSn = DD*A; #Peak Loads of A and B
Sm = TSn; #Peak Loads
#Consmath.tants for different conductors
Km = 0.0004;
Kl = 0.00095;
#Number of Laterals
Na = 16.; #Site A
Nb = 32.; #Site B
#Length of the Main
La = 2.;
Lb = 3.;
#length of laterals
Lla = 2.;
Llb = 1.;
# Calculations
#Length of expres Load
Le = 1;
Leffb = Le+((Lb-Le)/2); #Effective Length of the feeder in site B
#Voltage drops
VDa = (La*Km*Sm/2)+(Lla*Kl*Sm/(Na*2));
VDb = (Leffb*Km*Sm)+(Llb*Kl*Sm/(Nb*2));
# Results
print 'The Voltage drop in Site A is %g percent'%(VDa)
print 'The Voltage drop in Site B is %g percent'%(VDb)
VDb = (La*Km*Sm/2)+(Lla*Kl*Sm/Na);
print 'Comparing the results we find Site A suitable due to its less percent voltage drop',VDb
import math
# Variables
D = 500.; #Load Density in kVA per sq.miles
Vl = 12.47; #Line Voltage in kV
N = 2.; #Feeders per substation
#From Table A-5 Appendix A it Current Ampacity can be found
Imax = 340.;
# Calculations
S2 = math.sqrt(3)*Vl*Imax; #Load Per Feeder
l2 = math.sqrt(S2/D); #Length of the feeder
S = 2*l2; #Substation Spacing
TS2 = S2*N; #Total Load on substation
# Results
print 'The Parts a%(b and c of thhis question cannot be coded'
print 'd) The substation size and spacing is %g kVA and %g miles'%(TS2,S)
import math
from sympy import Symbol,solve
# Variables
Ts = 1.; #Assumed Load on station
K = 1.; #Assumption Consmath.tant
K2 = K;
K4 = K;
D = 1.; #Assumption Load Density
#Number of feeders
N2 = 2.;
N4 = 4.;
S2 = Ts/N2; #Load per feeder #Two feeders
S4 = Ts/N4; #Load per feeder #4 feeders
l = Symbol('l'); #Variable Value of length
L2eff = 1*l/3;
L4eff = 2*l/3;
# Calculations
def VD(y):
return D*(l**2)*K*y
VD2 = VD(L2eff);
VD4 = VD(L4eff);
RVD = VD2/VD4;
X = l-RVD;
RVD = 2. #1./(solve(X,2)[0]); #To find the ratio of (l2**3)/(l4**3)
Rl = pow(RVD,1./3); #Ratio of length of feeder for 2 feeders two by length of feeder for 4 feeders
#A is directly proportional to l**2
RA = (Rl**2);
#TSn is directly proportional to n and l**2
RTS = (N2/N4)*(Rl**2);
# Results
print 'a) Ratio of substation spacings = 2l2/2l4 = %g'%(Rl)
print 'b) Ratio of areas covered per feeder main = A2/A4 = %g'%(RA)
print 'c) Ratio of substation loads = TS2/TS4 = %g'%(RTS)