I am writing a code that keep giving error message.
이전 댓글 표시
function f=DarcyFricFact(D,E,Re)
% Calculatre Friction factor
% f: is friction
% E :pipe roughness (for cast iron, 0.010")
% D: pipe diameter in inches
% Re: Reynolds number
% For loop will help use to write the program
%%%%%%Argument
D=[2 5 10];
Re=(4000:400000);
E=0.01;
f1=zeros(1,350000);
f2=zeros(1,350000);
f3=zeros(1,350000);
n=1
Num=length (Re);
k=1;
f=zeros(k,Num);
for n=1:Num;
a = 2/log(10)
b = (E./D)/3.7;
d=log(10)*Re(n)/5.02
s=b*d+log(d);
q=s.^(s/(s+1));
g=b*d+log(d./q);
z=log(q/g);
DLA=z*(g/(g+1));
DCFA=DLA.*(1+(z/2)/((g+10.^(2) + (z/3).*(2.*g-1))));
f(k)=(a*((log(d/q)+DCFA))).^(-2);
end
end
댓글 수: 2
per isakson
2016년 7월 8일
편집: per isakson
2016년 7월 8일
There are many problems. Replacing
DCFA=DLA.*(1+(z/2)/((g+10.^(2) + (z/3).*(2.*g-1))));
by
DCFA=DLA.*(1+(z/2)./((g+10.^(2) + (z/3).*(2.*g-1))));
PaulBan
2016년 7월 8일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Fluid Dynamics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!