32
Challenges in Analysis of Algebraic Iterative Solvers Jörg Liesen Technical University of Berlin and Zden ˇ ek Strakoš Charles University in Prague and Czech Academy of Sciences http://www.karlin.mff.cuni.cz/˜strakos Workshop in honor of K. R. Rajagopal Prague, March 2012

Challenges in Analysis of Algebraic Iterative Solvers

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Challenges in Analysis of Algebraic Iterative Solvers

Challenges in Analysis of Algebraic IterativeSolvers

Jörg LiesenTechnical University of Berlin

and

Zdenek StrakošCharles University in Prague and Czech Academy of Sciences

http://www.karlin.mff.cuni.cz/˜strakos

Workshop in honor of K. R. RajagopalPrague, March 2012

Page 2: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 2

Cornelius Lanczos, March 9, 1947

“The reason why I am strongly drawn to suchapproximation mathematics problems is notthe practical applicability of the solution,but rather the fact that a very “economical”solution is possible only when it is very “adequate”.To obtain a solution in very few stepsmeans nearly always that one has found a waythat does justice to the inner nature of the problem.”

Page 3: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 3

Albert Einstein, March 18, 1947

“Your remark on the importance ofadapted approximation methods makes verygood sense to me, and I am convincedthat this is a fruitful mathematical aspect,and not just a utilitarian one.”

Page 4: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 4

Algebraic iterative computations

● In iterative methods applied to linear algebraic problems, computationalcost of finding sufficiently accurate approximation to the exact solutionheavily depends on the particular data, i.e.,

❋ on the underlying real world problem,❋ on the mathematical model,❋ on its discretisation.

● Any evaluation of cost in iterative computations must take into accounteffects of rounding errors.

● In mathematical modeling of real world phenomena, the accuracyof the computed approximation must be related to the underlyingphenomena. Its evaluation can not be restricted to algebra.

Page 5: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 5

Is there any algebraic error worth consideration?

Knupp and Salari, 2003:

“There may be incomplete iterative convergence (IICE) or round-off-errorthat is polluting the results. If the code uses an iterative solver, then onemust be sure that the iterative stopping criteria is sufficiently tight so thatthe numerical and discrete solutions are close to one another. Usually inorder-verification tests, one sets the iterative stopping criterion to justabove the level of machine precision to circumvent this possibility.”

Why do we care? Is not all these algebraic stuff linear and simple?

Page 6: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 6

Conjugate Gradients: A HPD, x0, r0, p0 = r0

‖x− xn‖A = minu∈x0+Kn(A,r0)

‖x− u‖A

Kn(A, r0) ≡ span {r0, Ar0, · · · , An−1r0}

γn−1 = (rn−1, rn−1)/(pn−1, Apn−1)

xn = xn−1 + γn−1 pn−1

rn = rn−1 − γn−1 Apn−1

δn = (rn, rn)/(rn−1, rn−1)

pn = rn + δn pn−1.

Hestenes and Stiefel (1952), Lanczos (1950, 1952)

This algebraic stuff is nothing but linear!

Page 7: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 7

CG is the Gauss-Christoffel Quadrature

Ax = b , x0 ←→ ω(λ),

∫ ξ

ζ

f(λ) dω(λ)

↑ ↑

Tn yn = ‖r0‖ e1 ←→ ω(n)(λ),n∑

i=1

ω(n)i f

(

θ(n)i

)

xn = x0 + Wn yn

ω(n)(λ) −→ ω(λ)

Page 8: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 8

Distribution function ω(λ)

λi, si are the eigenpairs of A , ωi = |(si, w1)|2 , w1 = r0/‖r0‖

...

0

1

ω1

ω2

ω3

ω4

ωN

L λ1 λ2 λ3. . . . . . λN U

Hestenes and Stiefel (1952), Lanczos (1952, almost unknown)

Page 9: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 9

CG does model reduction matching 2n moments

∫ U

L

λ−1 dω(λ) =n∑

i=1

ω(n)i

(

θ(n)i

)−1

+ Rn(f)

‖x− x0‖2A

‖r0‖2= n-th Gauss quadrature +

‖x− xn‖2A

‖r0‖2

With x0 = 0, b∗A−1b =n−1∑

j=0

γj‖rj‖2 + r∗nA−1rn .

Golub, Meurant, Reichel, Boley, Gutknecht, Saylor, Smolarski, ......... ,Meurant and S (2006), Golub and Meurant (2010), S and Tichý (2011),

Liesen, S, Krylov subspace methods, OUP (2012)

Page 10: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 10

Outline

1. CG convergence bounds based on Chebyshev polynomials

2. Sensitivity of the Gauss-Christoffel quadrature

3. PDE discretizations and matrix computations

Page 11: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 11

1 Linear bounds for the nonlinear method?

