import math
from sympy import Symbol,sqrt
#Variable Initialisation
q = Symbol('q')
q=0.305 #value of one feet
#Calculation
p=2.67*sqrt(q)
#Rewriting the given equation
#2.67=p/sqrt(q)
#in terms of dimensions,
p=2.67*(q)**(-1/2)
print"The formula in SI units would now read as,P=",round(p,2),"*sqrt(q)"
import math
#variable initialisation
Lr=1/50 #size of model
Qm=1.25 #discharge in m^3/s
tp=12 #time taken by prototype
#Calculation
#Frm=Vm/math.sqrt(g*Lm)
Qp=(1/Lr)**(2.5)*Qm #Prorotype ratio
print "Qp=",int(Qp),"m^3/s"
#Tr=Lr/Vr #Time ratio
tm=tp/math.sqrt(1/Lr)
print "tm=",round(tm,3),"hours"
import math
#variable initialisation
Lr=1/100 #size of prototype
Fm=0.12 #resistance in N
rhor=1 #relative density
#Calculation
#resistance is the significant force and is appropriate by froude's law.
#Frm=Vm/math.sqrt(g*Lm)
#Vr=math.sqrt(Lr)
Fp=(Fm/(Lr)**3*rhor)/1000 #Prototype force
print "Fp=",(Fp),"kN"
from sympy import symbols,cancel
x,Lr=symbols("x Lr")
import math
#variable initialisation
Lr=1/100 #size of prototype
nm=0.013 #Manning's n
#Calculation
#froude model law is applicable
#Frm=Vm/math.sqrt(g*Lm)
a=Lr**(2/3) #By mannings formula,
s=Lr**(1/2)
x=cancel(a/s) #simplifying
np=nm/x #prototype roughness coefficient
print "np=",round(np,3)
import math
#variable initialisation
Lr=1/20 #size of prototype
Vm=1.5 #velocity in m/s
qm=0.20 #unit width in m^3/s
Pm=5 #model pressure head in cm
#Calculation
Vp=round(Vm/math.sqrt(Lr),2) #Prototype velocity
print "Vp=",Vp,"m/s"
#qr=Qr/Lr
qp=round(qm/(Lr)**(3/2),2) #prototype discharge
print "qp=",qp,"m^3/s/m"
#Assuming rho_r=1,hence,Pr=Lr
Pp=Pm/Lr #pressure head in prototype
print "Pp=",Pp,"cm of mercury"
#Power ratio=(energy loss/second)
Pm=Pp*10*Lr**(7/2) #Energy dissipated
print "Pm=",round(Pm,3),"W"
#variable initialisation
rho_p=917 #density in kg/m^3
mu_p=0.29 #viscosity in Pa.s
L_p=15.0 #diameter in cm
V_p=2 #velocity of pipe
rho_m=998 #density in kg/m^3
L_m=1.0 #diameter in cm
mu_m=1.31E-3 #viscosity in Pa.s
#solution
#Reynold's similarity law of applicable,referring oil with p and water with m
m=round((mu_m/mu_p)*(1)/((L_m/L_p)*(rho_m)/(rho_p)),4)
V_m=V_p*m #velocity of water flow
print "V_m=",V_m,"m/s"
#variable initialisation
V_p=60 #velocity in Km/h
F_m=250 #model drag
mu_r=1 #viscosity
rho_r=1 #density in in kg/m^3
#solution
#Reynold's similarity law is applicable
#V_r=vr/L_r
#If vr=1,then V_r=1/L_r
L_r=6
V_m=((V_p*L_r)*1000)/3600 #V_m in m/s
#using force ratio,Fm/Fp=(mu_r**2)/rho_r
#Fm/Fp=1.0
Fp=F_m/((mu_r*mu_r))/rho_r #drag required
print "Fp=",int(Fp),"N(same as in the model)"
V_p=(V_p*1000)/(3600) #V_m in m/s
Pp=Fp*V_p #power to overcome drag in the prototype
print "Pp=",math.ceil(Pp)/1000,"kW"
#variable initialisation
Vr=1E-3 #Viscosity in Pa.s
Vp=0.104 #viscosity of prototype in Pa.s
rho_p=900 #density of prototype in kg/m^3
Lr=1/6 #size of prototype
Pm=450 #Pressure drop in Pa
Qp=200 #Prototype discharge
#Calculation
#Reynolds model law is applicable,
mu_r=Vr/Vp
rho_r=998/rho_p
Pr=(mu_r)**2/(Lr**2*rho_r)
rh_p=(Pm/Pr)/1000 #Prototype pressure drop
print "rho_p=",round(rh_p,0),"kPa"
Qr=(mu_r)*Lr/rho_r
Qm=Qp*Qr #model discharge
print "Qm=",round(Qm,3),"L/s"
#variable initialisation
Lm=0.30 #length of model in m
Lp=1.50 #Elength of device in m
Vm=35 #Velocity of model in m/s
Vp=3.5 #Velocity of prototype in m/s
mu_m=1.90E5 #relative density in Pa.s
mu_p=1E-3 #relative density in Pa.s
P=1.17 #atmospheric pressure in kg/m^3
Fm=40 #drag force in N
#Calculation
#Reynolds model law is applicable
a=1E-6
Lr=Lm/Lp #prototype length
Vr=Vm/Vp #prototype velocity
mu_r=mu_m/mu_p*a
rho_r=mu_r/(Vr*Lr)/10000 #prototype density
rho_air=(998*rho_r) #density of air
print "rho_air=",rho_air
#This is 8 times larger than the density at atmospheric pressure.
P_model=rho_air/P
print round(P_model,3),"times local atmospheric pressure"
Fr=mu_r**2/rho_r*a/100 #Force ratio
Fp=Fm/Fr #Drag force of prototype
print "Fp=",round(Fp/1000,3),"kN"
import math
#variable initialisation
D_p=1.5 #Diameter in m
rd=0.9 #relative density
v_p=0.03 #viscosity in stoke
Q=3.0 #rate
D_m=0.15 #diameter2 in m
V_m=0.01 #viscosity2 in stoke
#solution
#Reynolds number must be the same in the model and prototype for similar pipe flows
V_p=round((Q)/((math.pi/4)*(1.5*1.5)),4)
V_m=V_p*(D_p/D_m)*(V_m/v_p)
print "V_m=",V_m,"m/s"
Q_m=(math.pi/4)*(D_m**2)*(V_m) #Discharge in the model
print "Q_m=",round(Q_m,1),"m^3/s"
#variable initialisation
Lr=1/10 #model length
mu_r=400 #speed of prototype in km/h
rho_r=10 #density
Vr=1 #model velocity
Vp=1 #prototype velocity
Fm=500 #Force ratio
fm=25 #Frequency in Hz
#Calculation
#Reynolds number and prototype is same in this model.
Vm=Vp*mu_r/(rho_r*Lr) #Velocity in m/s
print "Vm=",Vm,"km/h"
#Model Velocity is the same as prototype velocity
Fr=Lr**2*rho_r*Vr**2 #Force ratio
Fp=Fm/Fr
print "Fp=",Fp,"N"
Fr=Fm/Fp
Fp=fm/10 #Prototype frequency
print "Fp=",Fp,"Hz"
import math
#variable initialisation
L_r=1/200 #horizontal scale
h_r=1/40 #vertical scale
Q_p=152 #normal discharge in m^3/s
y_p=2.0 #depth in metres
B_p=90 #width in metres
n_p=0.025 #roughness value
#solution
L_r=1/200
h_r=1/40
h=math.sqrt(h_r)
Q_m=Q_p*L_r*h*h_r*10 #Discharge
print "(i)Qm=",round(Q_m,2),"m^3/s"
y_m=y_p*h_r #Depth
print "(ii) ym=",y_m,"m"
B_m=B_p*L_r #Width
print "(iii)Bm=",B_m/10,"m"
a=math.pow(h_r,2/3) #Manning's n_m
b=math.sqrt(L_r)*L_r
n_m=((n_p)*(math.pow(h_r,2/3)))/(math.pow(L_r,1/2))
print "(iv) n_m=",round(n_m,2)
import math
#variable initialisation
L_r=1/500 #horizontal scale ratio
h_r=1/50 #vertical scale ratio
T_p=12 #time period
#Calculation
h_r=1/50
L_r=1/500
a=(math.sqrt(h_r))
T_r=round((L_r)/(a),5) #Time ratio
T_p=12*60*60 #model period
T_m=T_p*T_r
a=T_m/60 #To separate minutes and seconds
b=T_m%60
print "Model Period T_m =",int(a),"minutes",int(b),"seconds"
import math
#variable initialisation
L_r=1/250 #horizontal scale
h_r=1/25 #vertical scale
S_p=0.0002 #prototype slope
V_m=0.50 #velocity in m/s
Q_m=0.02 #discharge in m^3/s
#solution
h_r=1/25
L_r=1/250
S_r=h_r/L_r
S_m=round((S_p)*(S_r),3) #Slope ratio
print "(i)S_m=",S_m
V_r=math.sqrt(h_r)
V_p=V_m/V_r #Velocity ratio
print "(ii)V_p=", V_p,"r"
Q_p=(L_r)*(math.sqrt(h_r))*(h_r)
Q_p=(Q_m)/(Q_p) #Discharge ratio
print "(iii)Q_p=",int(round(Q_p,1)),"m^3/s"