Class NumericalIntegration

Object
NumericalIntegration

public class NumericalIntegration
extends Object
The NumericalIntegration class computes definite integrals using Simpson's rule and can also return a maximum possible error for the calculation.
  • Constructor Summary

    Constructors 
    Constructor Description
    NumericalIntegration()  
  • Method Summary

    Modifier and Type Method Description
    static double simpsonsError​(GeneralFunction function, double lowerBound, double upperBound)
    Returns the maximum error associated with the definite integral of a GeneralFunction function on a range
    static double simpsonsRule​(GeneralFunction function, double lowerBound, double upperBound)
    Returns the approximate definite integral of a GeneralFunction function on a range
    static double[] simpsonsRuleWithError​(GeneralFunction function, double lowerBound, double upperBound)
    Returns the approximate definite integral of a GeneralFunction function on a range with an error range

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • simpsonsRule

      public static double simpsonsRule​(GeneralFunction function, double lowerBound, double upperBound)
      Returns the approximate definite integral of a GeneralFunction function on a range
      Parameters:
      function - The GeneralFunction whose integral is being found
      lowerBound - The lower bound of the range
      upperBound - The upper bound of the range
      Returns:
      the approximate definite integral of the function on a range
    • simpsonsError

      public static double simpsonsError​(GeneralFunction function, double lowerBound, double upperBound)
      Returns the maximum error associated with the definite integral of a GeneralFunction function on a range
      Parameters:
      function - The GeneralFunction whose integral is being found
      lowerBound - The lower bound of the range
      upperBound - The upper bound of the range
      Returns:
      the maximum error associated with the definite integral of the function on a range
    • simpsonsRuleWithError

      public static double[] simpsonsRuleWithError​(GeneralFunction function, double lowerBound, double upperBound)
      Returns the approximate definite integral of a GeneralFunction function on a range with an error range
      Parameters:
      function - The GeneralFunction whose integral is being found
      lowerBound - The lower bound of the range
      upperBound - The upper bound of the range
      Returns:
      a double[] comprised of the approximate definite integral of the function on a range and its maximum error range