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

From testwiki
Jump to navigation Jump to search

Problem 4

Consider the system

x=1+hex21+y2,y=.5+harctan(x2+y2).


Problem 4a

Show that if the parameter h>0 is chosen sufficiently small, then this system has a unique solution (x*,y*) within some rectangular region.

Solution 4a

The system of equations may be expressed in matrix notation.

f(x,y)=[1+hex21+y2.5+harctan(x2+y2)]


The Jacobian of f(x,y), J(f), is computed using partial derivatives


J(f)=[h1+y2ex2(2x)h2yex2(1+y2)2h2x1+(x2+y2)2h2y1+(x2+y2)2]


If h is sufficiently small and x,y are restricted to a bounded region B,


J(f)C<1


From the mean value theorem, for x1,x2B, there exists ξ such that


f(x1)f(x2)=J(f(ξ))(x1x2)


Since J(f) is bounded in the region B give sufficiently small h


f(x1)f(x2)Cx1x2


Therefore, f is a contraction and from the contraction mapping theorem there exists a unique fixed point (solution) in a rectangular region.

Problem 4b

Derive a fixed point iteration scheme for solving the system and show that it converges.

Solution 4b

Use Newton Method

To solve this problem, we can use the Newton Method. In fact, we want to find the zeros of

g(x,y)=[xy][1+hex21+y2.5+harctan(x2+y2)]


The Jacobian of g(x,y), J(g), is computed using partial derivatives


J(g)=[1h1+y2ex2(2x)hex21+y2h2x1+(x2+y2)21h2y1+(x2+y2)2]


Then, the Newton method for solving this linear system of equations is given by


[xk+1yk+1]=[xkyk]1det(J(g))[1h2y1+(x2+y2)2hex21+y2h2x1+(x2+y2)21h1+y2ex2(2x)]J(g)1g(xk,yk)

Show convergence by showing Newton hypothesis hold

Jacobian of g is Lipschitz

We want to show that J(g) is a Lipschitz function. In fact,


J(g)(x1)J(g)(x2)=(IJ(f))(x1)(IJ(f))(x2)=x1x2J(f)x1+J(f)x2x1x2+J(f)x2J(f)x1


and now, using that J(f) is Lipschitz, we have


J(g)(x1)J(g)(x2)(1+C)(x1)(x2)

Jacobian of g is invertible

Since J(f) is a contraction, the spectral radius of the Jacobian of f is less than 1 i.e.


ρ(J(f))<1.


On the other hand, we know that the eigenvalues of J(g) are λ(J(g))=1λ(J(f)).


Then, it follows that det(I(J(g)))0 or equivalently J(g) is invertible.

inverse of Jacobian of g is bounded

1det(J(g))[1h2y1+(x2+y2)2hex21+y2h2x1+(x2+y2)21h1+y2ex2(2x)]J(g)1


Since J(g)1 exists, det(J(g))0. Given a bounded region (bounded x,y), each entry of the above matrix is bounded. Therefore the norm is bounded.

norm of (Jacobian of g)^-1 (x_0) * g(x_0) bounded

J(g)1(x0)*g(x0)< since J(g)1 and g(x) is bounded.


Then, using a good enough approximation (x0,y0), we have that the Newton's method is at least quadratically convergent, i.e,

(xk1,yk+1)(x*,y*)K(xk,yk)(x*,y*)2.

Problem 5a

Outline the derivation of the Adams-Bashforth methods for the numerical solution of the initial value problem y=f(x,y)y(x0)=y0.

Solution 5a

We want to solve the following initial value problem: y=f(x,y)y(x0)=y0.


First, we integrate this expression over [tn,tn+1], to obtain


y(tn+1)=y(tn)+tntn+1f(t,y(t))dt,


To approximate the integral on the right hand side, we approximate its integrand f(t,y(t)) using an appropriate interpolation polynomial of degree p at tn,tn1,...,tnp.


