In [1]:

```
#Variable declaration:
kW1 = 300
pf1 = 0.6 #power factor
pf2 = 1
#Calculation:
kVA = kW1/pf1
kW2 = kVA*pf2
kW = kW2-kW1
#Result:
print "Increased power supplied by the alternator is",kW,"kW"
```

In [1]:

```
import math
#Variable declaration:
V = 400 #rated voltage(V)
Im = 31.7 #motor curtrent(A)
pf1 = 0.7 #initial power factor
pf2 = 0.9 #raised power factor
f = 50 #Hz
#Calculation:
#Referring to the phasor diagram,
Ima = Im*pf1 #Active component of Im(A)
I = Ima/pf2 #total current(A)
Imr = Im*math.sqrt(1-pf1**2) #Reactive component of Im(A)
Ir = I*math.sqrt(1-pf2**2) #Reactive component of I(A)
Ic = Imr-Ir #A
C = Ic/(V*2*math.pi*f)
#Result:
print "Required value of capacitor is",round(C,7),"uF"
```

In [5]:

```
from __future__ import division
import math
#Variable declaration:
#(i):
kW1 = 20
pf1 = 1
#(ii):
kW2 = 100
pf2 = 0.707
#(iii):
kW3 = 50
pf3 = 0.9
#Calculation:
kVA1 = kW1/pf1
kVA2 = kW2/pf2
kVA3 = kW3/pf3
kVAR1 = kVA1*0
kVAR2 = -kVA2*math.sin(math.acos(0.707))
kVAR3 = kVA3*math.sin(math.acos(0.9))
kW = kW1+kW2+kW3
kVAR = kVAR1+kVAR2+kVAR3
kVA = math.sqrt(kW**2+kVAR**2)
pf = kW/kVA
#Result:
print "Total kW is",kW
print "Total kVA is",round(kVA)
print "Power factor is",round(pf,3)
```

In [2]:

```
from __future__ import division
import math
#Variable declaration:
pf1 = 0.75 #Original p.f lag
P = 5 #motor input(kW)
pf2 = 0.9 #final p.f lag
#Calculation:
kVAR = P*(math.tan(math.acos(pf1))-math.tan(math.acos(pf2)))
R = kVAR/3
#Result:
print "Rating of capacitors is",round(R,3),"kVAR"
```

In [6]:

```
from __future__ import division
import math
from sympy import *
#Variable declaration:
Vph = 400 #rated voltage(V)
n = .93 #efficiency
P = 74.6 #power output(kW)
pf1 = 0.75 #power faactor
pf2 = 0.95 #raised power factor
n1 = 4 #no. of capacitors in each branch
V1 = 100 #rating of capacitors(V)
f = 50 #frequency(Hz)
#Calculation:
Pi = round(P/n) #motor input(kW)
phy1 = math.acos(pf1)
phy2 = math.acos(pf2)
#Leading kVAR taken by the condenser bank
kVAR = round(Pi*(math.tan(phy1)-math.tan(phy2)),2)
kVAR1 = round(kVAR/3,2) #Leading kVAR taken by each of three sets
#Fig. above shows the delta* connected condenser bank.
C = symbols('C')
Icp = 2*math.pi*f*C*Vph #Phase current of capacitor(A)
c = solve(Vph*Icp/1000-kVAR1,C)[0] #capacitance(F)
#Result:
print "Capacitance of each capacitor is",round(c*4*10**6,1),"uF"
```

In [3]:

```
from __future__ import division
import math
#Variable declaration:
P = 800 #load(kW)
pf1 = 0.8 #initial power factor
pf2 = 0.9 #improved power factor
t = 3000 #working hours
c1 = 100 #1st part tariff(Rs/kVA)
c2 = 20 #2nd part tariff(paise/kWh)
c3 = 60 #cost of capacitors(Rs/kVAR)
n = 10 #interest & depreciation on capacitors(%)
#Calculation:
phy1 = math.acos(pf1)
phy2 = math.acos(pf2)
#Leading kVAR taken by the capacitors:
kVAR = P*(math.tan(phy1)-math.tan(phy2))
#Annual cost before p.f. correction:
kVAm1 = P/pf1 #max demand
T1 = kVAm1*c1+P*t*c2/100 #total annual cost(Rs)
#Annual cost after p.f. correction:
kVAm2 = P/pf2 #max demand
T2 = c1*kVAm2+P*t*c2/100+n*c3*kVAR/100
T = T1-T2 #annual saving(Rs)
#Result:
print "Annual saving is Rs",round(T)
```

