CoCalc Public FilesVoltage Drop.sagews
Author: Jacob Cox
Views : 40
"""
*********************************************************************
*
*Voltage Drop Calculation Check
*
*BY:Jacob Cox
*
*Date:11/2016
*
*********************************************************************
"""


'\n*********************************************************************\n*\n*Voltage Drop Calculation Check\n*\n*BY:Jacob Cox\n*\n*Date:11/2016\n*\n*********************************************************************\n'




#auto
"""
*********************************************************************
*Defined Variables and Properties
*********************************************************************
"""
#IEEE STD 141 Table 4a-7 60Hz Impedance 3PH copper cable circuits ohms/1000ft @75C Threee Single Conductors
AWG__12_C_SC_MD = 2.0000,0.0680,2.0011,2.0000,0.0540,2.0007
AWG__10_C_SC_MD = 1.2000,0.0630,1.2017,1.2000,0.0500,1.2010
AWG___8_C_SC_MD = 0.8110,0.0754,0.8140,0.8110,0.0603,0.8130
AWG___6_C_SC_MD = 0.5100,0.0685,0.5150,0.5100,0.0548,0.5130
AWG___4_C_SC_MD = 0.3210,0.0632,0.3270,0.3210,0.0506,0.3250
AWG___2_C_SC_MD = 0.2020,0.0585,0.2100,0.2020,0.0467,0.2070
AWG___1_C_SC_MD = 0.1600,0.0570,0.1700,0.1600,0.0456,0.1660
AWG___0_C_SC_MD = 0.1280,0.0540,0.1390,0.1270,0.0432,0.1340
AWG__00_C_SC_MD = 0.1020,0.0533,0.1150,0.1010,0.0426,0.1100
AWG_000_C_SC_MD = 0.0805,0.0519,0.0958,0.0766,0.0415,0.0871
AWG0000_C_SC_MD = 0.0640,0.0497,0.0810,0.0633,0.0398,0.0748
MCM0250_C_SC_MD = 0.0552,0.0495,0.0742,0.0541,0.0396,0.0670
MCM0300_C_SC_MD = 0.0464,0.0493,0.0677,0.0451,0.0394,0.0599
MCM0350_C_SC_MD = 0.0378,0.0491,0.0617,0.0368,0.0393,0.0536
MCM0400_C_SC_MD = 0.0356,0.0490,0.0606,0.0342,0.0392,0.0520
MCM0450_C_SC_MD = 0.0322,0.0480,0.0578,0.0304,0.0384,0.0490
MCM0500_C_SC_MD = 0.0294,0.0466,0.0551,0.0276,0.0373,0.0464
MCM0600_C_SC_MD = 0.0257,0.0463,0.0530,0.0237,0.0371,0.0440
MCM0750_C_SC_MD = 0.0216,0.0445,0.0495,0.0194,0.0356,0.0405

#Variables used in calculations
voltageDrop = 0;
theta = 0;

#Tag Dictionary for IEEE STD 142 Table 4a-7
CopperSingleConductor={'12 AWG':AWG__12_C_SC_MD,'10 AWG':AWG__10_C_SC_MD,'8 AWG':AWG___8_C_SC_MD,'6 AWG':AWG___6_C_SC_MD,'4 AWG':AWG___4_C_SC_MD,'2 AWG':AWG___2_C_SC_MD,'1 AWG':AWG___1_C_SC_MD,'1/0 AWG':AWG___0_C_SC_MD,'2/0 AWG':AWG__00_C_SC_MD,'3/0 AWG':AWG_000_C_SC_MD,'4/0 AWG':AWG0000_C_SC_MD,'250 kcmil':MCM0250_C_SC_MD,'300 kcmil':MCM0300_C_SC_MD,'350 kcmil':MCM0350_C_SC_MD,'400 kcmil':MCM0400_C_SC_MD,'450 kcmil':MCM0450_C_SC_MD,'500 kcmil':MCM0500_C_SC_MD,'600 kcmil':MCM0600_C_SC_MD,'750 kcmil':MCM0750_C_SC_MD}

'\n*********************************************************************\n*Defined Variables and Properties\n*********************************************************************\n'
#auto
print "Voltage Drop Calculator"
@interact
def vDrop(vSource = input_box(default=480,label='Source Voltage (V)'),
distance = input_box(default=50, label='Source to Load Distance (ft) - One Way'),
powerFactor = slider(0.6,1.0,0.025, label='Power Factor'),
raceway = ['Magnetic','Non-Magnetic'],
cableSize = selector(['12 AWG','10 AWG','8 AWG','6 AWG','4 AWG','2 AWG','1 AWG','1/0 AWG','2/0 AWG','3/0 AWG','4/0 AWG','250 kcmil','300 kcmil','350 kcmil','400 kcmil','450 kcmil','500 kcmil','600 kcmil','750 kcmil'],label='Cable Size'),
sets = selector([1..12],label='# of Sets'),
voltageSystem = selector(['line-to-neutral','single-phase','three-phase'],label='Calculation Type')):
theta=arccos(powerFactor)
if raceway == 'Magnetic':

elif raceway == 'Non-Magnetic':
if voltageSystem == 'line-to-neutral':
voltageDrop = voltageDrop
elif voltageSystem == 'single-phase':
voltageDrop=2*voltageDrop
elif voltageSystem == 'three-phase':
voltageDrop=sqrt(3)*voltageDrop
print "Voltage Drop =",voltageDrop.n(digits=3),"Volts"
print "%Voltage Drop =",((voltageDrop/vSource)*100).n(digits=3),"%"


Voltage Drop Calculator