In [51]:

```
from math import sqrt,cos,pi
from __future__ import division
#Input data
P=4000#Power in kW
N=400#Speed in r.p.m
h=200#Head in m
e=90#Efficiency in percent
d=1.5#Diameter in m
vd=10#Percentage decrease in velocity
a=165#Angle with which jet is deflected in degrees
#Calculations
V1=sqrt(2*9.81*h*(e/100))#Velocity in m/s
Vb=(3.14*d*N)/60#Velocity in m/s
nn=((2*(1-((e/100)*cos(pi/180*a)))*(V1-Vb)*Vb)/V1**2)*100#Efficiency in percent
p=(P/(nn/100))#Power developed in kW
pj=(p/2)#Power developed per jet in kW
dx=sqrt((pj*8)/(3.14*V1**3))#Diameter of each jet in m
#Output
print " (a) the efficiency of the runner is %3.2f percent \n (b) the diameter of each jet is %3.4f m"%(nn,dx)
```

In [3]:

```
from math import sqrt
#Input data
P=6000#Power in kW
h=300#Net head availabe in m
N=550#Speed in r.p.m
rd=(1/10)#Ratio of jet diameter to wheel diameter
nh=0.85#Hydraulic efficiency
Cv=0.98#Coefficient of velocity
f=0.46#Speed ratio
d=1000#Density in kg/m**3
#Calculations
V1=Cv*sqrt(2*9.81*h)#Velocity in m/s
Vb=f*sqrt(2*9.81*h)#Velocity in m/s
Q=((P*10**3)/(nh*d*9.81*h))#Discharge in m**3/s
D=((Vb*60)/(3.14*N))#Diameter in m
d=(D/10)#Diameter of jet in m
n=(Q/((V1*(3.14/4)*d**2)))#Number of jets
#Output
print " (a) the number of jets are%3.0f \n (b) diameter of each jet is %3.3f m \n (c) diameter of the wheel is %3.2f m \n (d) the quantity of water required is %3.1f m**3/s"%(n,d,D,Q)
```

In [52]:

```
from math import sqrt
from __future__ import division
#Input data
P=10#Capacity in MW
h=500#Head in m
Ns=10#Specific speed of the turbine
on=80#Overall efficiency in percent
Cv=0.98#Coefficient of velocity
x=0.46#Speed of the bucket wheel to the velocity of jet
da=1000#Density in kg/m**3
#Calculations
N=(Ns*h**(5/4))/sqrt(P*10**3)#Speed in r.p.m
V=(Cv*sqrt(2*9.81*h))#Velocity in m/s
Vb=(x*V)#Speed of bucket wheel in m/s
D=((60*Vb)/(3.14*N))#Diameter in m
d=sqrt((P*10**6)/((on/100)*(3.14/4)*da*V*9.81*h))#Diameter in m
#Output
print " Diameter of jet is %3.3f m \n Diameter of bucket wheel is %3.2f m"%(d,D)
```

In [5]:

```
from math import sqrt
#Input data
Cv=0.97#Coefficient of velocity
f=0.45#Friction coefficient
h=0.85#Head in m
d=1000#Density in kg/m**3
n=1#For a single jet turbine
#Calculations
Ns=((60/3.14)*(f*sqrt(2*9.8))*sqrt(n*(3.14/4)*Cv*sqrt(2*9.8)*9.8*h))#Specific speed in terms of d/D
#Output
print "The specific speed of a single jet Pelton wheel is about %3.0f (d/D) where d and D represent the jet and bucket wheel diameters respectively"%(Ns)
```

In [53]:

