Stochastic field

SpiDy.bfieldFunction
bfield(N, Δt, J::AbstractSD, noise::Noise; distro=Normal(0., 1/sqrt(Δt)), interpolation=true)

Generate a stochastic field realisation time series (of length N and spacing Δt) based on the given noise model noise and spectral density J.

Arguments

  • N: The number of time steps.
  • Δt: The time step size.
  • J::AbstractSD: The environment spectral density.
  • noise::Noise: The noise model for the environment.
  • distro=Normal(0., 1/sqrt(Δt)): (Optional) The distribution of noise samples. Default is a normal distribution with mean 0 and standard deviation 1/sqrt(Δt).
  • interpolation=true: (Optional) Specifies whether to use linear interpolation for the stochastic field time series. Default is true.

Note: The AbstractSD type is provided by the SpectralDensities.jl package.

Returns

A time series of the stochastic field values.

source
bfield(tend, J::AbstractSD, noise::Noise; distro=Normal(0., 1/sqrt(Δt)), interpolation=true, atol=0, rtol=sqrt(eps()), maxiters=Int(1e6))

Generate a stochastic field realisation time series of length tend given the noise model noise and spectral density J. The optional parameters atol, rtol control the accuracy of the power spectral density of the generated noise.

Arguments

  • tend: The total evolution time.
  • J::AbstractSD: The environment spectral density.
  • noise::Noise: The noise model for the environment.
  • atol=0: (Optional) The absolute tolerance for the spectral density estimation. Default is 0.
  • rtol=sqrt(eps()): (Optional) The relative tolerance for the spectral density estimation. Default is sqrt(eps()).
  • maxiters=Int(1e6): (Optional) The maximum number of iterations for the spectral density estimation. Default is 1e6.
  • interpolation=true: (Optional) Specifies whether to use linear interpolation for the stochastic field time series. Default is true.

Note: The parameters used for generating the stochastic field are estimated using the estimate_bfield_parameters function. See the documentation for more details.

Returns

A time series of the stochastic field values.

source
SpiDy.estimate_bfield_parametersFunction
estimate_bfield_parameters(J::AbstractSD, noise::Noise; atol=0, rtol=sqrt(eps()), maxiters=Int(1e6))

Estimate the minimum time step size Δt and minimum total evolution time tmin required to generate a stochastic field realisation time series based on the given noise model noise and spectral density J, such that the power spectral density of the generated noise matches the target power spectral density within absolute atol and relative tolerances rtol.

Arguments

  • J::AbstractSD: The environment spectral density.
  • noise::Noise: The noise model for the environment.
  • atol=0: (Optional) The absolute tolerance for the spectral density estimation. Default is 0.
  • rtol=sqrt(eps()): (Optional) The relative tolerance for the spectral density estimation. Default is sqrt(eps()).
  • maxiters=Int(1e6): (Optional) The maximum number of iterations for the spectral density estimation. Default is 1e6.

Returns

The minimum time step size Δt and minimum total evolution time tmin.

source