Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
METODO MULLER

# METODO MULLER

Ratings: (0)|Views: 161 |Likes:

### Availability:

See more
See less

05/30/2013

pdf

text

original

METODO MULLER
PRIMERA FORMA
% Mullerfunction Muller
tol=eps(’double’);
x0=1.5; x1=1.2; x2=1.0;fx0=fx(x0); fx1=fx(x1); fx2=fx(x2); iter=1;while abs(fx2)>tolc=fx2;d0=x0-x2; d1=x1-x2;det=d0*d1*(x0-x1);b=(d0*d0*(fx1-fx2)-d1*d1*(fx0-fx2))/det;a=(d1*(fx0-fx2)-d0*(fx1-fx2))/det;di=sqrt(b*b-4*a*c);isig=1; if b<0 isig=-1; endz=(-2)*c/(b+isig*di);x3=x2+z;if abs(x3-x1)<abs(x3-x0)u=x1; x1=x0; x0=u;u=fx1; fx1=fx0; fx0=u;endif abs(x3-x2)<abs(x3-x1)u=x2; x1=u;u=fx2; fx1=u;

endx2=x3;fx2=fx(x2);
fprintf(’%17.14f+%17.14fi %23.15f %4.0f
\
n’,real(x2),imag(x2),fx2,iter);
iter=iter+1;endfunction f=fx(x)
f=xˆ3
-sin(x);
EJEMPLOSEGUNDA FORMA
% metodo de Muller para obtener una solución para f(x)=0function p = muller(f,x0,x1,x2,tol,ni)h1 = x1 - x0;h2 = x2 - x1;d1 = (polyval(f,x1) - polyval(f,x0))/h1;d2 = (polyval(f,x2) - polyval(f,x1))/h2;d = (d2 - d1)/(h2 + h1);i = 3;while i <= nib = d2 + h2*d;D = (b*b - 4*polyval(f,x2)*d)^0.5;if abs(b - D) < abs(b + D)E = b + D;elseE = b - D;endh = -2*polyval(f,x2)/E;

p = x2 + h;if abs(h) < tolreturn;endx0 = x1;x1 = x2;x2 = p;h1 = x1 - x0;h2 = x2 - x1;d1 = (polyval(f,x1) - polyval(f,x0))/h1;d2 = (polyval(f,x2) - polyval(f,x1))/h2;d = (d2 - d1)/(h2 + h1);i = i + 1;endfprintf('Fallo después de %d iteraciones',ni);
EJEMPLO