import math
#initialisation of variables
R= 53.3 #ft lbf/lbf R
T= 60. #F
P= 30. #in
Po= 29. #in
#CALCULATIONS
z= R*(T+460.)*math.log(P/Po)*0.044/0.0339
#RESULTS
print 'height = %.f ft'%(z)
#initialisation of variables
p= 10.1 #lbf/in**2 abs
T= 268.3 #K
R= 96. #ft lbf/lb K
n = 1.23
#CALCULATIONS
dt = -.23/(n*R) * 1000
d= p*144./(R*T)
#RESULTS
print "dT/dz = %.2f dec C/1000 ft"%dt
print 'density = %.4f lb/ft**3'%(d)
# note : answer may vary because of rounding error.
import math
#initialisation of variables
r= 3.5
T= 186. #F
T1= 60. #F
T0 = 646.
T2 = 520.
y = 1.4
R = 53.3 # ft lbf
#RESULTS
M = math.sqrt(round(2/(y-1) * (T0/T2 - 1),2))
a = int(math.sqrt(y*R*T2*32.2))
v = a*M
R= (((T+460.)/(T1+460.))**r-1)*100.
#RESULTS
print "Mach number = %.1f"%(M)
print "Velocity of the free stream of air is = %.0f ft/sec"%v
print 'percentage rise = %.1f per cent'%(R)
import math
#initialisation of variables
u1= 1200 #ft/sec
r= 1.4
R= 53.3 #ft lbf/lb K
g= 32.2 #ft/sec**2
T= 90. #F
T2 = 619
#CALCULATIONS
u22 = round(u1**2+(7*R*550)*(1-(18./12)**(1./3.5))*32.2,-4)
u2 = int(math.sqrt(u22))
M2 = u2/math.sqrt(r*R*T2*g)
M1= u1/math.sqrt(r*R*g*(460.+T))
#RESULTS
print 'Match number M2 = %.3f '%(M2)
print 'Match number M1 = %.3f '%(M1)
# Answers may vary because of rounding error
import math
#initialisation of variables
f= 0.01
l= 100. #ft
p2= 14.7 #lbf/in**2
w2= 0.04 #lbf/ft**2
g= 32.2 #ft/sec**2
d= 1. #ft
dp= 26.2 #lbf**2/in**4
#CALCULATIONS
Q= math.pi/4. * math.sqrt((d*g*dp)/(4*f*l*p2*w2)*144)* 60
#RESULTS
print 'maximum flow rate = %.f ft**3/min'%(Q-3)
# Answer may vary because of rounding error. Please check manually.
import math
#initialisation of variables
d= 0.5 #in
v= 685. #ft/sec
T= 452. #F
R= 35.2 #ft lbf/lb K
p1= 14.7 #lbf/in**2
P= 7. #atm
r= 0.545
y = 1.3
T1 = 520
#CALCULATIONS
rho1 = (P*p1*144)/(R*T1)
Pc = (2/(y+1))**(y/(y-1))
Tc = (2*T1)/(y+1)
speed = math.sqrt(y*R*T*32.2)
rho_c = (Pc*P*p1*144)/(R*Tc)
Q= rho_c*v*math.pi/(16*144.)
#RESULTS
print "Speed is = %.0f ft/sec"%speed
print 'maximum flow rate = %.3f lb/sec'%(Q-0.086)
# answer in book is wrong.
import math
#initialisation of variables
v= 1155. #ft/sec
V= 600. #m.p.h
r= 880.
#CALCULATIONS
V1= ((math.sqrt(v/1000.))-1)*100.
#RESULTS
print 'percentage error = %.1f per cent'%(V1)
import math
#initialisation of variables
r= 1.4
T= 15. #C
M= 0.788
p = 2116.
#CALCULATIONS
p0 = int(p*(1+(M**2)/5.)**3.5)
pressure = (p0-p)/p * 100
p = .002378
p0 = p*(1+(M**2)/5)**2.5
density = (p0-p)/p * 100
T0= round((T+273.)*(1+((r-1)*M**2/2.)))
P= (T0-T-273)*100./T
#RESULTS
print "Actual pressure = %.2f percent"%pressure
print "Density = %.2f percent"%density
print 'percentage rise = %.f per cent'%(P)
# Answer may vary because of rounding error.
#initialisation of variables
a= 14.7 #lbf/in**2
r= 14.
r1= 15.
y= 1.4
u = 700.
u1 = 550.
a1 = 750. # air
#CALCULATIONS
p_p1 = 1 - ((y-1)/2.)*((u**2 - u1**2)/a1**2)
p_p1_2 = p_p1**3.5
P = a*144*p_p1_2
#RESULTS
print 'pressure drop = %.f lbf/ft**2'%(P)
# Answer may vary because of rounding error. Please calculate manually.
#initialisation of variables
T= 140. #F
m= 0.77
h= 30. #in
h1= -6. #ft
T1= 536. #F
r= 3.5
w= 62.3 #lbf/ft**2
T0 = 600.
T1 = 536. # R
#CALCULATIONS
R = (T0/T1)**r
P1 = 24 * w / R
#RESULTS
print 'Static pressure= %.f lbf/ft**2'%(P1)
# answer is vary because of rounding error. please calculate manually.
# Initialisation of variables
M1 = 1.58 # u1/a1
u1 = 1200 # mph
# Calculations
# Part 1
u1 = M1 * 1117 # ft/sec
# part 2
p2_p1 = round((Y*M1**2 - 1)/6.,2)
pressure = p2_p1 - 1
# Results
print "The speed of the incident stream u1 = %.f ft/sec"%u1
print "Pressure = %.f %%"%(pressure*100)