Special offer for new customers: 10% OFF your first order! Use coupon: FLEXclose

Romberg integration code

Write a program that numerically computes the integral of any given continuous function using Romberg integration. You may hardcode the to-be-integrated function in your program, but it should only appear once in your code, so its easy to change to a different function. Likewise for the endpoints of the interval of integration and error tolerance.

You may use any common programming language, such as Python, C/C++, Java.

I’ve posted the spreadsheet (attached) where I demoed Romberg integration; the output of your program should look like that table. You should also run your program on at least one integral for which you “can’t” do analytically to see if it works. (Integral of e^(-x^2/2) over any finite interval is a good one if you can’t think of another one you like.

You can leave a response, or trackback from your own site.
Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes
error: Content is protected !!