```
from math import cos,pi
#Input data
n=4#Number of jets
d=60#Diameter of each jet in mm
a=165#Angle in degrees
v=45#Speed of the bucket wheel in m/s
de=1000#Density in kg/m**3
#Calculations
v1=(2*v)#Jet velocity in m/s
Q=(3.14/4)*(d/1000)**2*v1#Discharge in m**3/s
P=(1-cos(pi/180*a))*(v1**2/4)*Q*de*10**-3#Power developed in kW
P4=(P*4)#For four jets in kW
nd=((1-cos(pi/180*a))/2)*100#Maximum efficiency in percent
#Output
print " Velocity of the jet for maximum efficiency is %3.0f m/s \n Power developed is %d kW \n Hydraulic efficiency is %3.1f percent"%(v1,P4,nd)
```

In [12]:

```
from math import atan, degrees
#Input data
v=20#Peripheral velocity in m/s
vw=17#Velocity of whirl in m/s
vr=2#Radial velocity in m/s
Q=0.7#Flow in m**3/s
hn=80#Hydraulic efficiency in percent
d=1000#Density in kg/m**3
#Calculations
H=((vw*v)/(9.81*(hn/100)))#Head on the wheel in m
P=(d*Q*9.81*H*(hn/100)*10**-3)#Power generated in kW
al=180-degrees(atan(vr/vw))#Angle of guide vanes in degrees
bl=degrees(atan(vr/(v-vw)))#Inlet blade angle in degrees
#Output
print " Head on the wheel is %3.1f m \n The power generated by the turbine is %3.0f kW \n Eit angle of guide vanes is %3.2f degrees and Inlet blade angle is %3.1f degrees"%(H,P,al,bl)
```

In [54]:

```
from math import atan,tan,pi,sqrt,degrees
#Input data
od=1.5#Outer diameter in m
id=0.75#Inner diameter in m
h=150#Head in m
P=14000#Power in kW
Ns=120#Specific speed
vw2=0#Velocity in m/s
a=(11+(20/60))#Angle in degrees
hn=92#Hydraulic efficiency in percent
#Calculations
N=(Ns*h**(5/4))/sqrt(P)#Speed in rpm
vb1=(3.14*od*N)/60#velocity in m/s
vw1=(((hn/100)*9.81*h)/vb1)#velocity in m/s
vf1=(tan(pi/180*a)*vw1)#Velocity in m/s
vf2=vf1#Velocity in m/s
b1=degrees(atan(vf1/(vb1-vw1)))#Angle in degrees
b1x=(b1-int(b1))*60#For output
vb2=(vb1/2)#Velocity in m/s
b2=degrees(atan(vf1/(vb2-vw2)))#Angle in degrees
b2x=(b2-int(b2))*60#For output
#Output
print " Inlet blade angle is %3.0f degrees %3.0f minutes \n Outlet blade angle is %3.0f degrees %3.0f minute"%(b1,b1x,b2,b2x)
```

In [55]:

```
from math import sqrt,pi,atan,degrees
#Input data
h=70#net head in m
N=700#speed in rpm
o=85#over all efficiency in %
P=350#shaft power in kW
he=92#hydraulic efficiency in %
fr=.22#flow ratio
b=.1#breadth ratio
s=2#outer diameter in terms of inner diametre
#Calculations
vf1=fr*sqrt(2*9.81*h)#velocity in m/s
q=(P/(9.81*h*(o/100)))#discharge in m**3/s
d1=sqrt(q/(.94*b*vf1*3.14))#diameter in metre
b1=d1*b#breadth in metre
d2=d1/2#diametre in metre
vb1=(3.14*d1*N)/60#velocity in m/s
vw1=((he/100)*9.81*h)/vb1#velcity in m/s
a=degrees(atan(vf1/vw1))#angle in degrees
bet=degrees(atan(vf1/(vw1-vb1)))#angle in degrees
vb2=(d2/d1)*vb1#velocity in m/s
bet2=degrees(atan(vf1/vb2))#angle in degrees
#Output
print " (a)the guide vane angle is %3.1f degrees \n (b)the runner vane angle at inlet is %3.1f degrees and outlet is %3.2f degrees \n (c)the diametres of the runner at inlet is %3.1f metre and outlet is %3.2f metre\n (d)the width of the wheel at inlet is %3.2f metre"%(a,bet,bet2,d1,d2,b1)
```

