Class SimpsonMatrixIntegrator<T extends MatrixQuadrature>

java.lang.Object
com.irurueta.numerical.integration.MatrixIntegrator
com.irurueta.numerical.integration.SimpsonMatrixIntegrator<T>
Type Parameters:
T - a quadrature.
Direct Known Subclasses:
SimpsonDoubleExponentialRuleQuadratureMatrixIntegrator, SimpsonInfinityMidPointQuadratureMatrixIntegrator, SimpsonLowerSquareRootMidPointQuadratureMatrixIntegrator, SimpsonMidPointQuadratureMatrixIntegrator, SimpsonTrapezoidalQuadratureMatrixIntegrator, SimpsonUpperSquareRootMidPointQuadratureMatrixIntegrator

public abstract class SimpsonMatrixIntegrator<T extends MatrixQuadrature> extends MatrixIntegrator
Base integrator for implementations based on Simpson's method. Simpson's method is an optimization of Trapezoidal quadrature integrator. Implementations of this class will in general be more efficient than Trapezoidal quadrature matrix integrators (i.e., require fewer function evaluations) when the matrix function to be integrated has a finite fourth derivative (i.e., a continuous third derivative).
  • Field Details

    • EPS

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

      private static final int JMIN
      Minimum required number of steps.
      See Also:
    • JMAX

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

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

      private final double eps
      Required accuracy.
  • Constructor Details

    • SimpsonMatrixIntegrator

      protected SimpsonMatrixIntegrator(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 SimpsonMatrixIntegrator<MatrixQuadrature> create(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener, double eps, QuadratureType quadratureType) throws com.irurueta.algebra.WrongSizeException
      Creates an integrator using Simpson's method.
      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 SimpsonMatrixIntegrator<MatrixQuadrature> create(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener, QuadratureType quadratureType) throws com.irurueta.algebra.WrongSizeException
      Creates an integrator using Simpson's method and having default accuracy.
      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 SimpsonMatrixIntegrator<MatrixQuadrature> create(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener, double eps) throws com.irurueta.algebra.WrongSizeException
      Creates an integrator using Simpson's method and default 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 SimpsonMatrixIntegrator<MatrixQuadrature> create(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener) throws com.irurueta.algebra.WrongSizeException
      Creates an integrator using Simpson's method and having default accuracy and 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.
    • normMin

      private static double normMin(com.irurueta.algebra.Matrix a)
      Estimates smallest norm of provided matrix. Smallest norm is used to ensure convergence of all elements in matrix.
      Parameters:
      a - matrix to compute min norm for.
      Returns:
      estimated min norm.
    • cast

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