Class RombergMatrixIntegrator<T extends MatrixQuadrature>

java.lang.Object
com.irurueta.numerical.integration.MatrixIntegrator
com.irurueta.numerical.integration.RombergMatrixIntegrator<T>
Type Parameters:
T - instance of a quadrature to be used for Romberg's method integration.
Direct Known Subclasses:
RombergDoubleExponentialRuleQuadratureMatrixIntegrator, RombergExponentialMidPointQuadratureMatrixIntegrator, RombergInfinityMidPointQuadratureMatrixIntegrator, RombergLowerSquareRootMidPointQuadratureMatrixIntegrator, RombergMidPointQuadratureMatrixIntegrator, RombergTrapezoidalQuadratureMatrixIntegrator, RombergUpperSquareRootMidPointQuadratureMatrixIntegrator

public abstract class RombergMatrixIntegrator<T extends MatrixQuadrature> extends MatrixIntegrator
Base integrator for implementations based on Romberg's method. Romberg's method is a generalization of Simpson's method for higher order integration schemes. This can be used to computed integration with less function evaluations for the same level of accuracy when more assumptions of function "smoothness" can be made. Implementations of Romberg's method are quite powerful for sufficiently smooth (e.g., analytic) integrands, integrated over intervals that contain no singularities, and where the endpoints are also non-singular. In such circumstances, Romberg's method, takes many, many fewer function evaluations than other method's such as Simpson's.
  • Field Details

    • EPS

      public static final double EPS
      Default accuracy.
      See Also:
    • JMAX

      private static final int JMAX
      Maximum number of allowed steps.
      See Also:
    • JMAXP

      private static final int JMAXP
      Maximum number of allowed steps + 1.
      See Also:
    • K

      private static final int K
      Minimum required number of steps.
      See Also:
    • q

      protected final T extends MatrixQuadrature q
      Quadrature used for integration.
    • eps

      protected final double eps
      Required accuracy.
    • s

      private final com.irurueta.algebra.Matrix[] s
      Successive trapezoidal approximations.
    • h

      private final double[] h
      Successive trapezoidal step sizes.
  • Constructor Details

    • RombergMatrixIntegrator

      protected RombergMatrixIntegrator(T q, double eps)
      Constructor.
      Parameters:
      q - Quadrature used for integration.
      eps - Required accuracy.
  • Method Details

    • integrate

      public void integrate(com.irurueta.algebra.Matrix result) throws IntegrationException
      Integrates function between provided lower and upper limits.
      Specified by:
      integrate in class MatrixIntegrator
      Parameters:
      result - instance where result of integration will be stored.
      Throws:
      IntegrationException - if integration fails for numerical reasons.
    • getIntegratorType

      public IntegratorType getIntegratorType()
      Gets type of integrator.
      Specified by:
      getIntegratorType in class MatrixIntegrator
      Returns:
      type of integrator.
    • create

      public static RombergMatrixIntegrator<MatrixQuadrature> create(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener, double eps, QuadratureType quadratureType) throws com.irurueta.algebra.WrongSizeException
      Creates an integrator using Romberg's method. It must be noticed that upper limit of integration is ignored when using exponential mid-point quadrature type.
      Parameters:
      a - Lower limit of integration.
      b - Upper limit of integration.
      listener - listener to evaluate a single dimension function at required points.
      eps - required accuracy.
      quadratureType - quadrature type.
      Returns:
      created integrator.
      Throws:
      IllegalArgumentException - if provided quadrature type is not supported.
      com.irurueta.algebra.WrongSizeException - if size notified by provided listener is invalid.
    • create

      public static RombergMatrixIntegrator<MatrixQuadrature> create(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener, QuadratureType quadratureType) throws com.irurueta.algebra.WrongSizeException
      Creates an integrator using Romberg's method and having default accuracy. It must be noticed that upper limit of integration is ignored when using exponential mid-point quadrature type.
      Parameters:
      a - Lower limit of integration.
      b - Upper limit of integration.
      listener - listener to evaluate a single dimension function at required points.
      quadratureType - quadrature type.
      Returns:
      created integrator.
      Throws:
      IllegalArgumentException - if provided quadrature type is not supported.
      com.irurueta.algebra.WrongSizeException - if size notified by provided listener is invalid.
    • create

      public static RombergMatrixIntegrator<MatrixQuadrature> create(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener, double eps) throws com.irurueta.algebra.WrongSizeException
      Creates an integrator using Romberg's method and default quadrature type. It must be noticed that upper limit of integration is ignored when using exponential mid-point quadrature type.
      Parameters:
      a - Lower limit of integration.
      b - Upper limit of integration.
      listener - listener to evaluate a single dimension function at required points.
      eps - required accuracy.
      Returns:
      created integrator.
      Throws:
      com.irurueta.algebra.WrongSizeException - if size notified by provided listener is invalid.
    • create

      public static RombergMatrixIntegrator<MatrixQuadrature> create(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener) throws com.irurueta.algebra.WrongSizeException
      Creates an integrator using Romberg's method and having default accuracy and quadrature type. It must be noticed that upper limit of integration is ignored when using exponential mid-point quadrature type.
      Parameters:
      a - Lower limit of integration.
      b - Upper limit of integration.
      listener - listener to evaluate a single dimension function at required points.
      Returns:
      created integrator.
      Throws:
      com.irurueta.algebra.WrongSizeException - if size notified by provided listener is invalid.
    • cast

      Casts integrator to a quadrature integrator without wildcard parameter.
      Parameters:
      integrator - integrator to be cast.
      Returns:
      cast integrator.