- Develop an algorithm which, for a given function f(x), interval bounds a and b with a < b, and a prescribed number of subintervals n, applies the multiple application trapezoidal rule to approximate the integral.
- Develop an algorithm which, for a given function f(x), interval bounds a and b with a < b, and a prescribed number of subintervals n, approximates the integral
according to the following procedure:
- If n = 1, it applies the trapezoidal rule.
- If n is even, it applies the multiple application Simpsons 1/3 rule.
- If n 3 and n is odd, it applies the multiple application Simpsons 1/3 rule on the first n 3 subintervals, and applies the Simpsons 3/8 rule on the last three subintervals.
- Develop an algorithm which, for a given function f(x), interval bounds a and b
with a < b, and error tolerance per subinterval tol, applies adaptive quadrature to approximate the integral (based on the pseudocode that was presented in the recorded lectures and can be found on page 642 of the textbook).
- Apply the algorithms you developed in questions 1-3 above to approximate
for varying values of n and tol. Note that this integral is not easy to evaluate analytically! Using the true value of 0.602298, plot t as a function of n for the algorithms you developed in questions 1 and 2, and plot t as a function of tol for the algorithm you developed for question 3. Use your best judgement to determine appropriate ranges of values for n and tol to be included in the plots.
Reviews
There are no reviews yet.