Question: 4 (a) Write, test and debug an adaptive 3-point Gaussian integration code gadap.m of the form function [int, abt] = gadap(a, b, f, r, tol)

 4 (a) Write, test and debug an adaptive 3-point Gaussian integrationcode gadap.m of the form function [int, abt] = gadap(a, b, f,

4 (a) Write, test and debug an adaptive 3-point Gaussian integration code gadap.m of the form function [int, abt] = gadap(a, b, f, r, tol) % a,b: interval endpoints with a b % f: function handle f (x, r) to integrate % r: parameters for f % to1: User-provided tolerance for integral accuracy % nt: Approximation to the integral % abt: Endpoints and approximations Build a list abt = {a,, bi, tj, , [an, bn,tn]} of n intervals [aj, bj] and ap- proximate integrals t, J9 f(x,r)dx, computed with 3-point Gaussian in- T, r)dx, computed wl point GGaussian in tegration from problem 3. Initialize with n -1 and [a1, bi] - [a, b]. At eaclh step j = 1,2 , subdivide interval j into left and right half-intervals I and r, and approximate the integrals t and tr over each half-interval by 3-point Gauss ian quadrature. If 4 (a) Write, test and debug an adaptive 3-point Gaussian integration code gadap.m of the form function [int, abt] = gadap(a, b, f, r, tol) % a,b: interval endpoints with a b % f: function handle f (x, r) to integrate % r: parameters for f % to1: User-provided tolerance for integral accuracy % nt: Approximation to the integral % abt: Endpoints and approximations Build a list abt = {a,, bi, tj, , [an, bn,tn]} of n intervals [aj, bj] and ap- proximate integrals t, J9 f(x,r)dx, computed with 3-point Gaussian in- T, r)dx, computed wl point GGaussian in tegration from problem 3. Initialize with n -1 and [a1, bi] - [a, b]. At eaclh step j = 1,2 , subdivide interval j into left and right half-intervals I and r, and approximate the integrals t and tr over each half-interval by 3-point Gauss ian quadrature. If

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!