tidy3d.plugins.autograd.functions.trapz

Contents

tidy3d.plugins.autograd.functions.trapz#

class trapz[source]#

Bases:

Integrate along the given axis using the composite trapezoidal rule.

Parameters:
  • y (np.ndarray) – Input array to integrate.

  • x (np.ndarray = None) – The sample points corresponding to the y values. If None, the sample points are assumed to be evenly spaced with spacing dx.

  • dx (float = 1.0) – The spacing between sample points when x is None. Default is 1.0.

  • axis (int = -1) – The axis along which to integrate. Default is the last axis.

Returns:

Definite integral as approximated by the trapezoidal rule.

Return type:

float

Inherited Common Usage