Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Examen Ejercicio 3.

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Método de Thomas

Net := 10

0 1 3  10 


       
4 2 6  20 
6 3 9  30 
8 4  12   40 
       
10 5 15 50 
AT :=   BT :=   CT :=   DT := 
 12  6  18   60 
 14  7  21   70 
       
 16  8  24   80 
 18  9  17   90 
       
 20   10  0  100 

CT DT
1 1
pT := qT :=
1 BT 1 BT
1 1

Ciclo para p

j := 2 .. Net

CT DT - AT  qT
j j j j -1
pT := qT :=
j BT - AT  pT j BT - AT  pT
j j j -1 j j j -1

1 1
1 3 1 10
2 -0.6 2 2
3 1.36364 3 2.72727
4 -1.73684 4 -2.63158
pT = 5 0.67059 qT = 5 3.41176
6 -8.7931 6 -9.31034
7 0.16141 7 1.53989
8 4.43014 8 10.21918
9 -0.24031 9 1.32799
10 0 10 4.96011

x := qT
Net Net
j := Net - 1 .. 1

x := qT - pT1 x
j j j j +1
1 -8.74892
2 6.24964
3 7.08273
4 -3.194
x= 5 -0.32382
6 5.57061
7 1.69234
8 -0.94452
9 2.51994
10 4.96011

1 3 0 0 0 0 0 0 0 0 
 
4 2 6 0 0 0 0 0 0 0

0 6 3 9 0 0 0 0 0 0 
0 0 8 4 12 0 0 0 0 0 
 
0 0 0 10 5 15 0 0 0 0 
M := 
0 0 0 0 12 6 18 0 0 0 
0 0 0 0 0 14 7 21 0 0

 
0 0 0 0 0 0 16 8 24 0 
0 0 0 0 0 0 0 18 9 27 
 
0 0 0 0 0 0 0 0 20 10 

sol := lsolve( M , DT)

1 1
1 -15.89642 1 -8.74892
2 8.63214 2 6.24964
3 11.05357 3 7.08273
4 -6.10595 4 -3.194
sol = 5 -2.0004 x= 5 -0.32382
6 8.07076 6 5.57061
7 1.97668 7 1.69234
8 -2.70607 8 -0.94452
9 2.91757 9 2.51994
10 4.16485 10 4.96011

You might also like