import math
#Variable initialization
F=80000.0 #lbs Force
F2=355800.0 #N Force
P=1600.0 #lbf/in^2 Pressure
P2=11.03*(1000000) #N/m^2 Pressure
#CALCULATIONS
db=math.sqrt(4.0*F/(math.pi*P))
#In SI units
db2=math.sqrt((4.0*F2)/(math.pi*P2))
db2=db2*100 # To convert it into cm
#RESULTS
print('\n Size of the cylinder postion = %.3f in ' %db)
print('\n Using SI units size of the cylinder postion = %.1f cm ' %db2)
import math
#Variable initialization
Q=25.0 #gpm flow rate
A=0.533 #in^2 area
#Calculations
nu=Q*19.25/(A*60.0) #Fluid velocity
nucylinder =Q*19.25/12.56 #Cylinder velocity
#Results
print('\n Fluid velocity = %.3f ft/sec' %nu)
print('\n Cylinder velocity = %.3f ft/min' %nucylinder )
import math
#Variable initialization
d=3.0 #in diameter
P=2000.0 #lbf/in^2 pressure
s=20.0 #stroke in
#CALCULATIONS
Cl=s*d/2.0 #corrected length
F=P*math.pi*d**2/4.0 #thrust
stl=(Cl-40.0)/10.0 #stop tube length
#RESULTS
print('\n Length of the stop tube= %.3f in ' %Cl)
F=F+3
print('\n Thrust on the rod= %.3f lb ' %F)
print('\n Stop Tube length= %.3f stl ' %stl)
import math
#Variable initialization
v=120.0 #ft/min velocity
S=1.5 #in distance
w=8000.0 #lb wight
#CALCULATIONS
ga=v**2*0.0000517/S
F=w*ga
#RESULTS
print(' Total force decessary to decelarate the load= %.3f lb ' %F)
import math
#Variable initialization
P=750.0 #lbf/in^2 pressure
d=3.0 #in distance
w=1500.0 #lb weight
ga=0.172 #Acceleration factor
f=0.12 #Coefficient of fraction
v=50 #ft/min velocity
s=0.75 #in stroke
#CALCULATIONS
Fa=P*math.pi*d**2/4.0
F=w*(ga-f)+Fa
#RESULT
print('\n Total force decessary to decelarate the load= %.3f lb ' %F)
import math
#Variable initialization
d=3.0 #in diameter
d1=1.5 #in diameter
F=7500.0 #lb force
#CALCULATIONS
A1=(math.pi/4.0)*(d**2-d1**2)
P=F/A1
#RESULT
print(' Pressure in the cylinder = %.3f psi' %P)