# Chapter No 3: Energy in Hydraulic systems

### Example 3.1, Page No 44

In [7]:
#initialisation of variables
h=50.0        #ft height
sg=1.0        #Density

#CALCULATIONS
p=sg*h*0.433      # pressure

#RESULTS
print('Pressure is = %.2f lbf/in^2' %p)
Pressure is = 21.65 lbf/in^2

### Example 3.2, Page No 44

In [3]:
#initialisation of variables
p=1500.0        #lbf/in^2 pressure
Sg=0.78         #Density
p2=p*6895       #lbf/in^2 pressure
#CALCULATIONS
h=(p*2.31)/Sg
h2=(p2*1.02)/(10000*Sg)           #In metric units

#RESULTS
print('Head in ft = %.2f ft' %h)
print('In metric units Head in ft = %.2f ft' %h2)
Head in ft = 4442.31 ft
Head in ft = 1352.48 ft

### Example 3.3, Page No 45

In [4]:
#initialisation of variables
p=13790000      #N/m^2 pressure
Sg=0.83         #Density

#CALCULATIONS
h=(p*1.02)/(Sg*10000)

#RESULTS
print('Head in ft = %.2f m' %h)
Head in ft = 1694.67 m

### Example 3.4, Page No 46

In [7]:
#initialisation of variables
Q=40            #Gal/min flow rate
a1=3.14         #in^2   area
a2=12.56        #in^2   area
#CALCULATIONS
#Part a
v1=Q/(a1*3.12)   #fluid velocity in 2 in diameter
#Part b
v2=(a1*v1)/a2    #Fluid Velocity in 4 in diameter
#RESULTS
print('Fluid Velocity in 2 in diameter pipe is = %.2f ft/sec' %v1)
print('Fluid Velocity in 4 in diameter pipe is = %.2f ft/sec' %v2)
Fluid Velocity is = 4.08 ft/sec
Fluid Velocity is = 1.02 ft/sec

### Example 3.5, Page No 47

In [1]:
import math

#initialisation of variables
Q=18           #Gal/min flow rate
a=3.14         #in^2 area
v2=10         #ft/sec velocity
#CALCULATIONS
v=Q/(a*3.12)
D=math.sqrt((4*Q)/(math.pi*v2*3.12))

#RESULTS
print('Velocity is = %.2f in' %D)
Velocity is = 0.86 in

### Example 3.6, Page No 51

In [2]:
#initialisation of variables
p=10.0        #lbf/in^2 pressure
Sg=0.87       #Density

#CALCULATIONS
h=p*2.31/Sg
#The value of h is actualy 26.55 but in book they have rounded off to 26.6
EPE=200*Sg*8.34*h      #Elevation energy
#RESULTS
print('The height = %.1f ft' %h)
print('The energy of elevation = %.2f ft-lbf' %EPE)
The height = 26.6 ft
The energy of elevation = 38530.80 ft-lbf

### Example 3.7, Page No 53

In [5]:
#initialisation of variables
F=1000        #lbf force
A=3.14        #in^2 area
pe=10.0       #lbf/in^2 (Pressure of elevation)

#CALCULATIONS
p=F/A         #Total pressure
P=p-pe

#RESULTS
print('The pressure is = %.2f lbf/in^2' %P)
The pressure is = 308.47 lbf/in^2

### Example 3.8, Page No 53

In [14]:
import math

#initialisation of variables
Sg=0.87        #Density
a=0.785        #in^2 area
g=32.2         #ft/sec^2

#CALCULATIONS
w=25*Sg*231*62.4*1/1738
Q=25*231*1/12*1/60
v=Q/a
KE=(w*v*v)/(2*g)

#RESULTS
print('The Kinetic enegry is = %.2f ft-lbf' %KE)
The Kinetic enegry is = 290.91 ft

### Example 3.9, Page No 55

In [15]:
#initialisation of variables
A1=7.065      #area in^2
A2=0.785      #area  in^2
p1=1000       #pressure lbf/in^2
Q=500         #flow rate gal/min
g=32.2        #ft/sec^2
Sg=0.91       #density

#CALCULATIONS
v1=Q/(A1*3.12)      #Velocity
v2=Q/(A2*3.12)       #Velocity
temp1=(p1*2.31)/Sg
temp2=(v1*v1)/ (2*g)
temp3=(v2*v2)/(2*g)
p2=(temp1+temp2-temp3)*Sg/2.31

#RESULTS
print('The pressure is = %.2f lbf/in^2' %p2)
The pressure is = 748.21 lbf/in^2

### Example 3.10, Page No 55

In [16]:
#initialisation of variables
p=1000   #pressure lbf/in^2
p1=350   #pressure lbf/in^2
Sg=0.85  #Specific gravity

#CALCULATIONS
Ha=p*2.31/Sg
H1=p1*2.31/Sg
He=Ha-H1-679.41

#RESULTS
print('The energy extracted from the fluid = %.2f lbf/in^2' %He)
The energy extracted from the fluid = 1087.06 lbf/in^2

### Example 3.11, Page No 55

In [17]:
import math

h=40    #height ft
g=32.2  #ft/sec^2
#CALCULATIONS
v=math.sqrt(2*g*h)    #velocity
#RESULTS
print('The energy extracted from the fluid = %.2f lbf/in^2' %v)
The energy extracted from the fluid = 50.75 lbf/in^2