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

From testwiki
Jump to navigation Jump to search

Problem 4a

Show that the two-step method

yn+1=2yn1yn+h[52f(xn,yn)+12f(xn1,yn1)](1)

is of order 2 but does not satisfy the root condition.

Solution 4a

Method of Order 2

Method (1) finds an approximation for y such that y=f(x,y).


Let xn=a0+hn be the nth point of evaluation where a0 is the starting point and h is the step size.

Taylor Expansion of y' about a_0

y(xn)=y(a0+hn)=y(a0)+hny(a0)+h2n2y(a0)/2+𝒪(h3)y(xn1)=y(a0+h(n1))=y(a0)+h(n1)y(a0)+h2(n1)2y(a0)/2+𝒪(h3)


Substituting into the second term on the right hand side of (1) and simplifying yields


h[52y(xn)+12y(xn1)]=52[hy(a0)+h2ny(a0)+𝒪(h3)]+12[hy(a0)+h2(n1)y(a0)+𝒪(h3)]=3hy(a0)+12(6n1)y(a0)+𝒪(h3)

Taylor Expansion of y about a_0

Since yny(xn), we also take Taylor Expansion of y about a0


y(xn+1)=y(a0)+h(n+1)y(a0)+h2(n+1)2y(a0)/2+𝒪(h3)y(xn)=y(a0)+hny(a0)+h2n2y(a0)/2+𝒪(h3)y(xn1)=y(a0)+h(n1)y(a0)+h2(n1)2y(a0)/2+𝒪(h3)


Substituting and simplifying yields,

yn+1+yn2yn1=3hy(a0)+12(6n1)y(a0)+𝒪(h3)

Take Difference of Taylor Expansions

Hence yn+1+yn2yn1h[52y(xn)+12y(xn1)]=𝒪(h3) shows that (1) is a method of order 2.

Does Not Satisfy Root Condition

The Characteristic equation of (1) is

λ2+λ2=0

Giving the roots

λ1=1
λ2=2

λ2 clearly does not satisfy |λj|1

Problem 4b

Give an example to show that the method (1) need not converge when solving y=f(x,y).

Solution 4b

Let f(x,y)=0,y(0)=y0=1. Then y(t)=1. We have the difference equation


yn+1+yn2yn1=0


which has general solution (use the roots)


yn=C1(2)n+C21n


If C10, then yn as n


y0=C1+C2


y1=2C1+C2


Hence, y0y13=C1. Therefore if y0y1, then C10.

Problem 5

Consider the boundary value problem


u+(1+x)u=x2u(0)=1,u(1)=1(2)

Problem 5a

Prove that (2) has at most one solution

Solution 5a

Let u1 and u2 be solutions. Let uu1u2.


By subtracting the two equations and their conditions we have


u+(1+x)u=0u(0)=0,u(1)=0


Multiplying by test function vV={vH1:v(1)=0} and integrating by parts from 0 to 1, we want to find uV such that for all vV


01uv+01(1+x)uv=0


Let v=u. Then, we have


01(u)2+01(1+x)u2=0


Since (u)2, (1+x), and u2 are all >0, u2=0. Hence u1=u2.

Problem 5b

Discretize the problem. Take a uniform partition of [0,1]:


xi=ih,i=0,1,2,,n,h=1n


Use the three point difference formula for u and the simplest difference formula for the boundary condition at x=0. Write the resulting system as a matrix vector equation Ax=b where x=(u1,u2,,un1)T


Solution 5b

The three point difference formula for u is given by

u(x)=u(x+h)2u(x)+u(xh)h2

Equations for i=2,...,n-2

Substituting into (2) with our difference formula we have in matrix formulation


[1h22h2+(1+ih)1h2][ui1uiui+1]=(ih)2

Equation for i=1

We can eliminate the u0 variable by using the approximation


u(0)=u1u0h=1


which implies


u0=u1h


Using this relationship and the three difference formula, we have


[1h2+(1+h)1h2][u1u2]=h21h

Equations for i=n-1

Since u(1)=un=1, we can eliminate the un variable by substituting into the n-1 equation.

[1h22h2+(1+(n1)h)][un2un1]=h2((n1)h)2+1h2

Problem 5c

Prove that the equation found in (b) has a unique solution


Solution 5c

Since the matrix A is diagonally dominant, the system Ax=b has unique solution.

Problem 5d

Transform the problem (2) into an equivalent problem with homogeneous boundary conditions.

