import math
#Initialization of variables
Q = 0.2 #m**3/s
v = 30. #m/s
angle = 120. #degrees
rho = 1000. #kg/m**3
#calculations
Rx = rho*Q*(v-v*math.cos(math.radians(angle)))
Ry = rho*Q*v*math.sin(math.radians(angle))
R = math.sqrt(Rx**2 +Ry**2)
#results
print "Resultant force = %.2f kN"%(R/1000)
import math
#Initialization of variables
angle = 45. #degrees
p1 = 150.*10**3 #pressure at inlet - N/m**2
Q = 0.5 #rate of flow - m**3/s
d1 = 60. #cm
d2 = 30. #cm
rho = 1000. #kg/m**3
g = 9.81 #m/s**2
#calculations
V1 = Q/(math.pi/4 *(d1/100)**2)
V2 = V1*(d1/d2)**2
P2 = rho*g*(p1/(rho*g) + V1**2 /(2*g) -V2**2 /(2*g))
Rx = p1*math.pi/4*(d1/100)**2 - P2*math.pi/4 *(d2/100)**2 *math.cos(math.radians(angle)) -rho*Q*(V2*math.cos(math.radians(angle)) -V1)
Ry = P2*math.pi/4 *(d2/100)**2 *math.sin(math.radians(angle)) + rho*Q*(V2*math.sin(math.radians(angle)))
R = math.sqrt(Rx**2 + Ry**2)
#results
print "resultant force = %.2f kN"%(R/1000)
import math
#Initialization of variables
Q = 20.*10**3 #discharge - cc/s
depth = 4. #m
d = 5. #cm
g = 9.81 #m/s**2
rho = 10.**3 #kg/m**3
#calculations
V1 = Q/(math.pi/4 *d**2) /100
V2 = math.sqrt(2*g*(V1**2/(2*g) + depth))
W = rho*Q*(V2-V1)/10**6
#results
print "weight of water = %d N"%(W)
import math
#Initialization of variables
g = 9.81 #m/s**2
rho = 10.**3 #kg/m**3
V = 50. #velocity - m/s
u = 20. #m/s
A = 6./10**4 #area - m**2
angle = 180. #degrees
#calculations
Vr = V-u
rq = rho*A*Vr
Rx = -rq*(Vr*math.cos(math.radians(angle)) - Vr)
Rx2 = -rho*A*V*(Vr*math.cos(math.radians(angle)) -Vr)
power = Rx2*u
#results
print "Force exetred on fluid = %d N"%(Rx)
print " Force transferred in case 2 = %d N"%(Rx2)
print " Power transferred in case 2 = %d kW"%(power/1000)
#Initialization of variables
g = 9.81 #m/s**2
rho = 10.**3 #kg/m**3
Vr = 10. #m/s
u = 8.5 #m/s
A = 250./10**4 #m**2
#calculations
V = Vr-u
Q = A*Vr
R = rho*Q*V
P = R*u
eth = 1/(1+ V/(2*u))
#results
print "Power required = %.3f kW"%(P/1000)
print " Efficiency of jet propulsion = %.0f percent"%(eth*100)
import math
#Initialization of variables
g = 9.81 #m/s**2
rho = 10.**3 #kg/m**3
v1 = 20. #m/s
v2 = 5. #m/s
r1 = 50./100 #cm
r2 = 30./100 #cm
a1 = 20. #degrees
a2 = 80. #degrees
N = 300. #rpm
Q = 5. #m**3/s
#calculations
u1 = round(math.pi*2*r1*N/60,1)
u2 = round(math.pi*2*r2*N/60,2)
T = rho*Q*(r1*v1*math.cos(math.radians(a1)) - r2*v2*math.cos(math.radians(a2)))
H = 1/g *(u1*v1*math.cos(math.radians(a1)) - u2*v2*math.cos(math.radians(a2)))
power = rho*g*Q*H
#results
print "torque = %d N m"%(T)
print " Heat = %.1f m"%(H)
print " Power = %d kW"%(power/10**3)
# Note :The answers given in textbook are a bit different due to rounding off error. please check using calculator.
import math
#Initialization of variables
g = 9.81 #m/s**2
rho = 10.**3 #kg/m**3
d1 = 0.05 #m
d2 = 0.3 #m
N = 1800. #rpm
Q = 0.425/60 #m**3/s
#calculations
u1 = math.pi*d1*N/60
u2 = math.pi*d2*N/60
T = rho*Q*(d2*u2 - d1*u1)/2
#results
print "Torque supplied = %.1f Nm"%(T)