程序代写代做 26/02/2020

26/02/2020
MAT6669 Heat and Materials with Application 1
MAT6669
Numerical modelling of heat transfer
Part 3
An implicit finite difference scheme
The Gauss-Seidel method
Magnus Anderson and Karl Travis

Gauss-Seidel
𝐴𝑥=𝑏
The Gauss-Seidel method is an iterative approach which can be readily applied to sparse matrix problems, improving computation time.
New iteration
Sum uses latest approximation
1𝑖−1 𝑛
Sum uses previous approximation
𝑥𝑘+1=
𝑖𝐴𝑖𝑖𝑖𝑖,𝑗𝑗 𝑖,𝑗𝑗
𝑏−෍𝐴 𝑥𝑘+1−෍𝐴 𝑥𝑘
Where 𝑥𝑘+1 is the latest approximation and 𝑥𝑘 𝑖𝑗
For comparison, the Jacobi scheme is;
1𝑛
𝑥𝑘+1= 𝑏−෍𝐴 𝑥𝑘 𝑖 𝐴𝑖𝑖𝑖 𝑖,𝑗𝑗
𝑗≠𝑖
𝑗=1
𝑗=𝑖+1
is the old approximation.
Sum uses previous approximation
26/02/2020
MAT6669 Heat and Materials with Application 2

Gauss-Seidel
We do not need to transform our n × 𝑚 matrix into a vector when using this technique. Let 𝑇𝑘 and 𝑇𝑘+1 refer to the previous and current iterations and 𝐴∗ refer to the
𝑖𝑗 𝑖𝑗 𝑖,𝑗
coefficients obtained from applying finite differences to the partial differential equation.
1𝑖−1 𝑛
𝑇𝑘+1 = 𝑏 −෍𝐴∗ 𝑇𝑘+1 − ෍ 𝐴∗ 𝑇𝑘 𝑖𝑗 𝐴𝑖𝑖 𝑖 𝑖,𝑗 𝑖𝑗 𝑖,𝑗 𝑖𝑗
𝑗=1 𝑗=𝑖+1
To assess convergence, we keep a copy of the previous approximation, and compare the relative difference between the two iterations. The maximum relative error may be calculated, and compared to an acceptable limit (1E-4). Avoid dividing by zero.
𝑇𝑘+1 − 𝑇𝑘
26/02/2020
MAT6669 Heat and Materials with Application 3
𝑒𝑟𝑟𝑜𝑟 = 𝑚𝑎𝑥
𝑖𝑗
𝑖𝑗
𝑇𝑘+1 𝑖𝑗

Top left corner
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1,𝑚 𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚 𝑇𝑛 , 𝑚
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
Finite difference scheme
1+4F +4BF 𝑇p+1−2F𝑇p+1−2F𝑇p+1=𝑇𝑝 +4BF𝑇 o io 1,1 o2,1 o1,2 1,1 io∞
Gauss-Seidel calculation
1 𝑇𝑝 +4BF𝑇 +2F𝑇p+1+2F𝑇p+1 1+4Fo+4BiFo 1,1 i o ∞ o 2,1 o 1,2
𝑇𝑛+1= 1,1
26/02/2020
MAT6669 Heat and Materials with Application
4

Top edge
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1,𝑚 𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚 𝑇𝑛 , 𝑚
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
Finite difference scheme
1+4𝐹 +2𝐹B 𝑇p+1−2𝐹𝑇p+1−𝐹𝑇p+1 −𝐹𝑇p+1 =𝑇𝑝 +2𝐹B𝑇
𝑜
𝑇p+1 = 1,𝑗
𝑜 i 1,𝑗 𝑜 2,𝑗 𝑜 1,𝑗−1 𝑜 1,𝑗+1 1,𝑗 𝑜 i ∞
Gauss-Seidel calculation
1 𝑇𝑝 +2𝐹B𝑇 +2𝐹𝑇p+1+𝐹𝑇p+1 +𝐹𝑇p+1 1+4𝐹 +2𝐹B 1,𝑗 𝑜 i ∞ 𝑜 2,𝑗 𝑜 1,𝑗−1 𝑜 1,𝑗+1
26/02/2020
MAT6669 Heat and Materials with Application
5
𝑜𝑜i

