Question: 6. Romberg Algorithm in Matlahb Preparation: quad. Use helpdesk in Matlab to learn how to use the functions feval and (a). Write a Matlab function

 6. Romberg Algorithm in Matlahb Preparation: quad. Use helpdesk in Matlabto learn how to use the functions feval and (a). Write a

6. Romberg Algorithm in Matlahb Preparation: quad. Use helpdesk in Matlab to learn how to use the functions feval and (a). Write a Matlab function that computes the Romberg integration. One should be able to call the function by: >> R-romberg('f',a,b,n) where f is the naine of the function where f() is implmented, and a and b defines the integrating interval, and n is the size of your Romberg table. The function should return the whole Romberg table. The best approximation of the interval would be the value in R(n,n) You may follow the pseudo-code in the lecture notes, or implement your own. You may check your code against the result of the slation in Section 4.8, to make sure that your code work (b). Use your romberg to compute the integrals sin(r)dr 2/3) Compute also the errors. The exact values of the integrals are given in the paren- theses above. Print the crrors along the diagonal of the table, and note how it changes along the diagonal of the table. Use format short e in Matlab to display the error data. c). Explain why Romberg algorithm works poorly for the last integral (d). Use Matlab functions quad and quadl to compute the integrals in b). Use 1e-9 as tolerance for both integrations. Mark your observation

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!