Write a script to compute the friction factor in a pipe for

Write a script to compute the friction factor in a pipe for any input value of Reynolds number and any value of relative roughness. Do not use fsolve or another matlab function to solve it. Use bisection or a fixed-point iteration technique. Calculate f according to the following flow regimes: 1/squareroot f = -2.0 * log (epsilon/D/3.7 + 2.51/Re_D squareroot f) f or Re greaterthanorequalto 2300 f = 64/Re f or Re

Solution

I\'ve been introduced more or less to these methods of finding a root of a function (a point where it intersects the xx axis), but I\'m not sure when they should be used and what are the advantages of one method over the other.

I think that it would be nice to have an answer that puts them in comparison and shows the situations where one method would be more advantageous than the other, etc.

So, my question are:

When should we use one method over the other and why?

And, what are the advantages and disadvantages therefore of one method over the other?

Also, if you want to provide a brief explanation of each of the method, I think that the answer would be more complete and interesting.

If you want to force convergence and can find intervals with opposite signs of the function, then use one of the anti-stalling variants of regula falsi. If you think that convergence could be faster, use a method based on the inverse quadratic like Muller or Brent.

 Write a script to compute the friction factor in a pipe for any input value of Reynolds number and any value of relative roughness. Do not use fsolve or anothe

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site