{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# t1_08 - 3 cos x x = This equation has root between 0 and 1...

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

DALHOUSIE UNIVERSITY (Department of Engineering Mathematics) ENGM-3052 Applied Numerical Methods TEST # 1 DATE: OCT 6, 2008 TIME: 1630-1830 1) This test will count 25% towards the final marks. 2) Do all problems. 3) The numbers in parenthesis denote the marks to each part 4) You are allowed to bring one 8.5 x 11 cheat sheet (one side) 5) Pass in your cheat sheet along with your exam booklet. 6) All test answers must be written in your exam booklet. 7) The only electronic equipment allowed on your desktop is a non-graphing calculator. (10) 1. Find an approximate value of 1 0 2 ) sin( dx x by finding a Taylor series of ) sin( 2 x to ) ( 14 x O . (15) 2. Consider the data below: x -1 0 1 2 ) ( x f -1.4 2.1 3.3 4 (a) Derive from the Taylor Series the most accurate algorithm to calculate ) 1 ( f . Do the calculation. (b) Use the trapezoidal rule to calculate dx x f - 2 1 ) ( . (5) 3. Use the trapezoidal rule to approximate dx x x 2 0 2 ) sin( with 5 panels. (10) 4. (a) Use Newton’s Method to approximate the root of

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

View Full Document
This is the end of the preview. Sign up to access the rest of the 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', i-1, ???? ); i= ???? ; end...
View Full Document

{[ snackBarMessage ]}