Operations Management
July 11, 2020
Spanish Missions
July 11, 2020
Show all

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.

Leave a Reply

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