I am using bisection method to solve an equation, but the solution always shows the first value input and I don't know where my mistake is

1 回表示 (過去 30 日間)
I am using the biscetion method to solve an equation but the solution is always the first picked value (xLeft).
bisection_method()
Error as percentage: 0 friction factor: 0.008 Solution reached in 57 iterations

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 12 月 23 日
D=0.1016; Q=0.00368; p=900;u=0.008; e=0;
A = (1/4)*pi*D^2;
R = (p*D*Q)/(u*A);
f = @(ft) 1/(-2*log((e/D)/3.7)+(2.51/(R*(ft^0.5))))^2;
syms ft
f(ft)
ans = 
simplify(ans)
ans = 
Notice the infinity, which is from the log((e/D)/3.7) when e is 0.

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by