from __future__ import division
import math
#Initializing the variables
z1 = 0; #Taking Ground as reference
z2 = -30 #Depth
rho = 1025 #Density
g = 9.81 #Acceleration due to gravity
#Calculation
pressureIncrease = -rho*g*(z2-z1);
print "Increase in Pressure (KN/m2):",round(pressureIncrease/1000,1)
from __future__ import division
import math
#Initializing the variables
p1 = 22.4*10**3 #Initial Pressure
z1 = 11000 #Initial Height
z2 = 15000 #final Height
g = 9.81 #Acceleration due to gravity
R = 287; #Gas Constant
T = 273-56.6 #Temperature
#Calculations
p2 = p1*math.exp(-g*(z2-z1)/(R*T));
rho2=p2/(R*T);
print "Final Pressure (kN/m2):",round(p2/1000,2)
print "Final Density (kg/m3):",round(rho2,3)
from __future__ import division
import math
#Initializing the variables
p1 = 101*10**3 #Initial Pressure
z1 = 0 #Initial Height
z2 = 1200 #Final Height
T1 = 15+273 #Initial Temperature
g = 9.81 #Acceleration due to gravity
gamma = 1.4 #Heat capacity ratio
R = 287 #Gas Constant
#Calculations
p2 = p1*(1-g*(z2-z1)*(gamma-1)/(gamma*R*T1))**(gamma/(gamma-1));
dT_dZ = -(g/R)*((gamma-1)/gamma);
T2 = T1 + dT_dZ*(z2-z1);
rho2 = p2/(R*T2);
print "Final Pressure (kN/m2) :",round(p2/1000,2)
print "Temprature (in degree celcius):",round(T2-273,1)
print "Density (kg/m^3) :",round(rho2,3)
from __future__ import division
import math
#Initializing the variables
p1 = 101*10**3 #Initial Pressure
z1 = 0 #Initial Height
z2 = 7000 #Final Height
T1 = 15+273 #Initial Temperature
g = 9.81 #Acceleration due to gravity
R = 287 #Gas Constant
dT = 6.5/1000 #Rate of Variation of Temperature
#Calculations
p2 = p1*(1-dT*(z2-z1)/T1)**(g/(R*dT));
T2 = T1 - dT*(z2-z1);
rho2 = p2/(R*T2);
print "Final Pressure (kN/m^2) :",round(p2/1000,2)
print "Final Density (kg/m^3 ):",round(rho2,3)
from __future__ import division
import math
#Initializing the variables
p = 350*10**3; #Gauge Pressure
pAtm = 101.3*10**3; #Atmospheric Pressure
rhoW = 1000; #Density of Water
sigma = 13.6; #Relative Density of Mercury
g = 9.81 #Acceleration due to gravity
#Calculations
def Head(rho):
head = p/(rho*g);
return head
rhoM = sigma*rhoW;
pAbs = p + pAtm;
print "\nPart(a)- Equivalent head of water (m) :",round(Head(rhoW),2)
print "\nPart(b)- Equivalent head of water (m) :",round(Head(rhoM),2)
print "\nAbsolute pressure (kN/m^2) :",pAbs/1000
from __future__ import division
import math
#Initializing the variables
rho = 10**3; #Density of water
h = 2; #Height
g = 9.81; #Acceleration due to gravity
#Calculations
p=rho*h*g;
print "Gauge pressure (k/m2) :",p/1000
from __future__ import division
import math
#Initializing the variables
rho = 0.8*10**3; #Density of fluid
rhoM = 13.6*10**3; #Density of manometer liquid
g = 9.81 #Acceleration due to gravity
#Calculations
def fluidPressure(h1,h2):
P = rhoM*g*h2-rho*g*h1;
return P
p1=fluidPressure(0.5,0.9)/1000
p2=fluidPressure(0.1,-0.2)/1000
print "!-----Part (a)-----! \nGauge pressure (kN/m2) :",round(p1,2)
print "\n!-----Part (b)-----! \nGauge pressure (kN/m2) :",round(p2,2)
from __future__ import division
import math
#Initializing the variables
rho = 10**3; #Density of fluid
rhoM = 13.6*10**3; #Density of manometer liquid
g = 9.81; #Acceleration due to gravity
H = 0.3; # Differnce in height = b-a as in text
h = 0.7;
#Calculations
result = rho*g*H + h*g*(rhoM-rho);
print "Pressure difference (kN/m^2):", round(result/1000,3)
from __future__ import division
import math
#Initializing the variables
rho = 10**3; #Density of fluid
rhoM = 0.8*10**3; #Density of manometer liquid
g = 9.81; #Acceleration due to gravity
a = 0.25;
b = 0.15;
h = 0.3;
#Calculations
def PressureDiff(a,b,h,rho,rhoM):
P = rho*g*(b-a) + h*g*(rho-rhoM);
return P
print "The presure difference,if the top of the manometer is filled with"
print "(a) air :",PressureDiff(a,b,h,rho,0)/1000, " N/m^2"
print "(b) oil of relative density 0.8. :",PressureDiff(a,b,h,rho,rhoM), "N/m^2"
from __future__ import division
import math
#Initializing the variables
phi = 30; #30 degree
h = 1.2 ; # Height of tank
l = 2; # Length of tank
#Calculations
def SurfaceAngle(a,phi):
g=9.81; # m/s**2
Theta = math.atan(-a*math.cos(math.radians(phi))/(g+a*math.sin(math.radians(phi))));
return Theta
#case (a) a = 4
print "ThetaA (degree) :",round(180 + 180/math.pi*SurfaceAngle(4,phi),2)
#Case (b) a = - 4.5
tanThetaR = math.tan((SurfaceAngle(-4.5,phi)));
print "\nThetaR (degree) :",round(SurfaceAngle(-4.5,phi)*180/math.pi,2)
Depth = h - l*tanThetaR/2;
print "\nMaximum Depth of tank (m) :",round(Depth,4)