Escolar Documentos
Profissional Documentos
Cultura Documentos
𝑘+1 𝑘 𝑘+1 𝑘
• Seja 𝑥 −𝑥 = max 𝑥𝑖 − 𝑥𝑖
1≤𝑖≤𝑛
• Se lim 𝑥 𝑘+1 − 𝑥 𝑘 = 0 então 𝑥 1 ,𝑥 2 , ..., 𝑥 𝑛 , ...; convergem
𝑘→∞
quando 𝑘 → ∞.
Solução Numérica de Sistemas Lineares
• Dado A𝑥 = 𝐵 tem-se varias maneiras de se obter 𝑥 = 𝐹𝑥 + 𝑑, por
exemplo:
• A𝑥 + 𝐼𝑥 = 𝐵 + 𝐼𝑥, 𝐼 é a matriz identidade
• A𝑥 + 𝐼𝑥 − 𝐵 = 𝐼𝑥
• 𝑥 = 𝐴+𝐼 𝑥−𝐵
Solução Numérica de Sistemas Lineares
• Método de Jacobi: Seja o sistema linear
𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛−1 𝑥𝑛−1 + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛−1 𝑥𝑛−1 + 𝑎2𝑛 𝑥𝑛 = 𝑏2
• …
𝑎𝑛−11 𝑥1 + 𝑎𝑛−12 𝑥2 + ⋯ + 𝑎𝑛−1𝑛−1 𝑥𝑛−1 + 𝑎𝑛−1𝑛 𝑥𝑛 = 𝑏𝑛−1
𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ + 𝑎𝑛𝑛−1 𝑥𝑛−1 + 𝑎𝑛𝑛 𝑥𝑛 = 𝑏𝑛
• Podemos isolar 𝑥1 , 𝑥2 , ..., 𝑥𝑛 nas equações do sistema linear do
seguinte modo
Solução Numérica de Sistemas Lineares
𝑏1 −𝑎12 𝑥2 −⋯−𝑎1𝑛−1 𝑥𝑛−1 −𝑎1𝑛 𝑥𝑛
𝑥1 =
𝑎11
𝑏2 −𝑎21 𝑥1 −⋯−𝑎2𝑛−1 𝑥𝑛−1 −𝑎2𝑛 𝑥𝑛
𝑥2 =
𝑎22
• …
𝑏𝑛−1 −𝑎𝑛−11 𝑥1 −𝑎𝑛−12 𝑥2 −⋯−𝑎𝑛−1𝑛 𝑥𝑛
𝑥𝑛−1 =
𝑎𝑛−1𝑛−1
𝑏𝑛 −𝑎𝑛1 𝑥1 −𝑎𝑛2 𝑥2 −⋯−𝑎𝑛𝑛−1 𝑥𝑛−1
𝑥𝑛 =
𝑎𝑛𝑛
• Precisamos que 𝑎𝑗𝑗 ≠ 0, ∀𝑖. Caso isso não ocorra as equações devem
ser reagrupadas para que se obtenha isso.
Solução Numérica de Sistemas Lineares
• O sistema A𝑥 = 𝐵 foi colocado na forma 𝑥 = 𝐹𝑥 + 𝑑, onde
𝑏1
𝑎11 𝑎1𝑛−1 𝑎1𝑛
𝑥1 0 −
𝑎12
… − −
𝑏2 𝑎11 𝑎11
𝑎21 𝑎11
𝑥2 𝑎22 − … −
𝑎2𝑛−1
−
𝑎2𝑛
•𝑥= … ,𝑑 = … e𝐹 = 𝑎22 0 𝑎22 𝑎22
𝑥𝑛−1 𝑏𝑛−1 … … … … …
𝑥𝑛 𝑎𝑛−1𝑛−1 𝑎𝑛1 𝑎𝑛2 𝑎𝑛3
− − − … 0
𝑏𝑛 𝑎𝑛𝑛 𝑎𝑛𝑛 𝑎𝑛𝑛
𝑎𝑛𝑛
Solução Numérica de Sistemas Lineares
• O método de Jacobi funciona do seguinte modo:
• a) Escolhe-se uma aproximação inicial 𝑥 0 .
𝑘
• b) Geram-se aproximações sucessivas de 𝑥 a partir da
iteração𝑥 𝑘+1 = 𝐹𝑥 𝑘 + 𝑑, 𝑘 = 0, 1, 2, 3, …
𝑘+1 𝑘
max 𝑥𝑖 −𝑥𝑖
• c) Continua-se a gerar aproximações até que 1≤𝑖≤𝑛 𝑘+1 ≤ 𝜀 ou
max 𝑥𝑖
1≤𝑖≤𝑛
até que o numero de iterações atinja um valor determinado.
Solução Numérica de Sistemas Lineares
• Exemplo: Solucionar o seguinte sistema com o método de Jacobi e
2𝑥1 − 𝑥2 = 1
com a tolerância desejada. e 𝜀 = 0,01 ou k=6.
𝑥1 + 2𝑥2 = 3
1
𝑥1𝑘+1 = 1 + 𝑥2𝑘
2
• Temos que 1
𝑥2𝑘+1 = 3 − 𝑥1𝑘
2
0 𝑇
• Tomando como aproximação inicial para a sequencia 𝑥 = 0 0
• Assim
Solução Numérica de Sistemas Lineares
1 1 1
𝑥11 = 1+ 𝑥20 = 1 + 0 = = 0,5
2 2 2 1 𝑇
• 1 1 3 𝑥 = 0,5 1,5
𝑥21 = 3 − 𝑥10 = 3 − 0 = = 1,5
2 2 2
1 1
𝑥12 = 1+ 𝑥21 = 1 + 1,5 = 1,25
2 2 2 𝑇
• 1 1 𝑥 = 1,25 1,25
𝑥22 = 3 − 𝑥11 = 3 − 0,5 = 1,25
2 2
2 1
max 𝑥𝑖 −𝑥𝑖 max 1,25−0,5 , 1,25−1,5 0,75
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 2 = = = 0,6 > 𝜀
max 𝑥𝑖 max 1,25 , 1,25 1,25
1≤𝑖≤𝑛 1≤𝑖≤𝑛
Solução Numérica de Sistemas Lineares
1 1
𝑥13 = 1+ 𝑥22 = 1 + 1,25 = 1,125
2 2 3 𝑇
• 1 1 𝑥 = 1,125 0,875
𝑥23 = 3 − 𝑥12 = 3 − 1,25 = 0,875
2 2
3 2
max 𝑥𝑖 −𝑥𝑖 max 1,125−1,25 , 0,875−1,25 0,375
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 3 = = = 0,33 > 𝜀
max 𝑥𝑖 max 1,125 , 0,875 1,125
1≤𝑖≤𝑛 1≤𝑖≤𝑛
1 1
𝑥14 = 1+ 𝑥23 = 1 + 0,875 = 0,9375
2 2 4 𝑇
• 1 1 𝑥 = 0,9375 0,9375
𝑥24 = 3 − 𝑥13 = 3 − 1,125 = 0,9375
2 2
4 3
max 𝑥𝑖 −𝑥𝑖 max 0,9375−1,125 , 0,9375−0,875 0,0625
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 4 = = = 0,06 > 𝜀
max 𝑥𝑖 max 0,9375 , 0,9375 0,9375
1≤𝑖≤𝑛 1≤𝑖≤𝑛
Solução Numérica de Sistemas Lineares
1 1
𝑥15
= 1+ 𝑥24 = 1 + 0,9375 = 0,9686
2 2 5 𝑇
• 1 1 𝑥 = 0,9686 1,03125
5
𝑥2 = 3 − 𝑥14 = 3 − 0,9375 = 1,03125
2 2
5 4
max 𝑥𝑖 −𝑥𝑖 max 0,9686−0,9375 , 1,03125−0,9375 0,09375
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 5 = = = 0,09 > 𝜀
max 𝑥𝑖 max 0,9686 , 1,03125 1,03125
1≤𝑖≤𝑛 1≤𝑖≤𝑛
1 1
𝑥16 = 1+ 𝑥25 = 1 + 1,03125 = 1,01562
2 2 6 𝑇
• 1 1 𝑥 = 1,01562 1,0157
𝑥26 = 3− 𝑥15 = 3 − 0,9686 = 1,0157
2 2
6 5
max 𝑥𝑖 −𝑥𝑖 max 1,01562−0,9686 , 1,0157−1,03125 0,01555
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 5 = = = 0,015 > 𝜀 ,
max 𝑥𝑖 max 1,01562 , 1,0157 1,0157
1≤𝑖≤𝑛 1≤𝑖≤𝑛
mas n=6.
Solução Numérica de Sistemas Lineares
• Método de Gauss-Seidel: Seja o sistema A𝑥 = 𝐵. O método de Gauss-
Seidel consiste em:
• a) Partindo-se de uma aproximação inicial 𝑥 0
• Assim
1 1 1
𝑥11 = 1+ 𝑥20 = 1+0 = = 0,5
2 2 2 1 𝑇
• 1 1 2,5 𝑥 = 0,5 1,25
𝑥21 = 3− 𝑥11 = 3 − 0,5 = = 1,25
2 2 2
Solução Numérica de Sistemas Lineares
1 1
𝑥12 = 1+ 𝑥21 = 1 + 1,25 = 1,125
2 2 2 𝑇
• 1 1 𝑥 = 1,125 0,9375
𝑥22 = 3− 𝑥12 = 3 − 1,125 = 0,9375
2 2
2 1
max 𝑥𝑖 −𝑥𝑖 max 1,125−0,5 , 0,9375−1,25 0,625
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 2 = = = 0,55 > 𝜀
max 𝑥𝑖 max 1,125 , 0,9375 1,125
1≤𝑖≤𝑛 1≤𝑖≤𝑛
1 1
𝑥13
= 1+ 𝑥22 = 1 + 0,9375 = 0,96875
2 2 3 𝑇
• 1 1 𝑥 = 0,96875 1,01562
3
𝑥2 = 3 − 𝑥13 = 3 − 0,96875 = 1,01562
2 2
3 2
max 𝑥𝑖 −𝑥𝑖 max 0,96875−1,125 , 1,01562−0,9375 0,15625
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 3 = = = 0,15 > 𝜀
max 𝑥𝑖 max 0,96875 , 1,01562 1,01562
1≤𝑖≤𝑛 1≤𝑖≤𝑛
Solução Numérica de Sistemas Lineares
1 1
𝑥14 = 1+ 𝑥23 = 1 + 1,01562 = 1,00781
2 2 4 𝑇
• 1 1 𝑥 = 1,00781 0,99609
𝑥24 = 3 − 𝑥14 = 3 − 1,00781 = 0,99609
2 2
4 3
max 𝑥𝑖 −𝑥𝑖 max 1,00781−0,96875 , 0,99609−1,01562 0,03906
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 4 = = = 0,03 > 𝜀
max 𝑥𝑖 max 1,00781 , 1,01562 1,01562
1≤𝑖≤𝑛 1≤𝑖≤𝑛
1 1
𝑥15 = 1+ 𝑥24 = 1 + 0,99609 = 0,99804
2 2 5 𝑇
• 1 1 𝑥 = 0,99804 1,00098
𝑥25 = 3 − 𝑥15 = 3 − 0,99804 = 1,00098
2 2
5 4
max 𝑥𝑖 −𝑥𝑖 max 0,99804−1,00781 , 1,00098−0,99609 0,00977
1≤𝑖≤𝑛 1≤𝑖≤𝑛
• 5 = = = 0,009 < 𝜀
max 𝑥𝑖 max 0,99804 , 1,00098 1,00098
1≤𝑖≤𝑛 1≤𝑖≤𝑛