|
bi-kappa 3.0.0
Monte Carlo particle samplers for plasma velocity and position distributions
|
All five samplers are used the same way: construct, call define(...), then call operator() once per sample.
Each owns a seedable std::mt19937, and each accepts your own engine instead.
| To load | Use | Minimal call |
|---|---|---|
| An anisotropic population with power-law tails | bi_kappa_distribution | d.define(kappa, theta_perp, theta_par, ub) |
| An anisotropic Maxwellian population | bi_maxwellian_distribution | d.define(theta_perp, theta_par, ub) |
| Speeds from your own density, isotropic direction | general_velocity_generator | g.define(gW, w_min, w_max) |
| Parallel speeds from your own density, along the field | field_aligned_velocity_generator | g.define(gW, w_min, w_max, theta_perp, ub, +1) |
| Positions from your own spatial density | general_position_generator | g.define(dim, lower, upper, rho) |
bi_kappa_distribution and bi_maxwellian_distribution transform standard random variates directly. The other three use rejection sampling against an envelope estimated in define(...); see Rejection-sampler settings: probe_points, max_reject_tries.
| bi_kappa | bi_maxwellian | general_velocity | field_aligned_velocity | |
|---|---|---|---|---|
| Tails | power law, set by kappa | Gaussian | set by g(w) | set by g(w) (parallel); Gaussian (perpendicular) |
| Anisotropy | theta_perp, theta_par | theta_perp, theta_par | none (isotropic) | g(w) parallel, Maxwellian perpendicular |
| Uses ub | yes | yes | no | yes |
| Method | direct transformation | direct transformation | rejection | rejection (parallel part) |
| Velocity cap | 20 thermal speeds by default; no_cap() removes it | 20 thermal speeds by default; no_cap() removes it | none; w is limited to [w_min, w_max] | perpendicular components, 20 theta_perp by default; no_cap() removes it |
| Returns | std::array<Real,3> | std::array<Real,3> | std::array<Real,3> | std::array<Real,3> |
With the default cap, bi_kappa_distribution samples the bi-Kappa distribution conditioned on a box of 20 thermal speeds per component. For kappa <= 3/2 this removes an appreciable part of the tail. Pass no_cap() to sample the bi-Kappa distribution itself; see The velocity cap.
The samplers do not fix units. Velocities are returned in the units of theta_perp, theta_par or sqrt(w), and positions in the units of the bounds. No mass enters: for a distribution written in energy, use w = |v|^2 = 2E/m.