seeking help with solving implicit equation



Len de Vlaming wrote:
> Folks,
> 
>  
> 
> I?m writing a routine which makes use of the Colebrook equation for 
> calculating friction factors:

> 1/sqrt(f) = -2log(e/3.7D + 2.51 / (Re*sqrt(f))

Ah hydraulics... an excellent use for maxima, but can only be solved by 
numerical methods.

here's an example of how to solve for f after plugging in Re=17000, 
e=.01, and D=.25. Note than in maxima "log" means natural log. However 
this equation is defined in terms of log base 10 I believe.

(%i1) eqn:1/sqrt(f)+2*log(e/D/3.7+2.51/Re/sqrt(f))/log(10);
                      .2702702702702702 e      2.51
                2 log(------------------- + ----------)
                               D            sqrt(f) Re       1
(%o1)          --------------------------------------- + -------
                                log(10)                   sqrt(f)
(%i2) find_root( subst([e=.01,D=.25,Re=17000],eqn),f,1e-7,1);
(%o2)                         .06617475278925225
(%i3)