AdaptiveQuadrature class final
The "Adaptive quadrature" is a technique for approximating the value of a definite integral that automatically adjusts the step size based on the local behavior of the function being integrated.
Details
Unlike fixed-step methods like Simpson's rule or the trapezoidal method, adaptive quadrature:
- Uses smaller step sizes in regions where the function varies rapidly
- Uses larger step sizes in regions where the function is smooth
- Automatically determines the best subdivision of the integration interval
- Provides better accuracy with fewer function evaluations
The algorithm works by:
- Computing two different approximations of the same subinterval
- Comparing their difference to a tolerance value
- If the difference is small enough, accepting the more accurate result
- If not, subdividing the interval and recursively applying the method
This approach makes adaptive quadrature particularly effective for functions with varying smoothness or regions of high curvature.
This algorithm requires two initial points (lowerBound and upperBound) that indicate the lower and upper integration bounds.
- Inheritance
-
- Object
- NumericalIntegration
- AdaptiveQuadrature
Constructors
- AdaptiveQuadrature({required String function, required double lowerBound, required double upperBound})
-
The "Adaptive quadrature" is a technique for approximating the value of a
definite integral that automatically adjusts the step size based on the
local behavior of the function being integrated.
const
Properties
- function → String
-
The function to be integrated on the given interval.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- lowerBound → double
-
The lower bound of the integral.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- upperBound → double
-
The upper bound of the integral.
finalinherited
Methods
-
evaluateFunction(
double x) → double -
Evaluates the given function at the
xpoint.inherited -
integrate(
) → ({List< double> guesses, double result}) -
Calculates the numerical value of the definite function integral
between lowerBound and upperBound. Returns a Record object whose
members are:
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited