270 likes | 554 Vues
Special Matrices. Banded matrices Solutions to problems that depend on their neighbours eg 1D T i = f(T i-1 ,T i+1 ) 2D T i,j = f(T i-1,j ,T i+1,j ,T i,j -1 ,T i,j +1 ). Tridiagonal Matrices. Tridiagonal Matrix Algorithm. TDMA procedure. Iterative Methods.
E N D
Special Matrices Banded matrices Solutions to problems that depend on their neighbours • eg 1D Ti = f(Ti-1,Ti+1) • 2D Ti,j = f(Ti-1,j,Ti+1,j ,Ti,j -1,Ti,j +1)
Iterative Methods • Often much better on sparse matrices than direct solvers • Idea: • guess {x} • use in an approximation of [A] {x}= {b} to get new values of {x} • repeat until {x} is not changing much • Pros: • much less effort / faster • less problems with roundoff
Point-Jacobi • rearrange equation set so that you get series of xi = fn(other x’s) • pick order so that using the xiwith the largest coefficient in each equation • guess value for xi, then iterate 6 x1 - 2 x2 + x3 = 11 x1 + 2 x2 - 5 x3 = -1 -2 x1 + 7 x2 + 2 x3 = 5
Jacobi Iteration • Rearrange x1 = 1/6 (11 + 2 x2 - x3 ) x2 = 1/7 ( 5 + 2 x1 - 2 x3) x3 = 1/5 (1 + x1 + 2 x2 ) • Iterate x1n+1 = 1/6 (11 + 2 x2n - x3n ) x2n+1 = 1/7 ( 5 + 2 x1n - 2 x3n) x3n+1 = 1/5 (1 + x1n + 2 x2n) • Guess, plugin, repeat n 0 x1 0 x2 0 x3 0
Importance of diagonal dominance Simple example
Convergence Formally
Convergence criteria How to judge whether solution is “close enough”
Gauss-Seidal • In Point-Jacobi technique, we use “old” values of xi throughout each iteration • but we are calculating “new” values all the way through the procedure • if we use these “new” values on the RHS’s, this is Gauss-Seidal
Under-relaxation and Over-relaxation xin = xin-1 + (xin - xin-1) New value depends on 0 < < 1 > 1 = 1
Q2in, C2in Q3out, C3 Q23, C2 2, V2 3, V3 Q21, C2 Q12, C1 Q13, C1 1, V1 Q1in, C1in Engineering examples Concentrations in a series of connected tanks (steady state) mass balances
Engineering examples - Forces on truss FaextV Sum of forces at each node = 0 (both vertical & horizontal) a Fab Fac FbextH b Fbc c FbextV FcextV
Trusses Forces on trusses loads: • dead weight • live (train) weight • wind loads • seismic