Numerical Methods Qualification Exam Problems and Solutions (University of Maryland)/January 2008

From testwiki
Jump to navigation Jump to search

Problem 1

Consider the system Ax=b. The GMRES method starts with a point x0 and normalizes the residual r0=bAx0 so that v1=r0ν has 2-norm one. It then constructs orthonormal Krylov bases Vk=(v1v2vm) satisfying

AVk=Vk+1Hk

where Hk is a (k+1)×k upper Hessenberg matrix. One then looks for an approximation to x of the form

x(c)=x0+Vkc

choosing ck so that r(c)=bAx(c) is minimized, where is the usual Euclidean norm.

Problem 1a

Show that ck minimizes νe1Hkc.

Solution 1a

We wish to show that bAx(c)=νe1Hkc


bAx(c)=bA(x0+Vkc)=bAx0AVkc=r0AVkc=r0Vk+1Hkc=νv1Vk+1Hkc=Vk+1(νe1Hkc)hc=(Vk+1hc,Vk+1hc)12=((Vk+1hc)TVk+1hc)12=(hcTVk+1TVk+1hc)12=(hcThc)12=hc=νe1Hkc

Problem 1b

Suppose we choose to solve the least squares problem in part a for ck by the method of orthogonal triangularization (QR). What is the order of the floating point operation for this method. Give reasons.

Solution 1b

We would like to transform Hk, a (k+1)×k upper Hessenberg matrix, into QR form.

The cost is on the order of 4k2+12k2=4.5k2 from the cost of Given's Rotations and backsolving.

Given's Rotations Cost

We need k Given's Rotation multiplies to zero out each of the k subdiagonal entries and hence transform Hk into upper triangular form R,

Each successive Given's Rotations multiply on an upper Hessenberg matrix requires four fewer multiplies because each previous subdiagonal entry has been zeroed out by a Given's Rotation multiply.

Hence the cost of k Given's Rotations multiplies is

4k+4(k1)++41<4kk=4k2

Back Solving Cost

R is a (k+1)×k upper triangular matrix with last row zero. Hence, we need to backsolve k upper triangular rows.

1+2++k=k(k+1)2=k22+k2


Problem 2

We wish to approximate the integral I(f)abf(x)dx

Problem 2a

State the composite trapezoidal rule QT,n for approximating I(f) on a uniform partitioning of width h=ban, and give a formula for the error I(f)QT,n that is in a form suitable for extrapolation.

Solution 2a

The composite trapezoidal rule is

QT,n(f)=h2(f(a)+f(b))+hk=1n1f(xk)

The error is

I(f)QT,n(f)=(ba)f(ξ)12h2

where ξ[a,b].

Derivation of Composite Trapezoidal Error

The local error, the error on one interval, is

h312f(η).

Observe that

nminη[a,b]f(ηi)i=1nf(ηi)nmaxη[a,b]f(ηi)

which implies

minη[a,b]f(ηi)i=1nf(ηi)nmaxη[a,b]f(ηi)

Hence, the Intermediate Value Theorem implies there exists a ξ[a,b] such that

f(ξ)=i=1nf(ηi)n.

Multiplying both sides of the equation by n,

nf(ξ)=i=1nf(ηi)

Using this relationship, we have

I(f)QT,n(f)=i=1nIi(f)Qi(f)=i=1n[h312f(ηi)]=h312f(ξ)n=h312f(ξ)(bah)=h212f(ξ)(ba)

Derivation of Local Error

The error in polynomial interpolation can be found by using the following theorem:

 Assume fn+1 exists on [a,b] and {x0,x1,,xn|x[a,b]}. Pn interpolates f at {xj}j=0n.  
 Then there is a ξx (ξ is dependent on x) such that 
 
 f(x)pn(x)=(xx0)(xx1)...(xxn)(n+1)!f(n+1)(ξx)
 
 where ξx lies in (m,M),  m=min{x0,x1,,xn,X},  M=max{x0,x1,,xn,X}

Applying the theorem yields,

f(x)p1(x)=(xa)(xb)f(ξx)2

Hence,

E(f)=abf(x)p1(x)dx=ab(xa)>0(xb)<0w(x)f(ξx)2dx


Since a is the start of the interval, xa is always positive. Conversely, since b is the end of the interval, xb is always negative. Hence, w(x)<0 is always of one sign. Hence from the mean value theorem of integration, there exists a ζ[a,b] such that


E(f)=f(ζ)2ab(xa)(xb)dx


Note that f(ζ) is a constant and does not depend on x.

Integrating ab(xa)(xb)dx, yields,


E(f)=f(ζ)2((ba)6)=f(ζ)(ba)12

