You are on page 1of 15

Curso:

mtodos numricos
Ciclo: V
Docente:
Braulio Gutirrez
Pari
Juliaca, junio 2014

Ejercicio N.1
Q=[-0.866 0 0.5 0 0 0;-0.5 0 -0.866 0 0 0; 8.66 1 0 1 0 0; 5 0 0 0 1 0;0 -1 -0.5 0 0 0;0 0
0.866 0 0 1]
Q=
-0.86600000000000
0

0 0.50000000000000

-0.50000000000000
0

0 -0.86600000000000

0
0

8.66000000000000
1.00000000000000
0
0
5.00000000000000
0 1.00000000000000
0

0
0
0
0.86600000000000

-1.00000000000000
-0.00
0
0
0 1.00000000000000

>> E=[0;1000;0;0;0;0]
E=
0
1000
0
0
0
0
>> X=inv(W)*E
X=
1.0e+003 *
-0.50002200096804

F1

0.43301905283832

F2

-0.86603810567665

F3

3.89717147554492

H2

1.00000000
0
0
0

2.50011000484021

R2

0.74998899951598

R1

Ejercicio N. 2
>> A=[55 30 15;25 45 30; 25 20 55]
A=
55

30

15

25

45

30

25

20

55

>> B=[4800;5800;5700]
B=
4800
5800
5700

>> T=inv(A)*B
T=
32.70000000000000
68.03333333333332
64.03333333333333
ARENA (X)
55
25
25
4800 m3
(55+25+25)X=4800
X=45.7143
(30+45+20)y=5800
Y=61.0561

FINO (Y)
30
45
20
5800 m3

GRUESA (Z)
15
30
55
5700 m3

(15+30+55)Z=5700
Z=57
CANTERA 1

55(45.7143)+30(61.0526)+15(57)=5200.87
CANTERA 2

25(45.7143)+45(61.0526)+30(57)=5600.23
CANTERA 3

25(45.7143)+20(61.0526)+55(57)=5498.91

Ejercicio N.3
>> E=[3 1 5;2 3 4; 4 5 2]
E=
3

>> C=[60;40;100]
C=
60
40
100
>> H=inv(E)*C
H=
25.50000000000000
1.00000000000000
-3.50000000000000

Ejercicio N.4
>> A=[-0.866 -0.707 -0.707 0 0 0 0 0 ; -0.5 -0.707 -0.707 0 0 0 0 0 ; 0.5 0 0 0 0 0 1 0;
0.866 0 0 1 0 1 0 0;0 0.707 0 -1 1 0 0 0;0 0.707 0 0 0 0 0 0;0 0 0.707 0 -1 0 0 0;0 0 0.707 0
0 0 0 1]
A=
-0.8660 -0.7070 -0.7070

-0.5000 -0.7070 -0.7070

0.5000

0.8660

1.0000

1.0000

0.7070

-1.0000

1.0000

0.7070

0.7070

0.7070

1.0000

-1.0000

1.0000

>> B=[1200;600;0;0;0;0;0;0]
B=
1200

600 0 0 0 0

>> x=inv(A)*B
x = 1.0e+003 *
-1.6393
0

F1
F2

0.3107

F3

0.2197

F4

0.2197

F5

1.2000

H1

0.8197

V2

-0.2197

Ejercicio N.5
>> M=[0.707 1 0 0 0 0 0 1 0 0;0.707 0 0 0 0 0 0 0 1 0;-0.707 0 0.707 1 0 0 0 0 0 0 ;0.707
0 0.707 0 0 0 0 0 0 0 ;0 -1 -0.707 0 0.5 1 0 0 0 0 ;0 0 0.707 0 0.866 0 0 0 0 0;0 0 0 -1 -0.5 0
0.866 0 0 0;0 0 0 0 -0.866 0 -0.5 0 0 0;0 0 0 0 0 -1 -0.866 0 0 0;0 0 0 0 0 0 0.5 0 0 1]
M=
0.7070

1.0000

0.7070

-0.7070