This idea generates the Adams-Bashforth methods.


yn+1=yn+tntn1k=0pg(tnk)lk(t)dt,


where, yn denotes the approximated solution, g(t)f(t,y) and lk(t) denotes the associated Lagrange polynomial.

Problem 5b

Derive the Adams-Bashforth formula

yi+1=yi+h[12f(xi1,yi1)+32f(xi,yi)](1)

Solution 5b

From (a) we have

yi+1=yi+xixi+1fdx where xixi+1fdxxixi+1[xxixi1xifi1+xxi1xixi1fi]dx


Then if we let x=xi+sh, where h is the fixed step size we get

dx=hdsxxi=shxxi1=(1+s)hxixi1=h


h01[shhfi1+(1+s)hhfi]ds=h[12fi1+32fi]


So we have the Adams-Bashforth method as desired

yi+1=yi+h[12f(xi1,yi1)+32f(xi,yi)]

Problem 5c

Analyze the method (1). To be specific, find the local truncation error, prove convergence and find the order of convergence.

Solution 5c

Find Local Truncation Error Using Taylor Expansion

Note that yiy(ti). Also, denote the uniform step size Δt as h. Hence,


ti1=tih


ti+1=ti+h


Therefore, the given equation may be written as


y(ti+h)y(ti)h[12y(tih)+32y(ti)]

Expand Left Hand Side

Expanding about ti, we get


Ordery(ti+h)y(ti)Σ0y(ti)y(ti)01y(ti)h0y(ti)h212!y(ti)h2012y(ti)h2313!y(ti)h3016y(ti)h34𝒪(h4)0𝒪(h4)

Expand Right Hand side

Also expanding about ti gives


Order1312hx(ti+2h)53hx(ti+h)512hx(ti)Σ0000011312hx(ti)53hx(ti)512hx(ti)1hx(ti)21312(2h)hx(ti)53hhx(ti)012h2x(ti)31312(2h)2hx(ti)253h2hx(ti)2043h3x(ti)4𝒪(h4)𝒪(h4)0𝒪(h4)

Show Convergence by Showing Stability and Consistency

A method is convergent if and only if it is both stable and consistent.

Stability

It is easy to show that the method is zero stable as it satisfies the root condition. So stable.

Consistency

Truncation error is of order 2. Truncation error tends to zero as h tends to zeros. So the method is consistent.

Order of Convergence

Dahlquist principle: consistency + stability = convergent. Order of convergence will be 2.

Problem 6

Consider the problem

u+u=f(x),0x1,u(0)=u(1)=0.(2)


Problem 6a

Give a variational formulation of (2), i.e. express (2) as

uH,B(x,y)=F(v),vH(3)

Define the Space H, the bilinear form B and the linear functional F, and state the relation between (2) and (3).

Solution 6a

Multiplying (2) by a test function and using integration by parts we obtain:


01uvdx+01uvdx=01fvdx


uv|010+01uvdx+01uvdx=01fvdx


Thus, the weak form or variational form associated with the problem (2) reads as follows: Find uH such that


B(u,v)=01uvdx+01uvdx=01fvdx=F(v) for all vH,


where H:=H01(0,1)={v:vH1,v(0)=v(1)=0}.

Problem 6b

Let 0=x0<x1<<xn=1 be a mesh on [0,1] with h=maxj=0,1,,n1(xj+1xj), and let

Vh={u:u continuous on [0,1],u|[xj,xj+1] is linear for each j,u(0)=u(1)=0}.

Define the finite element approximation, uh to u based on the approximation space Vh. What can be said about uuh1 the error on the Sobolev norm on H1(0,1)?

Solution 6b

Define piecewise linear basis

For our basis of Vh, we use the set of hat functions {ϕj}j=1n1, i.e., for j=1,2,,n1


