calamari.simulate.synthetic_mh_curve#

calamari.simulate.synthetic_mh_curve(field_oe, m_sat_emu, h_knee_oe, noise=0.0, rng=None)#

A saturating M(H) curve: m_sat_emu * tanh(H / h_knee_oe).

This reversible toy curve exercises fitting and unit conversion; it models neither hysteresis nor a particular material. Convert its saturation moment with Sample.moment_emu_to_muB_per_ion; this is distinct from the effective moment inferred from a Curie constant. h_knee_oe sets the characteristic saturation field.

Parameters:
  • field_oe (ArrayLike) – Applied field in Oe (may be negative).

  • m_sat_emu (float) – Saturation moment in emu.

  • h_knee_oe (float) – Characteristic field (Oe) at which the curve is within tanh(1) ~ 0.76 of saturation.

  • noise (float) – Standard deviation (emu) of additive Gaussian noise. Default 0 (no noise, and rng may then be omitted).

  • rng (Generator | None) – Required when noise > 0 – there is no implicit unseeded fallback, so every noisy call is reproducible by construction.

Return type:

ndarray

Returns:

numpy.ndarray – M(H) in emu, same shape as field_oe.

Raises:

ValueError – If noise > 0 and rng is None.