desc.integrals.Bounce1D.integrate
- Bounce1D.integrate(integrand, pitch_inv, data=None, names=None, points=None, *, method='cubic', check=False, plot=False, quad=None, **kwargs)Source
Bounce integrate ∫ f(ρ,α,λ,ℓ) dℓ.
Computes the bounce integral ∫ f(ρ,α,λ,ℓ) dℓ for every field line and pitch.
- Parameters:
integrand (callable or list[callable]) – The composition operator on the set of functions in
datathat determinesfin ∫ f(ρ,α,λ,ℓ) dℓ. It should accept a dictionary which stores the interpolated data and the argumentsBandpitch.pitch_inv (jnp.ndarray) – Shape (num rho, num pitch). 1/λ values to compute the bounce integrals. 1/λ(ρ) is specified by
pitch_inv[ρ]where in the latter the labels are interpreted as the indices that correspond to that field line.data (dict[str, jnp.ndarray]) – Shape (num rho, num alpha, num zeta). Real scalar-valued functions evaluated on the
gridsupplied to construct this object. Use the methodBounce1D.reshapeto reshape the data into the expected shape.names (str or list[str]) – Names in
datato interpolate. Default is all keys indata. Do not include|B|.points (tuple[jnp.ndarray]) – Shape (num rho, num alpha, num pitch, num well). Optional, output of method
self.points. Tuple of length two (z1, z2) that stores ζ coordinates of bounce points. The points are ordered and grouped such that the straight line path betweenz1andz2resides in the epigraph of B.method (str) – Method of interpolation. See https://interpax.readthedocs.io/en/latest/_api/interpax.interp1d.html. Default is cubic C1 local spline.
check (bool) – Flag for debugging. Must be false for JAX transformations.
plot (bool) – Whether to plot the quantities in the integrand interpolated to the quadrature points of each integral. Ignored if
checkis false.quad (tuple[jnp.ndarray]) – Optional quadrature points and weights. If given this overrides the quadrature chosen when this object was made.
- Returns:
result (jnp.ndarray or list[jnp.ndarray]) – Shape (num rho, num alpha, num pitch, num well). Last axis enumerates the bounce integrals for a given field line and pitch value.