In [4]:

```
# Aim:To find work done and power deliver
# Given:
# Force excerted by the person:
F=30.; #lb
# Distance moved by hand truck:
S=100.; #ft
# time taken:
t=60.; #s
# Solution:
# we know,Work done=Force * Displacement,
W=F*S; #ft.lb
# Now,Power,
P=W/t; #(ft.lb/s)
P=round(P/550,4); #HP
# Results:
print " Results: "
print "The work done by the person is ft.lb",W
print "The power delivered by the person is HP",round(P,3)
```

In [5]:

```
# Aim:To determine torque required by hydraulic motor
# Given:
# Power Supplied:
HP=2; #HP
# Speed of the Hydraulic motor:
N=1800; #rpm
# Solution:
# Power (HP)=(Torque*Speed)/63000
# Therefore,Torque
T=(HP*63000)/N; #in.lb
# Results:
print " Results: "
print " The Torque delivered by Hydraulic motor is in.lb",T
```

In [6]:

```
# Aim: Refer Example 3-3 for Problem Description
# Given:
# Load to be raised:
F=3000.; #lb
# Distance:
S=50.; #ft
# time required:
t=10.; #s
#efficiency of the system:
eta=80.; #%
# Solution:
# we know,output power=(Force * Displacement)/time,
outpw=(F*S)/t; #ft.lb/s
outpw_HP=outpw/550; #HP
# Efficiency=output power/input power
inpw=outpw_HP/(eta*0.01); #HP
# Results:
print " Results: "
print " The Input Horsepower required by elevator hoist motor is HP",round(inpw,1)
```

In [7]:

```
# Aim:Refer Example 3-4 for Problem Description
# Given:For the Hydraulic Jack,
# Area of Piston 1:
A1=2.0; #in^2
# Area of Piston 2:
A2=20.0; #in^2
# Input force downward:
F1=100.0; #lb
# downward movement of piston 1:
S1=1.0; #in
# Solution:
# Pascal law states, (F1*A1 = F2*A2)
# Similarly, (S1*A1 = S2*A2)
# Output force upward,
F2=(A2/A1)*F1; #lb
# upward movement of piston 2,
S2=((A1/A2)); #in
# Energy Input,
E1=F1*S1; #in.lb
# Energy Output,
E2=F2*S2; #in.lb
# Results:
print" Results: "
print" The Output force upward is lb",F2
print" The upward movement of piston 2 is in",S2
print" The Energy Input is in.lb",E1
print" The Energy Output is in.lb",E2
```

In [8]:

```
# Aim:Refer Example 3-5 for Problem Description.
# Given:
# Diameter of piston of pump cylinder:
Dp=1.0; #in
# Diameter of piston of load cylinder:
Dl=3.25; #in
# Average hand force:
Fh=25.0; #lb
# Load piston stroke:
Sl=10.0; #in
# Pump piston stroke:
Sp=2.0; #in
pi=3.14;
# Solution:
# Therfore, Force acting on rod of pump cylinder,
F_rod=(8/2)*Fh; #lb
# Area of piston of pump cylinder,
Ap=(pi/4)*Dp**2;#in**2
# Area of piston of load cylinder,
Al=(pi/4)*Dl**2; #in**2
# Pump cylinder discharge pressure,
p=round(F_rod/Ap); #psi
# Load carrying capacity,
F_load=p*Al; #lb
# Therefore, No.s of Cycles,
Noc=(Al*Sl)/(Ap*Sp);
# Output power,
outpw=((F_load*(Sl/12))/Noc); #ft.lb/s
outpw_HP=outpw/550; #HP
# Assuming efficiency 80 %
eta=0.8;
outpw_HP2=eta*outpw_HP; #HP
# Results:
print" Results: "
print" Therefore lb of load can be lifted",round(F_load)
print" The answer in the program is different than that in textbook. It may be due to no.s of significant digit in data and calculation"
print" Therefore no.s of cycles are required to lift the load 10 in.",round(Noc,1)
print" The answer in the program is different than that in textbook. It may be due to no.s of significant digit in data and calculation"
print" Input power when efficiency is 100 percent is HP",round(outpw_HP,3)
print" Input power when efficiency is 80 percent is HP",round(outpw_HP2,3)
```

In [9]:

