#calculate Voltage across the first,second,third,fourth,fifth,sixth unit
import math
#Given data :
C1=1.##
C=6.#
K=C1/C#
V2byV1=(1.+K)#
V3byV1=(1.+3.*K+K**2.)#
V4byV1=(1.+6.*K+5.*K**2.+K**3.)#
#I5=I4+i4#
#omega*C*V5=omega*C*V4+omega*C1*(V1+V2+V3+V4)
V5byV1=1.+10.*K+15.*K**2.+7.*K**3.+K**4.
VbyV1=1+V2byV1+V3byV1+V4byV1+V5byV1#
V1byV=1/VbyV1#
print '%s %.3f %s' %("Voltage across the first unit is ",V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the seconf unit is ",V2byV1*V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the third unit is ",V3byV1*V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the fourth unit is ",V4byV1*V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the bottom most unit is ",V5byV1*V1byV*100," % of V")#
n=5##no. of unit
Strinf_eff=1/n/(V5byV1*V1byV)##%
print '%s %.2f' %("String Efficiency(%)",Strinf_eff*100.)#
#calculate Voltage across the first,second,third,fourth,fifth,sixth unit
import math
#Given data :
C1=1.##
C=10.#
K=C1/C#
V2byV1=(1.+K)#
V3byV1=(1.+3.*K+K**2.)#
V4byV1=(1.+6.*K+5.*K**2.+K**3.)#
V5byV1=1.+10.*K+15.*K**2.+7.*K**3.+K**4.
#I6=I5+i5#
#omega*C*V6=omega*C*V5+omega*C1*(V1+V2+V3+V4+V5)
V6byV1=V5byV1+K*(1.+V2byV1+V3byV1+V4byV1+V5byV1)#
VbyV1=1.+V2byV1+V3byV1+V4byV1+V5byV1+V6byV1#
V1byV=1./VbyV1#
print '%s %.3f %s' %("Voltage across the first unit is ",V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the seconf unit is ",V2byV1*V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the third unit is ",V3byV1*V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the fourth unit is ",V4byV1*V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the fifth unit is ",V5byV1*V1byV*100," % of V")#
print '%s %.3f %s' %("Voltage across the sixth unit is ",V6byV1*V1byV*100," % of V")#
n=6##no. of unit
Strinf_eff=1/n/(V6byV1*V1byV)##%
print '%s %.2f' %("String Efficiency(%)",Strinf_eff*100)#
#calculate Part(i) Percentage String Efficiency,Part(ii) Percentage String Efficiency
import math
#Given data :
V=66.##kV
#Part(i)
n=5.##no. of uniits
K=1./5.##shunt to mutual capacitance ratio
V1=V/(5.+20.*K+21.*K**2.+8.*K**3.+K**4.)##kV
V5=V1*(1.+10.*K+15.*K**2.+7.*K**3.+K**4.)##kV
Strinf_eff=V/n/V5#
print '%s %.2f' %("Part(i) Percentage String Efficiency(%)",Strinf_eff*100.)#
#Part(ii)
n=5.##no. of uniits
K=1./6.##shunt to mutual capacitance ratio
V1=V/(5.+20.*K+21.*K**2.+8.*K**3.+K**4.)##kV
V5=V1*(1.+10.*K+15.*K**2.+7.*K**3.+K**4.)##kV
Strinf_eff=V/n/V5#
print '%s %.2f' %("Part(ii) Percentage String Efficiency(%)",Strinf_eff*100)#
#calculate Voltage across top most unit(kV),Voltage across middle unit(kV),Percentage String Efficiency(%)
import math
#Given data :
Vs=20.##kV
n=3.##no. of uniits
K=0.1##shunt to mutual capacitance ratio
V3=Vs##kV
V1=V3/(1.+3.*K+K**2.)##kV
print '%s %.3f' %("Voltage across top most unit(kV)",V1)#
V2=V1*(1.+K)##kV
print '%s %.3f' %("Voltage across middle unit(kV)",V2)#
V=V1+V2+V3##kV
Strinf_eff=V/n/V3#
print '%s %.3f' %("Percentage String Efficiency(%)",Strinf_eff*100.)#
#calculate Maximum safe working voltage(kV)
import math
#Given data :
Vs=17.5##kV
n=3.##no. of uniits
K=1./8.##shunt to mutual capacitance ratio
V3=Vs##kV
V1=V3/(1.+3.*K+K**2.)##kV
V2=V1*(1.+K)##kV
V=V1+V2+V3##kV
#Strinf_eff=V/n/V3#
print '%s %.2f' %("Maximum safe working voltage(kV)",V)#
#calculate Maximum safe working voltage,Percentage String Efficiency
import math
#Given data :
Vs=12.##kV
n=4.##no. of uniits
K=0.1##shunt to mutual capacitance ratio
V4=Vs##kV
V1=V4/(1.+6.*K+5.*K**2.+K**3.)##kV
V2=V1*(1.+K)##kV
V3=V1*(1.+3.*K+K**2.)##kV
V=V1+V2+V3+V4##kV
print '%s %.2f' %("Maximum safe working voltage(kV)",V)#
Strinf_eff=V/n/V4#
print '%s %.3f' %("Percentage String Efficiency(%)",Strinf_eff*100)#
#calculate Maximum safe working voltage
import math
#Given data :
Vs=11.##kV
n=5.##no. of uniits
K=0.1##shunt to mutual capacitance ratio
V5=Vs##kV
V1=V5/(1.+10.*K+15.*K**2.+7.*K**3.+K**4.)##kV
V2=V1*(1.+K)##kV
V3=V1*(1.+3.*K+K**2.)##kV
V4=V1*(1.+6.*K+5.*K**2.+K**3.)##kV
V=V1+V2+V3+V4+V5##kV
print '%s %.1f' %("Maximum safe working voltage(kV)",V)#
#calculate Voltage between conductors(kV),Percentage String Efficiency(%)
import math
import numpy
from numpy import roots
#Given data :
V2=15.##kV
V3=21.##kV
n=4.##no. of uniits
#V3/V2=(1+3*K+K**2)/(1+K)
#K**2*V2+K*(V3+3*V2)-V2+V3=0#
p=([V2, -V3+3.*V2, V2-V3])#
K=numpy.roots(p)#
K=K[1]##Taking +ve value
V1=V2/(1.+K)##kV
V4=(1.+6.*K+5.*K**2.+K**3.)*V1##kV
V=V1+V2+V3+V4##kV
VL=math.sqrt(3.)*V##kV
print '%s %.1f' %("Voltage between conductors(kV)",VL)#
Strinf_eff=V/n/V4#
print '%s %.2f' %("Percentage String Efficiency(%)",Strinf_eff*100.)#
#calculate C2,C3,C4,C5,C6
import math
#Given data :
K=0.1##shunt to mutual capacitance ratio
CbyC1=10.#
C2byC1=(1.+K)*CbyC1#
C3byC1=(1.+3.*K)*CbyC1#
C4byC1=(1.+6.*K)*CbyC1#
print '%s %.2f %s' %("C2 is ",C2byC1," times of C1")#
print '%s %.2f %s' %("C3 is ",C3byC1," times of C1")#
print '%s %.2f %s' %("C4 is ",C4byC1," times of C1")#
#I5=I4+i4
#omega*C5*v=omega*C4*v+omega*C1*4*v
C5byC1=(1.+10.*K)*CbyC1#
print '%s %.2f %s' %("C5 is ",C5byC1," times of C1")#
#I6=I5+i5
#omega*C6*v=omega*C5*v+omega*C1*5*v
C6byC1=(1.+15.*K)*CbyC1#
print '%s %.2f %s' %("C6 is ",C6byC1," times of C1")#
#calculate C1,C2,C3,C4,C5,C6,C7
import math
#Given data :
n=8.##no. of units
p=[1 ,2, 3, 4, 5, 6, 7, 8]#
#Cp=p*C/(n-p)
C1byC=1/(n-p[0])#
C2byC=2/(n-p[1])#
C3byC=3/(n-p[2])#
C4byC=4/(n-p[3])#
C5byC=5/(n-p[4])#
C6byC=6/(n-p[5])#
C7byC=7/(n-p[6])#
print '%s %.2f %s' %("C1 is ",C1byC," times of C")#
print '%s %.2f %s' %("C2 is ",C2byC," times of C")#
print '%s %.2f %s' %("C3 is ",C3byC," times of C")#
print '%s %.2f %s' %("C4 is ",C4byC," times of C")#
print '%s %.2f %s' %("C5 is ",C5byC," times of C")#
print '%s %.2f %s' %("C6 is ",C6byC," times of C")#
print '%s %.2f %s' %("C7 is ",C7byC," times of C")#
#calculate String efficiency in % is
import math
#Given data :
v2byv1=25./23.25##ratio(By Kirchoff law)
v3byv1=1.65/1.1625##ratio(By Kirchoff law)
Vbyv1=1.+v2byv1+v3byv1##ratio(Final voltage between line conductor & earth)
v1byV=1./Vbyv1##ratio
v2byV=v2byv1*v1byV##ratio
v3byV=v3byv1*v1byV##ratio
eff=1./3./v3byV*100.##string efficiency in %(V/3/v3)
print '%s %.1f' %("String efficiency in % is ",eff)#
#calculate Voltage onn the line end unit in kV,Capacitance required
import math
#Given data :
V=20.##kV
#Cmutual=C##F
CmutualBYC=1.#
#Cshunt=C/5##F
CshuntBYC=1./5.#
#I2=I1+i1#omega*C*V2=omega*C*V1+omega*Cshunt*V1
V2BYV1=1.+CshuntBYC#
V3BYV2=1.##a V2=V3
#V=V1+V2+V3
V1=V/(V3BYV2+V2BYV1+V2BYV1)##kV
V2=V2BYV1*V1##kV
V3=V2##kV
print '%s %.2f' %("Voltage onn the line end unit in kV : ",V3)#
#I3+ix=I2+i2
CxBYC=(V2+CshuntBYC*(V1+V2)-V3)/V3#
print '%s %.2f %s' %("Capacitance required is ",CxBYC,"C(in F).")#