In [6]:

```
from __future__ import division
from sympy import *
import math
#Variable declaration:
P1 = 200 #factory load(kW)
pf1 = 0.85 #initial power factor
pf2 = 0.9 #improved power factor
t = 2500 #working hours
c1 = 150 #1st part tariff(Rs/kVA)
c2 = 5 #2nd part tariff(paise/kWh)
c3 = 420 #cost of capacitors(Rs/kVAR)
Pcl = 100 #capacitor loss(W/kVAR)
n = 10 #interest & depreciation on capacitors(%)
#Calculation:
phy1 = math.acos(pf1)
phy2 = math.acos(pf2)
#suppose the leading kVAR taken by the capacitors is x:
x = symbols('x')
Pcl1 = Pcl*x/1000 #capacitor loss(kW)
P2 = P1+Pcl1 #total power(kW)
x1 = solve((P1*math.tan(phy1)-P2*math.tan(phy2))-x,x)[0]
#Annual cost before p.f. correction:
kVAm1 = P1/pf1 #max demand
T1 = kVAm1*c1+P1*t*c2/100 #total annual cost(Rs)
#Annual cost after p.f. correction:
kVAm2 = P1/pf2 #max demand
T2 = c1*kVAm2+P1*t*c2/100+n*c3*x1/100+round(Pcl*x1*t*c2/100000)
T = T1-T2 #annual saving(Rs)
#Result:
print "Annual saving is Rs",round(T)
```

In [6]:

```
from __future__ import division
import math
#Variable Declaration:
pf = 0.8 #power factor
kVA = 750 # monthly demand
c1 = 8.50 #monthly power rate(Rs/kVA per month)
R = 250 #rating of capacitors(kVA)
C2 = 20000 #installed cost of equipment(Rs)
r = 10 #fixed charge rate(%)
#Calculation:
phy = math.acos(pf)
kW = kVA*math.cos(phy) #kW component of demand
kVAR = kVA*math.sin(phy) #kVAR component of demand
kVAR1 = kVAR-R #Leading kVAR taken by the capacitors
kVA1 = math.sqrt(kVAR1**2+kW**2) #kVA after p.f. improvement
kVA11 = round(kVA-kVA1,1) #Reduction in kVA
T1 = c1*kVA11*12 #Yearly saving on kVA charges
T2 = r*C2/100 #Fixed charges/year(Rs)
T = T1-T2 #net saaving(Rs)
#Result:
print "The annual saving is Rs",T
```

In [9]:

```
from __future__ import division
import math
#Variable declaration:
pf1 = 0.8 #initial power factor
pf2 = 0.9 #improved power factor
L1 = 200 #load(kW)
L2 = 80 #motor load(kW)
#Calculation:
phy1 = math.acos(pf1)
phy2 = math.acos(pf2)
L = L1+L2 #combined load(kW)
#In Fig. above, Δ OAB is the power triangle for load,
#Δ ODC for combined load and Δ BEC for the motor.
#(i):
kVAR = L1*math.tan(phy1)-L*math.tan(phy2) #Leading kVAR taken by the motor
#(ii):
kVArat = math.sqrt(L2**2+kVAR**2) #kVA rating of motor
#(iii):
pf = L2/kVArat #p.f. of motor
#Result:
print "The leading kVAR taken by the motor is",round(kVAR,2)
print "kVA rating of the motor is",round(kVArat,2)
print "Power factor at which the motor operates is",round(pf,3),"leading"
```

In [10]:

```
from __future__ import division
import math
#Variable declaration:
#for induction motor:
kW1 = 37.3
pf1 = 0.8 #lagging
n1 = 0.85
#for synchronous motor:
kW2 = 18.65
pf = 0.9 #leading
n2 = 0.9
#for lighting load:
kW3 = 10
pf3 = 1
c1 = 60 #Rs/kVA of max demand
c2 = 5 #paie per kWh
t = 2000 #working hours
#Calculation:
P1 = kW1/n1 #power input to induction motor(kW)
Q1 = P1*math.tan(math.acos(pf1)) #Lagging kVAR taken by induction motor
P2 = kW2/n2 #Input power to synchronous motor(kW)
Q2 = P2**math.tan(math.acos(pf1)) #Leading kVAR taken by synchronous motor
#Since lighting load works at unity p.f., its lagging kVAR = 0.
Q3 = 0
kVAR = Q1-Q2 #net kVAR
kW = round(P1+P2+kW3,1) #total active power
kVA = round(math.sqrt(kW**2+kVAR**2))
T = c1*kVA+c2*kW*t/100
#Result:
print "The annual electical charges is Rs",round(T)
```

