Question: Scenario: You work as a software engineer in a company that develops software for providing approximate numerical solutions to complex mathematical problems. Your manager asked

Scenario: You work as a software engineer in a company that develops software for providing approximate numerical solutions to complex mathematical problems. Your manager asked you to develop two software products for (i) finding the roots of complex functions and (ii) performing complex integrations. Task 1: i) = iii) iv) Write three MATLAB functions that computes the integral of a function from a to b based on the number of sub-intervals n. Each function should be based on one of the following integral approximation methods: (i) Simpson, (ii) Trapezoidal, and (iii) Mid-ordinate rules. Use your MATLAB codes to compute the integral of f(x) = (2x from a = 0 to b = 10 with 5 sub-intervals. Compute the true value of the integral analytically. Based on the computed true value in the previous part, find the absolute relative true error for each method with different number of sub-intervals n starting from n=1 to n=20. Plot the relation between n and the absolute relative true error value. Compute the time needed for each method by fixing n=20. Comment on the accuracy and applicability of the three rules when applied to the above example. v) vi) vii)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
