Documentos de Académico
Documentos de Profesional
Documentos de Cultura
x0 , y0 f 1 ( x 0, y 0 ) f 1 ( x 0, y 0 )
f1 )+ x + y 0
x y
x0 , y0 f 2 ( x 0, y 0 ) f 2 ( x 0, y 0 )
x y
f2 )+ x + y 0
Si introducimos la notacin x =( x , y )
F = (f1, f2) y la matriz jacobiana
[ ]
f1 f 1
J= x y
f2 f 2
x y
Queda:
F ( x 0 ) + J ( x 0 )(x x 0) 0
Entonces
x =x 0J 1 ( x 0)
F (x 0)
x n+1=x nJ 1 ( x n )
F ( x n )
A la hora de implementar el mtodo se hace en dos pasos:
Se resuelve el sistema
x
J ( n) x n+1=
F (x n )
Se calcula
x n+1=x n + x n +1
2) Octave
Implemente en Octave (Matlab) la funcin newtonsis (F; X0; Tol; Maxiter) que
aproxima las races del sistema de ecuaciones no lineales fi (x1; x2;; xn) = 0 i = 1;
2; n; mediante el mtodo de Newton.
function [sol,tolval,steps] =
newtonsis(eqns,variables,start,TOL,maxIt)
func = FunctionN(eqns);
J = sym('J',[length(eqns) length(variables)]);
x=start;
steps = x;
for i=1:length(variables)
J(:,i)=diff(eqns,variables(i)).';
end
jacobi_matrix = FunctionN(J);
for j=1:maxIt
args = num2cell(x);
y=jacobi_matrix(args{:})\-func(args{:}).';
x = x + y';
steps(j+1,:)=x;
tolval = norm(y,2) < TOL;
if tolval
sol = x;
break
end
end
end
3) Solucin de Sistemas
a) Se desea resolver el siguiente sistema de ecuaciones no lineales :
{
1
4 x1 20 x 1 + x 22+ 8=0
4
1
x x 2 +2 x15 x 2 +8=0
2 1 2
X= sym('X',[1,2]);
F = [4*X(1)-20*X(1)+(1/4)*X(2).^2+8 0.5*X(1)*X(2).^2+2*X(1)-5*X(2)+8];
[x,t,steps]=newtonsis(F,X,[0 0],10^-12,100).
I X1 X2
teraci
n
1 0 0
2 0.5 1.8
3 0.564964 2.054919
229572359 636841937
4 0.566919 2.069560
769241220 237982901
5 0.566925 2.069597
543766198 739282447
6 0.566925 2.069597
543805215 739545967
7 0.566925 2.069597
543805215 739545968
(
x sol = 0.566925543805215
2.069597739545968 )
b) Se desea resolver el siguiente sistema de ecuaciones no lineales:
{
6 x 12 cos ( x 2 x3 ) 1=0
9 x 2 + x 21+sin ( x 3 ) +1.06+ 0.9=0
x 1 x2
60 x3 +3e +10 3=0
()
0
Tomando como solucin inicial: x = 0 , tolerancia de 1012 y un mximo
0
X= sym('X',[1,3]);
F = F = [ 6*X(1)-2*cos(X(2)*X(3))-1 9*X(2) + sqrt(X(1)^2+sin(X(3))+1.06)+0.9
60*X(3)+3*exp(-X(1)*X(2))+10*pi-3]:
[x,t,steps]=newtonsis(F,X,[0 0 0],10^-12,100)
Ite X1 X2 X3
racin
1 0 0 0
2 0.5 - -
0.186142329995 0.523598775598
067 299
3 0.498157 - -
810142320 0.199606824616 0.528826395182
109 626
4 - -
0.49814468458 0.199605895536 0.528825977572
9707 292 248
5 0.498144 - -
684589491 0.199605895543 0.528825977573
780 387
6 0.498144 - -
684589491 0.199605895543 0.528825977573
780 387
( )
0.4981446845894915
x sol = 0.199605895543780
0.528825977573387