Está en la página 1de 8

INGENIERA CIVIL

METODOS NUMERICOS
_____________________________________________________________________________

Ejercicio 0.1

En algn lenguaje de su preferencia, implemente el mtodo de Newton


para sistema de ecuaciones no lineales
Una Implementacin Bsica:

function [x,iter]=newton_nl(x,prec)
iter=0;
while norm(Fn(x))>prec
iter=iter+1;
x=x-inv(Jn(x))*Fn(x);
ifiter>1000;
error('parece que newton no converge');
end
end

Ejercicio 0.2
Se quiere resolver el sistema de ecuaciones no lineales

1. Hallar el sistema de ecuaciones y el Jacobiano

Solucin
function z=fn(x)

INGENIERA CIVIL
METODOS NUMERICOS
_____________________________________________________________________________

z=[-x(1)+2*x(2)-4
(x(1)-6)^2-x(2)+2];
function z=jn(x)
z=[-1 2
2*(x(1)-6) -1];
>> [x, iter] = newton_nl ([1 2]',0.000001)

x=
4.5000
4.2500
iter =
5

2. Ahora ejecutando NEWTON_NL, con otro punto inicial [9 3]


tenemos:
>> [x, iter] = newton_nl([9 3]',0.000001)
x=
8.0000
6.0000

iter =
4

INGENIERA CIVIL
METODOS NUMERICOS
_____________________________________________________________________________

Ejercicio 0.3
Haga sus respectivas grficas del ejercicio anterior y comente, porqu el
mismo
sistema de ecuaciones no lineales, para puntos distintos converge a dos
raices distintas

INGENIERA CIVIL
METODOS NUMERICOS
_____________________________________________________________________________

Ejercicio 0.4
Se quiere resolver el sistema de ecuaciones no lineales

Solucin
function z=fn(x)
z=[(-x(1)-3)^2-x(2)+4
(x(1)+2*x(2)-16];
function z=jn(x)
z=[2(x(1)-3) -1
1 2];
>> [x, iter] = newton_nl([1 2]',0.000001)
x=
-5.6085
10.8042
iter =
52

>> [x, iter] = newton_nl([6 10]',0.000001)

x=

-5.6085
10.8042

INGENIERA CIVIL
METODOS NUMERICOS
_____________________________________________________________________________

iter =

47

Ejercicio 0.5
Consideremos el siguiente sistema de ecuaciones no li-neales de 3
incgnitas y 3 ecuaciones:

Observe que

function z=fn(x)
z=[7*x(2)+5*x(2)-x(3)^2*sin(x(1))-12
-x(1)^4+cos(x(2))^2+2*x(3)^3-8
6*x(1)+2*x(2)-x(3)+34];
function z=jn(x)
z=[7*x(2)-x(3)^2*cos(x(1)) 7*x(1)+5 -2*x(3)*sin(x(1))
-4*x(1)^3 -2*cos(x(2))*sin(x(2)) 6*x(3)^2
6 2 -1];
>> [x, iter] = newton_nl([10 20 -50]',0.000001)

INGENIERA CIVIL
METODOS NUMERICOS
_____________________________________________________________________________

x=
-10.3885
23.1629
17.9951

iter =
78

Ejercicio 0.5
Se quiere resolver el sistema de ecuaciones no lineales
Al ejecutar NEWTON_NL con punto inicial [1 1] y con una precisin de
prec=0.000001

function z=fn(x)
z=[5*x(1)^2+6*x(1)*x(2)+5*x(2)^2-4*x(1)+4*x(2)-4
x(1)^2+x(2)^2-1];
function z=jn(x)
z=[10*x(1) +6*x(2) +10*x(2) -4 +4
2*x(1) +2*x(2)];
Ejercicio 0.6
Se quiere resolver el sistema de ecuaciones no lineales

Solucion :

INGENIERA CIVIL
METODOS NUMERICOS
_____________________________________________________________________________

function z=fn(x)
z=[x(1)^3+x(2)^3-2*x(1)*x(2)
x(1)^2+x(2)^2-1];
function z=jn(x)
z=[ 3*x(1) +3*x(2) -2*x(2)
2*x(1) +8*x(2)];
Al ejecutar Newton, verifique con los siguientes puntos iniciales [1 2]

Ejercicio 0.7
Se quiere resolver el sistema de ecuaciones no lineales

Use el mtodo de Newton, con el punto inicial [-1 -2 1]y con parmetro
de precisin = 106
Ejercicio 0.8
Resolver el sistema de ecuaciones no lineales

INGENIERA CIVIL
METODOS NUMERICOS
_____________________________________________________________________________

pruebe con un punto inicial [0 0 0] y con parmetro de precisin =


106.y tambin anote su Jacobiano.

También podría gustarte