‖x− xn‖A = minp(0)=1

deg(p)≤n

‖A1/2p(A)(x− x0)‖

= minp(0)=1

deg(p)≤n

‖Y p(Λ)Y ∗A1/2(x− x0)‖

(

minp(0)=1

deg(p)≤n

max1≤j≤N

|p(λj)|

)

‖x− x0‖A

Using the shifted Chebyshev polynomials on the interval [λ1, λN ] ,

‖x− xn‖A ≤ 2

(√

κ(A)− 1√

κ(A) + 1

)n

‖x− x0‖A .

Page 12: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 12

1 Minimization property and the bound

This bound has a remarkably wiggling history:

● Markov (1890)● Flanders and Shortley (1950)● Lanczos (1953), Kincaid (1947), Young (1954, ... )● Stiefel (1958), Rutishauser (1959)● Meinardus (1963), Kaniel (1966)● Daniel (1967a, 1967b)● Luenberger (1969)

It is relevant to the Chebyshev method!

Page 13: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 13

1 Composite bounds considering large outliers?

This bound should not be used in connection with the behaviour of CGunless κ(A) = λN/λ1 is really small or unless the (very special)distribution of eigenvalues makes it relevant.

In particular, one should be very careful while using it as a part of acomposite bound in the presence of the large outlying eigenvalues

minp(0)=1

deg(p)≤n−s

max1≤j≤N

| qs(λj) p(λj) | ≤ max1≤j≤N

|qs(λj)|

∣∣∣∣

Tn−s(λj)|

Tn−s(0)

∣∣∣∣

< max1≤j≤N−s

∣∣∣∣

Tn−s(λj)

Tn−s(0)

∣∣∣∣

.

This Chebyshev method bound on the interval [λ1, λN−s]is then valid after s initial steps.

Page 14: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 14

1 Quote (2009, ... ): the desired accuracy ǫ

Theorem. After

k = s +

ln(2/ǫ)

2

λN−s

λ1

iteration steps the CG will produce the approximate solution xn

satisfying

‖x− xn‖A ≤ ǫ ‖x− x0‖A .

This recently republished and used statement is in finite precisionarithmetic not true at all.

Page 15: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 15

1 Axelsson (1976), Jennings (1977)

p. 72: ... it may be inferred that rounding errors ... affects the convergencerate when large outlying eigenvalues are present.

Page 16: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 16

1 The composite bounds completely fail

0 20 40 60 80 100

10−15

10−10

10−5

100

0 20 40 60 80 100

10−15

10−10

10−5

100

Composite bounds with varying number of outliers:Exact CG (left) and FP CG (right),

Gergelits (2011).

Page 17: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 17

2 CG and Gauss-Christoffel quadrature errors

∫ U

L

λ−1 dω(λ) =n∑

i=1

ω(n)i

(

θ(n)i

)−1

+ Rn(f)

‖x− x0‖2A

‖r0‖2= n-th Gauss quadrature +

‖x− xn‖2A

‖r0‖2

Consider two slightly different distribution functions with

Iω =

∫ U

L

λ−1 dω(λ) ≈ Inω

Iω =

∫ U

L

λ−1 dω(λ) ≈ Inω

Page 18: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 18

2 Sensitivity of the Gauss-Christoffel Q.

0 5 10 15 2010

−10

10−5

100

iteration n

quadrature error − perturbed integralquadrature error − original integral

0 5 10 15 2010

−10

10−5

100

iteration n

difference − estimatesdifference − integrals

Page 19: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 19

2 The point goes back to 1814

1. Gauss-Christoffel quadrature for a small number of quadrature nodescan be highly sensitive to small changes in the distribution functionthat enlarge its support.

In particular, the difference between the corresponding quadratureapproximations (using the same number of quadrature nodes) can bemany orders of magnitude larger than the difference between theintegrals being approximated.

2. This sensitivity in Gauss-Christoffel quadrature can be observedfor discontinuous, continuous, and even analytic distribution functions,and for analytic integrands uncorrelated with changes in thedistribution functions, with no singularity close to the interval ofintegration.

Page 20: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 20

2 Theorem - O’Leary, S, Tichý (2007)

Consider distribution functions ω(λ) and ω(λ) on [L, U ] . Letpn(λ) = (λ− λ1) . . . (λ− λn) and pn(λ) = (λ− λ1) . . . (λ− λn) be thenth orthogonal polynomials corresponding to ω and ω respectively,with ps(λ) = (λ− ξ1) . . . (λ− ξs) their least common multiple.If f ′′ is continuous on [L, U ] , then the difference ∆n

ω,ω betweenthe approximation In

ω to Iω and the approximation Inω to Iω ,

obtained from the n-point Gauss-Christoffel quadrature, is bounded as

|∆nω,ω| ≤

∣∣∣∣∣

∫ U

