Vous êtes sur la page 1sur 9

Método de la Newton Raphson (Método de la Tangente)

En Matlab

>> f= @(x)x.*log10(x)-1

>> df=@(x)log(x)/log(10)+1/log(10);

>> x0=1 ; tol=0.002

>>[x,H]=newton(f,df,x0,tol)

function [x,H]=newton(f,df,x0,tol)
it=0;
H=[it x0 f(x0) df(x0) abs(f(x0)/df(x0))];
e=1;
while e>tol
it=it+1;
x=x0-f(x0)/df(x0);
function [x,H]=biseccion(f,a,b,tol)
e=abs(x-x0);
if f(a)*f(b)>0 , error('valor del intervalo incorrecto')
end; H=[H; it x f(x) df(x) abs(f(x)/df(x))];
it=0;x0=x;
end a
H=[it (a+b)/2 b f(a) f((a+b)/2) (b-a)/2];
while (b-a)/2>tol
Para el ejemplo anterior, ¿Cuántas iteraciones serán necesarias para una tolerancia de
0.002?
𝑥0 = 1

Iteraciones

k x f(x) f’(x) abs(f(x)/f’(x))

0 1.0000 -1.0000 0.4343 2.3026

1 3.3026 0.7136 0.9531 0.7486

2 2.5540 0.0400 0.8415 0.0475

3
3 2.5064
2.5064 0.0002
0.0002 0.8333
0.8333 0.0002
0.0002
4 2.5062 0.0000 0.8333 0.0000
Método del Punto Fijo (Aproximaciones Sucesivas)
CONVERGE!!

g3(x)
Casos:
1
Primer arreglo: 𝑥 = = 𝑔1 (𝑥)
log⁡(𝑥)
ln⁡(10) 𝑏=3
Condición de Convergencia: |𝑔1′ (𝑥 )| = |− |
𝑥(ln(𝑥))2 𝑎=𝟏.𝟓=𝝃
|𝑔1′ (𝜉 )| = 9.34 > 1⁡, por lo que no converge.

1
Segundo arreglo 𝑥 = 10 = 𝑔2 (𝑥)
𝑥
1 𝑏=3
10 ln⁡(10)
𝑥
Condición de Convergencia: |𝑔2′ (𝑥 )| = |− |
𝑥2
𝑎=𝟏.𝟓=𝝃
|𝑔2′ (𝜉 )| = 4.75 > 1⁡, por lo que no converge.

1+𝑥
Tercer arreglo : 𝑥 = = 𝑔3 (𝑥)
log(𝑥)+1
1 𝑥+1 𝑏=𝟑=𝝃
Condición de Convergencia: |𝑔3′ (𝑥 )| = | ( ) − () |
log 𝑥 +1 x.ln x .(log(𝑥)+1)2 𝑎=1.5
|𝑔2′ (𝜉 )| = 0.41 < 1⁡, por lo que converge.
>>g=@(x)(x + 1)./(log10(x + 1)
>>tol=0.002
>> x0=1

function [x,H]=pto_fijo(g,x0,tol)
it=0;
e=1;
H=[it x0 e];
while e>tol
it=it+1;
x=g(x0);
e=abs(x-x0);
H=[H; it x e];
x0=x;
end
Iteraciones

k xk Error
0 1 1
1 2 1
2 2.3059 0.3059
3 2.4257 0.1199
4 2.4737 0.0480
5 2.4931 0.0193
6 2.5009 0.0078
7 2.5040 0.0032
8 2.5053 0.0013

Vous aimerez peut-être aussi