In [20]:

```
from math import ceil,sqrt,cos,pi
#Input data
n=4#Number of units
P=70000#Power in kVA
f=50#Frequency in Hz
p=10#No.of pair of poles
h=505#Gross head in m
tn=94#Transmission efficiency in percent
po=260#Power in MW
e=91#Efficiency in percent
nn=0.98#Nozzle efficiency
Cv=0.98#Coefficient of velocity
x=0.48#Vb=0.48 V
dd=25#Nozzle diameter is 25% bigger than jet diameter
a=165#Angle of buckets in degrees
de=99.75#Discharge efficiency in percent
#Calculations
N=(120*f)/(p*2)#Synchronous speed in r.p.m
nh=((tn/100)*h)#Net head in m
pt=(po*10**3)/n#Power developed per turbine in kW
ip=(pt/(e/100))#Input water power in kW
Q=(ip/(9.81*nh))#Discharge in m**3/s
Qj=(Q/n)#Discharge per jet in m**3/s
V1=Cv*sqrt(2*9.81*nh)#Velocity in m/s
d=sqrt((4/3.14)*(Qj/V1))#Diameter of jet in m
nd=(1+(dd/100))*d#Nozzle tip diameter in m
Vb=(x*V1)#Velocity in m/s
D=((Vb*60)/(3.14*N))#Pitch circle diameter of the wheel in m
Ns=((N*sqrt(po*10**3))/nh**(5/4))#Specific speed
jr=(D/d)#Jet ratio
nob=(jr/2)+15#Number of buckets
nobb=ceil(nob)#Rounding off to next integer
W=((V1-Vb)*(1-(nn*cos(pi/180*a)))*Vb)/9.81#Workdone per kg in kg.m/kg
nth=((W/nh)*de)#Hydraulic efficiency in percent
#Output
print " (a) the discharge of the turbine is %3.2f m**3/s \n (b) the jet diameter is %3.3f m \n (c) the nozzle tip diameter is %3.3f m \n (d) the pitch circle diameter of the wheel is %3.2f m \n (e) the specific speed is %3.2f \n (f) the number of buckets on the wheel are %3.0f \n (g) the workdone per kg of water on the wheel is %3.2f kg.m/kg \n (h) the hydraulic efficiency is %3.0f percent"%(Q,d,nd,D,Ns,nobb,W,nth)
```

In [56]:

```
from math import sin,cos,degrees,atan,sqrt,pi
#Input data
gh=35#Gross head in m
md=2#Mean diameter in m
N=145#Speed in rpm
a=30#Angle in degrees
oa=28#Outlet angle in degrees
x=7#Percentage of gross head lost
y=8#Reduction in relative velocity in percent
#Calculations
H=((100-x)/100)*gh#Net haed in m
V1=sqrt(2*9.81*H)#Velocity in m/s
Vb=(3.14*md*N)/60#Velocity in m/s
b1=degrees(atan((V1*sin(pi/180*a))/((V1*cos(pi/180*a))-Vb)))#Angle in degrees
Vr1=((V1*sin(pi/180*a))/sin(pi/180*b1))#Velocity in m/s
Vr2=((100-y)/100)*Vr1#Velocity in m/s
Vw1=(V1*cos(pi/180*a))#Velocity in m/s
Vw2=(Vb-(Vr2*cos(pi/180*oa)))#Velocity in m/s
E=((Vb*(Vw1-Vw2))/9.81)#Workdone in kg.m/kg
nb=(E/gh)*100#Hydraulic efficiency in percent
#Output
print " Blade angle at inlet is %3.0f degrees \n Hydraulic efficiency is %3.0f percent"%(b1,nb)
```

In [26]:

