Help Solving an Equation

1 visualización (últimos 30 días)
Brittany Caughron
Brittany Caughron el 27 de Oct. de 2016
Comentada: Star Strider el 28 de Oct. de 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

Respuesta aceptada

Star Strider
Star Strider el 27 de Oct. de 2016
Editada: Star Strider el 27 de Oct. de 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 comentarios
Brittany Caughron
Brittany Caughron el 28 de Oct. de 2016
The second solution worked perfectly. Thank you so much!
Star Strider
Star Strider el 28 de Oct. de 2016
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by