Solution to Midterm exam Fall 2010--a

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

Info icon This 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.
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern