Filter löschen
Filter löschen

Help Solving an Equation

1 Ansicht (letzte 30 Tage)
Brittany Caughron
Brittany Caughron am 27 Okt. 2016
Kommentiert: Star Strider am 28 Okt. 2016
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

Akzeptierte Antwort

Star Strider
Star Strider am 27 Okt. 2016
Bearbeitet: Star Strider am 27 Okt. 2016
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 Kommentare
Brittany Caughron
Brittany Caughron am 28 Okt. 2016
The second solution worked perfectly. Thank you so much!
Star Strider
Star Strider am 28 Okt. 2016
As always, my pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by