Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The New Profit Frontier

Authors: Ed Burnett

1st Edition

0964535629, 978-0964535626

More Books

Students also viewed these Databases questions