Академический Документы
Профессиональный Документы
Культура Документы
Jacob White
k −1
⇒ x =
k
∑α w
i =0
i i
k −1
If x =k
∑α w
i =0
i i
k −1
⇒ r = b − Mx = b − ∑ α i Mwi
k k
i =0
Residual Minimizing idea: pick α i ' s to minimize
T
⎛ k −1
⎞ ⎛ k −1
⎞
( ) (r ) = ⎜ b − ∑ α i Mwi ⎟ ⎜ b − ∑ α i Mwi ⎟
T
k 2
r ≡ r k k
2
⎝ i =0 ⎠ ⎝ i =0 ⎠
SMA-HPC ©2003 MIT
Arbitrary Subspace Residual Minimization
methods Computational Approach
k −1 2
Minimizing r k 2
2
= b− ∑ α Mw
i =0
i i is easy if
2
( Mw ) = 0, i ≠ j or ( Mw ) orthogonal to ( Mw )
( Mwi )
T
j i j
( Mw ) ( Mp ) p
T
j −1
For j = 0 to k − 1 p j = w j − ∑
j i
( Mpi ) ( Mpi )
T i
i =0
x =∑
k
k −1
( r ) ( Mp )
0 T
i
k −1
pi = ∑
( r ) ( Mp )
i T
i
pi
( Mpi ) ( Mpi ) ( Mpi ) ( Mpi )
T T
i =0 i =0
M p0
SMA-HPC ©2003 MIT
Minimization Algorithm
Arbitrary Subspace
Solution Algorithm
r 0 = b − Ax 0
For j = 0 to k-1
p j = wj
For i = 0 to j-1 Orthogonalize
p j ← p j − ( Mp j ) ( Mpi ) pi
T
Search Direction
1
pj ← pj Normalize
( Mp ) ( Mp )
T
j j
x j +1
= x + (r j
) ( Mp ) p
j T
j j
Update Solution
r j +1
=r j
− ( r ) ( Mp ) M p
j T
j j
Update Residual
SMA-HPC ©2003 MIT
Arbitrary Subspace Subspace Selection
methods Criteria
1 T
Consider minimizing f ( x ) = x Mx − x b
T
2
Assume M = M (symmetric) and x Mx > 0 (pos. def)
T T
∇ x f ( x ) = Mx − b ⇒ x = M −1b minimizes f
{ ( )
Pick span {w0 ,..., wk −1} = span ∇ x f x ,..., ∇ x f x
0
( k −1
)}
Steepest descent directions for f, but f is not residual
Does not extend to nonsymmetric, non pos def case
{ ( )
Note: span ∇ x f x 0 ,..., ∇ x f x k −1 ( )} {
= span r 0 ,..., r k −1 }
If: span {w0 ,..., wk −1} = span r ,..., r { 0 k −1
}
k −1
then r k = r 0 − ∑ i
α
i =0
Mr i
{
and span r ,..., r0 k −1
} = span {r , Mr ,..., M
0 0 k −1 0
r }
Krylov Subspace
αk =
( r ) ( Mp )
k T
k Determine optimal stepsize in
( Mpk ) ( Mpk ) kth search direction
T
pk +1 = r k +1
−∑
k
( Mr ) ( Mp )
k +1 T
p
j
Compute the new
orthogonalized
( Mp ) ( Mp )
T j
j =0
j j search direction
SMA-HPC ©2003 MIT
The Generalized Conjugate
Residual Algorithm
Krylov Methods
Algorithm Cost for iter k
αk =
( r ) ( Mp )
k T
k Vector inner products, O(n)
( Mpk ) ( Mpk ) Matrix-vector product, O(n) if sparse
T
x k +1 = x k + α k pk
Vector Adds, O(n)
r k +1
= r − α k Mpk
k
pk +1 = r k +1
−∑
( Mr ) ( Mp )
k k +1 T
p
j
O(k) inner products,
( Mp ) ( Mp )
T j
j =0
j j total cost O(nk)
If M is sparse, as k (# of iters) approaches n,
total cost = O (n ) + O (2n ) + .... + O ( kn ) = O (n )
3
p = r −∑
(
k +1
Mr ) ( Mp )
k k +1 T
p ⇒ p =r −
j( Mr ) ( Mp )
p k +1
k +1 T
k
( Mp ) ( Mp )
k +1 k +1
( Mp ) ( Mp )
T j T k
j =0 k k
j j
T (1)
T (0)
Near End Far End
Temperature Discretization Temperature
⎡ 2 −1 ⎤
⎢−1 2 ⎥ Nodal
⎢ ⎥
m ⎢ −1⎥ Equation
⎢ ⎥ Form
⎣ −1 2 ⎦
1 2 3 4 m −1 m
⎡ 2 −1 ⎤
⎢−1 2 ⎥
⎢ ⎥ Nodal
m ⎢ Equation
−1⎥
⎢ ⎥ Form
⎣ −1 2 ⎦
SMA-HPC ©2003 MIT M
“leaky” Example
Krylov Methods
Nodal Formulation Conducting bar and Matrix
T (1)
T (0)
Near End Far End
Temperature Discretization Temperature
⎡2.01 −1 ⎤
⎢ −1 2.01 ⎥ Nodal
⎢ ⎥ Equation
m
⎢ −1 ⎥ Form
⎢ ⎥
⎣ −1 2.01⎦
1 2 3 4 m −1 m
⎡2.01 −1 ⎤
⎢ −1 2.01 ⎥ Nodal
m ⎢ ⎥ Equation
⎢ −1 ⎥ Form
⎢ ⎥
⎣ −1 2.01⎦
SMA-HPC ©2003 MIT M
GCR Performance(Random Rhs)
0
10
R Insulating
E
-1
S 10
Leaky
I
D 10
-2
U
A
L 10
-3
-4
10
0 10 20 30 40 50 60
Iteration
Plot of log(residual) versus Iteration
R
E -1
10
S
I -2
10
D
U -3
10
A Insulating
L -4
10
Leaky
-5
10
0 5 10 15 20 25 30 35 40 45 50
Iteration
{
If span {w0 ,..., wk } = span r 0 , Mr 0 ,..., M k r 0 }
k
x k +1
= ∑α M r
i =0
i
i 0
= ξk ( M ) r 0
i =0
Note: for any α 0 ≠ 0
1
{
span r , r = r − α 0 Mr
0 0 0
}= { 0
span r , Mr 0
}
SMA-HPC ©2003 MIT
Convergence Analysis
Krylov Methods
Basic Properties
k +1 2
polynomial which minimizes r
2
3) r = b − Mx = r − M ξ k ( M )r
k +1 k +1 0 0
= ( I − M ξ k ( M ) ) r ≡℘k +1 ( M ) r
0 0
minimizing r k +1 2
subject to ℘k +1 ( 0 ) =1
2
SMA-HPC ©2003 MIT
Convergence Analysis
Krylov Methods
Optimality of GCR poly
⎡ 1 −1 0 0 ⎤
⎡1.1 −1⎤ ⎢ −1 1 0 0 ⎥ Eigenvalues?
⎢ −1 1.1⎥ ⎢ ⎥ Eigenvectors?
⎣ ⎦ ⎢ 0 0 1 −1⎥
⎢ ⎥
⎣ 0 0 −1 2 ⎦
⎡ M 11 0 0 ⎤
⎢M M 22 ⎥
⎢ 21 ⎥ What about a lower
⎢ 0 ⎥ triangular matrix
⎢ ⎥
⎢⎣ M N 1 M NN −1 M NN ⎥⎦
SMA-HPC ©2003 MIT
Eigenvalues and A Simplifying
Vectors Review Assumption
Almost all NxN matrices have N linearly
independent Eigenvectors
⎡↑ ↑ ↑ ↑⎤
M ⎢
⎢u1 u2 u3
⎥
uN ⎥
⎢↓ ↓ ↓ ↓ ⎥⎦
⎣
⎡ ↑ ↑ ↑ ↑ ⎤
⎢ ⎥
= ⎢λ1u1 λ2u2 λ3u3 λN u N ⎥
⎢ ↓ ↓ ↓ ↓ ⎥⎦
⎣
The set of all eigenvalues of M is known as
the Spectrum of M
SMA-HPC ©2003 MIT
Eigenvalues and A Simplifying
Vectors Review Assumption Continued
Almost all NxN matrices have N linearly
independent Eigenvectors
⎡λ1 0 0⎤
MU =U ⎢0
⎢
⎢⎣ 0 0
0 ⎥⎥
λN ⎥⎦
U MU = λ or M = U λU
−1 −1
λi
Re ( λ )
T (1)
T (0)
+ +
- -
vs = T(0) vs = T(1)
Eigenvalues N=20
Given a polynomial
f ( x ) = a0 + a1 x + … + a p x p
Then
spectrum ( f ( M ) ) = f ( spectrum ( M ) )
⇒ M = Uλ U
p p −1
Factoring f ( M ) = U ( a0 I + a1λ + … + a p λ p
)U −1
Diagonal
f ( M ) U = U ( a0 I + a1λ + … + a p λ p
)
SMA-HPC ©2003 MIT
Useful Spectral
Eigenproperties Decomposition