Select Page

CMPSC 455 Penn State University Implement Romberg Integration Lab Report

Question Description

You are to write a MATLAB function to implement Romberg integration with an error estimate at the end. Your romberg function should have the form [int,err,ier]=romberg(f,a,b,tol)

The input variables are • f–a function handle for the function to be integrated • a,b– the limits of integration, i.e., you are approximating I =Zb a f(x)dx. • tol-the error between the last two Romberg approximations. In the notation in the notes this means that |Tk(h)Tk1(h)|?tol. and Tk(h) is accepted as the integral.

The value of h for your ?rst approximation from the Trapezoid rule should satisfy h <<1. I recommend that h =( ba)/2j for some appropriate valueof j. The output variables are • int–The approximate integral. • err– The value ofTk(h)Tk1(h), the error estimate. • ier – You are to have a maximum of l0 levels of extrapolation, i.e., k = 10. If you reach 10 levels and|err| > tol, then ier = 1 (tolerence was not reached), otherwise ier = 0 (tolerence was reached).

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now