cumulative_trapezoidal_integral#

petpal.kinetic_modeling.graphical_analysis.cumulative_trapezoidal_integral(xdata: numpy.ndarray, ydata: numpy.ndarray, initial: float = 0.0) numpy.ndarray#

Calculates the cumulative integral of ydata over xdata using the trapezoidal rule.

This function is based heavily on the scipy.integrate.cumulative_trapezoid() implementation (source). This implementation only works for 1D arrays and was implemented to work with numba.

Parameters:
  • xdata (np.ndarray) – Array for the integration coordinate.

  • ydata (np.ndarray) – Array for the values to integrate

Returns:

(np.ndarray) – Cumulative integral of ydata over xdata using the trapezoidal rule.