In [19]:

```
from __future__ import division
import math
#Variable declaration:
#(i)for a lighting load:
P1 = 500 #kW
#(ii) for a load:
P2 = 400 #kW
pf2 = 0.707 #power factor lagging
#(iii)for a load:
P3 = 800 #kW
pf3 = 0.8 #power factor leading
#(iv)for a load:
P4 = 500 #kW
pf4 = 0.6 #power factor lagging
#(v)a synchronous motor driving a d.c. generator:
P5 = 540 #power rated at generator(kW)
n = 0.9 #overall efficiency
#Calculation:
#Total lagging kVAR taken by loads (ii) and (iv)
kVAR24 = P2*math.tan(math.acos(pf2))+P4*math.tan(math.acos(pf4))
#Leading kVAR taken by the load (iii)
kVAR3 = P3*math.tan(math.acos(pf3))
#Leading kVAR to be taken by synchronous motor
kVAR5 = kVAR24-kVAR3
Pi = P5/n #motor input(kW)
phy = math.atan(kVAR5/Pi) #phase angle of synchronous motor
pf = math.cos(phy)
#Result:
print "The power factor of synchronous motor is",round(pf,2,),"leading"
```

In [4]:

```
from __future__ import division
import math
#Variable declaration:
P1 = 100 #power of synchronous motor(hp)
P2 = 200 #power aggregated by induction motor(hp)
pf2 = 0.707 #lagging power factor for induction motor
n2 = 0.82 #efficiency of induction motor
P3 = 30 #lighting load(kW)
c1 = 100 #1st part tariff(Rs per kVA per annum)
c2 = 0.06 #2nd part tariff Rs per kWh
pfa = 0.8 #power factor factor initially(lagging)
na = 0.93 #efficiency of synchronous motor initially
pfb = 0.8 #power factor factor changed later(leading)
nb = 0.93 #efficiency of synchronous motor changed later
#Calculation:
#(a) When synchronous motor runs at p.f. 0·8 lagging.
kW1 = round(P1*735.5/(na*1000)) #input to synchronous motor(kW)
kVAR1 = round(kW1*math.tan(math.acos(pfa)),2) #Lagging kVAR taken by the synchronous motor(kVAR)
kW2 = round(P2*735.5/(n2*1000),1) #input to induction motor(kW)
kVAR2 = kW2*math.tan(math.acos(pf2)) #Lagging kVAR taken by the induction motor(kVAR)
#Since lighting load works at unity p.f., its lagging kVAR is zero.
kVARt = kVAR1+kVAR2 #Total lagging kVAR
kWt = kW1+kW2+P3 #Total active power(kW)
kVAt = round(math.sqrt(kWt**2+kVARt**2),1) #total kVA
C1 = kVAt*c1 #annual kVA demand charges
E1 = kWt*8760 #Energy consumed/year(kWh)
C2 = round(0.06*E1) #annual energy charges(Rs)
T1 = C1+C2 #total Annual bill(Rs)
#(b) When synchronous motor runs at p.f. 0·8 leading.
kVARn = kVAR2-kVAR1 #Net lagging kVAR
kWtt = kWt #total active power(kW)
kVAtt = math.sqrt(kVARn**2+kWtt**2) #total kVA
C11 = c1*kVAtt #annual kVA charges(Rs)
C22 = C2 #Annual energy charges(Rs)
T2 = C11+C22 #total annual bill(Rs)
Ts = T1-T2 #annual saving(Rs)
#Result:
print "The annual saving is Rs",round(Ts/100)*100
```

In [14]:

