Está en la página 1de 6

UNIVERSIDAD NACIONAL DEL CALLAO

FACULDAD DE INGENIERIA ELECTRICA Y


ELECTRONICA

METODOS NUMERICOS
CICLO 2019-A

TEMA: METODOS DE RESOLUCION DE


ECUACIONES NO LINEALES
ESTUDIANTES: QUINO BRICEÑO JEFFRY.

CODIGO: 1713210041

ESCUELA PROFESIONAL: INGENIERIA ELECTRONICA.


GRUPO HORARIO: 01L

LIMA-CALLAO – 2019
LABORATORIO 2
COMPARACION DE METODOS DE RESOLUCION DE ECUACIONES NO LINEALES
El algoritmo desarrollado en clase fue mejorado y trabajado con una interfaz gráfica, ya que es mas sencillo trabajar de manera gráfica
y le da un aspecto avanzado al trabajo.
CODIGO POR PARTES:
METODO DE LA BISECCION
resB = 0;
funcion=get(handles.funcion,'string');
f=inline(funcion);
a=str2double(get(handles.aBP,'string'));
b=str2double(get(handles.bBP,'string'));
tol=str2double(get(handles.tolerancia,'string'));
if f(a)*f(b)<0
error=1;
e=0;
i = 1;
while abs(error)>=tol
c=(a+b)/2;
resB(i) = c;
i = i +1;
error=(c-e)/c;
e=c;
if f(a)*f(c)<0
b=c;
end
if f(b)*f(c)<0
a=c;
end
if (f(a)*f(c)==0)~=(f(b)*f(c)==0)
error=0.0000001;
end
end
set(handles.adevertencia,'string',' ');

else
set(handles.adevertencia,'string','el intervalo no contiene
raiz');
end

METODO DE LA FALZA POSICION


resFP = 0;
funcion=get(handles.funcion,'string');
f=inline(funcion);
a=str2double(get(handles.aBP,'string'));
b=str2double(get(handles.bBP,'string'));
tol=str2double(get(handles.tolerancia,'string'));
i = 1;
if f(a)*f(b)
error = 1;
e = 0;
while abs(error)>=tol
c = b-(f(b)*(b-a))/(f(b)-f(a));
resFP(i) = c;
i = i+1;
error = e - c;
e = c;
if f(a)*f(c)<0
b = c;
end
if f(b)*f(c)<0
a = c;
end
if(f(a)*f(c)==0)~=(f(b)*f(c)==0)
error = 0.000000000001;
end
end
else
set(handles.advertencia,'string','el intervalo no contiene raiz');
end

METODO DEL PUNTO FIJO ( SECANTE)


error = 100;
resPF = 0;
funcionF = get(handles.funcion,'string');
funcionG = get(handles.gFP,'string');
f = inline(funcionF);
g = inline(funcionG);
x = str2double(get(handles.xCero,'string'));
tolerancia = str2double(get(handles.tolerancia,'string'));
i = 1;
while error>=tolerancia
x = g(x);
resPF(i) = x;
i= i + 1;
error = abs(f(x));
if i == 200
break %%para finalizar el bucle en caso de algun error
end
end

METODO DE NEWTON – RAPHSON


syms x;
funcion = get(handles.funcion,'string');
f = inline(funcion);
x1 = str2double(get(handles.xCeroN,'string'));
tol = str2double(get(handles.tolerancia,'string'));
i = 1;
resNR = 0;
pd = diff(funcion,x);
g = inline(pd);
sd = diff(pd,x);
h = inline(sd);
error = 1;
while abs(error)>=tol
x2 = x1 -(f(x1)*g(x1))/((g(x1))^2-f(x1)*h(x1));
resNR(i) = x2;
i = i + 1;
if(x2)==0
error = 00000000000000.1;
else
error = x2 - x1;
x1 = x2;
end
end
la ecuación analizada es:

f ( x )=x 4 −4 x2 −8
Donde para el método de la bisección los puntos [a,b] = [-3 0] y

g ( x )=( 4 x ¿¿ 2+ 8)/x 3 ¿
Para el método de la secante, con un punto inicial xo = -4 , la solución aproximada de la
ecuación es x = -2.3375, pero se observa que para el método de la bisección x o la raíz
nunca converge, esto se debe a es que es una función de raíz par. Por este motivo se
implementó el método de Newton mejorado, con el cual se evita ese error.
Se observa que el método de la bisección y la falsa posición tienen que realizar mas
iteraciones que los dos métodos restantes, así el método de Newton-R es más rápido y
eficaz que los métodos restantes.
Probando con otro intervalo:

También podría gustarte