```
from math import sqrt
#Input data
P=10000#Power in kW
h=12#Head in m
Nr=2#Speed ratio
Fr=0.65#Flow ratio
x=0.3#Diameter of hub is 0.3 times the eternal diameter of the vane
on=94#Overall efficiency in percent
#Calculations
Q=(P/(9.81*h*(on/100)))#Discharge in m**3/s
Vr1=(Fr*sqrt(2*9.81*h))#Velocity in m/s
Ab=(Q/Vr1)#Area of flow in m**2
D=sqrt(((Ab*4)/3.14)/(1-x**2))#Diameter of runner in m
Vb=(Nr*sqrt(2*9.81*h))#Velocity in m/s
N=((Vb*60)/(3.14*D))#Speed in rpm
f=50#Taking frequency as 50 Hz
p=(120*50)/N#Number of poles
N1=(120*f)/int(p)#Speed in rpm
Ns=(N1*sqrt(P))/h**(5/4)#Specific speed
#Output
print " (a) the speed is %3.1f rpm \n (b) the diameter of the runner is %3.2f m \n (c) the specific speed is %3.0f"%(N1,D,Ns)
```

In [29]:

```
from math import sqrt
#Input data
P=10000#Power in kW
h=25#Head in m. In textbook it is given wrong as 2 m
N=135#Speed in rpm
h1=20#Head in m
#Calculations
Ns=((N*sqrt(P))/h**(5/4))#Specific speed
N1=sqrt(h1/h)*N#Speed in rpm
P2=P/(h/h1)**(3/2)#Power in kW
#Output
print " Specific speed is %3.1f \n Normal speed is %3.1f rpm \n Output under a head of %d m is %3.0f kW"%(Ns,N1,h1,P2)
```

In [32]:

```
from math import ceil
#Input data
Q=175#Discharge in m**3/s
h=18#Head in meter
N=150#Speed in rpm
oe=82#Overall efficiency in percent
Ns1=460#Maximum specific speed
Ns2=350#Maximum specific speed
d=1000#Density in kg/m**3
#Calculations
P=(d*Q*9.81*h*(oe/100)*10**-3)#power in kW
P1=((Ns1*h**(5/4))/N)**2#Power in kW
n1=P/P1#No.of turbains
P2=((Ns2*h**(5/4))/N)**2#Power in kW
n2=ceil(P/P2)#No.of turbains
#Output
print "The number of turbines in \n (a) Francis turbine are%3.0f \n (b) Kaplan turbine are %d"%(n1,n2)
```

In [34]:

```
from math import sqrt
#Input data
Ns=210#Specific speed
P=30#Power in MW
N=180#Speed in rpm
Q=0.6#Discharge in m**3/s
h=4.5#Head in m
e=88#Efficiency in percent
d=1000#Density in kg/m**3
#Calculations
Pm=(d*Q*9.81*h*(e/100)*10**-3)#Power in kW
Nm=(Ns*h**(5/4))/sqrt(Pm)#Speed in rpm
Hp=((N*sqrt(P*1000))/Ns)**(4/5)#Head in m
Dpm=(Nm/N)*sqrt(Hp/h)#Scale ratio
Qp=(P*10**6)/(d*9.81*Hp*(e/100))#Discharge in m**3/s
#Output
print " Speed is %3.0f rpm \n Power is %3.3f kW \n Scale ratio is %3.3f \n Flow through the turbine is %3.1f m**3/s"%(Nm,Pm,Dpm,Qp)
```

In [36]:

```
from math import sqrt
#Input data
x=1/5#Scale model
h=1.5#Head in m
P=5#Power in kW
N=450#Speed in rpm
h1=30#Head in m
#Calculations
N1=(x*N)/sqrt(h/h1)#Speed in rpm
Ns=(N*sqrt(P))/h**(5/4)#Specific speed
P1=((Ns*h1**(5/4))/N1)**2#Power in kW
#Output
print " Speed is %3.0f rpm \n Power is %3.0f kW"%(N1,P1)
```

In [38]:

