Area Integration

Shipping
area_integration

Definite integral / area under curve

Signature

Inputs

  • signalSignalrequired

Outputs

  • areaScalar
  • cumulativeSignal
  • absAreaScalar

Parameters

KeyTypeDefaultNotes
methodenumtrapezoidalone of: trapezoidal, simpson
start_timefloat-1.0sIntegration start (−1 = signal start)
end_timefloat-1.0sIntegration end (−1 = signal end)

Description

Area Integration computes the definite integral (area under the curve) of a signal over a time window. It emits three outputs at once: area, the total signed integral as a Scalar; cumulative, a Signal holding the running integral sample-by-sample; and absArea, the total unsigned area as a Scalar.

The method parameter selects the quadrature rule: trapezoidal (linear interpolation between samples) or simpson (parabolic, higher-order accuracy on smooth signals). The window is bounded by start_time and end_time, each in seconds; a value of -1 means "use the signal's start/end", so the default (-1, -1) integrates the entire signal.

This node is stateless — each execution integrates the current input window from scratch, with no carry-over between runs. This distinguishes it from integral, which maintains a running accumulator across streaming blocks.

Unit and uncertainty behavior: integration multiplies the signal's amplitude unit by time, so a signal in V yields an area in . Measurement uncertainty (sigma) on the samples propagates through the weighted quadrature sum into the scalar outputs and the cumulative signal.

Mathematics

Examples

Total charge from a current signal

Feed a current signal in A sampled over time. With default method = trapezoidal and the full-window defaults start_time = -1, end_time = -1, the area output gives accumulated charge in . The cumulative output traces charge accumulation over time, useful for plotting battery drain.

Windowed energy with Simpson's rule

To integrate only a sub-interval of a smooth waveform, set an explicit window and the higher-order rule:

method     = simpson
start_time = 0.10   # s
end_time   = 0.35   # s

Simpson's rule converges faster than trapezoidal on smooth data, so for a resolved sinusoid it yields a markedly more accurate area. The absArea output simultaneously reports over the same window.

Applications

  • Computing accumulated charge ($\int I\,dt$) or impulse ($\int F\,dt$) from measured current or force traces.
  • Energy and dose calculations: integrating power to get energy, or integrating a rate signal to get a total quantity.
  • Peak-area quantification in chromatography and spectroscopy, where `absArea` captures total unsigned response.
  • Estimating mean value or DC offset of a waveform by dividing the signed `area` by the window duration.

Neat

The three outputs share one traversal: `area` (signed), `absArea` (rectified), and `cumulative` (the running partial sums) are produced in a single quadrature pass, so `cumulative`'s last sample equals `area`.

Simpson's rule requires an even number of intervals; on windows with an odd sample count the implementation must handle the trailing segment separately, which trapezoidal never needs.

Known issues

Simpson's rule assumes locally parabolic behavior; on noisy or under-sampled signals it can be less accurate than trapezoidal despite its higher formal order.

If `start_time`/`end_time` fall between samples or the window collapses to fewer than two samples, the integral degenerates toward zero — verify the window brackets the intended interval.

See also

integrationquadratureareatrapezoidalsimpsonstateless