Problem 2b

Use the error formula to derive a new quadrature rule obtained by performing one step of extrapolation on the composite trapezoidal rule. What is this rule, and how does its error depend on h? You may assume here that f is as smooth as you need it to be.

Solution 2b

STOER AND BUESCH pg 162

INTRODUCTION TO APPLIED NUMERICAL ANALYSIS by RICHARD HAMMING pg 178

The error for the composite trapezoidal rule at n points in [a,b] is


En=I(f)QT,n=(ba)h212+𝒪(h3)


With 2n points, there are twice as many intervals, but the intervals are half as wide. Hence, the error for the composite trapezoidal rule at 2n points in [a,b] is


E2n=I(f)QT,2n=2(ba)(h2)212+𝒪(h3)=(ba)h224+𝒪(h3)


We can eliminate the h2 term by choosing using an appropriate linear combination of En and E2n. This gives a new error rule with h3error.


En2E2n=(ba)h2122(ba)h224+𝒪(h3)=𝒪(h3)


Substituting our equations for En and E2n on the left had side gives


I(f)QT,n2I(f)2QT,2n=𝒪(h3)


I(f)=2QT,2nQT,n+𝒪(h3)



If we call our new rule Q^ we have


Q^=2QT,2nQT,n whose error is on the order of 𝒪(h3)

Problem 3

Consider the shifted QR iteration for computing a 2 x 2 matrix A: starting with A0=A, compute


AkσkI=QkRkAk+1=RkQk+σkI


where σk is a scalar shift.

Problem 3a

If


Ak=[a11a12a21a22],


specify the orthogonal matrix Qk used to perform this step when Givens rotations are used. The matrix should be described in terms of the entries of the shifted matrix.

Solution 3a

Let A~k be the σk-shifted matrix of Ak i.e.


A~k=AkσkI=[a11σka12a21a22σk],


QkT is an orthogonal 2x2 Given's rotations matrix. QkT's entries are chosen such that when QkT is pre-multiplied against the 2x2 matrix A~k, QkT will zero out the (2,1) entry of A~k and scale A~k's remaining three entries i.e.


QkTA~k=[**0*]=Rk


where * denotes calculable scalar values we are not interested in and Rk is our desired upper triangular matrix sought by the QR algorithm.


Since QkT is orthogonal, the above equation implies


QkTA~k=RkQkQkTA~k=QkRkA~k=QkRk


The Given's rotation QkT is given by


QkT=[cssc]


where


c=a11σkrs=a21rr=(a11σk)2+a212


Taking the transpose of QkT yields


Qk=[cssc]

Problem 3b

Suppose a21=δ, a small number, and |a12|(a11a22)2. Demonstrate that with an appropriate shift σk, the (2,1)-entry of Ak+1 is of magnitude O(δ2). What does this suggest about the convergence rate of the QR iteration?

Solution 3b

From hypothesis and part (a),


Ak+1=RkQk+σkI=[**0r22][cssc]+[σk00σk]


Let Ak+1(2,1) be the (2,1) entry of Ak. Using the above equation, we can find Ak+1(2,1) by finding the inner product of the second row of Rk and first column Qk and adding the (2,1) entry of σkI i.e.


Ak+1(2,1)=(0c+r22s)+0=r22s


We need to find the value of r22 so we need to calculate Rk.


From hypothesis and the orthogonality of Qk, we have


AkσkI=QkRkQkT(AkσkI)=QkTQkRkQkT(AkσkI)=RkRk=QkT(AkσkI)=[cssc][a11σka12δa22σk]


From Rk, we can find its (2,2) entry r22 by using inner products.


r22=sa12+c(a22σk)


Now that we have r22 we can calculate Ak+1(2,1) by using appropriate substitutions


Ak+1(2,1)=r22s=(sa12+c(a22σk))s=s2a12+cs(a22σk)=δ2a12(a11σk)2+δ2+(a11σk)(a22σk)δ(a11σk)2+δ2=δ2a12+δ(a11σk)(a22σk)(a11σk)2+δ2δ2a12+δ(a11σk)(a22σk)(a11σk)2


since δ is a small number.


Let our shift σk=a22. Then the above equation yields,


Ak+1(2,1)δ2a12+δ(a11σk)(a22σk)(a11σk)2δ2a12+δ(a11a22)(a22a22)(a11a22)2=δ2a12(a11a22)2


Hence,


|Ak+1(2,1)||δ2a12(a11a22)2||δ2|


since |a12|(a11a22)2


Hence we have shown that Ak+1(2,1) is of order δ2.


If δ is small, the QR convergence rate will be quadratic.

Template:BookCat