```
# Aim:Refer Example 3-6 for Problem Description.
# Given:
# inlet air pressure:
p1=100; #psi
# air piston area:
A1=20; #in^2
# oil piston area:
A2=1; #in^2
# load piston area:
A3=25; #in^2
# load piston diameter:
d3=5.64; #in
# Solution:
# booster input force = booster output force
# p1*A1 = p2*A2
p2=(A1/A2)*p1; #psi
# As per pascal law,
p3=p2; # where p3=outlet pressure
# Therefore load carrying capacity of system,
F=p3*A3; #lb
# Results:
print"\n Results: "
print"\n The load carrying capacity of system is lb.",F
```

In [10]:

```
# Aim:Refer Example 3-7 for Problem Description.
# Given:
# inlet diameter:
D1=4.0; #in
# outlet diameter:
D2=2.0; #in
# inlet velocity:
v1=4.0; #ft/s
pi=3.14
# Solution:
# we know, Discharge=Area*Velocity
A1=(pi/4)*(D1/12)**2; #ft**2
Q=A1*v1; #ft**3/s
# Since, for hydraulic system, volume flow rate is always constant
# we get,outlet velocity,
v2=((D1/D2)**2)*v1; #ft/s
# Results:
print"\n Results: "
print"\n The Volume flow rate of the system is ft**3/s.",round(Q,3)
print"\n The fluid velocity at station 2 is ft/s.",v2
```

In [11]:

```
# Aim:Refer Example 3-8 for Problem Description.
# Given:
# Time period of operations:
t=10; #s
# Stroke of hydraulic cylinder:
S=10; #ft
# Load required to compress car:
F_load=8000; #lb
# Pump pressure:
p=1000; #psi
# Efficiency of cylinder:100 %
eta=1;
# Solution:
from math import floor
# The required piston area,
A=round(F_load/p); #in**2
# The necessary pump flow rate,
Q=((A/144)*S)/t; #ft**3/s
Q_gpm=Q*449; #gpm
# The Hydraulic Horsepower delivered to cylinder,
HHP=(p*Q_gpm)/1714; #HP
# rounding off the above answer
HHP=round(HHP)+(round(floor((HHP-round(HHP))*10))/10); #HP
# The output horsepower delivered by cylinder to load,
OHP=HHP*eta; #HP
# Results:
print"\n Results: "
print"\n The Required piston area is in**2.",A
print"\n The necessary pump flow rate is gpm.",round(Q_gpm,1)
print"\n The Hydraulic Horsepower delivered to cylinder is HP.",HHP
print"\n The output horsepower delivered by cylinder to load is HP.",OHP
```

In [12]:

```
# Aim:Refer Example 3-9 for Problem Description.
# Given:
# Time period of operations:
t=10.0; #s
# Stroke of hydraulic cylinder:
S=10.0; #ft
# Load required to compress car:
F_load=8000.0; #lb
# Pump pressure:
p=1000.0; #psi
# Frictional Force:
F_fric=100.0; #lb
# Leakage:
Q_leak=0.2; #gpm
import math
from math import ceil
from math import floor
# Solution:
# The required piston area,
A=(F_load+F_fric)/p; #in^2
# The Theoretical pump flow rate,
Q_theo=((A/144)*S)/t; #ft^3/s
Q_gpm=(Q_theo*449); #gpm
# The Actual pump flow rate,
Q_act=Q_gpm+Q_leak; #gpm
# rounding off the above answer
Q_act=round(Q_act)+(round(math.floor((Q_act-round(Q_act))*10))/10); #gpm
# The Hydraulic Horsepower delivered to cylinder,
HHP=(p*Q_gpm)/1714; #HP
# rounding off the above answer
HHP=round(HHP)+(round(math.ceil((HHP-round(HHP))*10))/10); #HP
# The output horsepower delivered by cylinder to load,
OHP=(F_load*(S/t))/550; #HP
# The Efficiency of System,
eta=math.floor((OHP/HHP)*100); #
# Results:
print"\n Results: "
print"\n The Required piston area is in^2.",A
print"\n The necessary pump flow rate is gpm.",Q_act
print"\n The Hydraulic Horsepower delivered to cylinder is HP.",HHP
print"\n The output horsepower delivered by cylinder to load is HP.",round(OHP,1)
print"\n The Efficiency is",round(OHP/HHP,2)
```

In [13]:

```
# Aim:Refer Example 3-10 for Problem Description.
# Given:
# Pump Power:
HHP=5.0; #HP
# Pump flow:
Q=30.0; #gpm
# Pipe Diameter:
D=1.0; #in
# specific gravity of oil:
SG=0.9;
# Pressure at Station 1:
p1=0.0; #psig (It is atmospheric pressure.)
# Head Loss due to friction between Station 1 and 2 of oil:
Hl=30.0; #ft
import math
from math import pi
from math import ceil
from math import floor
# Solution:
# Acceleration due to gravity,
g=32.2; #ft/s**2
# Energy Equation between Station 1 and Station 2 is given by,
# (Z1+P1+K1+Hp-Hm-Hl)=(Z2+P2+K2)
# since, There is no Hydraulic motor between Station 1 and 2,
# Therefore Motor Head,
Hm=0; #ft
# also, cross section of oil tank is very large, as a result oil is at rest,
v1=0; #ft/s
# Kinetic Energy Head at inlet,
K1=(v1**2)/(2*g); #ft
# Height of Station 1 from Datum,
Z1=0; #ft
# Height of Station 2 from Datum,
Z2=20; #ft
# Pressure Head at inlet,
P1=p1/SG; #ft
# Pump Head,
Hp=ceil((3950*HHP)/(Q*SG)); #ft
# Pump flow,
Q_1=Q/449; #ft**3/s
# Area of pipe,
A=((pi)*((D/12)**2))/4; #ft**2
# Therefore, velocity in pipe,
v2=Q_1/A; #ft/s
# Kinetic Energy head at Station 2,
K2=(v2**2)/(2*g); #ft
# Therefore, Pressure Head at outlet,
P2=Z1+P1+K1+Hp-Hm-Hl-Z2-K2; #ft
# specific weight of oil,
gamma1=SG*62.4; #lb/ft**3
# Pressure available at inlet of hydraulic motor at station 2,
p2=P2*gamma1; # lb/ft**2
p2=floor(p2/144); #psi
# Results:
print"\n Results: "
print"\n The Pressure available at inlet of hydraulic motor at Station 2 is psig.",p2
```

In [14]:

```
# Aim:Refer Example 3-11 for Problem Description.
# Given:
# Fluid Head:
h=36.0; #ft
# Diameter of opening:
d=2.0; #in
# Frictional Head Losses:
Hl=10.0; #ft
import math
from math import pi
from math import floor
# Solution:
# Acceleration due to gravity,
g=32.2; #ft/s**2
# Assuming ideal fluid, Jet velocity,
v2=(2*g*h)**0.5 #ft/s
# Area of the opening,
A=(pi/4)*((d/12)**2); #ft**2
# flow rate,
Q=A*v2; #ft**3/s
Q_gpm=floor(449*Q); #gpm
# Jet velocity considering friction losses,
v2l=(64.4*(h-Hl))**0.5; #ft/s
# since, flow rate is proportional to velocity,
Ql=((v2l/v2)*Q_gpm); #gpm
# Results:
print"\n Results: "
print"\n The Jet velocity is ft/s.",round(v2,1)
print"\n The answer in the program is different than that in textbook. It may be due to no.s of significant digit in data and calculation"
print"\n The Flow rate is gpm.",Q_gpm
print"\n The Jet velocity considering friction losses is ft/s.",round(v2l,1)
print"\n The Flow rate considering friction losses is gpm.",round(Ql)
print"\n The answer in the program is different than that in textbook. It may be due to no.s of significant digit in data and calculation"
```

In [15]:

```
# Aim:Refer Example 3-12 for Problem Description.
# Given:
# Fluid Head:
h=30.0; #ft
# Frictional Head Losses:
Hl=10.; #ft
# U-tube inside diameter:
d=1.; #in
import math
from math import floor,pi
# Solution:
# Acceleration due to gravity,
g=32.2; #ft/s**2
# Jet velocity through siphon,
v2=((2*g*(h-Hl))**0.5); #ft/s
# rounding off the above answer
v2=round(v2)+(round(floor((v2-round(v2))*10))/10); #ft/s
# Area of the U tube,
A=(pi/4)*((d/12)**2); #ft**2
# flow rate through siphon,
Q=A*v2; #ft**3/s
Q_gpm=449*Q; #gpm
# rounding off the above answer
Q_gpm=round(Q_gpm)+(round(floor((Q_gpm-round(Q_gpm))*10))/10); #gpm
# Results:
print"\n Results: "
print"\n The velocity through siphon is ft/s.",v2
print"\n The Flow rate through siphon is gpm.",Q_gpm
```

In [16]:

```
# Aim:Refer Example 3-13 for Problem Description
# Given:For the Hydraulic Jack,
# Area of Piston 1:
A1=25.0; #cm**2
# Area of Piston 2:
A2=100.0; #cm**2
# Input force downward:
F1=200.0; #N
# downward movement of piston 1:
S1=5.0; #cm
# Solution:
# Pascal law states, (F1*A1 = F2*A2)
# Similarly, (S1*A1 = S2*A2)
# Output force upward,
F2=(A2/A1)*F1; #N
# upward movement of piston 2,
S2=(A1/A2)*S1; #cm
# Results:
print"\n Results: "
print"\n The Output force upward is N",F2
print"\n The upward movement of piston 2 is cm",S2
```

In [17]:

```
# Aim:To Determine velocity through pipe.
# Given:
# Diameter of pipe:
D=30.0; #mm
# Flow through pipe:
Q=60.0; #lpm
import math
from math import pi
from math import floor
# Solution:
# Pump flow in m**3/s,
Q_si=0.0000167*Q; #m**3/s
# Diameter of pipe,
D_m=D/1000; #m
# Area of pipe,
A=(pi*(D_m**2))/4; #m**2
# velocity,
v=Q_si/A; #m/s
# rounding off the above answer
v=round(v)+(round(floor((v-round(v))*100))/100); #m/s
# Results:
print"\n Results: "
print"\n The velocity through pipe is m/s.",v
```

In [18]:

```
# Aim:To Determine Hydraulic power delivered by pump.
# Given:
# Pump flow:
Q=50; #lpm
# Pressure delivered by pump:
p=10000; #kPa
# Solution:
# Pump flow in m^3/s,
Q_si=0.0000167*Q; #m^3/s
# Hydraulic Power,
HP=p*Q_si; #kW
# Results:
print"\n Results: "
print"\n The Hydraulic power delivered by pump is kW",HP
```

In [19]:

```
# Aim:To determine torque delivered by hydraulic motor
# Given:
# Mechanical Output Power:
OP=10.0; #kW
# Speed of the Hydraulic motor:
N=1450.0; #rpm
# Solution:
# Power(kW)=(Torque*Speed)/9550
# Therefore,Torque
T=(OP*9550)/N; #Nm
# Results:
print"\n Results: "
print"\n The Torque delivered by Hydraulic motor is Nm.",round(T,1)
```

In [20]:

```
# Aim:Refer Example 3-17 for Problem Description.
# Given:
# Pump Power:
HHP=3.73; #kW
# Pump flow:
Q=0.001896; #m**3/s
# Pipe Diameter:
D=0.0254; #m
# specific gravity of oil:
SG=0.9;
# Pressure at Station 1:
p1=0; #Pa (It is atmospheric pressure.)
# Elevation Between Station 1 and 2:
# Z=Z1-Z2
Z=-6.096; #m -ve sign indicates Station 2 is above Station 1
# Head Loss due to friction between Station 1 and 2 of oil:
Hl=9.144; #m
import math
from math import pi
from math import floor
# Solution:
# Acceleration due to gravity,
g=9.81; #m/s**2
# Energy Equation between Station 1 and Station 2 is given by,
# (Z+P1+K1+Hp-Hm-Hl)=(P2+K2)
# since, There is no Hydraulic motor between Station 1 and 2,
# Therefore Motor Head,
Hm=0; #m
# also, cross section of oil tank is very large, as a result oil is at rest,
v1=0; #m/s
# Kinetic Energy Head at inlet,
K1=(v1**2)/(2*g); #m
# Pressure Head at inlet,
P1=p1/SG; #m
# specific weight of oil,
gamma1=round(SG*9797); #N/m**3
# Pump Power,
W=HHP*1000; #W
# Pump Head,
Hp=(W/(Q*gamma1)); #m
# Area of pipe,
A=((pi)*(D**2))/4; #m**2
# Therefore, velocity in pipe,
v2=Q/A; #m/s
# Kinetic Energy head at Station 2,
K2=(v2**2)/(2*g); #m
# Therefore, Pressure Head at outlet,
P2=Z+P1+K1+Hp-Hm-Hl-K2; #m
# Pressure available at inlet of hydraulic motor at station 2,
p2=floor((P2*gamma1)/1000); # kPa gage
# Results:
print"\n Results: "
print"\n The Pressure available at inlet of hydraulic motor at Station 2 is kPa gage.",p2
```

In [ ]:

```
```

In [ ]:

```
```