This utility calculates the classical Jiles-Atherton (JA) magnetic hysteresis model. This model has found wide application in physics and engineering to simulate how ferromagnetic materials become magnetized under the influence of an external field.
The magnetic moment inside a material is affected not only by the external field
Where
To describe the "ideal" behavior of a material without hysteresis, the Langevin function (
Real materials contain microscopic defects and impurities. When domain walls (boundaries between magnetic regions) move, they "catch" on these defects. This process is called pinning.
- To move a wall further, energy must be expended.
- This expended energy is converted into heat—this is how hysteresis losses occur.
- In equations, this is described by the coefficient
$k$ (pinning factor).
Differentiating the energy balance equation in a magnetic material with respect to
The hysteresis loop can be represented with
or with
The total magnetization (
- Irreversible (
$M_{irr}$ ): the domain walls overcome obstacles (pinning) and do not return to their original state. This creates a "memory" effect in the material. - Reversible (
$M_{rev}$ ): the domain walls simply "bend" under the field pressure, like an elastic membrane, and return to their original state when the field is removed. In the text, this is described by the coefficient$c$ .
By combining all factors (energy balance, pinning losses, and elastic deflection of the walls), the authors derive a final differential equation. This allows one to calculate how the magnetization (
To model any magnetic material (steel, ferrite, nickel), one must substitute into the final equation:
-
$M_{s}$ (Saturation): The maximum possible magnetization. When all the magnetic moments inside are aligned, the material cannot be further magnetized. -
$a$ (Curve shape): Determines how quickly the material approaches saturation. Depends on the temperature and structure of the material. -
$k$ (Coercivity / Pinning): Controls the "width" of the loop. The larger$k$ , the more defects in the material that the domain walls "catch," and the more energy is lost as heat. -
$\alpha$ (Interaction): Indicates how strongly already magnetized regions help (or hinder) the magnetization of their neighbors. -
$c$ (Reversibility): The "elasticity" coefficient. If$c$ is large, the material behaves like rubber: it easily returns to its shape (magnetic state) when the field is removed.
To simulate a periodic signal, a time grid is generated. Unlike simple models, strict indexing is used here:
-
Signal Period (
$T$ ): 2.0 seconds. - Simulation Time: 40 seconds (20 full periods). This is necessary to complete transient processes and allow the model to reach a stable steady-state state.
-
Integration Step (
$tin$ ): The recommended value is$0.001$ s to ensure a balance between speed and accuracy.
Instead of the iterative secant method, an analytical calculation of the hysteresis-free magnetization (get_dMdH_instant method, which calculates the slope of the
Key formulas:
-
Effective field:
$H_e = H + \alpha M$ (takes into account domain interactions). -
Langevin function: Describes the ideal material response. Linearization (Taylor series) is used to protect against singularities at zero (
$H \to 0$ ). -
Energy balance: Irreversible changes (
$M_{irr}$ ) are calculated only under the condition of energy absorption (the condition$(M_{an} - M) \cdot \delta \gt 0$ ).
The RK4 method is used to solve the differential equation of magnetization, significantly exceeding the Euler method in accuracy.
At each step, the program calculates four coefficients (
The program ignores the first 19 periods ("warm-up") and writes only the last, 20th period to the buffer. This ensures that the resulting loop is steady and symmetrical.
Due to microscopic rounding errors in double numbers, the loop may not close perfectly. The algorithm performs the final "stitching":
- The gap between the first and last point of the period is calculated (
$driftH$ ,$driftM$ ). - The error is distributed linearly across the entire array, making the loop geometrically closed.
Magnetic flux density is calculated using the "harmonized" formula from modern research (MDPI):
Where the magnetization
TODO
Describes the logic for calculating the derivative
Describes how, within a single time step tin, the program performs four "test" derivative calculations
to predict the magnetization trajectory as accurately as possible.
Describes the high-level logic of the program's operation: from initializing parameters to obtaining a finished, "sewn" hysteresis loop.
- Jiye Zhao et al. - State Space Representation of Jiles–Atherton Hysteresis Model and Application (MDPI, 2024).
- Guangming Xue - Numerical Solving Method for Jiles-Atherton Model and Influence Analysis.
- Gustav Mörée - Review of Hysteresis Models for Magnetic Materials.
- Nowicki M. - Modeling the Hysteresis Loop of Ultra-High Permeability Amorphous Alloy.
- Jastrzebski R. - Comparison of macroscopic descriptions of magnetization curves.
- Knypinski L. - Application of a PSO algorithm for identification of the parameters of Jiles-Atherton hysteresis model.
- Kuznetsov V. - Improved Jiles–Atherton Magnetic Core Model and Its SPICE Implementation(MDPI, 2026).
- Rupnik U. - Harmonization and Validation of Jiles–Atherton Static Hysteresis Models.
- Szewczyk R.-Validation of the Anhysteretic Magnetization Model for Soft Magnetic Materials with Perpendicular Anisotropy (MDPI, 2014)
- Gozdur R.-A Study of Temperature-Dependent Hysteresis Curves for a Magnetocaloric Composite Based on La(Fe, Mn, Si)13-H Type Alloys (MDPI, 2020)