You are on page 1of 3

Homework 2, Ch E 5323, due Sep 15, 2011 at 11am (turn in a paper copy at the beginning of class) For all

Matlab work, create a Word document that includes all commented code and output for all the problems. Problem 1 (a) Write a Matlab function that uses Newtons method to solve for a real root of

f (x) =

x3 2.5x2 + 2x 1; 3

given an initial guess x0 . Use your results to show that Newtons method converges quadratically once the error becomes small by plotting log(k+1 ) vs. log(k ), where k = |xsolution xk | is the error associated with xk . Your programs output should be the exact convergence

rate y (where k+1 y ) for the nal step. y should be 2. Please label all axes and title k all plots. (b) Repeat part (a) using the Secant method instead of Newtons method. Again, your programs output should be the exact convergence rate y. y should be < 2. Please label all axes and title all plots. (c) fsolve and fzero are built-in Matlab functions that use Newton-like and Secant-like methods for solving non-linear problems. fzero can only be used on single equations whereas fsolve may be used on systems of equations. Use fzero to solve the following equation f (x) = x3 5x2 + 10x 6 + 0.1 sin(x); Plot the nal solution vs. initial guess for a range of initial guesses: 10 < x0 < 10. Hint: Type "help fzero" 1

Problem 2 Problem 2.A.1. in Beers book. Feel free to use Matlab to check your answers that you got by hand. Problem 3 Conceptual questions: Along with your simple "true/false/yes/no" answers on these questions, briey describe your reasoning behind your answer. (a) What condition ensures that the bisection method will nd a zero of a continuous nonlinear function f (x) in the interval a < x < b? What if it were noncontinuous? (b) How many function evaluations are required for each iteration of the secant method for one equation? (Think this one through.) (c) What is a 3x3 matrix whose kernel is larger than its range? (d) What vector constitutes the kernel of a nonsingular matrix? (e) Imagine you use Newtons method with the backtrack weak line search as discussed in class. Would this have the same convergence rate as the normal Newtons method? (f) If the errors at successive iterations of an iterative method are as follows, how would you characterize the convergence rate? (I) 102 , 104 , 108 , 1016 (II) 102 , 104 , 106 , 108

Problem 4 Use Broydens method to solve the following system of equations in a Matlab function. Use an initial guess of x = [1; 2]. Feel free to use the backslash \. x1 + 1.5x2 2 + 0.01/(x1 + x2 ) f(x) = 0 = 2x2 + 3x2 4 1 2

Problem 5

For the following matrices, determine whether a Cholesky decomposition can be done and if not, why not. (feel free to use Matlab to help you).

9 1 0 A = 1 3 2 1 2 10 B = A + AT

1 0 3 0 1.5 2 C= 3 2 1

You might also like