Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

ME681A: Module 4-Numerical Methods Assignment 2

Submission on 06.12.2020

1. Approximating an integrand, f (x), with a cubic polynomial whose graph interpolates through
quadruplets of consecutive data points yields the Simpson’s 3/8 rule. Similarly, approximating
the integrand with a fourth-degree polynomial whose graph interpolates quintets of consecutive
data points yields Boole’s rule. The integration formula for Simpson’s 3/8 rule and Boole’s
rule along with their errors, for evenly spaced points, are given as

2 8 6 7
h(7fi + 32fi+1 + 12fi+2 + 32fi+3 + 7fi+4 ), − f h , (1)
45 945

3 3 0000 5
h(fi + 3fi+1 + 3fi+2 + fi+3 ), − f h , (2)
8 80
respectively. Taking reference from the codes given in lectures 14 and 15 write a computer
programR in the language of your choice to find out the output for different values of P for inte-
1 2
grating 0 e−x dx. Further plot log2 (error) vs log2 (N ) and compare the slope of this plot with
respect to the accuracy of the method used. 25 marks.

2. Choose five points on a straight line, e.g., (−2, −2), (−1, −1), (0, 0), (1, 1), (2, 2). Move one
point 1 unit upward and downwards, and find the quadratic least squares polynomial. Do
this for each point. Graph the ten polynomials on common axes. Label them properly with
different colors. Which of the ten motions has the greatest effect and why? 25 marks.

You might also like