Solution 5d

Let u,a solution of the boundary value problem, be represented as the sum of solutions to two different boundary value problems i.e.


u=w+v where


w+(1+x)w=f(x)w(0)=0,w(1)=0


v+(1+x)v=g(x)v(0)=1,v(1)=1(*)


u+(1+x)u=x2=f(x)+g(x)u(0)=1,u(1)=1


Suppose v(x)=ax+b. Then


v(0)=a=1 and v(1)=1+b=1 which implies b=0 and hence


v(x)=x


Substituting into (*), we then have


0+(1+x)x=g(x)


which implies


g(x)=x2+x


Since f(x)+g(x)=x2, we have f(x)=x


Therefore an equivalent boundary value problem with hemogenous boundary conditions is given by


w+(1+x)w=xw(0)=0,w(1)=0

Problem 5e

Obtain the variational formulation of the problem formulated in (d). Specify the Sobolev space H involved. Prove that this problem has a unique solution, which we denote by v.

Solution 5e

Variational Formulation and Sobolev space

Using the problem's notation, we want to find vH={wH1:w(1)=0} such that for all wH, we have


a(v,w)=01vw+01(1+x)vw=01xw=F(w)


The above comes from integrating by parts and applying the boundary conditions.

Unique Solution

To show that v is unique, we show that the hypothesis of the Lax-Milgram Theorem are met.

a(v,w) bounded and continuous

a(v,w)=01vw+01(1+x)2vw2[01vw+01vw]2[[01v'2]12[01w'2]12+[01v2]12[01w2]12] Cauchy-Schwartz in L2 2[[01v'2+01v2]12[01w'2+01w2]12] Cauchy-Schwartz in R2 =2w1v1

a(v,v) coercive

a(v,v)=01v'2+01(1+v)1v201v'2+v2=v12

F(v) bounded

|F(v)|=|01xv||01v|v12

Problem 5f

Consider the approximation of v by piecewise linear finite elements. Define precisely the piecewise linear finite element subspace (use the partition (3)). Show that the finite element problem has a unique solution.

Problem 5g

Show that vvhHCh and indicate how the constant C depends on the derivatives of v.

Solution 5

Problem 6

Let f: be a nonlinear function with zero x*:


f(x,y)=[x22x+y2xy21], x*=[11].


Consider the iteration

xn+1=xnAf(xn), A=[11210](4).


Problem 6a

Prove (4) is locally convergent.

Solution 6a

ϕ(xn):=xn+1=xnAf(xn) is a fixed point iteration. By the contraction mapping theorem, if ϕ(x) is a contraction in some neighborhood of x* then the iteration converges at least linearly.


We have to show there exists γ<1 such that ϕ(x)ϕ(y)γxy.


By the mean value theorem we have that ϕ(x)ϕ(y)Dϕ(ξ)xy, that is γ=Dϕ(ξ) for some ξ in our neighborhood of x*.


In particular, Dϕ(x*)=IADϕ(x*)=0<1, implying that ϕ(x) is a contraction and that the iterative method converges at least linearly.


Calculating the Jacobian

Dϕ=DxADf


Dx=I


Df=(2x2122y)


Dϕ(x*)=IADϕ(x*)=(1001)(11210)(2(1)2122(1))=(1001)(1001)=(0000)Dϕ(x*)=0



Problem 6b

Show that the convergence is at least quadratic.

Solution 6b

en+1=xn+1x*=xnAf(xn)ϕ(xn)x*=ϕ(xn)x*=(ϕ(x*)+(xnx*)TDϕ(x*)0+(xnx*)THϕ(x*)2!(xnx*)+R(xn,x*))x*=(x*+Af(x*)0+Hϕ(x*)2!(xnx*)T(xnx*)en2+R(xn,x*))x*Cen2+R(xn,x*)


where R(xn,x*) satisfies R(xn,x*)xnx*0 when xnx*0.


Then, we obtain en+1Cen2.

Problem 6c

Write the Newton iteration and compare it with (4)

Solution 6c

The Newton iteration looks like this:

xn+1=xnB(xn)f(xn)


[xn+1yn+1]=[xnyn][2xn2122yn]1B[xn22xn+yn2xnyn21]


Where B is the inverse of the Jacobian of f.


B(x*)=[2(1)2122(1)]1=[0122]1=[11210]=A


That is, B(x*) in the Newton Iteration gives (4).


Template:BookCat