L06 - Solution To A System of Linear Algebraic Equations
L06 - Solution To A System of Linear Algebraic Equations
▪ Line-by-line Methods
› Where Nnbu,k denotes the number of neighboring nodes to node k that have
already been updated,
› Nnb,k − Nnbu,k is the number of neighboring nodes to node k that have not been
updated and are treated explicitly.
Step 3: Compute the residual vector using φ(n+1), and then compute R2(n+1).
Step 4: Monitor convergence, i.e., check if R2(n+1) < εtol? If YES, then go to Step
5. If NO, then go to Step 2.
Step 5: Stop iteration and postprocess the results.
› In summary, two popular point-wise iteration schemes have been presented and
demonstrated.
› The Gauss–Seidel method was found to be twice as effective as the Jacobi
method.
› Both schemes have the advantage that they are simple to implement and are
applicable to any mesh topology.
› Although the convergence is slow, the cost per iteration of both methods is also
very low, making them attractive choices.
› However, their major shortcoming is that both schemes scale poorly, and the
number of iterations go up by a factor of four when the number of nodes is
increased by a factor of four.
25000
SOR 1.7 GS 1 No if statement for lamda
20000
Time, sec
15000
10000
5000
0
0 2000 4000 6000 8000 10000 12000
Number of equtions
30000
10000
5000
0
0 2000 4000 6000 8000 10000 12000
Number of equtions
Step 2: Set up a tridiagonal matrix system to solve for the j-th row.
– This entails filling up matrix elements for d, c, a, and Q
Step 3: Solve the tridiagonal system of equations using the algorithm described
before and update the value of φ(n + 1) of the j-th row
Line-by-line Method
Step 5: Compute the residual vector using φ(n + 1), and then compute R2(n + 1).
Step 6: Monitor convergence, i.e., check if R2(n + 1) < εtol? If YES, then go to Step
7. If NO, then go to Step 2.
▪ the global aspect ratio of the geometry (whether it is long or short or fairly
isotropic),
› The developer has no prior knowledge of what geometry the solver might be
applied to, what mesh might be used, or what boundary conditions might be
applied.
› To avoid drastic changes in convergence behavior with direction of sweep, it is
customary to alter the direction of sweep at each iteration.
› Hence, a row-wise sweep of the whole domain is followed by a column-wise
sweep and vice versa, where each row-wise or column-wise sweep of the entire
computational domain counts as one iteration.
› This method is known as the alternating direction implicit (ADI) method.
› The method is popular because it is easy to implement, while at the same time,
yields reasonably rapid convergence at a low computational cost.
1.00E+04
1.00E+03 ADI
1.00E+02 R
1.00E+01 C
Residual, R2
1.00E+00
1.00E-01
1.00E-02
1.00E-03
1.00E-04
1.00E-05
1.00E-06
0 50 100 150 200 250 300 350 400 450
Number of iteration
› Thus far, three iterative solvers with increasing degrees of implicitness have
been discussed.
› The convergence was found to improve with an increase in the degree of
implicitness.
› Out of the three solvers, the line-by-line method is applicable only to structured
mesh computations.
› The three solvers, discussed thus far, are often referred to as classical iterative
solvers, in which the explicit versus implicit terms are clearly identifiable.
› Considered one of the most efficient solvers for banded systems arising out of
discretization of a multidimensional PDE.
› Let us consider the system of equations shown
› Using the global nodal index k: Such that the diagonal is positive
▪ Where
▪ The correction in the solution from
› Next, Stone proposed factorizing the matrix [A] into a lower triangular matrix
[L], and an upper triangular matrix [U].
Solve for Yn
Solve for n
› The product [L][U] results in a matrix › The relationship between the seven
that has seven bands bands and the coefficients of the [L] and
[U] matrices
[A]
ME 626 ADVANCED NUMERICAL METHODS 7/13/2019 46
Stone’s Strongly Implicit Method
› [A] has five bands, while the product of [L] and [U] results in seven bands.
› This implies that Stone’s proposition of factorizing [A] exactly into [L] and [U]
matrices, with each of these matrices having only three bands, is not realizable.
› Stone realized that even if [A] can be factorized approximately into [L] and
[U], it still serves the needs of the task at hand.
› If the factorization [A] = [L][U] were exact, the correction [(n)] would be such
that, when added to [φ(n)], the result would be the exact solution to [A][φ] =
[Q].
› Therefore, Stone set his goal on approximate factorization of the matrix [A]
› [A] only has five terms → The last two terms are missing
› Therefore, in order to establish an equivalence between [A] and [L][U], the last
two terms shown in the expression above must be somehow eliminated.
› Therefore,
› = Stone’s factor, should have a value close to unity, and could be adjusted
arbitrarily to attain faster convergence.
› Substituting into
500.0 Gauss–Seidel
SOR
400.0 Gauss Elimination
ADI
Time, min
300.0
200.0
100.0
0.0
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
Number of equtions