You are on page 1of 3

PRACTICA G-S G-J

Sea la Matriz:

A A

1 1

- 1

b

1 = m3 de cada material a extraer en

CREANDO PROGRAMA EN GAUSS SEIDEL

CONGS(A , b , n) :=

for

i 0

n

T

T

for

j 0

L i, j

D i, j

U i, j

n

A i, j

if

i > j

0

otherwise

A i, j

if

i = j

0

otherwise

A i, j

if

i < j

0

otherwise

gs

 -

(L + D)

- 1

U

gs

CONGS A

A

(

1 1

,

b

1 ,2

)

= T gs

:=

0

0

0

-0.385

0.231

0

-0.481

-0.112

0.218 0
eigenvals T
(
)
=
0.231
gs
0.218
CONGJ(A, b , n) :=
for
i  0
n
for
j 
0
n
if
i > j
L i, j
A i, j
0
otherwise
U
if
i < j
i, j
A i, j
0 otherwise
D
if
i = j
i, j
A i, j
0 otherwise
D - 1
 -
(L + U)
T gj
T gj
CONGJ A
(
A
,
b
1 ,2
)
=
1 1

T gj

:=

0

-0.6

-0.327

-0.385

-0.481

0

0 -0.4

-0.545

(

eigenvals T

gj

)

=

-0.913

0.457

0.457

+ 0.138i

- 0.138i

y :=

1

1

1

(

GJ A

1

,

b

1

 X  y for i  0 n for j  0 n L i, j  A i, j if 0 D i, j  A i, j if 0 U i, j  A i, j if 0 for k  0 m X  - D - 1 S k+1, 1  X 0 S k+1, 2  X 1 S k+1, 3  X 2 S S  0.52 0.2 0 0.25  1  0 :=   0.3 0.5 0.2 0   b 1 := 0 1  0.18 0.3  0 0.55  9229.903846 2 0 -211.433566 3 0 8008.412332 0 367.416542 5 0 7311.950532 6 0 972.064112 7 0 6769.467411 8 0 1483.307886 9 0

GJ(A, b , x, n, m) :=

)

A 1

=

4

i > j

otherwise

i = j

otherwise

i < j

otherwise

(L + U)X

+

4800

5810

5690

, y, 2, 70

D

- 1

b