blob: 8617221d941c8c4936df93de8dd4d0d3aff1bf45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
clc
//Initialization of variables
z2=500//ft
z1=300//ft
D=[1 1.5 2 2.5 3 4 6]
g=32.2
gam=62.4
//calculations
Dj=D/12
Vj=sqrt((z2-z1)*2*g./(1.04 + 640.*Dj.^4))
Aj=%pi/4 *Dj.^2
Q=Aj.*Vj
Pjet=gam*Q.*Vj.^2 /(2*g) /550
Pj=max(Pjet)
for i=1:length(Pjet)
if(Pjet(i) ==Pj)
break
end
end
diameter=D(i)
//results
printf("Thus a pipe of %d in will be the optimum",diameter)
|