import math
# Variables :
p = 5.; #kg/cm**2
print ("Gauge units : ");
# Calculations and Results
print "Pressure Intensity in kg/m**2 : ",(p/10**-4)
g = 9.81; #gravity consmath.tant
print "Pressure Intensity in N/m**2 : ",(p*g/10**-4)
print "Pressure Intensity in Pa : ",(p*g/10**-4)
print "Pressure Intensity in kPa : ",p*g/10**3/10**-4
print "Pressure Intensity in MPa : ",p*g/10**6/10**-4
print ("In terms of head : ");
w = 1000.; #kg/m**3 for water
h = p*10**4/w; #meter of water
print "Pressure is : ",(h)," meter of water."
w = 13.6*1000; #kg/m**3 for mercury
h = p*10**4/w; #meter of mercury
print "Pressure is : ",(h)," meter of mercury."
print ("Absolute units : ");
Patm = 760.; #mm of mercury
Patm = 760*13.6/1000; #m of water
Patm = Patm*1000.; #kg/m**2
Pabs = p+Patm; #kg/m**2
print "Absolute pressure in kg/m**2 : ",Pabs
print "Absolute pressure in kg/cm**2 : ",Pabs*10**4
print "Absolute pressure in N/m**2 : ",Pabs*10**4*g
print "Absolute pressure in Pa : ",Pabs*10**4*g
print "Absolute pressure in kPa : ",Pabs*10**5/10**3
print "Absolute pressure in MPa : ",Pabs*10**5/10**6
h1 = p*10.**4/w; #meter of water
h2 = p*10.**4/1000; #meter of water
h = h1+h2; # #meter of water
print "Absolute pressure head in terms of water in meter : ",h
w = 13.6*1000; #kg/m**3 for mercury
h = p*10**4/w+760./1000; #meter of mercury
print "Absolute pressure head in terms of mercury in meter : %.3f"%h
# note : rounding off error
import math
# Variables :
w = 1000.; #kg/m**3
h = 50./1000; #m
# Calculations and Results
p = w*h; #kg/m**2
p = p*9.81; #N/m**2 or Pa
print "Pressure Intensity in Pa : ",p
alfa = 30.; #degree
h = 50; #mm
l = h/math.sin(math.radians(alfa)); #mm
print "Reading in tube in mm : ",l
import math
# Variables :
S1 = 13.6; #sp. gravity of mercury
S2 = 1.; #sp. gravity of water
H1 = 5.; #m
# Calculations and Results
H2 = S1*H1/S2; #m
print "(i) Pressure is ",(H2)," meter of water."
S2 = 0.79; #sp. gravity of kerpsene
H1 = 5; #m
H2 = S1*H1/S2; #m
print "(ii) Pressure is ",round(H2,3)," meter of kerosene."
S2 = 1.7; #sp. gravity of fluid
H1 = 5; #m
H2 = S1*H1/S2; #m
print "(iii) Pressure is ",(H2)," meter of fluid."
# Variables :
S = 0.9; #sp. gravity of liquid
Sm = 13.6; #sp. gravity of mercury
S1 = Sm/S; #sp. gravity
# Calculations
w = S*9.81; #kN/m**3
h2 = 500./1000; #m
h1 = 300./1000; #m
a_BY_A = 1./80; #ratio of area
pa = w*(h2*((S1-1)*a_BY_A+S1)-h1); #kPa
# Results
print "Pressure in the pipe in kPa: %.3f"%pa
import math
# Variables :
S1 = 1.2; #sp. gravity
S2 = 13.6; #sp. gravity
w = 1000.; #kg/m**3
# Calculations
h2 = 50./1000; #m
h1 = 200./1000; #m
pa = w*(S2*h1-S1*h2); #kg/m**2
# Results
print "Pressure in the pipe in kg/m**2: ",pa
print "Pressure in the pipe in Pa: ",pa*9.81
# Variables :
S = 1.; #sp. gravity
w = 1000.; #kg/m**3
h2 = 50./1000; #m
h1 = 200./1000; #m
# Calculations
pa = w*S*(h1-h2); #kg/m**2
# Results
print "Pressure in the pipe in kg/m**2: ",pa
print "Pressure in the pipe in Pa: ",pa*9.81
import math
# Variables :
S1 = 0.005; #sp. gravity
S2 = 1.; #sp. gravity
Patm = 1.014*10**5; #Pa
h = 50./1000; #m
w = 1000.; #kg/m**3
# Calculations
pa = -w*S2*h; #kg/m**2
Pabs = pa*9.81+Patm; #
# Results
print "Pressure intensity of gas in Pa(Vaccum): ",abs(pa*9.81)
print "Absolute pressure in the pipe in Pa: ",Pabs
# Variables :
S1 = 0.9; #sp. gravity
S2 = 13.6; #sp. gravity
h1 = 12.5/100; #m
# Calculations and Results
P_AB = h1*(S2-S1); #meter of water
print "Difference in pressure head at the points A & B is ",(P_AB)," meter of water"
w = 1000; #kg/m**3
P_diff = P_AB*w*9.81; #Pa or Nm**2
print "In terms A pressure entirely, the difference of pressure in N/m**2 : ",P_diff
# Variables :
S1 = 1.; #sp. gravity
S2 = 13.6; #sp. gravity
h1 = 120./1000; #m
# Calculations and Results
P_diff = h1*(S2-S1); #meter of water
print "Difference in pressure head is ",(P_diff)," meter of water"
w = 1000; #kg/m**3
P_diff = P_diff*w*9.81; #Pa or Nm**2
print "In terms of pressure intensity, the difference of pressure in N/m**2 : ",P_diff
import math
# Variables :
S1 = 0.81; #sp. gravity
S2 = 1.2; #sp. gravity
S3 = 13.6; #sp. gravity
h3 = 200./1000; #m
h2 = 50./1000; #m
h1 = 100./1000; #m
w = 1000.; #kg/m**3
# Calculations
pAB = ((h1*(S2-S1)+h2*(S3-S1)-h3*S1))*w; #Kg/m**2
# Results
print "Pressure difference between the two vessel in kg/m**2: ",pAB
import math
# Variables :
S1 = 1.9; #sp. gravity
S2 = 1.2; #sp. gravity
S3 = 0.79; #sp. gravity
h2 = 545./1000; #m
h1 = 750./1000; #m
h3 = h1-h2; #m
w = 1000*9.81; #N/m**3
# Calculations
pAB = (h1*S1-h2*S2-h3*S3)*w; #N/m**2
# Results
print "Pressure difference between the two vessel in N/m**2: ",pAB
# Variables :
S1 = 0.005; #sp. gravity
S2 = 0.79; #sp. gravity
S3 = 13.6; #sp. gravity
h = 30./1000; #m
w = 1000*9.81; #N/m**3
# Calculations
pAB = h*(S3-S2)*w; #N/m**2
# Results
print "Pressure difference between the two vessel in N/m**2: ",pAB
import math
# Variables :
S1 = 1.25; #sp. gravity
S2 = 1.05; #sp. gravity
S3 = 0.79; #sp. gravity
h = 30./1000; #m
w = 1000.; #kg/m**3
# Calculations
#pA = pB
h = (0.15*w*S2-S1*w*0.15)/(S3*w-w*S2); #m
h = h*1000; #mm
# Results
print "Reading of manometer in mm : %.f"%h
import math
# Variables :
S1 = 1.; #sp. gravity of water
S2 = 1.; #sp. gravity of water
S3 = 0.9; #sp. gravity of oil
h3 = 100./1000; #meter
w = 9.81*1000; #N/m**3
# Calculations
pAB = w*(h3-h3*S3); #N/m**2
# Results
print "Difference of pressure in N/m**2 or Pa : ",pAB