hw6 - Due CS 257(Luke Olson Homework#6 Problem 1 Problem 1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Due: October 16, 2008 CS 257 (Luke Olson): Homework #6 Problem 1 Problem 1 You are writing an API for a finance company which is in need of a solver for finding the roots of nonlinear equations (i.e. finding an x such that f ( x ) = 0). You decide to implement Newton’s method in MATLAB. (Newton’s method is given in Lecture 13.) The function takes as arguments f,f ,x ,maxiter where f is the function we want to find the zeros of, f its derivative, x the initial guess and maxiter is the maximum number of iterations. For each iteration, output the following table. Iteration number x i f ( x i ) f ( x i ) /f ( x i- 1 ) 2 f ( x i ) /f ( x i- 1 ) Run your program on the following test cases a. f ( x ) = e- x- cos( x ), x = π/ 2, maxiter = 10 b. f ( x ) = 2 x 3- 9 x 2 + 12 x + 15, x = [2 . 99 , 3 , 3 . 01], maxiter = [20 , 4 , 20] c. f ( x ) = p | x | ,x = 0 . 5 ,maxiter = 10 hint: f ( x ) = sign ( x ) 2 √ | x | and for each case, determine if the method converges. If so, is the convergence quadratic or linear? If is not quadratic explain why.quadratic explain why....
View Full Document

This note was uploaded on 07/10/2011 for the course CS 257 taught by Professor Olson during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 2

hw6 - Due CS 257(Luke Olson Homework#6 Problem 1 Problem 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online