#initialisation of variables
pm= 1.6 #lb/ft**3
vm= 6.2*10**-6 #ft**2/sec
R= 1.8 #lbf
um= 100. #ft/sec
p= 64. #lb/ft**3
v= 1.7*10**-5 #ft^2/sec
lm_by_l= 1/10. #ft
#CALCULATIONS
u= (um*lm_by_l*v)/vm
u_knot= ((um*lm_by_l*v)/vm)/1.98 #knot
F_by_Fm = (p/pm)*(1/lm_by_l)**2*(u/um)**2
F= F_by_Fm*R
#RESULTS
print ' speed of torpedo in sea water = %.1f knot'%u_knot
print ' resistance= %.f lbf '%(F)
print (1/lm_by_l)**2
#initialisation of variables
import math
S= 5. #ft
F= 70. #lbf
B= 4. #degrees
l= 1. #ft
d= 0.002378 #slug/ft**3
u= 120. #ft/sec
#CALCULATIONS
L= F*math.cos(math.radians(B))
D=F*math.sin(math.radians(B))
S1= S*l
p= 0.5*d*u**2
Cl= L/(p*S1)
Cd= D/(p*S1)
#RESULTS
print ' coefficient of lift= %.2f'%(Cl)
print ' coefficient of drag= %.4f'%(Cd)
#initialisation of variables
import math
A= 600. #ft**2
W= 40. #lbf/ft**2
n= 75. #percent
r= 10.
v= 300. #miles/hour
#CALCULATIONS
L= W*A
D= L/r
P= D*v*5280./(60.*33000)
hp= P*100./n
#RESULTS
print ' brake horse-power of the engines= %.f h.p'%(hp)
#initialisation of variables
W = 22400 # lbf
p = 0.002378 # slug/ft^3
S = 500. # ft**2
b = 398.
a = 293
D1 = 1530. # lbf
U = 200.
# Calculation
#Part a
U1 = round((2*W/(p*S)),-2)**(1./2) * (b/a)**(1./4)
P1 = round((D1 * U1)/550)
#Part b
Umph = U1*0.681818 # ft/sec to m.p.h
D = round(round((D1/2)*((U/Umph)**2 + (Umph/U)**2),1))
P = round(D*U*5280./(60*33000),-1)
U = .76 * U1
D = (D1/2.)*((U/Umph)**2 + (Umph/U)**2)
power = round((D * U)*5280./(60*33000),-2)
# Part c
min_power = .76 * U
# Results
print "a)Power expended for minumum drag is = %.1f h.p."%P1
print " Speed for minimum power is U = %.1f m.p.h"%U
print "b)Drag for minimum power is = %.0f lbf"%D
print " The minimum power is = %.0f h.p."%power
print "c) Speed for minimum power is U = %.1f m.p.h"%min_power
print "Answers in book are wrong. Please calculate manually."
#initialisation of variables
va= 0.2
r= 1./1.25
r1= 1./50
P= 20. #atm
v= 400. #m.p.h
#CALCULATIONS
Um= v*va/(P*r*r1)
#RESULTS
print ' Speed of air= %.f m.p.h'%(Um)
import math
#initialisation of variables
U= 30. #ft/sec
g= 32.2 #ft/sec**2
l= 500. #ft
r= 1./25
#CALCULATIONS
F=(U**2./(l*g))
R= math.sqrt(r)
Um= U*R
#RESULTS
print ' Froude number= %.4f '%(F)
print ' speed= %.f ft/sec'%(Um)
import math
#initialisation of variables
R1= 9.5 #lbf
f1= 0.01
S1= 22. #ft**2
U1= 5.3
n= 1.825
l= 540. #ft
l1= 15. #ft
C= 0.0087 #lbf/ft**2
#CALCULATIONS
Rr1= round(R1-f1*S1*U1**n,1)
U= U1*math.sqrt(l/l1)
r= (l/l1)**3.
Rr= round(r*Rr1,-3)
Rf= C*(l/l1)**2*S1*U**n
R= Rr+Rf
P= R*U*1.69/550.
#RESULTS
print ' propulsive power= %.f h.p'%(P)
print 'Answer in book is wrong.'
import math
#initialisation of variables
s= 20. #ft
u= 10. #ft/sec
t= 1. #sec
#CALCULATIONS
r= s/u*t
a= r*u/t
#RESULTS
print ' constant accelaration= %.f ft/sec**2'%(a)
#initialisation of variables
a= 20. #ft/sec**2
s= 20. #ft
u= 10. #ft/sec
#CALCULATIONS
P= a*s/u**2.
t= s*2/(u*P)
#RESULTS
print ' time taken= %.f sec'%(t)
#initialisation of variables
s= 0.8
l= 1. #ft
r= 8.
#CALCULATIONS
Hw= (s/r)**(2./3)*l
Qw= 1.5*Hw**(2.5)
R= (1./Hw)**2.5
Q= Qw*R
#RESULTS
print ' depth of water= %.3f ft'%(Hw)
print ' rate of flow of fluid= %.1f ft**3/sec'%(Q)
#initialisation of variables
Q1= 140. #gallons
h= 3. #in
r= 16.
#CALCULATIONS
H= h*r/12.
Q2= round(Q1*H**5.,-3)
#RESULTS
print ' corresponding head over the full-scale wier= %.f ft'%(H)
print ' discharge over the latter= %.f gal/min'%(Q2)
#initialisation of variables
r= 0.448
R= 0.868
r1= 0.152
R1= 0.807
#CALCULATIONS
P= R**3./r**2.
U= R/r
P1= R1**3./r1**2.
U1= R1/r1
#RESULTS
print ' power ratio in case 1= %.2f '%(P)
print ' velocity ratio in case 1= %.2f '%(U)
print ' power ratio in case 2= %.2f '%(P1)
print ' velocity ratio in case 2= %.1f '%(U1)
import math
#initialisation of variables
w= 1. #gf/cm**3
Ss= 7.8
Sl= 0.9
D= 1. #cm
D1= 0.1 #cm
g= 981. #cm/sec**2
#CALCULATIONS
F= w*(Ss-Sl)*4.*math.pi*D**3./(3.*8000)
v= F*g/(3*math.pi*D1*2.)
#RESULTS
print ' coefficient of viscosity= %.2f poise'%(v)
#initialisation of variables
T= 15. #C
T1= -44. #C
P= 24. #atm
s= 0.374
m= 6. #tonf
#CALCULATIONS
r= ((T+273.)/(T1+273))**0.75
R= P/s
R1= r**2./R
F= R1*m*2240.
#RESULTS
print ' lift force= %.1f lbf'%(F)
#initialisation of variables
u= 80. #ft/sec
n= 62.
r= 1./4
v= 11. #ft**3
w= 62.3 #lbf/ft**3
p= 2. #lbf/in**2
#CALCULATIONS
uw= u*n/(r*v*w)
R= v*w*(uw/u)**2.
P= r**2.*p/R
#RESULTS
print ' water velocity= %.f ft/sec'%(uw)
print ' pressure drop= %.5f lbf/in**2 per ft'%(P)
#initialisation of variables
N= 1800. #rev/min
Vm= 60. #mile/hour
V= 300. #mile/hour
r= 10.
#CALCULATIONS
Nm= N*Vm*r/V
#RESULTS
print ' rotary speed= %.f rev/min'%(Nm)