Sunteți pe pagina 1din 5

CS4MN3 Final 2006

Page

Name Student Number Instructor: S. Qiao

COMP SCI 4MN3


Day Class Duration of examination: two hours McMaster University Final Examination

April 2006

This examination paper includes 5 pages and 7 questions. You are responsible for ensuring that your copy of the paper is complete. Bring any discrepancy to the attention of your invigilator. SPECIAL INSTRUCTIONS: This paper must be returned with your answers. Use of McMaster standard (Casio-FX991) calculator only is allowed. 1. (2 marks) What is the 2-norm condition number linear equations? 4 0 0 6 0 0 cond2 (A) = 6/2 = 3. of the following matrix with respect to solving 0 0 2

2. (3 marks) Given an n-by-n nonsingular matrix A and a second n-by-n matrix B, what is an ecient way to compute A1 B? Let B = [b1 b2 bn ]. PA = L*U; for i=1...n solve L*y = P*bi; solve U*ci = y; end % LU decomposition % for each column bi of B % solve triangular systems

Then C = [c1 c2 cn ] = A1 B.

next page ...

CS4MN3 Final 2006

Page

3. (4 marks) If A is an ill-conditioned matrix, and its LU decomposition is computed by Gaussian elimination with partial pivoting, how is the ill-conditioning of A reected in L and U ? Why? (Hint: Estimate an upper bound for the condition number of L.) Since partial pivoting, the multipliers, the entries in L, |mij | 1. Thus, L
1

n and

L1

n.

Consequently, cond1 (L) n2 . The ill-conditioning of A is mostly reected in U .

4. (3 marks) How would you solve a partitioned linear system of the form: L1 0 B L2 x y = b c ,

where L1 and L2 are nonsingular lower triangular matrices, and the solution and right-hand-side vectors are partitioned accordingly? Show the specic steps you would perform in terms of the given submatrices and vectors. solve L1*x = b; solve L2*y = c - B*x

next page ...

CS4MN3 Final 2006

Page

5. (5 marks) Carry out one iteration of Newtons method applied to the system of nonlinear equations x2 x2 = 0 2 1 2x1 x2 = 1, with starting point x0 = [0 1]T . The Jacobian is J(x) and J(x0 ) = Thus x1 = x0 J 1 (x0 ) f (x0 ) = 0 1 0 1/2 1/2 0 1 1 = 1/2 1/2 0 2 2 0 J 1 (x0 ) = 0 1/2 1/2 0 2x1 2x2 2x2 2x1

next page ...

CS4MN3 Final 2006

Page

6. (8 marks) Consider the initial value problem for the ODE y = y 2 with the initial condition y(0) = 1. Use the backward Euler method with step size h = 0.1 starting from y0 = y(0) = 1 at t0 = 0 to compute the approximate value y1 of the solution at time t1 = 0.1. Since the backward Euler method is implicit, and the ODE is nonlinear, you need to solve a nonlinear algebraic equation for y1 . (a) Write that nonlinear algebraic equation for y1 . (b) Write the Newton iteration for solving the nonlinear algebraic equation. (c) Obtain a starting guess for the Newton iteration by using one step of Euler method for the ODE. (Predictor) (d) Compute y1 by applying one iteration of Newtons method for the nonlinear algebraic equation. (Corrector) Answer: The exact solution is y = 1/(t + 1) and y(0.1) = 0.909. (a) Backward Euler method 2 y1 = y0 + hf1 = 1 + 0.1(y1 ). The nonlinear algebraic equation for y1 :
2 0.1y1 + y1 1 = 0.

(b) Newton iteration y+ = yc (c) One step of Euler method y1 = y0 + hf0 = 1 + 0.1(12 ) = 0.9. (d) One iteration of Newtons method y1 = y1
(0) (0)

fc fc

where f (y) = 0.1y 2 + y 1.

0.1y1 y1 + y1 1
(0) 0.2y1

(0) (0)

(0)

+1

= 0.9

0.081 + 0.9 1 = 0.9161. 0.18 + 1

next page ...

CS4MN3 Final 2006

Page

7. (8 marks) Given four points (xi , yi ), i = 1, 2, 3, 4, Find the linear least squares approximation of the data set. Specically, formulate the problem as Ax b. (a) What is the coecient matrix A? What is the right side vector b? (b) How would you solve this problem using the QR decomposition of A? (c) Suppose that you nd A is ill-conditioned, how would you solve this problem using the SVD of A? (a)

A= (b)

x1 x2 x3 x4

1 1 1 1

b=

y1 y2 y3 y4

A = Q

R 0 b1 b2

b = QT b = Rx = b1 , (c) A = U V T

solve for x

and b = U T b.

Set small i to zero. Suppose k > k+1 = = n = 0, then zi = bi /i , and the solution x = V z. END! for i = 1, ..., k, zk+1 = zn = 0,

S-ar putea să vă placă și