Question: Write a program to compute the integral I=ff(r)dr where f(x)= ao+ar+ az + a3z+ar+asz and do ==0.84885406 01 = 31.51924706 02 =-137.66731262 03 ==240.55831238
Write a program to compute the integral I=ff(r)dr where f(x)= ao+ar+ az + a3z+ar+asz and do ==0.84885406 01 = 31.51924706 02 =-137.66731262 03 ==240.55831238 04 = -171.45245361 as = 41.95066071 with a=0.0 and b= 1.5 using all the following approaches (a) exact integration (when the integrand is a polynomial function, the integral can be exact). (b) trapezoidal rule with the number of sub-intervals n,= (1,2,3,.,12) = (c) Simpson's one-third rule with the number of sub-intervals n, (2, 4, 6, 8, 10, 12) (d) Simpson's three-eights rule with the number of sub-intervals n, (3,6,9,12} M Please tabulate your results for (b), (c) and (d) and compare your results with the exact solution you obtained in (a). Show the order of accuracy of the methods used in (b), (c) and (d) by computing log(ei/e-1) log(n-1/n,) order= i= 0, 1,... where is the absolute error between the numerical integration and the exact solution n, is the number of intervals. Note the above formula becomes calculable only when 121
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
