This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 3 ) cos( x x = . This equation has root between 0 and 1. Use 5 . = x as your starting point and do 4 iterations. (b) Use the Secant method to solve the equation in 4(a). Use 0 and 1 as your starting point and do 4 iterations. (10) 5. Consider the program below. Replace ???? by the correct expression in order for this program to work properly.(NOTE there are five of these question marks, answers should be on your exam booklet and not on your test paper) %Newton method clear;clc; f=inline('cos(x)x^3'); fp=inline('sin(x)3*x^2'); h=0.1; tol=1; x=0; % ****************** find brackets *********************** while( ???? >0) x=x+h; end %*************** initialize *************************** i=1; x(1)=x; % ***************** Newton's Method ********************** while(tol>10^8) x(i+1)= ????f(x(i))/fp(x(i)); tol=abs(x(i+1)x(i)); x(i)= ???? ; fprintf('x(%i) = %17.15f\n', i1, ???? ); i= ???? ; end...
View
Full Document
 Fall '09
 yao
 Numerical Analysis, exam booklet

Click to edit the document details