Está en la página 1de 2

26/9/2019 Ejercicio2_48

Contents
GRAFICA DE LA FUNCION

% MODELO OSWALD-DEWAELE

GRAFICA DE LA FUNCION

fplot ('7.9527*log10(600*x^(0.8))-1.20112-1/x',[-1,2])
hold on
fplot ('0*x',[-1,2])
title('f(x)=7.9527*log10(600*x^0.8)-1.20112-1/x')
xlabel('X')
ylabel('Y')
grid on
hold off

%Metodo Newton raphson


%Datos
x0=0.05, tol=0.001, error=10;
f = inline('7.9527*log10(600*x^0.8)-1.20112-1/x')
df = inline('79527/(12500*x*log(10)) + 1/x^2')
disp('Raiz_aprox Error_Abs')
while(error>tol)
x1=x0-f(x0)/df(x0);
error=abs(x1-x0);
fprintf('%10.6f %10.6f \n',x1,error)
x0=x1;
end
disp('Solucion')
disp('El factor de friccion f es:')
fprintf ('%f + - %f \n',x1,error)

Warning: Imaginary parts of complex X and/or Y arguments ignored

x0 =

0.0500

tol =

1.0000e-03

f =

Inline function:
f(x) = 7.9527*log10(600*x^0.8)-1.20112-1/x

df =

Inline function:
df(x) = 79527/(12500*x*log(10)) + 1/x^2

Raiz_aprox Error_Abs
0.066221 0.016221
0.072557 0.006336
0.073163 0.000606

file:///C:/Users/TICLLA/Documents/MATLAB/html/Ejercicio2_48.html 1/2
26/9/2019 Ejercicio2_48
Solucion
El factor de friccion f es:
0.073163 + - 0.000606

Published with MATLAB® R2015a

file:///C:/Users/TICLLA/Documents/MATLAB/html/Ejercicio2_48.html 2/2

También podría gustarte