```
from __future__ import division
import math
#Variable declaration:
pf1 = 0.75 #Power factor of the factory(lagging)
x = 72 #Max. demand charges(Rs per kVA per annum)
d = 10 #interest & depreciation of capital investment(%)
M = 175 #max. demand(kW)
c2 = 120 #cost of phase advancing equipment(Rs/kVAR)
#Calculation:
y = c2*d/100 #Expenditure on phase advancing equipment(Rs/kVAR/annum)
pf2 = math.sqrt(1-(y/x)**2) #power factor
#Result:
print "Most economical p.f. at which factory should operate is",round(pf2,3),"lagging"
```

In [15]:

```
from __future__ import division
import math
#Variable declaration:
L = 400 #avg. demand(kW)
pf1 = 0.8 #original power factor(lagging)
LF = 0.5 #annual load factor
c1 = 50 #first part tariff(Rs/kVA per annum)
c2 = 0.05 #second part tariff(Rs/kWh)
pf2 = 0.95 #improved power factor
c3 = 100 #phase advancement equipment cost(Rs/kVAR)
d = 10 #annual interest and depreciation(%)
#Calculation:
M = L/LF #maximum demand(kW)
#Leading kVAR taken by phase advancement equipment:
kVAR1 = M*(math.tan(math.acos(pf1))-math.tan(math.acos(pf2)))
y = d*c3/100 #Expenditure on phase advancing equipment(Rs/kVAR/annum)
kVA1 = M/pf1 #Max. kVA demand at pf1 power fctor
kVA2 = round(M/pf2) #Max. kVA demand at pf2 power fctor
Cs = c1*(kVA1-kVA2) #Annual saving in maximum demand charges
Ce = y*kVAR1 #Annual expenditure on phase advancing equipment
NS = Cs-Ce #net annual saving
#Result:
print "(i) The capacity of the phase advancing equipment is",round(kVAR1),"kVAR"
print "(ii)The annual saving is Rs",round(NS)
```

In [2]:

```
from __future__ import division
import math
#Variable declaration:
L = 50 #avg. demand(kW)
pf1 = 0.75 #original power factor(lagging)
LF = 0.5 #annual load factor
c1 = 100 #first part tariff(Rs/kVA of max demand per annum)
c2 = 0.05 #second part tariff(Rs/kWh)
c3 = 600 #cost of loss free capacitors(Rs/kVAR)
d = 10 #depreciation & interest(%)
#Calculation:
y = c3*d/100 #Expenditure on capacitors(Rs/kVAR/annum)
pfe = math.sqrt(1-(y/c1)**2) #Most economical power factor
M = L/LF #Max kW demand
kVAm1 = M/pf1 #The maximum kVA demand at pf1 power factor
kVAm2 = M/pfe #The maximum kVA demand at pfe power factor
Cs = c1*(kVAm1-kVAm2) #annual saving(Rs)
#Result:
print "Most economical power factor is",round(pfe,3),"lagging"
print "Annual saving is Rs",round(Cs)
```

In [3]:

```
from __future__ import division
import math
#Variable declaration:
L = 200 #avg. demand(kW)
pf1 = 0.8 #original power factor(lagging)
LF = 0.5 #annual load factor
c1 = 100 #first part tariff(Rs/kVA of max demand per annum)
c2 = 0.05 #second part tariff(Rs/kWh)
c3 = 500 #cost of phase advancing plant(Rs/kVAR)
d = 10 #depreciation & interest(%)
#Calculation:
y = c3*d/100 #Expenditure on capacitors(Rs/kVAR/annum)
pfe = math.sqrt(1-(y/c1)**2) #Most economical power factor
Pc = L*(math.tan(math.acos(pf1))-math.tan(math.acos(pfe))) #Capacity of phase advancing plant
E = L*5000 #units consumed per year(kWh)
C2 = c2*E #annual energy charges(Rs)
C1 = y*Pc #Annual cost of phase advancing plant(Rs)
Cm = c1*L/pfe #Max. demand charge(Rs)
C = C2+C1+Cm #annual charge(Rs)
#Result:
print "(i) The value to which the power factor be improved is",round(pfe,3),"lagging"
print "(ii) The capacity of the phase advancing plant is",round(Pc,2),"kVAR"
print "(iii)The new bill for energy is Rs",round(C,1)
```

In [18]:

```
from __future__ import division
import math
#Variable declaration:
E = 80000 #units consumed per year
kVAm1 = 500 #maximum kVA demand
pf1 = 0.707 #initial power factor(lagging)
c1 = 120 #first part tariff(Rs/kVA of max demand per annum)
c2 = 0.025 #second part tariff(Rs/kWh)
c3 = 50 #cost of phase advancing plant(Rs/kVAR)
pf2 = 0.9 #increased powe factor(Rs)
d = 10 #depreciation on advancing plant(%)
#Calculation:
C1 = c1*kVAm1+c2*E #annual cost of supply(Rs)
P = kVAm1*pf1 #max. kW demand
#Leading kVAR taken by phase advancing equipment:
kVARe = P*(math.tan(math.acos(pf1))-math.tan(math.acos(pf2)))
C2 = round(kVARe*c3*d/100) #Annual cost of phase advancing equipment(Rs)
#When p.f. is raised from 0·707 lag to 0·9 lag
kVAm2 = P/pf2 #new maximum kVA demand
kVAr = kVAm1-kVAm2 #Reduction in kVA demand
Cs = round(c1*kVAr) #annual saving(Rs)
#As the units consumed remain the same, therefore, saving will
#be equal to saving in M.D. charges minus annual cost of
#phase advancing plant.
Cs2 = Cs-C2 #annual charges(Rs)
#Result:
print "The annual cost of supply is Rs",C1
print "Annual saving is Rs",Cs2
```

In [36]:

```
from __future__ import division
#Variable declaration:
pf = 0.7 #power factor when plant working at its max. capacity(lagging)
#Calculation:
#For calculating the cost of increasing plant capacity.
#We have, referring to Fig. 6.15, the increase in kVA capacity is BD.
#Now OE*cos phy2 = OD*cos phy1
#or OB*cos phy2 = OD*cos phy1 (Since OE = OB)
#or OD = OB * cos phy2/cos phy1
# = OB * 0·85/0·7
# = 1·2143 OB
#Increase in the kVA capacity of the plant is
#BD = OD − OB = 1·2143 × OB − OB = 0·2143 OB
#Total cost of increasing the plant capacity
# = Rs 800 × 0·2143 × OB
# = Rs 171·44 × OB ...(i)
cos_phy1 = 0.7; sin_phy1 = 0.714
cos_phy1 = 0.85; sin_phy1 = 0.527
#Leading kVAR taken by p.f. correction equipment is
# ED = CD − CE = OD*sin phy1 − OE*sin phy2
# = 1·2143 * OB*sin phy1 − OB*sin phy2
# = OB*(1·2143 * 0·714 − 0·527) = 0·34 * OB
#Suppose the cost per kVAR of the equipment be Rs y.
#So, total cost of p.f. correction equipment
# = Rs 0·34 × OB × y ...(ii)
#The cost per kVAR of the equipment that would justify its
#installation is when exp. (i) = exp. (ii)
#i.e.,
# 171·44 × OB = 0·34 × OB × y
y = 171.44/0.34 #Rs/kVAR
#If the losses in p.f. correction equipment are neglected,
#then its kVAR = kVA.
#Result:
print "The maximum cost per kVA of p.f. correction equipment"
print "that can be paid is Rs",round(y,1)
```

In [2]:

```
from __future__ import division
#Variable declaration:
pf = 0.7 #power factor when plant working at its max. capacity(lagging)
#Calculation:
#Cost of increasing plant capacity
# BD = OD − OB
# = OB * 0.866/0.70-OB
# = OB*(1·237 − 1)
# = 0·237 * OB
#∴ Annual cost of increasing the plant capacity
# = Rs 10 * 0·237 * OB
# = Rs. 2.37 * OB ...(i)
#Cost of phase advancing equipment. Leading kVAR taken by
#phase advancing equipment,
# ED = CD − CE
# = OD*sin phy1 − OE*sin phy2
# = 1.237 * OB * sin phy1 − OB*sin phy2
# = OB*(1·237 * 0·174 − 0·5) = 0·383 × OB
#Let the cost per kVAR of the equipment be Rs y.
#Annual cost of phase advancing equipment
# = Rs 0.1 * y * 0·383 * OB ...(ii)
#For economical use, the two costs should be equal i.e.,
# exp. (i) = exp. (ii).
#or 0·1 * y * 0·383 * OB = 2·37 * OB
y = 2.37/(0.1*0.383) #Rs
#If the losses in the phase advancing equipment are neglected,
#then its kVAR = kVA.
#Result:
print "The maximum cost per kVA of phase advancing equipment"
print "that can be paid is Rs",round(y,2)
```