Topic 13.3: Romberg Integration (Maple)

Contents Previous Chapter Start of Chapter Previous Topic Introduction Notes Theory HOWTO Examples Engineering Error Questions Matlab Maple Next Topic Next Chapter

The following commands in Maple:

with( Student[Calculus1] ):
R := Array( 0..5, 0..5, 0 ):
R[0,0] := Student:-Calculus1:-ApproximateInt( exp(-x)*cos(x), x = 0.0..10.0,
   method = trapezoid, partition = 1 ):

for i from 1 to 5 do
   R[i, 0] := Student:-Calculus1:-ApproximateInt( exp(-x)*cos(x), x = 0.0..10.0,
      method = trapezoid, partition = 2^i );
   for j from 1 to i do
      R[i, j] := (4^j*R[i, j - 1] - R[i - 1, j - 1])/(4^j - 1);
   end do;
end do:

convert( R, Matrix );
int( exp(-x)*cos(x), x = 0..10 );
evalf( % );

For more help on ApproximateInt or on the Student[Calculus1] package, enter:

?ApproximateInt
?Student,Calculus1

Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.