L

ps(λ)f [ξ1, . . . , ξs, λ] dω(λ) −

∫ U

L

ps(λ)f [ξ1, . . . , ξs, λ] dω(λ)

∣∣∣∣∣

+

∣∣∣∣∣

∫ U

L

f(λ) dω(λ) −

∫ U

L

f(λ) dω(λ)

∣∣∣∣∣

.

Page 21: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 21

3 Take very simple model boundary value problem

−∆u = 16η1η2(1− η1)(1− η2)

on the unit square with zero Dirichlet boundary conditions. Galerkin finiteelement method (FEM) discretization with linear basis functions on theregular triangular grid with the mesh size h = 1/(m + 1), where m is thenumber of inner nodes in each direction. Discrete (piecewise linear)solution

uh =N∑

j=1

ζj φj(η1, η2) .

Computational error

u− u(n)h

︸ ︷︷ ︸

total error

= u− uh︸ ︷︷ ︸

discretisation error

+ uh − u(n)h

︸ ︷︷ ︸

algebraic error

.

Page 22: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 22

3 Local discretization and global computation

Discrete (piecewise linear) solution

uh =N∑

j=1

ζj φj(η1, η2) .

● If ζj is known exactly, then u(n)h = uh , and the global information is

approximated as the linear combination of the local basis functions.

● Apart from trivial cases, ζj , which supplies the global information,is not known exactly.

Page 23: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 23

3 Local discretisation and global computation

−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1−1

−0.8

−0.6

−0.4

−0.2

0

0.2

0.4

0.6

0.8

1

Page 24: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 24

3 Energy norm of the error

Theorem

Up to a small inaccuracy proportional to machine precision,

‖∇(u− u(n)h )‖2 = ‖∇(u− uh)‖2 + ‖∇(uh − u

(n)h )‖2

= ‖∇(u− uh)‖2 + ‖x− xn‖2A .

Using zero Dirichlet boundary conditions,

‖∇(u− uh)‖2 = ‖∇u‖2 − ‖∇uh‖2 .

Page 25: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 25

3 Solution and the discretization error

0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Exact solution u of the PDE

0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1

0

1

2

3

x 10−4 Discretisation error u−u

h

Exact solution u of the Poisson model problem (left)and the MATLAB trisurf plot of the discretization error u− uh (right).

Page 26: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 26

3 Algebraic and total errors

0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1

−6

−4

−2

0

2

4

6

x 10−4 Algebraic error u

h−u

hCG with c=1 and α=3

0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1

−4

−2

0

2

4

6

8

10

x 10−4 Total error u−u

hCG with c=1 and α=3

Algebraic error uh − u(n)h (left) and the MATLAB trisurf plot of the total

error u− u(n)h (right)

‖∇(u− u(n)h )‖2 = ‖∇(u− uh)‖2 + ‖x− xn‖

2A

= 5.8444e− 03 + 1.4503e− 05 .

Page 27: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 27

3 Algebraic and total errors

0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1

−6

−4

−2

0

2

4

6

8

x 10−5 Algebraic error u

h−u

hCG with c=0.5 and α=3

0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1

0

1

2

3

x 10−4 Total error u−u

hCG with c=0.5 and α=3

Algebraic error uh − u(n)h (left) and the MATLAB trisurf plot of the total

error u− u(n)h (right)

‖∇(u− u(n)h )‖2 = ‖∇(u− uh)‖2 + ‖x− xn‖

2A

= 5.8444e− 03 + 5.6043e− 07 .

Page 28: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 28

3 One can see 1D analogy

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−0.5

0

0.5

1

1.5

2

2.5

3x 10

−3Errors with the algebraic normwise backward error 6.6554e−017

alg.errortot. error

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−2

0

2

4

6

8

10x 10

−3 Errors with the algebraic normwise backward error 0.0020031

alg.errortot. error

The discretization error (left),the algebraic and the total error (right),

Papež (2011).

Page 29: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 29

3 Why?

Krylov subspace methods represent matching moments model reduction!

Page 30: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 30

3 Adaptivity?

We need a-posteriori error bounds which are:

● Locally efficient,

● fully computable (no hidden constants),

● and allow to compare the contribution of the discretization error and thealgebraic error to the total error.

Page 31: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 31

Conclusions

Patrick J. Roache’s book Validation and Verification in ComputationalScience, 2006, p. 387:

“With the often noted tremendous increases in computer speed andmemory, and with the less often acknowledged but equally powerfulincreases in algorithmic accuracy and efficiency, a natural questionsuggest itself. What are we doing with the new computer power? withthe new GUI and other set-up advances? with the new algorithms?What should we do? ... Get the right answer.”

Page 32: Challenges in Analysis of Algebraic Iterative Solvers

Z. Strakoš 32

Thank you for your work, help and friendship!