from __future__ import division
import math
# Initialization of Variable
rgas = 42.5 #lbf/ft3
rwater = 62.4 #lbf/ft3
hgas = 17 #ft
hwater = 3 #ft
#calculations:
#pressure relative to atmospheric pressure at 1
#Pdiff1 = P1- P0
Pdiff1 = rgas*hgas
#corresponding pressure head in feet of water is therefore at 1
#head1 = (P1-P0)/rwater
head1 = Pdiff1/rwater
#pressure relative to atmospheric pressure at 2(bottom)
#Pdiff2 = P2- P0
Pdiff2 = rwater*hwater + Pdiff1
#corresponding pressure head in feet of water is therefore at 1
#head2 = (P2-P0)/rwater
head2 = Pdiff2/rwater
#Results
print " the pressure relative to atmospheric pressure at junction is", Pdiff1,"lbf/ft2 or", round(Pdiff1/144,2),"lbf/in2"
print " corresponding pressure head in feet of water is", round(head1,1),"ft"
print " the pressure relative to atmospheric pressure battom is", Pdiff2,"lbf/ft2 or", round(Pdiff2/144,2),"lbf/in2"
print " corresponding pressure head in feet of water is", round(head2,1),"ft"
from __future__ import division
import math
# Initialization of Variable
SGoil = 0.9
rwater = 62.4 #lbf/ft3
h1 = 36/12 #ft
h2 = 6/12 #ft
SGhg = 13.6
h3 = 9/12 #ft
#calculations:
Pair = -1*SGoil*rwater*(h1 + h2) + SGhg*rwater*h3
#gage pressure
Pgage = Pair/144
#Results
print "Gage pressure is",round(Pgage,2),"lbf/in2(psi)"
from __future__ import division
import math
# Initialization of Variable
b = 2 #m
r = 9.8E3 #N/m3
a = 4 #m
#calculations:
Yc = 8
#area
A = b*a
hc = Yc*math.sin(60*math.pi/180)
FR = r*hc*A
#moment of Inertia
Ixc = (b*a**3)/12
#location
YR = Ixc/(Yc*A) + Yc
#Results
print "the magnitude and location of the resultant force exerted on the gate by the water are", round(FR,0),"N at", round(YR,2),"m"