Numerical Methods Qualification Exam Problems and Solutions (University of Maryland)/Jan05 667

From testwiki
Jump to navigation Jump to search

Problem 4

Let f:RnR be a nonlinear smooth function. To determine a (local) minimum of f one can use a descent method of the form


xk+1=xk+αkdk(k0)(1)


where 0αk1 is a suitable parameter obtained by backtracking and dk is a descent direction i.e. it satisfies


f(xk+1)<f(xk)(2)

Problem 4a

Write the steepest descent method (or gradient) method and show that there exist 0<αk1 such that the resulting method satisfies (2)

Solution 4a

Steepest Descent Method

xk+1=xkαkf(xk)


Choose αk(0,1] such that αk minimizes f(xkαkf(xk)) i.e.


αk:min0<αk1f(xkαkf(xk))

Directional Derivative Negative

To satisfy (2), the directional derivative should be negative i.e.


dkf(xk)=limαk0f(xk+αkdk)f(xk)αk<0


which implies


f(xk+αkdk)f(xk+1)<f(xk)


since αk(0,1]

Problem 4b

Write the Newton method and examine whether or not there exist αk which yield (2). Establish conditions on the Hessian H(f(x)) of f(x) which guarantee the existence of αk.

Solution 4b

Newton's Method

xk+1=xkH1(f(xk))f(xk)

Directional Derivative Negative

To have descent, we want the directional derivative to be negative i.e.


αkdkf(xk)=f(xk)αkdk=f(xk)H1(f(xk))f(xk)<0


which implies


f(xk)TH1(f(xk))f(xk)>0


Therefore H1(f(xk)) is positive definite and therefore H(f(xk)) is positive definite.

Problem 4c

If we replace the Hessian by the matrix H(f(x))+γkI, where γk0 and I is the identity matrix, we obtain a quasi-Newton method. Find a condition on γk which leads to (2).

Solution 4c

We now want H~(f(xk))=H(f(xk))+γkI to be positive definite.


Let λi, i=1,2,,n be the eigenvalues of H(f(xk)).


Then λi+γk1, i=1,2,,n are eigenvalues of H~(f(xk)).


Since we want H~(f(xk)) to be positive definite, we equivalently have for i=1,2,,n


λi+γk>0


i.e.


γk>λii=1,2,,n

Problem 5

Consider the following nonlinear autonomous initial value problem in R with fC2.


y=f(y)y(0)=y0

Problem 5a

Write the ODE in integral form and use the mid-point quadrature rule to derive the mid-point method with uniform time-step h=TN:


yn+1=yn+hf(yn+1+yn2)

Solution 5a

For x[xn,xn+1],


y(xn+1)y(xn)=xnxn+1f(y(x))dxhf(yn+1+yn2)

Problem 5b

