Post on 01-Mar-2018
7/26/2019 s4 Newton 1er y 2do Orden (1)
1/4
DR. SORIA QUIJAITE JUAN JESS MTODOS NUMRICOS
MTODOS NUMRICOS CON SOFTWARE MATLABECUACIONES NO LINEALES: MTODO DE NEWTON RAPHSON DE PRIMER ORDEN
MTODO DE NEWTON RAPHSON DE PRIMER ORDEN.-El mtodo de Newton-Raphsones un mtodo iterativo para encontrar la raz de una ecuacin no lineal. Laiteracin de Newton se deduce al hacer la expansin de la serie de Brook Taylor.
Supongamos que el problema consiste en encontrar una raz de f(x)=0.Sea f una funcin diferenciable en
0x un valor aproximado de *x raz nica en ];[ 00 ba , como:
2
0
*
0
*
00
* )())((')()( xxhxxxfxfxf 2
0
*
0
*
0'0 )())((')(0 xxhxxxfxf , si 0)(' *
xf tenemos:
2
0
*
0
*
0
0 )()()('
)(0 xxhxx
xf
xf Entonces
20
*
0
00
* )())('
)(xxh
xf
xfxx
Si despreciamos el ltimo sumando obtendremos un valor aproximado de *x
Al que le denotamos por1
x :)('
)(
0
001
xf
xfxx
Con este mismo razonamiento se genera la sucesin { ix } donde:
,2,1,0;)('
)(1 i
xf
xfxx
i
iii ..(I)
Geomtricamente (I) resulta de intersecar el eje de abscisas con la recta tangente a la curva f , en elpunto )](;[ ii xfx .
raz
ALGORITMO DEL MTODO DE NEWTON-RAPHSONNewton
repeatxx 0 ;
)('
)(
0
00
xf
xfxx
until Errorxx 21
retorno raz es xend Newton
----------------------------------------------------------------------------------------------------------PLOTEO DE LA CURVA )sin()3/exp()5.0()( xxxf
%ploteo de la curva - mtodo de newtonx=-3:0.005:3;y=(0.5)*exp(x/3)-sin(x);plot(x,y,'k')xlabel('EJE DE ABSCISAS')ylabel('EJE DE ORDENADAS')
gridzoom ontitle('Grfica de f(x)=(0.5)*exp(x/3)-sin(x)');
1x
0x
2x 3x 4x
x
*x
7/26/2019 s4 Newton 1er y 2do Orden (1)
2/4
DR. SORIA QUIJAITE JUAN JESS MTODOS NUMRICOS
%PROGRAMA DEL MTODO DE NEWTON-RAPHSON
function newton_orden1nombre_f=input(' Ingrese la funcin asociada f(x)= ','s');x0=input(' ingrese el valor inicial : ');fprintf ('\n');fprintf (' it aprox g(x) error \n');i=1; e=1; delta=0.001;
while e>=3E-12 && i
7/26/2019 s4 Newton 1er y 2do Orden (1)
3/4
DR. SORIA QUIJAITE JUAN JESS MTODOS NUMRICOS
MTODOS NUMRICOS CON SOFTWARE MATLABECUACIONES NO LINEALES: MTODO DE NEWTON RAPHSON DE SEGUNDO ORDEN
Mtodo de Newton Raphson de Segundo OrdenEl mtodo de Newton-Raphson es un mtodo iterativo para encontrar la raz de una ecuacin no lineal. La
iteracin de Newton se deduce al hacer la expansin de la serie de Brook Taylor.Supongamos que el problema consiste en encontrar una raz de f(x)=0.Sea f una funcin (k+1) veces diferenciable en ba, y continua en [a ; b] donde su desarrollo de Taylor
alrededor de0
x es:
!
))((
!3
))((
!2
))(())((')()( 00
3
00
'''2
00
''
000n
xxxfxxxfxxxfxxxfxfxf
nn
Considerando la aproximacin cuadrtica de f en el desarrollo de Taylor tenemos:
!2
))(())((')()(
2
00
''
000
xxxfxxxfxfxf
..(1)
Si x es una raz de f y 0xxh tenemos en (1)
2
)()(')(0
2
0
''
00
hxfhxfxf , una ecuacin cuadrtica en variable h la cual por la frmula general se obtiene:
2
)(''2
)(2
)(''4)]('[)('
0
002
00
xf
xfxf
xfxf
h
Reduciendo y simplificando tenemos:
)(''
)().(''2)]('[)('
0
00
2
00
0
xf
xfxfxfxfxx
)(''
)().(''2)]('[)('
0
00
2
00
0xf
xfxfxfxfxx
Con este mismo razonamiento se genera la sucesin { 1n
x }
)().(''2)]('[:
3,2,1,0)(''
)('
)(''
)('
2
1
1
nnnn
n
nn
nn
n
nn
nn
xfxfxfxDonde
nxf
xxfxx
xf
xxfxx
------------------------------------------------------------------------------------------------------------------PLOTEO DE LA CURVA 33)2()( 2 xxsenexf x
x=-4:0.05:5;y=exp(-x)+sin(2*x)-3*x.^2+3;
plot(x,y)xlabel('EJE X')ylabel('EJE Y')title('Mtodo Newton de 2 orden')gtext('f(x)=exp(-x)+sin(2*x)-3*x.^2+3')grid on
7/26/2019 s4 Newton 1er y 2do Orden (1)
4/4
DR. SORIA QUIJAITE JUAN JESS MTODOS NUMRICOS
----------------------------------------------------------------------------------------------------- %Programa de Newton-Raphson de 2 ordenfunction newton2ordennombre_f=input('Ingrese la funcin f(x)=','s');nombre_f2=input('Ingrese la derivada de f(x)=','s');x0=input('Ingrese el valor inicial:');fprintf('\n');fprintf('it aprox g(x) error \n');i=1; e=1; delta=0.001;while e>3E-12 & i