Class DoubleExponential
- java.lang.Object
-
- dev.nm.analysis.integration.univariate.riemann.substitution.DoubleExponential
-
- All Implemented Interfaces:
SubstitutionRule
- Direct Known Subclasses:
DoubleExponential4HalfRealLine,DoubleExponential4RealLine,MixedRule
public class DoubleExponential extends Object implements SubstitutionRule
This transformation speeds up the convergence of the Trapezoidal Rule exponentially. It applies to a finite integral region [a, b]. The tricky part of using this transformation is to figure out a good range for t. If there is information about the integrand available,SubstitutionRule.ta()andSubstitutionRule.tb()should be overridden. The substitution isx = 0.5 * (b + a) + 0.5 * (b - a) * tanh(c * sinh(t))
- See Also:
- Wikipedia: Tanh-sinh quadrature
-
-
Constructor Summary
Constructors Constructor Description DoubleExponential(UnivariateRealFunction f, double a, double b, double c)Construct aDoubleExponentialsubstitution rule by trying to automatically determine the substitution rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UnivariateRealFunctiondx()the first order derivative of the transformation: x'(t) = dx(t)/dtdoubleta()Get the lower limit of the integral.doubletb()Get the upper limit of the integral.UnivariateRealFunctionx()the transformation: x(t)
-
-
-
Constructor Detail
-
DoubleExponential
public DoubleExponential(UnivariateRealFunction f, double a, double b, double c)
Construct aDoubleExponentialsubstitution rule by trying to automatically determine the substitution rule.- Parameters:
f- the integranda- the lower limitb- the upper limitc- a constant; usually either 0 or 0.5 * PI
-
-
Method Detail
-
x
public UnivariateRealFunction x()
Description copied from interface:SubstitutionRulethe transformation: x(t)- Specified by:
xin interfaceSubstitutionRule- Returns:
- x(t)
-
dx
public UnivariateRealFunction dx()
Description copied from interface:SubstitutionRulethe first order derivative of the transformation: x'(t) = dx(t)/dt- Specified by:
dxin interfaceSubstitutionRule- Returns:
- x'(t) = dx(t)/dt
-
ta
public double ta()
Get the lower limit of the integral. The accuracy of using the double exponential transformation lies in choosing the correct region of t for integration. It is very hard to determine the region without knowing about the function, such as where the singularities are. If the region of t is known, override this function.- Specified by:
tain interfaceSubstitutionRule- Returns:
- the lower limit
-
tb
public double tb()
Get the upper limit of the integral. The accuracy of using the double exponential transformation lies in choosing the correct region of t for integration. It is very hard to determine the region without knowing about the function, such as where the singularities are. If the region of t is known, override this function.- Specified by:
tbin interfaceSubstitutionRule- Returns:
- the upper limit
-
-