DoM = [0.7620 0.8128 0.8636 0.9144 0.9652 1.0160 1.0668 1.1176 1.1684 1.2192]Re= [319130 299180 281590 265940 251940 239350 227950 217590 208130 199460]Ks=0.000045Er=10.^-8Fo=0.01;for I=0:1:10^8; Fn=(1./(-4.*log10(Ks./(3.71.*DoM))+(1.26./(Re.*sqrt(Fo))))).^2 E=abs((Fn-Fo)/Fn) if E<=Er Fn=Fn ;break; elseif E>Er Fn=Fo; endend
i have an iterative equation where i have to set an initial value for Fo=0.01 to ahieve the Left hand side (Fn)
then calculate the absolute error (E)
after that compare the absolute error (E) with the specified Erorr (Er)
if the absolute error (E) is greater than the specified Error (Er)
replace Fo with the new Fn achived earlier
and calculate for a new Fn
until the absolute error is less than the specified error (Er)
then show the final value of Fn
Best Answer