metodo de newton

Upload: edu-cristian-calle-morocho

Post on 13-Jan-2016

21 views

Category:

Documents


0 download

DESCRIPTION

pdf matlap

TRANSCRIPT

  • ESCUELA SUPERIOR POLITCNICA DE CHIMBORAZO

    Facultad: Mecnica Escuela: Ing. Automotriz

    Carrera: Ing. Automotriz Catedra: Mtodos numricos

    Fecha: 08-06/2015

    Nombre: Cristian Calle cdigo: 1581

    %METODO DE NEWTON

    clcclear

    fprintf(' METODO DE NEWTON\n\n\n');

    format long;

    Xo=input ('ingrese el valor inicial\n');Iter=input ('\ningrese el nmero de iteraciones\n');Tol=input ('\ningrese la tolerancia que desea\n');F=input ('\ningrese la funcin en comillas simples\n');

    f=inline(F);

    Y1=f(Xo);Derivada=diff(F)Der=char(Derivada);D=inline(Der);

    De=D(Xo);

    Error=Tol+1;Cont=0;Z1= [Cont, Xo, Y1, De, Error];

    Z= [Cont, Xo, Y1, De, Error];while Y1~=0 & Error>Tol & Cont

  • end

    if Y1==0fprintf('\n\nSOLUCION:\n')fprintf('%g es raz\n\n',Xo);elseif Error