581practice1 - x (1) =-1 . 6, and A2.dat is the mid point (...

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

View Full Document Right Arrow Icon
AMATH 581 Practice 1: Autumn 2011 DUE: midnight, Thursday 10/6 I Consider the function f ( x ) = x sin(3 x ) - exp( x ) and solve for the x-value near x ≈ - 0 . 5 that satisfies f ( x ) = 0. In the first part, use the Newton-Raphson method with the initial guess x (1) = - 1 . 6 to converge (in absolute value) to the solution to 10 - 6 . Keep track of the number of iterations until convergence is achieved (NOTE: please check convergence with f ( x n ) not f ( x n +1 )). In the second part, use bisection with the initial end points x = - 0 . 7 and x = - 0 . 4. Keep track of the mid point values and number of iterations until an accuracy of 10 - 6 is achieved. ANSWERS : Should be written out as A1.dat, A2.dat, and A3.dat. Specifically, A1.dat is the vector of x-values in the Newton method starting with the initial guess
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x (1) =-1 . 6, and A2.dat is the mid point ( x mid ) values in the bisection method for successive itera-tions. A3.dat is a 1x2 vector with the number of iterations for the Newton and bisection respectively as the two components. II Let the following be dened: A = " 1 2-1 1 # , B = " 2 0 0 2 # , C = " 2 0-3 0 0-1 # , D = 1 2 2 3-1 0 x = " 1 # , y = " 1 # , z = 1 2-1 , Calculate the following: (a) A + B , (b) 3 x- 4 y , (c) Ax , (d) B ( x-y ), (e) D x , (f) D y + z , (g) AB , (h) BC , (i) CD ANSWERS : Should be written out as A4.datA12.dat NOTE: Do not put any exclamation marks (!) in your code....
View Full Document

This note was uploaded on 03/23/2012 for the course AMATH 581 taught by Professor Staff during the Fall '08 term at University of Washington.

Ask a homework question - tutors are online