Class RungeKuttaIntegrator1D
- java.lang.Object
-
- com.opengamma.strata.math.impl.integration.Integrator1D<Double,Double>
-
- com.opengamma.strata.math.impl.integration.RungeKuttaIntegrator1D
-
public class RungeKuttaIntegrator1D extends Integrator1D<Double,Double>
Adapted from the forth-order Runge-Kutta method for solving ODE. See here for the maths. It is a very robust integrator and should be used before trying more specialised methods.
-
-
Constructor Summary
Constructors Constructor Description RungeKuttaIntegrator1D()
RungeKuttaIntegrator1D(double tol)
RungeKuttaIntegrator1D(double atol, double rtol)
RungeKuttaIntegrator1D(double absTol, double relTol, int minSteps)
Constructor from absolute and relative tolerance and minimal number of steps.RungeKuttaIntegrator1D(double tol, int minSteps)
RungeKuttaIntegrator1D(int minSteps)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getRelativeTolerance()
Double
integrate(Function<Double,Double> f, Double lower, Double upper)
1-D integration method.-
Methods inherited from class com.opengamma.strata.math.impl.integration.Integrator1D
integrate
-
-
-
-
Constructor Detail
-
RungeKuttaIntegrator1D
public RungeKuttaIntegrator1D(double absTol, double relTol, int minSteps)
Constructor from absolute and relative tolerance and minimal number of steps.The adaptable integration process stops when the difference between 2 steps is below the absolute tolerance plus the relative tolerance multiplied by the value.
- Parameters:
absTol
- the absolute tolerancerelTol
- the relative toleranceminSteps
- the minimal number of steps
-
RungeKuttaIntegrator1D
public RungeKuttaIntegrator1D(double tol, int minSteps)
-
RungeKuttaIntegrator1D
public RungeKuttaIntegrator1D(double atol, double rtol)
-
RungeKuttaIntegrator1D
public RungeKuttaIntegrator1D(double tol)
-
RungeKuttaIntegrator1D
public RungeKuttaIntegrator1D(int minSteps)
-
RungeKuttaIntegrator1D
public RungeKuttaIntegrator1D()
-
-
Method Detail
-
getRelativeTolerance
public double getRelativeTolerance()
-
integrate
public Double integrate(Function<Double,Double> f, Double lower, Double upper)
Description copied from class:Integrator1D
1-D integration method.- Specified by:
integrate
in classIntegrator1D<Double,Double>
- Parameters:
f
- The function to integrate, not nulllower
- The lower bound, not nullupper
- The upper bound, not null- Returns:
- The result of the integration
-
-