Options
All
  • Public
  • Public/Protected
  • All
Menu

Integral of a one-dimensional function

Given a number $ N $ of intervals, the integral of a function $ f $ between $ a $ and $ b $ is calculated by means of the trapezoid formula $$ \int_{a}^{b} f \mathrm{d}x = \frac{1}{2} f(x_{0}) + f(x_{1}) + f(x_{2}) + \dots

  • f(x_{N-1}) + \frac{1}{2} f(x_{N}) $$ where $ x_0 = a $, $ x_N = b $, and $ x_i = a+i \Delta x $ with $ \Delta x = (b-a)/N $.

\test the correctness of the result is tested by checking it against known good values.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private _intervals

_intervals: Size

Methods

absoluteAccuracy

  • absoluteAccuracy(): Real

absoluteError

  • absoluteError(): Real

f

increaseNumberOfEvaluations

  • increaseNumberOfEvaluations(increase: Size): void

Protected integrate

integrationSuccess

  • integrationSuccess(): boolean

maxEvaluations

  • maxEvaluations(): Size

numberOfEvaluations

  • numberOfEvaluations(): Size

setAbsoluteAccuracy

  • setAbsoluteAccuracy(accuracy: Real): void

setAbsoluteError

  • setAbsoluteError(error: Real): void

setMaxEvaluations

  • setMaxEvaluations(maxEvaluations: Size): void

setNumberOfEvaluations

  • setNumberOfEvaluations(evaluations: Size): void