```
from math import sqrt
#Input data
h=19#Head in m
Q=3#Flow rate in m**3/s
N=600#Speed in rpm
h1=5#Head in m
#Calculations
N1=N/sqrt(h/h1)#Speed in rpm
Q1=Q/sqrt(h/h1)#Discharge in m**3/s
#Output
print " Speed of the turbine is %3.1f rpm \n Maximum flow rate is %3.1f m**3/s"%(N1,Q1)
```

In [39]:

```
from math import ceil
#Input data
Q=350#Discharge in m**3/s
h=30#Head in m
e=87#Turbine efficiency in percent
f=50#Frequency in Hz
p=24#Number of poles
Ns1=300#Specific speed
Ns2=820#Specific speed
d=1000#Dnsity of water in kg/m**3
#Calculations
N=(120*f)/p#Speed in rpm
P=d*Q*9.81*h*(e/100)*10**-3#Power in kW
P1=((Ns1*h**(5/4))/N)**2#Power in kW
n1=P/P1#No.of turbines
P2=((Ns2*h**(5/4))/N)**2#Power in kW
n2=ceil(P/P2)#No.of turbines
#Output
print "Least number of machines required if using \n (a) Francis turbines are %3.0f \n (b) Kaplan turbines are %3.0f"%(n1,n2)
```

In [41]:

```
#Input data
h=27#Head in m
A=430#Area in sq.km
R=150#Rainfall in cm/year
pr=65#Percentage of rainfall utilised
pe=95#Penstock efficiency in percent
te=80#Turbine efficiency in percent
ge=86#Generator efficiency in percent
lf=0.45#Load factor
d=1000#Density of water in kg/m**3
#Calculations
Q=A*10**6*(R/100)*(pr/100)#Discharge in m**3 per year
Qs=(Q/(365*24*3600))#Quantity of water per second in m**3
P=(pe/100)*(te/100)*(ge/100)*d*Qs*9.81*h*10**-3#Power in kW
plc=(P/lf)#Peak load capacity in kW
C=(plc/(2*(ge/100)))#Capacity of each unit in kW
#Output
print " (a) Power developed is %3.0f kW \n (b) As the available head is low, Kaplan turbines are suggested.\n Two turbines each of 3000kW capacity may be installed."%(P)
```

In [50]:

```
%matplotlib inline
from matplotlib.pyplot import plot, subplot, title,show,xlabel,ylabel
#Input data
q=[0,30,25,20,0,10,50,80,100,110,65,45,30]#Mean discharge in millions of cu.m per month respectively
h=90#Head in m
n=86#Overall efficiency in percent
#Calculations
Qm=(q[(1)]+q[(2)]+q[(3)]+q[(4)]+q[(5)]+q[(6)]+q[(7)]+q[(8)]+q[(9)]+q[(10)]+q[(11)]+q[(12)])/12#Mean discharge in millions m**3/s
Q=[0,30,30,25,25,20,20,0,0,10,10,50,50,80,80,100,100,110,110,65,65,45,45,30,30,0]#Discharge(million m**3/month) on y-axis
y=[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12]#Months on x-ais
D=[0,110,100,90,80,70,60,50,40,30,25,20,10,0]#Discharge per month in million m**3
pt=[0,8.3,16.7,25,25,25,33.3,41.7,50,66.7,75,83.3,91.7,100]#Percentage time
Po=((Qm*10**6*9.81*h*(n/100))/(30*24*3600*1000))#Power developed in MW
#Output
#subplot(131)
plot(y[1:],Q[1:])#Graph Discharge(million m**3/month) vs Month
title("Discharge(million m**3/month) vs Month")
xlabel("Months")
ylabel("Discharge(million m**3/month)")
show()
#subplot(133)
plot(pt[1:],D[1:])#Graph percentage time vs Discharge(million m**3/month)
title("percentage time vs Discharge(million m**3/month)")
xlabel("percentage time")
ylabel("Discharge(million m**3/month)")
show()
print "Power developed is %3.2f MW"%(Po)
```