Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function M = newton_mod(fn,dfn,d2fn,x0,E) // CAMBIA TUTTO!
- x = x0; // Punto iniziale.
- df = dfn(x);
- while (df <> 0) // Condizione di punto NON stazionario.
- d2f = d2fn(x);
- if (d2f == 0) then
- d = -df;
- else
- S = -(d2f^(-1))*df;
- if (abs(df*S) < E*abs(df)*abs(S)) then
- d = -df;
- else
- d = S;
- end
- end
- alfa = armijo(fn,x,d); // Calcolo un passo adatto e determino
- x = x+alfa*d; // la "x" successiva con cui proseguire
- df = dfn(x); // la determinazione del punto di minimo
- d2f = d2fn(x);
- end
- M = [x fn(x)];
- return M;
- endfunction
Add Comment
Please, Sign In to add comment