M todos Num ricos 02 4
Transcript of M todos Num ricos 02 4
![Page 2: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/2.jpg)
Métodos NuméricosMétodos Numéricos
Lic. Guillermo Mario Chuquipoma PachecoLic. Guillermo Mario Chuquipoma Pacheco 20102010
![Page 3: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/3.jpg)
MétodoMétodo de Newtonde Newton--RaphsonRaphson
![Page 4: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/4.jpg)
MétodoMétodo de Newtonde Newton--RaphsonRaphson
( ) kf xx x= −
Fórmula iterativa de Newton-Raphson
Tal vez, de las fórmulas para localizar raíces, la fórmula de Ne wton-Raphsonsea la más ampliamente utilizada. Es un método abierto que usa laaproximación de línea recta que es la tangente a la curva.
1
( )
'( )k
k kk
f xx x
f x+ = −
![Page 5: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/5.jpg)
InterpretaciónInterpretación gráficagráficadel del
MétodoMétodo dedeMétodoMétodo dedeNewtonNewton--RaphsonRaphson
![Page 6: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/6.jpg)
0 0( , ( ))x f x
MétodoMétodo de Newtonde Newton--RaphsonRaphson
( )y f x=
0x
'( )km f x=
1x2x3x
Raíz
1 1( , ( ))x f x
2 2( , ( ))x f x3 3( , ( ))x f x
![Page 7: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/7.jpg)
La formula La formula iterativaiterativa de de NewtonNewton--RaphsonRaphson
![Page 8: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/8.jpg)
( , ( ))k kx f x
Formula Formula iteracióniteración dedeNewtonNewton--RaphsonRaphson
( ) kf xx x= −
1
0 ( )k
k kxm
f x
x +
−=− 1
'( )( )
kk
k k
f xf
xx
x+
−=−⇒
( ,0)kx
'( )km f x=
1( ,0)kx +
1
( )
'( )k
k kk
f xx x
f x+ = −
'( ) 0kf x ≠
⇒
( )y f x=
![Page 9: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/9.jpg)
De acuerdo con la serie truncada de Taylor :
2''( ( ))( ) ( ) '( )( ) ( )
2
f xf x f a f a x a x a
ξ= + − + −= + − + −= + − + −= + − + −
OtraOtra maneramanera de de obtenerobtenerla formula de Newtonla formula de Newton--RaphsonRaphson
1kx x ++++==== ka x====Haciendo cambio de Variable 1kx x ++++==== ka x====
211 1 1
''( ( ))( ) ( ) '( )( ) ( )
2k
k k k k k k kf x
f x f x f x x x x xξ ++++
+ + ++ + ++ + ++ + += + − + −= + − + −= + − + −= + − + −
1 0k kx x++++ − ≈− ≈− ≈− ≈ 1( ) 0kf x ++++ ====
10 ( ) '( )( )k k k kf x f x x x++++= + −= + −= + −= + − ⇒⇒⇒⇒ 1( )
'( )k
k kk
f xx x
f x++++ = −= −= −= −
Haciendo cambio de Variable
Considerando:
![Page 10: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/10.jpg)
Método de Newton-Raphson
Se ejecuta la iteración como: = − anteriornuevo anterior
anterior
f(x )x x
f '(x )
Algoritmo del método de Newton-Raphson
Proceso de iteración:
inicializa: x0 = . . .
inicia_iteración k = 0,1, 2, . . .
xk+1 = xk - f( xk )/ f ’(xk )
Si converge,que pare en alguna iteración
fin_de_iteración
![Page 11: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/11.jpg)
Método de NewtonMétodo de Newton-- RaphsonRaphsonEN MATLABEN MATLAB
![Page 12: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/12.jpg)
Ejemplo:Usar una iteración simple de punto fijo para hallar un valor aproximadoa la raíz de:
SoluciónConsideramos: xf(x) xe−= −
x x 0e− − =
−= − −xf '(x) 1e
=0Punto inicial x 0
Crear el archivo m-file de la función de f.mfunction y=f(x)y=exp(-x)-x;
Crear el archivo m-file de la derivada de la función f1.mfunction y=f1(x)y=-exp(-x)-1;
f(x) xe= − = − −f '(x) 1e
![Page 13: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/13.jpg)
function [x,iter] = newton1(f,f1,x0,maxiter)iter = 0;disp('i xi');while iter < maxiter
Método de Newton-Rahson
Escribir en un archivo m-file con el nombre de newton1.m
while iter < maxiterdisp(sprintf('%-3d %2.15f ',iter,x0));
x = x0 - feval(f,x0)/ feval(f1,x0);iter = iter + 1;x0 = x;
end
Guardar en su área de trabajo…
![Page 14: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/14.jpg)
En la línea de comandos escribir:>> newton1( ‘f ‘, ‘f1‘,0,100)
![Page 15: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/15.jpg)
Ejercicio
![Page 16: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/16.jpg)
DESVENTAJAS DEL MÉTODO DE NEWTON RAPHSON
El método es muy eficiente, aunque hay situaciones en que se c omportaen forma deficiente. Un caso especial en raíces múltiples, y cuando laderivada de la función es compleja de realizar.
![Page 17: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/17.jpg)
( )f x
x1x
DESVENTAJAS DEL MÉTODO DE NEWTON RAPHSON
2x0x1x
X
En este caso en el que existe un punto de inflexión, f’’(x)=0 e n la vecindadde una raíz, con lo que las iteraciones divergen rápidamente y no esposible hallar el cero.
![Page 18: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/18.jpg)
( )f x
DESVENTAJAS DEL MÉTODO DE NEWTON RAPHSON
0x 1x X2x
En este caso de algunas iteraciones la pendiente se hace cerc ana a cero, loque hace que el próximo valor encontrado salga del área de int erés ydiverja.
![Page 19: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/19.jpg)
( )f x
2xx
1x
0x X
En este caso existen raíces cercanas, dado un valor inicial n o se acerca a laraíz más cercana, lo que hace que el próximo valor encontrado salga delárea de interés y diverja.
![Page 20: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/20.jpg)
( )f x
0x 1x X
En este caso se observa que en la segunda iteración la pendien te es cero yel valor se dispara horizontalmente al infinito. Estas posib ilidades traenconsigo una división por cero, que hacen fallar el método.
![Page 21: M todos Num ricos 02 4](https://reader036.fdocumentos.com/reader036/viewer/2022062713/62b79b120b87420d565f0496/html5/thumbnails/21.jpg)
GRACIAS POR SU ATENCIÓNGRACIAS POR SU ATENCIÓN