ϕj(x)={xxj1xjxj1for x[xj1,xj]xj+1xxj+1xjfor x[xj,xj+1]0otherwise

Define u_h

Since {ϕj}j=1n1 is a basis for Vh, and uhVh we have


uh=j=1n1uhjϕj.

Discrete Problem

Now, we can write the discrete problem: Find uhVh such that


B(uh,vh)=F(vh) for all vhVh.


If we consider that {ϕj}j=1n1 is a basis of Vh and the linearity of the bilinear form B and the functional F, we obtain the equivalent problem:


Find uh=(uh,1,,uh,n1)n1 such that


j=1n1uh,j{01ϕjϕidx+01ϕjϕidx}=01fϕidx,i=1,,n1.


This last problem can be formulated as a matrix problem as follows:


Find uh=(uh,1,,uh,n1)n1 such that


Auh=F,


where Aij=01ϕjϕidx+01ϕjϕidx and Fj=01fϕidx.

Bound error

In general terms, we can use Cea's Lemma to obtain


uuh1CinfvhVhuvh1


In particular, we can consider vh as the Lagrange interpolant, which we denote by vI. Then,


uuh1CuvI1ChuH2(0,1).


It's easy to prove that the finite element solution is nodally exact. Then it coincides with the Lagrange interpolant, and we have the following punctual estimation:


u(x)uh(x)L([xi1,xi])maxx[xi1,xi]u(2)(x)(2)!(h2)2

Problem 6c

Derive the estimate for uuh0, the error in L2(0,1). Hint: Let w solve

(#) :{w+w=uuh,w(0)=w(1)=0.

We characterize w variationally as

wH01,B(w,v)=(uuh)vdx,vH01.

Let v=uuh to get

B(w,uuh)=(uuh)2dx=uuhL22.(4)

Use formula (4) to estimate uuhL2.

Solution 6c

Continuity of Bilinear Form

B(u,v)=uv+uvu0v0+u0v0 (Cauchy-Schwarz in L2) (u02+u02)12(v02+v2)12 ( Cauchy-Schwarz in R2 ) =u1v1

Orthogonality of the Error

B(uuh,vh)=0,vhVh.

Bound for L2 norm of w

w02w12=B(w,w)=(uuh)wuuh0w0 (Cauchy-Schwarz in L2 ) 


Hence,


(*)w0uuh0

Bound for L2 norm of w

From (#), we have


w+w=uuh


Then,


w0w0+uuh0 (triangle inequality) uuh0+uuh0 (by (*) ) =2uuh0

Bound L2 Error

uuhL22=B(w,uuh) ( from equation (4) ) =B(w,uuh)B(wh,uuh)0=B(wwh,uuh)wwhH1(0,1)uuhH1(0,1) (Continuity of Bilinear Form) ChwH2(0,1)uuhH1(0,1) (Cea Lemma and Polynomial Interpolation Error) 


Finally, from (#), we have that wH2(0,1)CuuhL2(0,1). Then,


uuhL2(0,1)2ChuuhL2(0,1)uuhH1(0,1),


or equivalently,


uuhL2(0,1)ChuuhH1(0,1)Ch2uH2(0,1).

Problem 6d

Suppose {ϕ1h,,ϕNhh} is a basis for Vh where Nh=dimVh, so uh=j=1Nhcjhϕjh, for appropriate coefficients cjh.. Show that

uuh12=u12CTAC

where C=[c1h,,cNhh]T and A is the stiffness matrix.

Solution 6d

We know that

uuh12=uuh,uuhH1(0,1)=uuh,uH1(0,1)uuh,uhH1(0,1)0=uH1(0,1)2uh,uH1(0,1)=uH1(0,1)2uhH1(0,1)2


where the substitution in the last lines come from the orthogonality of error.


Now, uhH1(0,1)2=j=1n1i=1n1uh,juh,i(01ϕiϕjdx+01ϕiϕjdx)=j=1n1i=1n1uh,jAijuh,i=CtAC.


Then, we have obtained


uuh12=uH1(0,1)2CtAC.

Template:BookCat