AuxFunctions

Contents

AuxFunctions#


Text


MAPIT.core.AuxFunctions.trapSum(relevantIndex, time, data, IT=None, baseline_zero=1e-10)#

Function performs trapezoidal integration on a dataset segment. This is required for bulk facility flows that might need integration before use within statistical tests.

In some cases, flows might be represented as discontinuous pulses of material, in which case, special care is needed to identify the non-zero regions of the dataset to enable proper integration.

This function first identified a list of non-zero pulses of material before performing trapezoidal integration on each non-zero pulse segment. np.trapz is used to perform the integration. See the numpy documentation for more information.

\(\int y(x) dx\)

Parameters:
  • relevantIndex (ndarray) – An array that expresses the relevant time slice, with boolean values (0 = not relevant, 1 = relevant), with shape \([m,j]\) where \(m\) is the total number of relevant samples and \(j\) is the total number of iterations.

  • time (ndarray) – An array containing the total number of timestep values under consideration for the analysis. Has shape \([n,j]\) where \(n\) is the total number of samples under consideration and \(n>m\) for \(m\) in relevantIndex and \(j\) is the total number of iterations.

  • data (ndarray) – An array containing the total number of samples under consideration for the analysis. Should have the same shape as time.

  • baseline_zero (float) – A float that expresses the threshold below which values are considered zero. Important as datasets often do not represent zero as exactly zero for a variety of reasons.

Returns:

An array of shape \([1,j]\) containing the integrated total for each iteration over the time specified by time[relevantIndex].

Return type:

ndarray