Top right corner
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1,𝑚 𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚 𝑇𝑛 , 𝑚
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
Finite difference scheme
1+4F +4BF 𝑇p+1 −2F 𝑇p+1 −2F 𝑇p+1 =𝑇𝑝 +4BF 𝑇
o
𝑇p+1= 1,𝑚
i o 1,𝑚 o 2,𝑚 o 1,𝑚−1 1,𝑚 i o ∞
Gauss-Seidel calculation
1 𝑇𝑝 +4BF𝑇 +2F𝑇p+1+2F𝑇p+1 1+4Fo+4BiFo 1,𝑚 i o ∞ o 2,𝑚 o 1,𝑚−1
26/02/2020
MAT6669 Heat and Materials with Application
6

Left edge
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1,𝑚 𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚 𝑇𝑛 , 𝑚
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
Finite difference scheme
1+4𝐹 +2B𝐹 𝑇p+1−𝐹𝑇p+1 −𝐹𝑇p+1 −2𝐹𝑇p+1=𝑇𝑝 +2B𝐹𝑇
0
𝑇p+1= i,1
i 0 𝑖,1 0 𝑖+1,1 0 𝑖−1,1 0 𝑖,2 𝑖,1 i 0 ∞
Gauss-Seidel calculation
1 𝑇𝑝 +2B𝐹𝑇 +𝐹𝑇p+1 +𝐹𝑇p+1 +2𝐹𝑇p+1 1+4𝐹+2B𝐹 𝑖,1 i 0 ∞ 0 𝑖+1,1 0 𝑖−1,1 0 𝑖,2
26/02/2020
MAT6669 Heat and Materials with Application
7
0i0

Interior
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
𝑇1,𝑚 𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚 𝑇𝑛 , 𝑚
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
𝑇p+1 𝑖,𝑗
1 + 4F0
Finite difference scheme
− F0𝑇p+1 − F0𝑇p+1 − F0𝑇p+1 − F0𝑇p+1 = 𝑇𝑝 𝑖+1,𝑗 𝑖−1,𝑗 𝑖,𝑗+1 𝑖,𝑗−1 𝑖,𝑗
Gauss-Seidel calculation
𝑇𝑝 + F0𝑇p+1 + F0𝑇p+1 + F0𝑇p+1 + F0𝑇p+1 𝑖,𝑗 𝑖+1,𝑗 𝑖−1,𝑗 𝑖,𝑗+1 𝑖,𝑗−1
𝑇p+1 = 1,𝑚
1
1 + 4F0
26/02/2020
MAT6669 Heat and Materials with Application
8

Right edge
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1,𝑚
𝑇𝑛 , 𝑚
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
𝑇p+1= 𝑖,𝑚
Gauss-Seidel calculation
1 𝑇𝑝 +2FB𝑇 +F𝑇p+1 +2F𝑇p+1 +F𝑇p+1 1+4Fo+2FoBi 𝑖,𝑚 o i ∞ o 𝑖+1,𝑚 o 𝑖,𝑚−1 o 𝑖−1,𝑚
Finite difference scheme
1+4F +2F B 𝑇p+1−F 𝑇p+1 −2F 𝑇p+1 −F 𝑇p+1 =𝑇𝑝 +2F B𝑇 o o i 𝑖,𝑚 o𝑖+1,𝑚 o𝑖,𝑚−1 o𝑖−1,𝑚 𝑖,𝑚 o i∞
26/02/2020
MAT6669 Heat and Materials with Application
9
𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚

Bottom left corner
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1,𝑚 𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚 𝑇𝑛 , 𝑚
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
Finite difference scheme
1+4F +4BF 𝑇p+1−2F𝑇p+1 −2F𝑇p+1=𝑇𝑝 +4BF𝑇 o io 𝑛,1 o𝑛−1,1 o𝑛,2 𝑛,1 io∞
𝑇p+1 = 1,𝑚
Gauss-Seidel calculation
1 𝑇𝑝 +4BF 𝑇 +2F 𝑇p+1 +2F 𝑇p+1 1+4Fo+4BiFo 𝑛,1 i o ∞ o 𝑛−1,1 o 𝑛,2
26/02/2020
MAT6669 Heat and Materials with Application
10

