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

From testwiki
Jump to navigation Jump to search

Problem 1

Let a=x0<x1<<xn=b be an arbitrary fixed partition of the interval [a,b]. A function q(x) is a quadratic spline function if


(i) qC1[a,b]


(ii) On each subinterval [xi,xi+1], q is a quadratic polynomial


The problem is to construct a quadratic spline q(x) interpolating data points (x0,y0),(x1,y1),,(xn,yn). The construction is similar to the construction of the cubic spline but much easier.

Problem 1a

Show that if we know ziq(xi),i=0,,n, we can construct q.

Solution 1a

Consider interval [xi,xi+1]. Since q'i(x) is linear on this interval, using the point slope form we have


qi(x)=zi+1zixi+1xi(xxi)+zi


Integrating, we have


qi(x)=zix+zi+1zixi+1xi(xxi)22+Ki


or, in a more convenient form,


qi(x)=zi(xxi)+zi+1zixi+1xi(xxi)22+yi

Problem 1b

Find equations which enable us to determine the zi. You should find that one of the zi can be prescribed arbitrarily, for instance z0=0

Solution 1

Since q is continuous on [a,b],


qi1(xi)=qi(xi)=yi


i.e.


zi1(xixi1)+zizi1xixi1(xixi1)22+yi1=yi


Simplifying and rearranging terms yields the reoccurrence formula


zi=zi1+2(yiyi1)xixi1i=1,n

Problem 2a

Give the definition of the QR algorithm for finding the eigenvalues of a matrix A. Define both the unshifted version and the version with shifts χ0,χ1,χ2,

Solution 2a

Unshifted Version

QkRk=Ak
Ak+1=RkQk

Shifted Version

QkRk=AkχkI
Ak+1=RkQk+χkI

Problem 2b

Show that in each case the matrices A1,A2 generated by the QR algorithm are unitarily equivalent to A (i.e. Ai=UiAUiH,Ui unitary).

Solution 2b

Suppose Am=UTAU for some unitary U. Since Rm=QmTAm we have

Am+1=RmQm=QmTAmQm=QmTUTAUQm

which is as desired as QmU is unitary.

For the shifted case, the same argument holds using the fact that Rm=QmT(AmχmI).

Problem 2c

Let


A=(3112)


Use plane rotations (Givens rotations) to carry out one step of the QR algorithm on A, first without shifting and then using the shift χ0=1. Which seems to do better? The eigenvalues of A are λ1=1.382,λ2=3.618. (Recall that a plane rotation is a matrix of the form


Q=(cssc)


with c2+s2=1

Solution 2c

The shifted iteration appears to work better because its diagonal entries are closer to the actual eigenvalues than the diagonal entries of the unshifted iteration.

Unshifted Iteration

A1=(3.5.5.51.5)

Shifted Iteration

A1=(3.6.2.21.4)

Problem 3

Let A be an N×N symmetric, positive definite matrix. Then we know that solving Ax=b is equivalent to minimizing the functional F(x)=12x,Axb,x where , denotes the standard inner product in RN. To solve the problem by minimization of F we consider the general iterative method xv+1=xv+αvdv

Problem 3a

When xv and dv are given, show that the value of αv which minimizes F(xv+αdv) as a function of α is given in terms of the residual rv


αv=rv,dvdv,Adv,rv=bAxv


Solution 3a

Useful Relationship

Since A is symmetric


(Ax,y)=(x,ATy)=(x,Ay)


This relationship will used throughout the solutions.


Substitute into Functional

F(xv+αdv)=12xv+αdv,Axv+αAdvb,xv+αdv=dv,Adv2α2+αdv,Axvαb,dv+12xv,Axvb,xv

Take Derivative With Respect to Alpha

F(xv+αdv)=dv,Advα+dv,Axvb,dv

Set Derivative Equal To Zero

0=dv,Advα+dv,Axvb


which implies


α=dv,rvdv,Adv

Problem 3b

Let {dj}j=1N be an A-orthogonal basis of RN, dj,Adk=0,jk. Consider the expansion of the solution x in this basis:


x=j=1Nxj^dj


Use that Aorthogonality of the dj to compute the x^j in terms of the solution x and the dj's

Solution 3b

x,Adk=j=1nx^jdj,Adk=j=1Nx^jdj,Adk=x^kdk,Adk


which implies


x^k=x,Adkdk,Adk

Problem 3c

Let xv denote the partial sum


xv=j=1v1x^jdj,v=2,3,


so that xv+1=xv+x^vdv where the x^v's are the coefficients found in (b). Use the fact that xvspan{d1,d2,,dv1} and the A-orthogonality of the dj's to conclude that the coefficient x^v is given by the optimal αv i.e.


x^v=rv,dvdv,Adv=αv

Solution 3c

rv,dv=bAxv,dv=AxAxv,dv=Ax,dvAxv,dv=x,Advxv,Adv0=x^vdv,Adv


which implies


x^v=rv,dvdv,Adv

Template:BookCat