Define truncation error Tn. Assuming that Tn=O(h3), show an estimate for the error |y(tN)yN|. What is the order of the method? (Hint: use that f is Lipschitz continuous.

Solution 5b

|en+1|=|y(tn+1)yn+1||y(tn)yn|+h|f(y(tn+1)y(tn)2)f(yn+1yn2)|γ2|y(tn+1)y(tn)yn+1+yn|+𝒪(h3)|en|+hγ2(|en+1|+|en|)+𝒪(h3)

where γ is the Lipschitz constant of f. Rearranging terms we get


|en+1|1+hγ21hγ2C|en|+𝒪(h3)


In particular, |e1|C|e0|0+𝒪(h3)


Then eN is given by


eN=(CN1+CN2++C+1)𝒪(h3)=CN1C1𝒪(h3)K𝒪(h2)

Problem 5c

Prove that Tn=O(h3) for this method. (Hint: expand first y(tn+1) and y(tn) around τn=tn+h2 and next expand f(12(y(tn+1)+y(tn))). Also expand y(t) around τn.)

Solution 5c

The midpoint method may be rewritten as follows:


y(tn+1)=y(tn)+h2y(tn+1)+h2y(tn)+Tn


which implies


y(tn+1)y(tn)h2y(tn+1)h2y(tn)=Tn


Expanding each term around τn=tn+h2 yields Tn.


Order hy(tn+1)y(tn)h2y(tn+1)h2y(tn)Σ0y(tn+h2)y(tn+h2)01y(tn+h2)h2y(tn+h2)(h2)h2y(tn+h2)h2y(tn+h2)02y(tn+h2)2h24y(tn+h22h24h2y(tn+h2)h2h2y(tn+h2)(h2)03O(h3)O(h3)O(h3)O(h3)O(h3)

Problem 6

Consider the following boundary two-point boundary value problem in (0,1) with ϵ<<1b:


ϵuxx+bux=1,u(0)=u(1)=0

Problem 6a

Write the finite element method with piecewise linear elements over a uniform partition of (0,1) with meshsize h. If U=Uii=0I+1 is the vector of nodal values of the finite element solution, find the (stiffness) matrix A and right-hand side F such that AU=F. Is A symmetric? Is A positive definite?

Solution 6a

Weak Variational Formulation

Multiplying the given equation by a test function vH01[0,1] and integrating from 0 to 1 gives the equivalent weak variational formulation:


Find uH01[0,1] such that for all vH01[0,1] the following holds


ϵ01uvdx+b01uvdxa(u,v)=01vdxf(v)

Discrete Variational Formulation

Let Vh={vH01[0,1]:vh|[xi1,xi] linear  for i=1,2,,n}


Then we have the discrete variational formulation which is an approximation to the weak variational formulation.


Find uhVh such that for all vhVh


a(uh,vh)=f(vh)

Define basis for V_h

Let {ϕi}i=1n be the linear "hat" functions which defines a basis for Vh.


ϕi(x)={xxi1h if x[xi1,xi]xi+1xh if x[xi,xi+1]0 otherwise 


Then calculation yields the following: (draw pictures)


01ϕi(x)dx=h


ϕi(x)={1h if x[xi1,xi]1h if x[xi,xi+1]0 otherwise 


01ϕi(x)ϕj(x)dx={2h if i=j1h if |ij|=10 otherwise 


01ϕi(x)ϕj(x)dx={0 if i=j12 if ij=112 if ij=10 otherwise 

Discrete Variational Formulation in Matrix Form

Since {ϕi}i=1n is a basis for Vh,


uh=i=1nuhiϕi


Also, the discrete variational formulation may be expressed as


ϵi=1nuhi01ϕi(x)ϕj(x)dx+bi=1nuhi01ϕi(x)ϕj(x)dx=01ϕj(x)dx for j=1,2,,n


which in matrix form is


[2ϵhϵh+b200ϵhb22ϵhϵh+b2000000ϵhb22ϵh]A[u1u2un]=[hhh]


A is not symmetric. A is positive definite if


ϵh>b2

Problem 6b

Find a relation between the three parameters h,ϵ,b for A to be an Mmatrix, i.e. to have aii>0,aij0 if ij and aiiijaij

Solution 6b

The first, second, and last rows all yield the same inequality for A to be an M-matrix:


ϵh>b2

Problem 6c

Consider the upwind modification of the ODE


(ϵ+b2h)uxx+bux=1


Show that the resulting matrix A is an M-matrix without restrictions on h,ϵ and b.

Solution 6c

Substituting ϵ+b2h for ϵ yields the following matrix A:


[2ϵh+bϵh00ϵhb2ϵh+bϵh000000ϵhb2ϵh+b]


All off diagonal entries are 0. Diagonal entries are >0


The first row meets the last condition since


2ϵh+bϵh


The second row through (n-1) rows meets the last condition since


2ϵh+bϵh+b+ϵb


The last row meets the last condition since


2ϵh+bϵh+b

Template:BookCat