SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.integration.univariate.riemann.substitution
Class DoubleExponential

java.lang.Object
  extended by com.numericalmethod.suanshu.analysis.integration.univariate.riemann.substitution.Substitution
      extended by com.numericalmethod.suanshu.analysis.integration.univariate.riemann.substitution.DoubleExponential
Direct Known Subclasses:
DoubleExponential4HalfRealLine, DoubleExponential4RealLine, MixedRule

public class DoubleExponential
extends Substitution

This transformation speeds up the convergence of the Trapezoidal Rule exponentially. It applies to a finite integral region [a, b].

The substitution is

 x = 0.5 * (b + a) + 0.5 * (b - a) * tanh(c * sinh(t))
 

The tricky part of using this transformation is to figure out a good range for t. The user should override Substitution.ta() and Substitution.tb() if there is information about the integrand available.

See Also:
Wikipedia: Tanh-sinh quadrature

Field Summary
 double a
          the lower limit
 double b
          the upper limit
 double c
          a constant; usually either 0 or 0.5 * PI
 UnivariateRealFunction f
          the original integrand
 
Fields inherited from class com.numericalmethod.suanshu.analysis.integration.univariate.riemann.substitution.Substitution
dx, x
 
Constructor Summary
DoubleExponential(UnivariateRealFunction f, double c, double a, double b)
          Construct an instance of the DoubleExponential substitution rule.
 
Method Summary
 double ta()
          Get the lower limit of the integral.
 double tb()
          Get the upper limit of the integral.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

f

public final UnivariateRealFunction f
the original integrand


a

public final double a
the lower limit


b

public final double b
the upper limit


c

public final double c
a constant; usually either 0 or 0.5 * PI

Constructor Detail

DoubleExponential

public DoubleExponential(UnivariateRealFunction f,
                         double c,
                         double a,
                         double b)
Construct an instance of the DoubleExponential substitution rule. We try to automatically determine the substitution rule.

Parameters:
f - the integrand; with f, we try to determine the lower and upper limits automatically
c - a constant; usually either 0 or 0.5 * PI
a - the lower limit
b - the upper limit
Method Detail

ta

public double ta()
Get the lower limit of the integral. The accuracy of using the Double Exponential transformation lies on choosing the region of t for integration. It is very hard to determine the appropriate region without knowing much about the function, such as where its singularities are.

If the user knows about t's region, s/he should override this function.

Specified by:
ta in class Substitution
Returns:
the lower limit

tb

public double tb()
Get the upper limit of the integral. The accuracy of using the Double Exponential transformation lies on choosing the region of t for integration. It is very hard to determine the appropriate region without knowing much about the function, such as where its singularities are.

If the user knows about t's region, s/he should override this function.

Specified by:
tb in class Substitution
Returns:
the upper limit

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.