# hw3 - 6[3pt Write an implementation of the Secant...

This preview shows page 1. Sign up to view the full content.

CS 257 Numerical Methods - Homework 3 September 17, 2006 1. [1pt] Section 3.2 #15 2. [1pt] Section 3.2 #28 (use MATLAB if you wish) 3. [1pt] Using the MATLAB implementation of Newton’s method (see page 106) on the course webpage or one of your own, solve the following problems. Compute a zero of f ( x ) = x 4 - 5 x 3 + 9 x 2 - 7 x + 2 with x 0 = 2 . 2, call this value ˆ x . Now create a semilog plot (not to be turned in) with blue lines showing the error e i = | ˆ x - x i | at each iteration. 4. [1pt] Repeat the previous problem, but change x 0 = 0 . 8 and the line color to red. Create a single semilog plot titled Plot 1 (to be turned in) with the results from the previous problem (in blue) and this problem (in red). You may ﬁnd the built-in MATLAB documentation for plot , semilog and hold on helpful. 5. [1pt] Give a short explanation (no more than 50 words) for the diﬀerence in the results of the previous experiment (see pgs. 109-111 of your text).
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6. [3pt] Write an implementation of the Secant Method (see page 127) to be turned in. 7. [2pt] Create a semilog plot titled Plot 2 (to be turned in) which compares the error of Newton’s method (in blue) with the Secant Method (in red) for f ( x ) = x 6-x-1. For Newton’s method use x = 1 . 5 and for Secant Method use x = 1 . 5 , x 1 = 1 . 4. Additionally, for the errors associated with Newton’s method compute (and print out) the ratios e i +1 /e 2 i and for the Secant method compute (and print out) the ratios e i +1 /e 1 . 6 i . For this problem you should turn in one plot and the two lists of error ratios. 8. [1pt] Give a short explanation (no more than 50 words) for the results of the previous experiment. 9. [1pt] Explain (in no more than 50 words) when, if ever, the Secant Method should be used. 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online