フィルターのクリア

Help Solving an Equation

1 回表示 (過去 30 日間)
Brittany Caughron
Brittany Caughron 2016 年 10 月 27 日
コメント済み: Star Strider 2016 年 10 月 28 日
Hi,
I am trying to solve the following function for x where er, Re and d_i are known values:
x+4*log10(er/(3.7*d_i)+1.4125*x/Re)=0
I have tried several methods and cant seem to get the right answer. I know that the correct answer is approximately 10.8. Can anyone help me set this up?
Thanks in advance

採用された回答

Star Strider
Star Strider 2016 年 10 月 27 日
編集済み: Star Strider 2016 年 10 月 27 日
You have to provide the correct values for the constants.
This will provide you with the numeric result:
syms d_i er Re x
d_i = sym(3); % Insert Correct Values
er = sym(5); % Insert Correct Values
Re = sym(1000); % Insert Correct Values
Eq = x+4*log10(er/(3.7*d_i)+1.4125*x/Re) == 0;
x_sol = solve(Eq, x, 'IgnoreAnalyticConstraints',1);
x_val = double(x_sol) % Desired Numeric Result
EDIT You could do this numerically with fzero if you know the approximate value of the desired root:
d_i = 3; % Insert Correct Value
er = 5; % Insert Correct Value
Re = 1000; % Insert Correct Value
fcn = @(x) x+4*log10(er/(3.7*d_i)+1.4125*x/Re); % Anonymous Function
x_val = fzero(fcn, 10.8); % Solution
  2 件のコメント
Brittany Caughron
Brittany Caughron 2016 年 10 月 28 日
The second solution worked perfectly. Thank you so much!
Star Strider
Star Strider 2016 年 10 月 28 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by