Course Solutions Uncategorized (Solved) : Numerical Integration 4 Point 5 Point Gauss Quadrature Given Range B Function Pointer F Se Q36970088 . . . .

(Solved) : Numerical Integration 4 Point 5 Point Gauss Quadrature Given Range B Function Pointer F Se Q36970088 . . . .

 

Numerical integration with 4 point and 5 point Gauss quadraturegiven a range a to b and a function pointer f. Seehttps://en.wikipedia.org/wiki/Gaussian_quadrature for moreinformation. Implement the following two functions:

typedef double (*dfunc)(double);

double gaussquad4(double a, double b, dfunc f);

double gaussquad5(double a, double b, dfunc f);

Use each method to integrate the function 4/(x 2+1) from 0 to 1(you should get pi) and compare the error against M_PI and thesimple integration method shown in class with increasing number ofsteps (10, 100, 1000, 10000, 100000). How many iterations do youneed to get a better answer than gaussquad4 and gaussquad5?

Expert Answer


An answer will be

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post