kspace.DoublePowerLaw#

class kspace.DoublePowerLaw(alpha_lo, alpha_hi, l_break, delta=2.0, ndim=3)[source]#

Bases: PowerSpectrum

Smoothly broken power-law power spectrum: index alpha_lo at large scales (k below the break wavenumber 2*pi/l_break), transitioning to index alpha_hi at small scales (k above the break wavenumber).

Parameters:
  • alpha_lo (float) – Power-law index at large scales (low k).

  • alpha_hi (float) – Power-law index at small scales (high k).

  • l_break (float) – The break scale (wavelength) separating the two power-law regimes.

  • delta (float, optional) – Controls the width of the transition region between the two power-law regimes. Default is 2.0.

  • ndim (int, optional) – Number of dimensions (1, 2, or 3). Default is 3.

__init__(alpha_lo, alpha_hi, l_break, delta=2.0, ndim=3)[source]#

Methods

A(k)

The Fourier amplitude corresponding to the power spectrum at a given wavenumber k, A(k) = sqrt(E(k) * k).

E(k)

The "energy spectrum" of the power spectrum as a function of the wavenumber k.

__init__(alpha_lo, alpha_hi, l_break[, ...])

integrate_E(kmin, kmax)

Integrate the energy spectrum E(k) over a range of wavenumbers.

renormalize(f_rms[, kmin, kmax])

Rescale the power spectrum's normalization so that the integral of its energy spectrum over [kmin, kmax] gives the desired RMS field value.