0.7070

1.0000

0.7070

0.7070

0 -1.0000 -0.7070

0.5000

1.0000

0
0
1.0000

1.0000

0
0

0
0

0
0

0
0

0.7070

0.8660

0 -1.0000 -0.5000

0.8660

0 -0.8660

0
0

0
0

0 -0.5000

0 -1.0000 -0.8660

0.5000

1.0000

>> E=[0; 0 ;0; 500; 0; 0; 0; 1000 ;0; 0]


E=
0 0 0 500 0 0 0 1000 0

>> X=inv(M)*E
X=
-25.3769

F1

17.9415

F2

732.5905

F3

-535.8829

F4

-598.0848

F5

834.9254

F6

-964.1171

F7

-0.0000

H1

17.9415

V2

482.0585

V5

Ejercicio N.6
R=[0.5 0 0 0 0 0 0 1 0 0;0.866 0 0 0 0 0 1 0 0 0;-0.5 0.5 0 0 0 -0.866 0 0 0 0;-0.866 0.707
0 1 0 0.5 0 0 0 0;0 0.707 0 0 0 0 0 0 0 0;0 -0.707 0 0 0 0 0 0 0 0;0 0 1 0 -1 0 0 0 0 0;0 0 0
-1 0 0 0 0 0 0;0 0 0 0 1 0.866 0 0 1 0;0 0 0 0 0 0.5 0 0 0 1]
R=
0.50000000000000
0 1.00000000000000
0.86600000000000
1.00000000000000

0
0

0
0

0
0
0

-0.50000000000000 0.50000000000000
-0.86600000000000
0
0

0
0

0
0

0
0

-0.86600000000000 0.70700000000000
0.50000000000000
0
0
0

0 0.70700000000000
0
0

0 -0.70700000000000
0
0

0
0
0

0
0

0
0.86600000000000
0
0

0
0

0
0

0 -1.00000000000000
0

0 -1.00000000000000
0

0 1.00000000000000
0
0

0 1.00000000000000
0
0

0 1.00000000000000
0 1.00000000000000

0
0
0 1.00000000000000

0 0.50000000000000

>> C=[0;0;0;0;0;500;0;250;0;0]
C=
0 0 0 0 0 500 0 250 0 0

Laboratorio N.6
PROBLEMA 1.
Se quiere resolver el sistema de ecuaciones no lineales

x +2 y4=0

(x6)2 y +2=0

Al ejecutar newton, verifique con los siguientes puntos iniciales

SOLUCION:
function [x,iter]=NEWTON_NL(x,prec)
iter=0;
while norm(Fn(x))>prec
iter=iter+1;
x=x-inv(Jn(x))*Fn(x);
if iter>1000

1
2 ]

9
3 ]
y

error('parece que newton no converge');


end
end

function z=Fn(x)
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];
RESPUESTA
>> [x, iter] = NEWTON_NL([1 2]', 0.0001)
x = 4.5000
4.2500
iter =

>> [x, iter] = NEWTON_NL([9 3]', 0.0001)


x = 8.0000
6.0000
iter = 3

PROBLEMA 2.
Se quiere resolver el sistema de ecuaciones no lineales

(x3)2 y + 4=0
x+ 2 y +16=0

Al ejecutar newton, verifique con los siguientes puntos iniciales

SOLUCION:
function [x,iter]=NEWTON_NL(x,prec)
iter=0;
while norm(Fn(x))>prec

1
2 ]

6
10 ]
y

