Professional Documents
Culture Documents
a) En forma grafica b) Con el mtodo de la Biseccin, e itere hasta que E 0.1%. c) Con el mtodo del punto fijo. Haga una eleccin inicial de X0=0.5, e itere hasta que E 0.001%. d) Con el mtodo de Newton-Raphson, e itere hasta que E 0.1%. e) Con el mtodo de la Secante (tres iteraciones, X0=3 y X1=4), e itere hasta que E 0.1%. DESARROLLO: a) Metodo de la Biseccion.-
PROGRAMACION EN LOS BUTTONS: PushButton(Aceptar).F=inline(get(handles.edit1,'string')); a=str2double(get(handles.edit2,'string')); b=str2double(get(handles.edit3,'string')); E=str2double(get(handles.edit4,'string')); if F(a)*F(b)<0 while abs(b-a)>E
x=(a+b)/2; if F(a)*F(x)==0 a=b; else if F(a)*F(x)<0 b=x; else a=x; end end end set(handles.edit5,'string',x); else set(handles.edit5,'string','no existe raiz'); end
c) Metodo de Newton-Rapshon.-
2*sin(sqrt(x))-x
cos(x^(1/2)/x^(1/2)-1 Programacion en los Buttons: PushButton(Aceptar).f=inline(get(handles.edit1,'string')); g=inline(get(handles.edit2,'string')); x0=str2double(get(handles.edit3,'string')) ;E=str2double(get(handles.edit4,'string')); x1=x0-(f(x0)/g(x0)); while abs(x1-x0)>E x0=x1 x1=x0-(f(x0)/g(x0)) end set(handles.edit5,'string',x1);
d) Metodo de la Secante:
f=inline(get(handles.edit1,'string')); x0=str2double(get(handles.edit2,'string')); x1=str2double(get(handles.edit3,'string')); E=str2double(get(handles.edit4,'string')); x2=x1-(((x1-x0)*f(x1))/(f(x1)-f(x0))); while abs (x2-x1)>E x1=x2; x2=x1-(((x1-x0)*f(x1))/(f(x1)-f(x0))) end set(handles.edit5,'string',x2);
if F(a)*F(b)<0 while abs(b-a)>E x=(a+b)/2; if F(a)*F(x)==0 a=b; else if F(a)*F(x)<0 b=x; else a=x; end end end set(handles.edit5,'string',x); else set(handles.edit5,'string','no existe raiz'); end
Programacion en los Buttons: PushButton(Aceptar).f=inline(get(handles.edit1,'string')); g=inline(get(handles.edit2,'string')); x0=str2double(get(handles.edit3,'string')); E=str2double(get(handles.edit4,'string')); x1=g(x0); while abs(x1-x0)>E
c) Metodo de Newton-Rapshon.-