A basic hysteresis simulation is implemented using the Flatley Model, originally implemented by Marco Buzio, and now translated to Python in the following package: https://gitlab.cern.ch/dsb/hysteresis/hysteresis-simulator.

Implementation of Jiles-Atherton model with open-source matlab code

A crude version of the Jiles-Atherton model was originally implemented by Verena, but then superseeded by using open-source Octave code on GitHub and running it through oct2py. Open Source Implementation of Different Variants of Jiles-Atherton Model of Magnetic Hysteresis Loops paper.

Eddy current decay implementation

Eddy current decay is implemented in as

And since , so , and therefore

and This solves the differential equation for , however we are interested in , and since , we end up with

where

Note that the eddy current decay constant is in fact not a constant, as discussed with Marco, and is in fact described as , or with a first order approximation , or .

Supposing that is indeed , we need to compute it using a fully connected layer, as opposed to with an torch.nn.Parameter.