Class SimpsonIntegral
- java.lang.Object
-
- org.hortonmachine.gears.utils.math.integration.SimpsonIntegral
-
- Direct Known Subclasses:
ConvolutionDiffusionDischarge,ConvolutionDiffusionWidth,ConvolutionExponential,ConvolutionExponentialPeakflow
public abstract class SimpsonIntegral extends Object
- Author:
- Andrea Antonello (www.hydrologis.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected doubleaccuracyprotected doublelowerlimitprotected intmaxstepsstatic intSIMPSONprotected doublestrapezoidstatic intTRAPEZOIDALprotected doubleupperlimit
-
Constructor Summary
Constructors Constructor Description SimpsonIntegral()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract doubleequation(double x)Equation to integrateprotected doublesimpson()Calculate the integral with the simpson method of the equation implemented in the method equationprotected doubletrapezoid(int n)Calculate the integral with the trapezoidal algorithm of the equation implemented in the method equation
-
-
-
Field Detail
-
SIMPSON
public static final int SIMPSON
- See Also:
- Constant Field Values
-
TRAPEZOIDAL
public static final int TRAPEZOIDAL
- See Also:
- Constant Field Values
-
strapezoid
protected double strapezoid
-
lowerlimit
protected double lowerlimit
-
upperlimit
protected double upperlimit
-
maxsteps
protected int maxsteps
-
accuracy
protected double accuracy
-
-
Method Detail
-
simpson
protected double simpson()
Calculate the integral with the simpson method of the equation implemented in the method equation- Returns:
- Throws:
Exception
-
trapezoid
protected double trapezoid(int n)
Calculate the integral with the trapezoidal algorithm of the equation implemented in the method equation- Parameters:
n- - number of steps to perform- Returns:
-
equation
protected abstract double equation(double x)
Equation to integrate- Parameters:
x- - point in which to calculate the function- Returns:
-
-