sol_finalex1

# sol_finalex1 - NAME TA NAME 1 30 2 30 3 30 4 35 5 35 EMAIL...

This preview shows pages 1–3. Sign up to view the full content.

NAME ________________________________ EMAIL ID____________ TA NAME_____________________________ SECTION #________ 1 2 3 4 5 6 Total 30 30 30 35 35 40 200 points Problem 1) [30 pts.] Using NEWTON’S METHOD of root finding, obtain an approximation to the root of the equation: 0 1 x 3 x ) x ( f 2 3 = + - = Assume a starting guess of x=1.0 . YOU MUST : a) use four decimal digits in your calculations, b) iterate three times, showing the results in the table c) show all your equations and calculations for the first iteration. x n f ( x n ) df/dx( x n ) x n+1 1 -1 -3 0.6667 0.6667 -0.0371 -2.6667 0.6528 0.6528 -0.0003 -2.6384 0.6527 Where, using Newton’s method ( 29 n n n 1 n x dx df ) x ( f x x - = - 1 x 3 x ) x ( f 2 3 + - = ) 2 x ( x 3 x 6 x 3 ) x ( dx df 2 - = - = For first iteration ( 29 ( 29 1 1 1 3 1 ) 1 ( f 2 3 - = + - = ( 29 ( 29 3 1 6 1 3 ) 1 ( dx df 2 - = - = ( 29 ( 29 6667 . 0 3 ) 1 ( 1 x 1 n = - - - = -

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

View Full Document
Problem 2) [ 30 pts. ] Predict the output of the following MatLab m-files. Put your answers in the box to the right of each segment. Each m file is independent from the others . 2a) 2b) 2c) 2d) clear y=[0 1 2;2 3 4;4 5 6]; z=y(1,:); x=y(3,:); out=[x;z]; fprintf(‘%2.0f %2.0f\n’,out) clear x=2; i=2; while(x<10) x=x+2; if(x>i) fprintf('\nTrue'); else fprintf('\nFalse'); end; i=i*i; end; clear a=[5 9 6 2];
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

sol_finalex1 - NAME TA NAME 1 30 2 30 3 30 4 35 5 35 EMAIL...

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

View Full Document
Ask a homework question - tutors are online