Function integrateQAWO

Calculate the integral of an oscillatory function over the finite interval (a,b).

Result!Real integrateQAWO(Func, Real) (
  scope Func f,
  Real a,
  Real b,
  Real omega,
  Oscillation weight,
  Real epsRel = cast(Real)1e-06,
  Real epsAbs = cast(Real)0
);

Use this to calculate the integral of f(x)*cos(omega*x) or f(x)*sin(omega*x) where f(x) is the (possibly singular) user-specified function and omega is a known constant. The weight function is specified by setting weight to Oscillation.cos or Oscillation.sin.

The rule evaluation component is based on the modified Clenshaw–Curtis technique. An adaptive subdivision scheme is used in connection with an extrapolation procedure, which is a modification of that in integrateQAGS() and allows the algorithm to deal with singularities in f(x).

See Also

integrateQAWF(), for similar integrals over an infinite interval.

Example

// Integrate exp(20*(x-1))*sin(256*x) over the interval (0,1)
real f(real x) { return exp(20*(x-1)); }
auto i = integrateQAWO(&f, 0.0L, 1.0L, 256.0L, Oscillation.sin, 1e-15L);