|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.analysis.integration.univariate.riemann.ChangeOfVariable
public class ChangeOfVariable
Change of variable can easy the computation of some integrals, such as improper integrals. The idea is to transform a dependent variable to another so that the "new" integral is easier to compute.
We set
x = x(t)
t = x-1(x) = t(x)
/ b /t(b)
| f(x) dx = | f(x(t)) * x'(t) dt
/ a /t(a)
This implementation does not assume any particular integrator,
other than that the integrator is an IterativeIntegrator.
The user may combine a substitution rule with his favorite iterative integrator.
| Constructor Summary | |
|---|---|
ChangeOfVariable(Substitution change,
IterativeIntegrator integrator)
Construct an integrator that uses change of variable to do integration. |
|
| Method Summary | |
|---|---|
UnivariateRealFunction |
fdx(UnivariateRealFunction f)
Get the integrand in the "transformed" integral. |
double |
integrate(UnivariateRealFunction f,
double a,
double b)
Integrate function f from a to b. |
double |
precision()
Get the convergence threshold. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChangeOfVariable(Substitution change,
IterativeIntegrator integrator)
change - the substitution formulaintegrator - the integrator.
If there is a singularity at an endpoint, the integrator should use an OPEN formula such as Midpoint;
otherwise, use an integrator with a CLOSED formula.| Method Detail |
|---|
public double integrate(UnivariateRealFunction f,
double a,
double b)
Integratorf from a to b.
/ b
| f(x) dx
/ a
integrate in interface Integratorf - a univariate functiona - lower limitb - upper limit
public UnivariateRealFunction fdx(UnivariateRealFunction f)
g(t) = f(x(t)) * x'(t)
f - the integrand in the original integral
public double precision()
Integrator
For example, for an IterativeIntegrator,
the integral is considered converged
if the relative error of two successive sums is less than the threshold.
precision in interface Integrator
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||