Help Solving an Equation
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuesta aceptada
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
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!