Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Matlab

Name: Anonymous 2012-02-19 12:11

So i'm trying to do the method of Newton-raphson, all i can do is this but do not run, help a bro out please
:
function x3=nr(sem)
if (f(sem+h)-f(sem))/2h=0;
        display('la funcion no es diferenciable por lo tanto no es posible aplicar el metodo de newton-rhapson')
    return
end
%definir tolerancias
dtol=1e-4;
etol=1e-4;
Nmax=100;
h=10^-4;
%inicializacion de variables
sem=0;
eL2=1;
desv=1;
n=1;

while(eL2>etol)||(desv>dtol)&&(n<=Nmax)
    fp=(f(sem+h)-f(sem))/2h);
    x3=sem-(f(sem)/fp);
   
    %errores
    eL2=abs((x3-sem)/x3);
    desv=abs(f(x3));
    if n<Nmax
%         fprintf('n=%0.0f sem=%1.6f x3=%1.6f eL2=%1.3e\n',n,sem,x3,eL2,desv)
    n=n+1;
    sem=x3;
    x3=[x3,n,eL2,desv];
    end
end

Name: Anonymous 2012-02-19 12:37

"i'm so sorry i'm from latino-america"
i'm really not but you won't help just because English is not my maternal language? that is just stupid my friend and FYI math is universal, do not matter your language, stupid cunt

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List