# Variables
rho_Hg = 13596.; #kg/m**3
g = 9.806; #m/s**2
h = 0.76; #m
# Calculations and Results
P = rho_Hg*g*h/1000; #kPa
h1 = 0.80; #m
P1 = h1/h*P;
print "(i) Pressure of 80 cm of Hg %.3f kPa"%P1
print ("(ii) 30 cm Hg vacuum")
H2 = 0.30; #cm Hg vacuum
h2 = h-H2; #cm of Hg absolute
P2 = h2/h*P;
print "Pressure due to 46 cm of Hg %.3f kPa"%P2
rho_H2O = 1000; #kg/m**3
h3 = 1.35; #m
P3 = rho_H2O*g*h3/1000;
print "(iii) Pressure due to 1.35 m H2O gauge %.3f kPa"%(P3)
P4 = 4.2*10**2;
print "(iv) 4.2 bar %.3f kPa"%(P4),
import math
# Variables
d = 0.1; #m
F = 1000.; #N
# Calculations
A = math.pi/4*d**2; #m**2
P = F/A/10**3;
# Results
print "Pressure on the piston = %.3f kN/m**2"%(P),
# Variables
SG = 0.9;
h = 1.2; #m
g = 9.81; #m/s**2
rho_w = 1000.; #kg/m**3
# Calculations
rho = SG*rho_w; #kg/m**3
P = rho*g*h/10**3;
# Results
print "Gauge pressure P = %.3f kN/m**2"%(P)
# Variables
Vacuum_recorded = 740.; #mm of Hg
Barometric_reading = 760.; #mm of Hg
# Calculations
Absolute_pressure = (Barometric_reading-Vacuum_recorded)*133.4;
# Results
print "Absolute pressure in the condenser = %.3f Pa"%(Absolute_pressure),
import math
# Variables
d = 0.5; #m
h = 0.75; #m
m = 4.; #kg
Manometer_reading = 620.; #mm of Hg above atmosphere
Barometer_reading = 760.; #mm of Hg
V = math.pi/4*d**2*h; #m**3
print ("(i) Total pressure in the vessel")
# Calculations and Results
P = (Barometer_reading+Manometer_reading)*133.4/10**5; #bar
print "P = %.3f bar"%(P)
print ("(ii) Specific volume and density")
SV = V/m;
print "Specific volume = %.3f m**3/kg"%(SV)
D = m/V;
print "Density = %.3f kg/m**3"%(D),
# Variables
h0 = .761; #m
h = .55; #m
g = 9.79; #m/s**2
rho = 13640.; #kg/m**3
# Calculations
P = rho*g*(h0+h); #N/m**2
# Results
print "Gas pressure = %.3f bar"%(P/10**5),
# Variables
h_H2O = 34.; #mm of Hg
g = 9.81; #m/s**2
rho = 13600.; #kg/m**3
P_Hg = 97.5; #mm of Hg
P_atm = 760.; #mm of Hg
# Calculations
P_H2O = h_H2O/13.6; #mm of Hg
Pabs = rho*g*(P_Hg+P_atm-P_H2O)/10**8; #bar
# Results
print "absolute pressure = %.3f bar"%(Pabs)
# Variables
SG = 0.8;
rho_H2O = 1000.; #kg/m**3
g = 9.81; #ms**2
h = 0.17; #m
Patm = 1.01325; #bar
# Calculations
rho = SG*rho_H2O; #kg/m**3
P_liq = rho*g*h/10**5; #bar
P_gas = Patm - P_liq;
# Results
print "gas pressure = %.3f bar"%(P_gas),
import math
# Variables
d = 0.2; #m
g = 9.81; #m/s**2
h = 0.117; #m
rho = 13600.; #kg/m**3
# Calculations
p = rho*g*h;
m = (p*math.pi/4*d**2)/g;
# Results
print "mass = %.3f kg"%(m),
# Variables
v = 800.; #m/s
g = 9.; #m/s**2
F = 3600.; #N
# Calculations
m = F/g;
KE = 1./2*m*v**2./10**6;
# Results
print "Kinetic Energy = %.3f MJ"%(KE),
import math
from scipy.integrate import quad
# Variables
m = 6.; #kg
T1 = 25.; #0C
T2 = 125.; #0C
print ("(i) Heat transferred")
# Calculations and Results
def f18(T):
return m*(0.4+0.004*T)
Q = quad(f18,T1,T2)[0]
print "heat tranferred = %.3f kJ"%(Q)
print ("(ii) Mean specific heat of the gas")
c_n = Q/m/(T2-T1);
print "Mean specific heat = %.3f kJ/kg.0C"%(c_n),
import math
from numpy import *
# Variables
Ice_point = 0.;
Steam_point = 100.;
# Calculations
P = [[math.log(1.5),1],[math.log(7.5),1]];
Q = [0,100];
X = linalg.inv(P)*Q;
a = X[0,1];
b = X[1,1];
p = 3.5;
t = a*math.log(p)+b;
# Results
print ("The value of temperature is given by %.3f")%(t),("°C")
def func(t):
return 0.20*t-5*10**(-4)*t**2
# Variables # Calculations
t1 = 0; #0C
e1 = func(t1);
t2 = 100; #0C
e2 = func(t2);
t3 = 70; #0C
e3 = func(t3);
t = e3*(t2-t1)/e2-e1;
# Results
print "thermocouple will read",t,"°C"
# Variables
p = 101.325; #kPa
V2 = 0.6; #m**3
V1 = 0; #m**3
# Calculations
W = p*(V2-V1);
# Results
print ("work done by atmosphere = "),(-W),"kJ"
from scipy import integrate
# Variables
#p = 1.013*10**5; #N/m**2
p = lambda x: 1.013*10**5
V1 = 1.5; #m**3
V2 = 0; #m**3
# Calculations
integ, err = integrate.quad(p,V1,V2)
# Results
print ("W = "),(integ/10**3),"kJ"
import math
# Variables
T = 1.25; #N.m
N = 9500.;
p = 101.3; #kPa
d = 0.65; #m
L = 0.6; #m
# Calculations
W1 = 2*math.pi*N*T/1000; #kJ
A = math.pi/4*d**2; #m**2
W2 = p*A*L; #kJ
Wnet = (-W1)+W2;
# Results
print "The net work transfer for the system = %.3f"%(Wnet),"kJ"
# Variables
A = 45.*10**(-4); #m**2
P = 0.9*10**5; #N/m**2
Patm = 1.013*10**5; #N/m**2
L = 0.05; #m
# Calculations
dV = 300.*10**(-6); #m**3
W = P*A*L-Patm*dV;
# Results
print ("net work done = "),(W),"J"
import math
from scipy.integrate import quad
# Variables
p1 = 1.5; #bar
p2 = 7.5; #bar
V1 = 3/p1;
V2 = 3/p2;
# Calculations
def f19( V):
return 3./V*10**2
W = quad(f19, V1, V2)[0]
# Results
print "Work done = %.3f"%(W),"kJ"
import math
# Variables
W = 150; #kJ
V1 = 0.6; #m**3
# Calculations and Results
V2 = (8-math.sqrt(64-4*2*2.58))/4; #m**3
print ("Final volume = %.3f")%V2,"m**3"
p2 = 8-4*V2;
print "Final pressure = %.2f"%p2,"bar"
import math
from scipy.integrate import quad
# Variables
p1 = 3.*10**5; #Pa
v1 = 0.18; #m**3/kg
p2 = 0.6*10**5; #Pa
# Calculations
C = p1*v1**2;
v2 = math.sqrt(C/p2);
def f17( v):
return C/v**2
W = quad(f17, v1,v2)[0]
# Results
print ("Work done = %d")%(W),("Nm/kg")
# Note : output would be differ as rounding error is there. v2 has rounding off error.
import math
from scipy.integrate import quad
# Variables
m = 1.; #kg
p1 = 20.*10**5; #Pa
V1 = 0.05; #m**3
# Calculations
V2 = 2*V1;
p2 = p1*(V1/V2)**2;
C = p1*V1**2;
V3 = V1;
def f20( V):
return C/V**2
W_12 = quad(f20, V1,V2)[0]
W_23 = p2*(V2-V3);
W_net = W_12-W_23;
# Results
print ("Net work done = "),(W_net),("Nm")