forked from ntertainer43/Differeeqnmethods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoody.m
42 lines (37 loc) · 813 Bytes
/
moody.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
clear
clc
re = 1000;
rough = [500,100, 50,10,5,1,.5,.1]* 10^-4;
error =1;
a = 0;
for i = 3: 7
for j = 1:10
Re(j+ 10*(i-3),1) = j* 10^i;
end
end
%fric(1: length(Re),1: length(rough)) = .1;
fric(1: length(Re),1) = 1;
%for r= 1: length(rough)
for i = 1: length(Re)
fric(i)
Re(i)
while error >0.00001
temp = fric(i);
inter = -2* log10( rough(8)/3.7 + (2.51/Re(i) / fric(i)^.5))
fric(i) = inter ^-2;
error = temp - fric(i);
end
error =1;
end
% end
loglog(Re, fric, 'x')
%plot(Re, fric, '*')
% while error >0.00001
% temp = fric
% inter = -2* log((3.7* rough)^-1 + (2.51/re * fric^.5))
% fric = inter ^-2
% error = temp - fric
% a = a + 1;
% end
% fric
% a