Bottom edge
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1,𝑚 𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚 𝑇𝑛 , 𝑚
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
Finite difference scheme
𝑇p+1 1+4𝐹 +2𝐹B −𝐹𝑇p+1 −2𝐹𝑇p+1 −𝐹𝑇p+1 =𝑇𝑝 +2𝐹B𝑇
𝑛,𝑗
𝑜 𝑜 i 𝑜𝑛,𝑗−1 𝑜𝑛−1,𝑗 𝑜𝑛,𝑗+1 𝑛,𝑗 𝑜 i∞
Gauss-Seidel calculation
1 𝑇𝑝 +2𝐹B𝑇 +𝐹𝑇p+1 +2𝐹𝑇p+1 +𝐹𝑇𝑝+1 1+4𝐹+2𝐹B 𝑛,𝑗 𝑜 i ∞ 𝑜 𝑛,𝑗−1 𝑜 𝑛−1,𝑗 𝑜 𝑛,𝑗+1
𝑇p+1 = 1,𝑚
𝑜𝑜i
26/02/2020
MAT6669 Heat and Materials with Application
11

Bottom right corner
𝑇1 , 1 𝑇1,2 𝑇2,1 𝑇2,2 𝑇3,1 𝑇3,2 𝑇…,1 𝑇…,2
𝑻= 𝑇𝑖,1 𝑇𝑖,2 𝑇…,1 𝑇…,2 𝑇𝑛 − 2 , 1 𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 1 𝑇𝑛 − 1 , 𝑇𝑛 , 1 𝑇𝑛 , 2
𝑇1,3 𝑇2,3 𝑇3,3 𝑇…,3 𝑇𝑖 , 3 𝑇…,3
𝑇𝑛 − 2 , 𝑇𝑛 − 1 , 𝑇𝑛 , 3
𝑇1,… 𝑇2,… 𝑇3,… 𝑇…,… 𝑇𝑖,… 𝑇…,… 𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇1 , … 𝑇1 , 𝑚 − 2 𝑇1 , 𝑚 − 1 𝑇2,… 𝑇2,𝑚−2 𝑇2,𝑚−1 𝑇3,… 𝑇3,𝑚−2 𝑇3,𝑚−1 𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
𝑇1,𝑚 𝑇2,𝑚 𝑇3,𝑚 𝑇…,𝑚 𝑇𝑖,𝑚 𝑇…,𝑚 𝑇𝑛 − 2 , 𝑚 𝑇𝑛 − 1 , 𝑚 𝑇𝑛 , 𝑚
𝑇1 , 𝑗
𝑇2,𝑗
𝑇3,𝑗
𝑇…,𝑗
𝑇𝑖,𝑗 𝑇𝑖,… 𝑇𝑖,𝑚−2 𝑇𝑖,𝑚−1
2 2
3 3
𝑇𝑛 − 2 , … 𝑇𝑛 − 1 , … 𝑇𝑛 , …
𝑇𝑛 − 2 , 𝑚 − 2 𝑇𝑛 − 1 , 𝑚 − 2 𝑇𝑛 , 𝑚 − 2
𝑇𝑛 − 2 , 𝑚 − 1 𝑇𝑛 − 1 , 𝑚 − 1 𝑇𝑛 , 𝑚 − 1
𝑇…,𝑗 𝑇𝑛 − 2 , 𝑗 𝑇𝑛 − 1 , 𝑗 𝑇𝑛 , 𝑗
𝑇…,… 𝑇…,𝑚−2 𝑇…,𝑚−1
Finite difference scheme
1+4F +4BF 𝑇p+1 −2F 𝑇p+1 −2F 𝑇p+1 =𝑇𝑝 +4BF 𝑇 o i o 𝑛,𝑚 o 𝑛−1,𝑚 o 𝑛,𝑚−1 𝑛,𝑚 i o ∞
Gauss-Seidel calculation
1 𝑇𝑝 +4BF 𝑇 +2F 𝑇p+1 1+4Fo+4BiFo 𝑛,𝑚 i o ∞ o 𝑛−1,𝑚
𝑇p+1 = 1,𝑚
+2F 𝑇p+1
o 𝑛,𝑚−1
26/02/2020
MAT6669 Heat and Materials with Application
12