go to Examples
For example, using trapezoidal rule:
To use Gaussian quadrature to solve a general integral, you do the following:
x = {(b-a)*s + a + b}/2
Integral from a to b of f = (b-a)/2 * [a*f(@s=-0.5773) + b*f(@s=0.5773) ]
Use Romberg technique to find the integral of exp(-x2)
between the
limits a=0.2 and b=1.5.
The correct result (to 5 places) is 0.65882
The largest possible grid interval is: h = (b-a)/2 = 0.65 which
gives 3 (=M) grid points. The trapezoidal rule formula is quite simple:
Subdivide this interval by using d = (b-a)/4 = 0.325 which gives
5 grid points. The trapezoidal rule formula in this case is:
Using EI = E2 + 1/3 ( E2 - E1 ) = 0.65859
Clearly, this estimate
is better than the ones which came before it.
Subdivide the interval further: using D = (b-a)/8 = 0.1625, this gives 9 grid points. The trapezoidal rule is a bit lengthy to write down. When evaluated, you get the result: E3 = 0.65898 which is better than the E1, E2 or EI estimates. However, combining the E2 and E3 estimates using the Romberg formula obtains: EI2 = 0.65881. If one then combines EI and EI2 using the Romberg technique, one obtains: EF = 0.65882, the best estimate yet.
Some books will refer to a "Romberg table" Which would have the order as follows:
interval = h       E1          
               
         
0.66211
interval = d       E2     EI      
               
      0.65947     0.65859
interval = D     E3     EI2      
  EF        
    0.65898     0.65881     0.65882
Use a "Romberg table" to compare with Trapezoidal rule:
                 
Simpson's                
          Trapezoidal
n = 5       0.65860      
               
                   
0.65947
n = 9       0.65881       0.65882
               
      0.65898     0.65881
Back to ATM 150 homepage