Hello all, I have the following attempt...
clc
clear
Re=linspace(2300,40000,100);
ed=0.058887;
relr=ed;
dfTol=5e-6;
ft= (1./(-1.8*log10(((ed/3.7)^1.11)+(6.9./Re)))).^2;
for ii=ft;
jj=Re;
cole=@(f,ed,Re) 1/sqrt(f)+2*log10((ed/3.7)...
+(2.51./Re*sqrt(f)));
f(ii) = fzero(cole,ii,optimset('TolX',dfTol,'Display','off'),relr,Re);
end
plot(fric)
I want to find the value of 'f' at each value in 'Re' and plot this against 'Re'. I am using 'ft' as the estimation point for fzero and am not sure how to get this to work. I apologize if my coding is terrible, I am a beginner at matlab and am not very good. Any help would be much appreciated. Thanks!

 Respuesta aceptada

Walter Roberson
Walter Roberson el 22 de Nov. de 2017

0 votos

Probably something like
for ii = 1 : length(ft);
cole = @(f,ed,Re) 1./sqrt(f) + 2*log10((ed/3.7) +(2.51./Re*sqrt(f)));
f(ii) = fzero( @(f) cole(f,relr,Re(ii)), ft(ii) ,optimset('TolX',dfTol,'Display','off'));
end
plot(ft, f)

Más respuestas (0)

Etiquetas

Preguntada:

el 22 de Nov. de 2017

Respondida:

el 22 de Nov. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by