iter=iter+1;
x=x-inv(Jn(x))*Fn(x);
if iter>1000
error('parece que newton no converge');
end
end
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];
RESPUESTA
>> [x, iter] = NEWTON_NL([1 2]', 0.0001)
x =1.1492
7.4254
iter = 2
>> [x, iter] = NEWTON_NL([6 10]', 0.0001)
x = 4.3508
5.8246
iter = 4

Ejercicio 0.5
Consideremos el siguiente sistema de ecuaciones no lineales de 3 incgnitas
y 3 ecuaciones:

7 x1 x 2+5 x 2x 23 sen x 112=0


x 41 + cos2 x2 +2 x 338=0
6 x 1 +2 x2x 3 +34=0
SOLUCION:
function [x,iter]=NEWTON_NL(x,prec)
iter=0;

while norm(Fn(x))>prec
iter=iter+1;
x=x-inv(Jn(x))*Fn(x);
if iter>1000
error('parece que newton no converge');
end
end
function z=Fn(x)
z=[7*x(1)*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];
respuesta
>> [x, iter] = NEWTON_NL([10 20 -50]', 0.0001)
x =-4.2313
-1.5675
5.4768

iter = 13

Ejercicio 0.6
Se quiere resolver el sistema de ecuaciones no lineales

x 3+ y3 2 xy =0
x 2+ y 2 1=0

Al ejecutar newton, verifique con los siguientes puntos iniciales

SOLUCION:

1
2 ].

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)-4 6*x(1)+10*x(2)+4
2*x(1) 2*x(2)];
RESPUESTA
>> [x, iter] = NEWTON_NL([1 1]', 0.0001)
x = 0.9569
0.2903
iter = 4
EJERCICIO 4 Se requiere resolver un sistema de ecuaciones no lineales

5 x12 6 x1 x2 5 x22 4 x1 4 x2 4 0
x12 x22 1 0

Al ejecutar newton con un punto inicial

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

1
1 ] y con una precisin de 0.000001

FN
function z=Fn(x)
z=[5*x(1)^2+6*x(1)*x(2)+5*x(2)^2-4*(1)+4*x(2)-4
x(1)^2+x(2)^2-1];

JN
function z=Jn(x)
z=[10*X(1)+6*X(2)-4 6*x(1)+10*x(2)+4
2*x(1) 2*x(2)];

SOLUCION
>>[x,iter]=NEWTON_NL([1 1],0.0000001)
x=
0.9569
0.2903
Iter=
5

EJERCCION 5
Se require resolver el siguiente Sistema de ecuaciones no lineales

x 3 y 3 2 xy 0
x2 y2 1 0

1
Al ejecutar Newton, verifique con los siguientes puntos iniciales 2 ]

Solucion
function [x,iter]=NEWTON_NL(x,prec)
iter=0;

while norm(Fn(x))>prec
iter=iter+1;
x=x-inv(Jn(x))*Fn(x);
if iter>1000
error('parece que newton no converge');
end
end
FN
function z=Fn(x)
z=[x(1)^3+x(2)^3-2*x(1)*x(2)
x(1)^2+x(2)^2-1];
JN
function z=Jn(x)
z=[3*x(1)^2-2*x(2) 3*x(2)^2-2*x(1)
2*x(1) 2*x(2)];

SOLUCION
>>[x,iter]=NEWTON_NL([1 2],0.0000001)
x=0.4498
0.8931
Iter=6

EJERCICIO 6
Se requiere resolver un Sistema de ecuaciones no lineales

2x4 2x2 y y 2 2 y3 y 4 0
3x 2 2 xy 6 y 2 3 0
SOLUCION
function [x,iter]=NEWTON_NL(x,prec)
iter=0;

while norm(Fn(x))>prec
iter=iter+1;
x=x-inv(Jn(x))*Fn(x);
if iter>1000
error('parece que newton no converge');
end
end
FN
function z=Fn(x)
z=[ 2*x(1)^4-2*(x(1)^2)*x(2)+x(2)^2-2*x(2)^3+x(2)^4
3*x(1)^2-2*x(1)*x(2)-6*x(2)^2+3];
JN
function z=Jn(x)
z=[8*x(1)^3-4*x(1)*x(2) -2*x(1)^2+2*x(2)-6*x(2)^2+4*x(2)^3
6*x(1)-2*x(1) -2*x(2)-12*x(2)];
SOLUCION
>>[x,iter]=NEWTON_NL([1 2],0.0000001)
x=0.8920

0.8105

ter=13

You might also like