Solution to Midterm exam Fall 2010--a

Solution to Midterm exam Fall 2010--a - EGM 3344...

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

View Full Document Right Arrow Icon
EGM 3344 Introduction to Numerical Methods of Engineering Analysis Midterm Exam Fall 2010 Name: , Grade: Closed book; 1 page formula sheet (8.5″ x 11″). Only scientific calculator is allowed. 1a. (6 points) The true value of x T =0.061838367… was approximated by John as x A =0.0 618 3. How many significant digits does his x A have based on the given x T ? Solution: # of significant digits = 3 1b. (6 points) For f ( x )= x 3 +e 2( x-1) , the Taylor series expansion near x =1 in the form of f ( x )= a 0 + a 1 ( x -1) + a 2 ( x -1) 2 + a 3 ( x -1) 3 + … is needed. What are the values of a 0 , a 1 , and a 2 ? Solution: f(1)=1+1=2, f (1)=3+2=5, f =6+4=10 f(x)~2+5(x-1)+5(x-1) 2 +… a 0 =2, a 1 =5 and a 2 =5. 1c. (6 points) A student wrote the following function: function result=myfun(a) reciprocal=1/a; result=2*reciprocal In the Matlab command window, the student typed the following: >>clear >>a=3 >>myfun(a) >>reciprocal What value do you expect Matlab to print for reciprocal , and why? Solution: Matlat will give: “ ??? Undefined function or variable 'reciprocal' . ” Basically, you should not get any meaningful value for 'reciprocal' since it is only defined INSIDE the function and it not exported to the workspace. 1d.
Background image of page 1

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

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

Page1 / 4

Solution to Midterm exam Fall 2010--a - EGM 3344...

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