% Grafica de La Funciopn: CLC Format Fplot (, (-15,3) ) Hold Fplot (, (-15,3) ) Title Xlabel Ylabel Grid Hold

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

26/9/2019 NEWTONRAPHSON

clc
format compact
% GRAFICA DE LA FUNCIOPN
fplot('(x^4+20.75*x^3+92.6*x^2+73.69*x)',[-15,3])
hold on
fplot('0*x',[-15,3])
title(' FORMULA DE BAZIN')
xlabel('radio hidraulico (pies)')
ylabel('F(radio hidraulico)')
grid on
hold off

% METODO DE NEWTON RAPHSON


% DATOS
x0=4, tol=0.001, error=10;
f=inline('8787/(0.552+1.1/sqrt(x))*sqrt(0.001*x)-5')
df=inline('8787/(2000*(11/(10*x^(1/2)) + 69/125)*(x/1000)^(1/2)) + (96657*(x/1000)^(1/2))/(20*x^(3/2)*(11/(10*x^(1/2)) + 69/125)^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)
disp([x1,error])
x0=x1;
end

x0 =
4
tol =
1.0000e-03
f =
Inline function:
f(x) = 8787/(0.552+1.1/sqrt(x))*sqrt(0.001*x)-5
df =
Inline function:
df(x) = 8787/(2000*(11/(10*x^(1/2)) + 69/125)*(x/1000)^(1/2)) + (96657*(x/1000)^(1/2))/(20*x^(3/2)*(11/(10*x^(1/2)) + 69/125)^2)
raiz aprox error_ABS
-1.283651 5.283651
-1.2837 5.2837
0.114293 1.442297
0.1143 + 0.3549i 1.4423 + 0.0000i
0.039250 0.405438
0.0393 - 0.0435i 0.4054 + 0.0000i
0.022015 0.048345
0.0220 + 0.0017i 0.0483 + 0.0000i
0.021244 0.001837
0.0212 - 0.0000i 0.0018 + 0.0000i
0.021241 0.000004
0.0212 + 0.0000i 0.0000 + 0.0000i

file:///C:/Users/KEVIN/Desktop/OTROS CURSOS/html/NEWTONRAPHSON.html 1/2


26/9/2019 NEWTONRAPHSON

Published with MATLAB® R2015a

file:///C:/Users/KEVIN/Desktop/OTROS CURSOS/html/NEWTONRAPHSON.html 2/2

You might also like