# Neural oscillators for magnetic hysteresis modeling

Abhishek Chandra
Department of Electrical Engineering
TU Eindhoven, The Netherlands
<EMAIL_ADDRESS>
&Taniya Kapoor*
Faculty of Civil Engineering and Geosciences
TU Delft, The Netherlands
&Bram Daniels, Mitrofan Curti
Department of Electrical Engineering
TU Eindhoven, The Netherlands
&Koen Tiels
Department of Mechanical Engineering
TU Eindhoven, The Netherlands
&Daniel M. Tartakovsky
Department of Energy Science and Engineering
Stanford University, USA
&Elena A. Lomonova
Department of Electrical Engineering
TU Eindhoven, The Netherlands
Equal contribution

###### Abstract

_Hysteresis_ is a ubiquitous phenomenon in science and engineering; its
modeling and identification are crucial for understanding and optimizing the
behavior of various systems. We develop an ordinary differential equation-
based recurrent neural network (RNN) approach to model and quantify the
hysteresis, which manifests itself in sequentiality and history-dependence.
Our _neural oscillator, HystRNN_ , draws inspiration from coupled-oscillatory
RNN and phenomenological hysteresis models to update the hidden states. The
performance of HystRNN is evaluated to _predict generalized scenarios_ ,
involving first-order reversal curves and minor loops. The findings show the
ability of HystRNN to generalize its behavior to previously untrained regions,
an essential feature that hysteresis models must have. This research
highlights the _advantage_ of neural oscillators over the traditional RNN-
based methods in capturing complex hysteresis patterns in magnetic materials,
where traditional rate-dependent methods are inadequate to capture intrinsic
nonlinearity.

##  1 Introduction

Magnetic hysteresis pertains to a prevalent observed phenomenon in
ferromagnetic and ferrimagnetic materials where the change in magnetization
response _lags behind_ variations in the applied magnetic field. Specifically,
the hysteresis effect is characterized by a delay in the magnetic flux density
($B$) to changes in the applied magnetic field strength ($H$), exhibiting
_history dependency_ , nonlinearity and non-monotonicity [1]. The relationship
between $B$ and $H$ fields is represented as a hysteresis curve $\mathcal{C}$
($B-H$ curve), which plays a pivotal role in comprehending hysteresis and
governing the magnetization process during alterations in $H$ (Fig. 1). The
hysteresis loop offers insights into material behavior; for instance, the area
of the hysteresis loop signifies the energy dissipated as heat during each
cycle of magnetization and demagnetization.

Accurate hysteresis modeling is pivotal in enhancing the operational
_efficiency_ of electrical machines. For instance, in engineering systems that
involve the movement of cables, hysteresis requires more sophisticated control
strategies to compensate for its effects [2]. Similarly, the efficiency of
electrical machines is intrinsically linked to the _precise modeling_ of the
hysteresis characteristics exhibited by the steel materials employed [3].
Incorporating a robust model would avoid the costly manufacturing of multiple
prototypes. Mathematically, the primary objective of hysteresis modeling is to
predict the sequence of $B$ values that correspond to a given sequence of $H$
values. However, the relationship between $B$ and $H$ defies the mathematical
definition of a single-valued function. Consequently, conventional function
approximation techniques are _not suitable_ for modeling hysteresis as a
function with domain $H$ and codomain $B$ [4].

Traditionally, modeling the hysteresis behavior is based on fundamental
principles of physics [5]. However, in practical engineering scenarios, the
manifestation of hysteresis behavior often stems from complex, large-scale
effects and the multiphysical nature of the system, rendering deterministic
models _inaccurate_ [5, 1]. Consequently, phenomenological models are
employed, establishing connections between desired behaviors and specific
underlying phenomena rooted in principles of thermodynamics or elasticity, for
instance. Notable phenomenological models include the Preisach [6, 1], Jiles-
Atherton [7], and Bouc-Wen models [8, 9]. Generalizing these models across
disciplines and incorporating them into systematic modeling approaches,
fitting them to experimental data, and integrating them into other
mathematical models _pose significant challenges_ [10], such as sophisticated
optimization techniques and increased computational burden [11].

To mitigate these limitations of phenomenological models, feed-forward neural
networks (FFNNs) are commonly used for modeling magnetic hysteresis [12, 13,
14, 15]. However, owing to the _absence of a functional relationship_ between
$B$ and $H$ fields, the traditional FFNN approach with input $H$ and output
$B$ is inadequate and suboptimal. Instead, studies [13, 14] propose $H$ and
$B_{-1}$ as input and $B$ as output during training, where $B_{-1}$ denotes
the previous $B$ value [4]. The notation $B_{-1}$ is discussed in detail in
the ’Method’ section. However, this approach is characterized by two notable
limitations. First, it lacks the incorporation of _sequential information_ and
fails to capture interdependencies among output values, hence not respecting
the underlying physics of the problem. Second, this strategy exhibits
_limitations in generalizing_ to new situations, as it relies on single-step
prior information during training [16]. Consequently, these models _struggle
to extrapolate_ to scenarios beyond training data, limiting broader
applications that require robust generalization.

To address the limitations faced by FFNNs, models centered on recurrent neural
networks (RNNs) [4, 17] have been employed, which provide a _natural
framework_ for modeling the sequential hysteretic nature. However, the models
that employ traditional RNNs, gated recurrent unit (GRU) [18], long-short-term
memory (LSTM) [19] and their variants exhibit _limitations_ regarding their
ability to _generalize effectively_ to unseen $H$ variations, as we present in
the _current work_. Although these recurrent networks model the underlying
relationship and predict hysteresis loops exceedingly well as an interpolation
task, the _primary objective_ of achieving _robust generalization remains
inadequately addressed_ [20]. An optimal recurrent-based technique should
excel in _both_ interpolation tasks and demonstrate reasonable accuracy in
generalization, effectively predicting $B$ sequences for unseen $H$ sequences.

A possible approach to accomplishing efficient generalization could be to
enforce the recurrent architecture to _incorporate the underlying dynamics_.
An efficient way to represent time-varying dynamics involves representation
through ordinary differential equations (ODEs) and dynamical systems,
recognized for their capacity to model diverse, intricate and nonlinear
phenomena across natural, scientific, and engineering domains [21]. This
inclusion of inherent dynamics, which should effectively _encapsulate crucial
physical attributes_ of the underlying magnetic material, motivates us to
employ a system of ODEs to update the hidden states of the recurrent
architecture, referred to as _neural oscillators_. Recently, neural
oscillators have shown significant success in machine learning and artificial
intelligence and have been shown to handle the exploding and vanishing
gradient problem effectively with high expressibility [22, 23, 24, 25, 26].
The recent universal approximation property [27] also supports our belief in
modeling magnetic hysteresis with neural oscillators.

Our neural oscillator, referred to as _HystRNN_ (hysteresis recurrent neural
network), is influenced by the principles of the coupled-oscillator recurrent
neural network (CoRNN) [22], which integrates a second-order ordinary
differential equation (ODE) based on mechanical system principles. CoRNN
considers factors such as oscillation frequency and damping in the system.
However, for magnetic hysteresis, these physical attributes are less
significant. Instead, we focus on embedding the hysteric nature within the ODE
formulation. We _leverage phenomenological differential hysteresis models_ to
accomplish this, recognizing that models like Bouc-Wen [8, 9], and Duhem [28]
utilize the absolute value function to represent the underlying dynamics. By
incorporating this function into our model, we can _effectively capture_ and
control the shape of the hysteresis loop. This integration into the recurrent
model is expected to _facilitate robust generalization_ , as it inherently
captures the shape of the hysteresis loop, preserving _symmetry_ and
_structure_.

(a) Major loop

(b) FORCs

(c) Minor loop

Figure 1: $B-H$ magnetic hysteresis curves (FORC = first-order reversal curve)

In this manuscript, we model _nonoriented electrical steel_ (NO27) to test the
validity of the proposed method for magnetic materials. The hysteresis loops
employed and modeled in this work are acquired using the Preisach model for an
Epstein frame. This model has been adjusted to adhere to the IEC standard, and
the core was assembled using 16 strips of NO27-1450H material. More details
about the Preisach model are provided in supplementary material SM §B. We
train all our models on a _major loop_ (represented by a blue loop in Fig.
1(a)) and use the trained model to test two different generalization tasks:
predicting _first-order reversal curves_ (FORCs, represented by red curves in
Fig. 1(b)) and _minor loops_ (represented by a red loop in Fig. 1(c)). We
perform experiments for _four different $B$ fields_ with applications relevant
to modeling electrical machines.

The remainder of the manuscript is structured as follows. The section
‘Generalization in hysteresis’ presents the _challenge_ of this manuscript and
explains how the task amounts to _generalization_. The section ‘Method’
formulates the proposed HystRNN method and explains it in detail. The section
‘Numerical experiments’ _validates_ the proposed method through a series of
numerical experiments. Finally, the ‘Conclusions’ section collates the key
findings and implications of this study.

##  2 Generalization in hysteresis

Traditional supervised machine learning methodologies employed to model
magnetic hysteresis train the model for $(H_{i},B_{i})\in\mathcal{C}_{1}$,
where $1\leq i\leq N$, $i\in\mathbb{Z}$ and $N$ is the number of training
samples. The trained model is then tested on
$(H_{k},B_{k})\in\mathcal{C}_{2}$, where $1\leq k\leq M$, $k\in\mathbb{Z}$ and
$M$ is the number of testing samples. Traditionally,
$\mathcal{C}_{2}\subset\mathcal{C}_{1}$, with $H_{i}\neq H_{k}$. However, this
prediction reduces to an _interpolation task_ [29]. In _contrast_ , we are
interested in training the model for $(H_{i},B_{i})\in\mathcal{C}_{1}$ and
predicting a hysteresis trajectory for $(H_{k},B_{k})\in\mathcal{C}_{2}$,
where $\mathcal{C}_{2}\nsubseteq\mathcal{C}_{1}$, and
$\mathcal{C}_{2}\cap\mathcal{C}_{1}=\phi$. Here, $\phi$ denotes the null set.
Precisely, we train all our models on the major loop
($\mathcal{C_{\mathrm{major}}}$) as shown in Fig. 1(a). Then the trained model
is tested for two different scenarios. First the FORCs
($\mathcal{C_{\mathrm{FORC}}}$) shown in Fig. 1(b) and second the minor loops
($\mathcal{C_{\mathrm{minor}}}$) presented in Fig. 1(c).

Modeling FORCs and minor hysteresis loops play a significant role in
_analyzing_ magnetic materials. FORC modeling reveals intricate interactions,
enabling the differentiation between magnetization components that can be
reversed and those that cannot. This knowledge is pivotal in the optimization
of magnetic devices like memory and sensor technologies [30, 31, 32]. Minor
hysteresis loop modeling complements this by providing insights into localized
variations in magnetic behavior.

More insights on how predicting $\mathcal{C_{\mathrm{FORC}}}$ and
$\mathcal{C_{\mathrm{minor}}}$ entails to a generalization task is provided in
Fig. 2. In Fig. 2(a) and 2(b), the time series of $H$ and $B$ fields are
shown, respectively. The blue curve represents the training data ($H$ vs $B$
is $\mathcal{C_{\mathrm{major}}}$), and the red curve represents the region in
which the prediction is sought ($\mathcal{C_{\mathrm{FORC}}}$ in this case).
The black curve behind the shaded region signifies the _history_ that the
material has gone through, which is the _series of magnetization and
demagnetization_ that is _unknown_ at the time of testing. Hence, this task
amounts to _extrapolation in time or predicting in a generalized scenario_.
Similarly, Fig. 2(c) and 2(d) represent the case for
$\mathcal{C_{\mathrm{major}}}$ and $\mathcal{C_{\mathrm{minor}}}$.

(a) $H$ vs time

(b) $B$ vs time

(c) $H$ vs time

(d) $B$ vs time

Figure 2: Variation of magnetization and demagnetization in a magnetic
material over time

##  3 Method

HystRNN utilizes a recurrent structure akin to RNNs, with the _difference_
being in the hidden state update. HystRNN _employs ODEs_ for updating the
hidden states. The approach involves two inputs, $H$ and $B_{-1}$, which are
mapped to $B$. The modeling process begins by collecting $N_{e}$ number of
experimental data points ($H_{i},B_{-1}:=B_{i}$) for
$\mathcal{C_{\mathrm{major}}}$, where $1\leq i\leq N_{e}$, and
$i\in\mathbb{Z}$. Subsequently, ($H_{j},B_{k}$) and $B_{j}$ are taken as the
input and output of HystRNN, respectively, where $2\leq j\leq N_{e}$, $1\leq
k\leq N_{e}-1$, $k=j-1$, and $j,k\in\mathbb{Z}$. The number of training points
is denoted by $N=N_{e}-1$. While sharing certain similarities with some
feedforward neural network (FFNN) architectures employed for modeling
hysteresis, this training approach diverges by _incorporating a recurrent
relationship_ that captures _longer-time dynamics_ and _output dependencies_ ,
which are absent in FFNNs. Next, the hidden states of HystRNN are updated
using the following second-order ODE

$\displaystyle{\bf y}^{\prime\prime}=\sigma_{1}\left({\bf W}_{1}{\bf
y}+\boldsymbol{\mathcal{W}_{1}}{\bf y}^{\prime}+{\bf V}_{1}{\bf u}+{\bf
b}_{1}\right)$ (1) $\displaystyle+\sigma_{2}\left({\bf W}_{2}|{\bf
y}|^{2}+\boldsymbol{\mathcal{W}_{2}}|{\bf y}^{\prime}|^{2}+{\bf V}_{2}|{\bf
u}|^{2}+{\bf b}_{2}\right).$

Here, the hidden state of the HystRNN is denoted by ${\bf y}={\bf
y}(t)\in{\mathbb{R}}^{m}$. ${\bf y}^{\prime}$ indicates a time derivative,
while ${\bf y}^{\prime\prime}$ indicates a second-order time derivative. ${\bf
W}_{1},{\bf
W}_{2},\boldsymbol{\mathcal{W}_{1}},\boldsymbol{\mathcal{W}_{2}}\in{\mathbb{R}}^{m\times
m}$, and ${\bf V}_{1},{\bf V}_{2}\in{\mathbb{R}}^{m\times n}$ are the weight
matrices, $n=N\times 2$, and $t$ corresponds to the time at which the training
data has been collected. ${\bf u}={\bf u}(t)\in{\mathbb{R}}^{n}$ is the input
to HystRNN. ${\bf b}_{1},{\bf b}_{2}\in{\mathbb{R}}^{m}$ are the bias vectors.
The activation functions $\sigma_{1,2}:{\mathbb{R}}\mapsto{\mathbb{R}}$ are
taken to be $\sigma_{1,2}(u)=\tanh(u)$. By setting ${\bf z}={\bf
y}^{\prime}(t)\in{\mathbb{R}}^{m}$, (1) becomes a system of first-order ODEs

$\displaystyle{\bf y}^{\prime}={\bf z},\quad{\bf
z}^{\prime}=\sigma_{1}\left({\bf W}_{1}{\bf
y}+\boldsymbol{\mathcal{W}_{1}}{\bf z}+{\bf V}_{1}{\bf u}+{\bf b}_{1}\right)$
(2) $\displaystyle+\sigma_{2}\left({\bf W}_{2}|{\bf
y}|^{2}+\boldsymbol{\mathcal{W}_{2}}|{\bf z}|^{2}+{\bf V}_{2}|{\bf
u}|^{2}+{\bf b}_{2}\right).$

Discretizing the system of ODEs (2) using an explicit scheme for $0<{\Delta
t}<1$ leads to

$\displaystyle{\bf y}_{n}$ $\displaystyle={\bf y}_{n-1}+{\Delta t}{\bf
z}_{n},$ (3) $\displaystyle{\bf z}_{n}$ $\displaystyle={\bf z}_{n-1}+{\Delta
t}\sigma_{1}\left({\bf W}_{1}{\bf y}_{n-1}+\boldsymbol{\mathcal{W}_{1}}{\bf
z}_{n-1}+{\bf V}_{1}{\bf u}_{n}+{\bf b}_{1}\right)$ $\displaystyle\quad{\Delta
t}\sigma_{2}\left({\bf W}_{2}|{\bf
y}_{n-1}|^{2}+\boldsymbol{\mathcal{W}_{2}}|{\bf z}_{n-1}|^{2}+{\bf V}_{2}|{\bf
u}_{n}|^{2}+{\bf b}_{2}\right).$

Finally, the output $\hat{B}$ is computed for each recurrent unit, where
$\hat{B}\in{\mathbb{R}}^{n}$ with $\hat{B}=\mathcal{Q}{\bf y}_{n}$ and
$\mathcal{Q}\in{\mathbb{R}}^{n\times m}$.

###  3.1 Related work

(a) LSTM

(b) GRU

(c) HystRNN

(d) LSTM

(e) GRU

(f) HystRNN

(g) LSTM

(h) GRU

(i) HystRNN

(j) LSTM

(k) GRU

(l) HystRNN

Figure 3: Experimental vs predicted hysteresis trajectories for experiment 1, where $\max(B)$ $=$ $1.7\text{\,}\mathrm{T}$. The blue curve represents the training loop $\mathcal{C_{\mathrm{major}}}$. The red curve represents the ground truth for $\mathcal{C_{\mathrm{FORC/minor}}}$ and the black curve represents the prediction of the model. Top two rows: predictions for $\mathcal{C_{\mathrm{FORC_{1}}}}$ and $\mathcal{C_{\mathrm{FORC_{2}}}}$ respectively. Bottom two rows: predictions for $\mathcal{C_{\mathrm{minor_{1}}}}$ and $\mathcal{C_{\mathrm{minor_{2}}}}$ respectively. The colors are used consistently for the following figures. Table 1: The generalization performance assessed using the metrics: L2-norm relative error, explained variance error, maximum error, and mean absolute error for the first experiment, where $\max(B)$ $=$ $1.7\text{\,}\mathrm{T}$. For these metrics, higher (respectively, lower) values are favored for ($\uparrow$) (respectively, ($\downarrow$)). The implication of arrows remains consistent for all the following Tables. Test case | L2-norm $(\downarrow)$ | Explained variance score $(\uparrow)$ | Max error $(\downarrow)$ | Mean absolute error $(\downarrow)$
---|---|---|---|---
RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN
$\mathcal{C_{\mathrm{FORC_{1}}}}$ | 5.0204 | 0.8525 | 0.7764 | 0.2198 | -0.0721 | 0.1081 | 0.2007 | 0.8252 | 5.3597 | 2.4089 | 2.0075 | 1.2030 | 2.9888 | 1.1967 | 1.5550 | 0.6149
$\mathcal{C_{\mathrm{FORC_{2}}}}$ | 6.4877 | 0.5255 | 0.4701 | 0.3085 | -0.2545 | 0.1875 | 0.2395 | 0.8844 | 5.3484 | 1.8428 | 1.8177 | 1.2371 | 3.6038 | 0.9327 | 0.8723 | 0.7613
$\mathcal{C_{\mathrm{minor_{1}}}}$ | 5.3506 | 1.4382 | 1.8028 | 0.0438 | -0.1013 | 0.0298 | 0.0776 | 0.9839 | 2.7641 | 1.7098 | 1.8925 | 0.3108 | 1.4877 | 0.7142 | 0.7797 | 0.1258
$\mathcal{C_{\mathrm{minor_{2}}}}$ | 12.3671 | 1.5785 | 2.0563 | 0.0786 | -2.7046 | 0.0248 | 0.0673 | 0.9661 | 3.7491 | 1.5726 | 1.7486 | 0.3630 | 1.9703 | 0.6544 | 0.7341 | 0.1450

Oscillator networks play a pervasive role across natural and engineering
systems like pendulums in classical mechanics, among other instances. A
_notable trend_ is emerging where RNN architectures are constructed based on
ODEs and dynamical systems [33, 34, 35, 23]. Our study is _closely associated_
with CoRNN, where the oscillation and damping factors are integrated into
model construction. _In contrast_ , our approach _incorporates hysteretic
terms_ into the model. Another recent study [36], demonstrates employing
neural oscillators to extend the applicability of physics-informed machine
learning. Our work shares similarities with this study, as both works aim to
_generalize scientific machine_ learning and seek to predict quantities of
interest beyond the scope of the training data _without_ relying on retraining
or transfer learning methodologies. However, our work aims to predict
trajectories of the hysteresis dynamics, whereas [36] predicts the solutions
of partial differential equations in a generalized domain.

###  3.2 Motivation

The hidden state update in HystRNN is _motivated_ by the _differential models
of hysteresis_ [8, 9, 28] that describe the phenomenon, incorporating an
_absolute value function_ to model the hysteretic nonlinearity. Examples of
such phenomenological models include, but are not limited to, the Bouc-Wen and
Duhem models, presented in SM §F. These absolute valued components play a
crucial role in capturing hysteretic characteristics. These terms allow the
models to account for the different responses during magnetization and
demagnetization, as well as the _effects of history_ on the behavior of the
system. The inclusion of absolute valued terms enhances the ability of the
model to capture the intricate dynamics of hysteresis and provides a more
realistic representation of the observed phenomena.

##  4 Numerical Experiments

Table 2: The generalization performance assessed using the metrics: L2-norm relative error, explained variance error, maximum error, and mean absolute error for the second experiment, where $\max(B)$ $=$ $1.25\text{\,}\mathrm{T}$. Test case | L2-norm $(\downarrow)$ | Explained variance score $(\uparrow)$ | Max error $(\downarrow)$ | Mean absolute error $(\downarrow)$
---|---|---|---|---
RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN
$\mathcal{C_{\mathrm{FORC_{1}}}}$ | 5.3234 | 1.2308 | 0.6863 | 0.0109 | 0.1625 | 0.3566 | 0.4230 | 0.9891 | 2.6134 | 1.4922 | 1.0994 | 0.2370 | 1.6253 | 0.6871 | 0.5433 | 0.0563
$\mathcal{C_{\mathrm{FORC_{2}}}}$ | 6.4035 | 0.9569 | 0.5098 | 0.0115 | 0.1576 | 0.3834 | 0.4693 | 0.9924 | 2.6084 | 1.2985 | 0.9055 | 0.2520 | 1.7484 | 0.5796 | 0.4587 | 0.0583
$\mathcal{C_{\mathrm{minor_{1}}}}$ | 7.5971 | 1.6295 | 0.8069 | 0.0320 | 0.1497 | 0.2977 | 0.3268 | 0.9844 | 2.3788 | 1.3344 | 0.9456 | 0.1882 | 1.4996 | 0.5974 | 0.4396 | 0.0916
$\mathcal{C_{\mathrm{minor_{2}}}}$ | 11.8293 | 2.1787 | 0.8859 | 0.1283 | 0.0616 | 0.2769 | 0.3091 | 0.9267 | 2.2669 | 1.1784 | 0.7925 | 0.2923 | 1.5243 | 0.5639 | 0.3653 | 0.1443
Table 3: The generalization performance assessed using the metrics: L2-norm relative error, explained variance error, maximum error, and mean absolute error for the third experiment, where $\max(B)$ $=$ $1.3\text{\,}\mathrm{T}$. Test case | L2-norm $(\downarrow)$ | Explained variance score $(\uparrow)$ | Max error $(\downarrow)$ | Mean absolute error $(\downarrow)$
---|---|---|---|---
RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN
$\mathcal{C_{\mathrm{FORC_{1}}}}$ | 6.0907 | 0.9692 | 0.6625 | 0.0342 | 0.0534 | 0.3290 | 0.3649 | 0.9705 | 3.2184 | 1.5661 | 1.2194 | 0.3878 | 1.9992 | 0.7105 | 0.6247 | 0.1296
$\mathcal{C_{\mathrm{FORC_{2}}}}$ | 7.2661 | 0.6720 | 0.4775 | 0.0377 | 0.0295 | 0.3691 | 0.4183 | 0.9785 | 3.2126 | 1.2972 | 0.9456 | 0.4055 | 2.1660 | 0.5806 | 0.5249 | 0.1371
$\mathcal{C_{\mathrm{minor_{1}}}}$ | 10.2305 | 1.6042 | 0.9009 | 0.0301 | -0.0216 | 0.2699 | 0.2909 | 0.9774 | 2.7703 | 1.3222 | 0.9947 | 0.1857 | 1.7520 | 0.5923 | 0.4619 | 0.0855
$\mathcal{C_{\mathrm{minor_{2}}}}$ | 18.2528 | 2.3069 | 1.0498 | 0.1580 | -0.1629 | 0.2528 | 0.2785 | 0.8780 | 2.5696 | 1.1249 | 0.8045 | 0.3066 | 1.7901 | 0.5446 | 0.3673 | 0.1491
Table 4: The generalization performance assessed using the metrics: L2-norm relative error, explained variance error, maximum error, and mean absolute error for the fourth experiment, where $\max(B)$ $=$ $1.5\text{\,}\mathrm{T}$. Test case | L2-norm $(\downarrow)$ | Explained variance score $(\uparrow)$ | Max error $(\downarrow)$ | Mean absolute error $(\downarrow)$
---|---|---|---|---
RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN | RNN | LSTM | GRU | HystRNN
$\mathcal{C_{\mathrm{FORC_{1}}}}$ | 0.7673 | 0.8556 | 0.9330 | 0.1007 | 0.2957 | 0.1675 | 0.3407 | 0.9017 | 1.7979 | 1.9572 | 1.8971 | 0.7491 | 0.9147 | 0.9642 | 0.9957 | 0.3258
$\mathcal{C_{\mathrm{FORC_{2}}}}$ | 0.4968 | 0.5942 | 0.5268 | 0.1164 | 0.3331 | 0.2209 | 0.3718 | 0.9330 | 1.2239 | 1.3492 | 1.3040 | 0.7725 | 0.7094 | 0.7686 | 0.7253 | 0.3304
$\mathcal{C_{\mathrm{minor_{1}}}}$ | 1.3719 | 1.3723 | 4.0550 | 0.0784 | 0.2318 | 0.0903 | 0.0640 | 0.9224 | 1.1112 | 1.1767 | 1.7688 | 0.2394 | 0.4981 | 0.5022 | 0.9177 | 0.1306
$\mathcal{C_{\mathrm{minor_{2}}}}$ | 1.7923 | 1.6721 | 6.0749 | 0.2257 | 0.2291 | 0.0907 | 0.0157 | 0.7743 | 0.9550 | 0.9988 | 1.5820 | 0.2991 | 0.4396 | 0.4261 | 0.911 | 0.1717

A series of numerical experiments encompassing _four distinct scenarios_ is
conducted, in which we systematically vary the upper limit of the magnetic
field $B$. The selection of diverse maximum $B$ field values corresponds to
the specific usage context of the material. As a result, these experiments are
geared towards demonstrating the viability of the proposed methodology across
a spectrum of electrical machines, all constrained by their respective
permissible maximum $B$ values.

(a) LSTM

(b) GRU

(c) HystRNN

(d) LSTM

(e) GRU

(f) HystRNN

(g) LSTM

(h) GRU

(i) HystRNN

(j) LSTM

(k) GRU

(l) HystRNN

Figure 4: Experimental vs predicted hysteresis trajectories for experiment 2,
where $\max(B)$ $=$ $1.25\text{\,}\mathrm{T}$. Top two rows: predictions for
$\mathcal{C_{\mathrm{FORC_{1}}}}$ and $\mathcal{C_{\mathrm{FORC_{2}}}}$
respectively. Bottom two rows: predictions for
$\mathcal{C_{\mathrm{minor_{1}}}}$ and $\mathcal{C_{\mathrm{minor_{2}}}}$
respectively.

Precisely, we opt for the maximum $B$ values of $1.7\text{\,}\mathrm{T}$,
$1.5\text{\,}\mathrm{T}$, $1.3\text{\,}\mathrm{T}$, and
$1.25\text{\,}\mathrm{T}$. _In each of these instances, we execute a total of
four experiments_. After training for $\mathcal{C_{\mathrm{major}}}$ until the
$B$ field reaches its saturation point, the experiments involve predicting
$\mathcal{C_{\mathrm{FORC}}}$ and $\mathcal{C_{\mathrm{minor}}}$. Notably, the
data set is generated from the Preisach model, which characterizes the
behavior of non-oriented NO27 steel. It is imperative to preprocess the data
before feeding it into the HystRNN model. We employ a normalization step using
the min-max scaling technique, as elucidated in SM §C.

For all the numerical experiments, the software and hardware environments used
for performing the experiments are as follows: Ubuntu 20.04.6 LTS, Python
3.9.7, Numpy 1.20.3, Scipy 1.7.1, Matplotlib 3.4.3, PyTorch 1.12.1, CUDA 11.7,
and NVIDIA Driver 515.105.01, i7 CPU, and NVIDIA GeForce RTX 3080.

###  4.1 Baselines

We introduce the concept of employing neural oscillators constructed within
the framework of recurrent networks for modeling hysteresis. This choice is
driven by the _intrinsic sequentiality and memory dependence_ characteristics
of hysteresis. Additionally, recurrent architectures have been successfully
employed for interpolation-type hysteresis modeling tasks across various
fields [4, 17]. Consequently, motivated by these rationales, we conduct a
comparative analysis of HystRNN with traditional recurrent networks such as
RNN, LSTM, and GRU. We subject these models to a comprehensive comparison,
specifically focusing on their performance in the context of generalization.
Our experiments involve delving into the potential of these models by
predicting outcomes for untrained $H$ sequences, thereby exploring their
capabilities for _generalization beyond trained data_.

(a) LSTM

(b) GRU

(c) HystRNN

(d) LSTM

(e) GRU

(f) HystRNN

(g) LSTM

(h) GRU

(i) HystRNN

(j) LSTM

(k) GRU

(l) HystRNN

Figure 5: Experimental vs predicted hysteresis trajectories for experiment 3,
where $\max(B)$ $=$ $1.3\text{\,}\mathrm{T}$. Top two rows: predictions for
$\mathcal{C_{\mathrm{FORC_{1}}}}$ and $\mathcal{C_{\mathrm{FORC_{2}}}}$
respectively. Bottom two rows: predictions for
$\mathcal{C_{\mathrm{minor_{1}}}}$ and $\mathcal{C_{\mathrm{minor_{2}}}}$
respectively.

(a) LSTM

(b) GRU

(c) HystRNN

(d) LSTM

(e) GRU

(f) HystRNN

(g) LSTM

(h) GRU

(i) HystRNN

(j) LSTM

(k) GRU

(l) HystRNN

Figure 6: Experimental vs predicted hysteresis trajectories for experiment 4,
where $\max(B)$ $=$ $1.5\text{\,}\mathrm{T}$. Top two rows: predictions for
$\mathcal{C_{\mathrm{FORC_{1}}}}$ and $\mathcal{C_{\mathrm{FORC_{2}}}}$
respectively. Bottom two rows: predictions for
$\mathcal{C_{\mathrm{minor_{1}}}}$ and $\mathcal{C_{\mathrm{minor_{2}}}}$
respectively.

###  4.2 Hyperparameters

The selected hyperparameters consist of an input size of 2, a single hidden
layer with a dimension of 32, and an output size of 1. The optimization
process involves the utilization of the Adam optimizer, with a learning rate
of $0.01$. Training is conducted for 10000 epochs, with a batch size of $1$.
The hyperparameter ${\Delta t}$ is chosen to be $0.05$. A sequence length of
$595$ is chosen for all four experiments to train
$\mathcal{C_{\mathrm{major}}}$. The determination of sequence length depends
upon the data generated by the Preisach model for
$\mathcal{C_{\mathrm{major}}}$. _Uniformity_ in hyperparameter settings is
maintained across all experiments. Furthermore, to ensure _fair comparisons_
with RNN, LSTM, and GRU models, the hyperparameters are also held constant for
these methods.

###  4.3 Evaluation metrics

We evaluate the proposed method using four metrics. The first is the _L2-norm_
, measuring the Euclidean distance between predicted and actual values. The
_explained variance score_ indicates prediction accuracy, capturing variance
proportion. _Maximum error_ detects significant prediction discrepancies as
potential outliers. The _mean absolute error_ assesses average differences
between predictions and actual values for overall precision. Lower L2-norm,
maximum error, and mean absolute error coupled with higher explained variance
signify improved performance. Metric expressions are detailed in SM §D.

###  4.4 Train and test criteria

The trained model is tested in two distinct scenarios involving the prediction
of two FORCs and two minor loops. For FORC prediction, testing sequences of
lengths $199$ and $399$ are utilized, respectively. The prediction of minor
loops involves a testing sequence with a length of $399$ each. As in the case
of training the model, these testing sequence lengths depend on the data
generated from the Preisach model for evaluating the model. The HystRNN model
trained on $\mathcal{C_{\mathrm{major}}}$ is evaluated on
$\mathcal{C_{\mathrm{FORC}}}$ and $\mathcal{C_{\mathrm{minor}}}$. This testing
sequence is initiated with an input
$(H_{i},B_{i})\in\mathcal{C_{\mathrm{FORC/minor}}}$, where both $H_{i}$, and
$B_{i}$ are provided and $B_{i+1}$ is predicted. The output generated from
this step, $B_{i+1}$, becomes the subsequent input along with $H_{i+1}$, the
known magnetization for the following sequence. Such testing holds _paramount
importance_ as _practical scenarios lack prior knowledge_ about the $B$ values
on $\mathcal{C_{\mathrm{FORC}}}$ or $\mathcal{C_{\mathrm{minor}}}$. Thus, the
sole available information for generalization stems from the predicted
solution in $\mathcal{C_{\mathrm{FORC}}}$ or $\mathcal{C_{\mathrm{minor}}}$.

###  4.5 Experimental Results

Four experiments are carried out to evaluate the performance of HystRNN. The
experiments differ by the _maximum permitted magnetic flux density_ of the
electrical machine $B_{\mathrm{max}}$. Exact $B_{\mathrm{max}}$ values are
indicated for the experiments in SM §G. Performing experiments and exploring
the generalization capabilities of the model for varying $B_{\mathrm{max}}$
values is _crucial_ for understanding and optimizing the performance and
efficiency of different and diverse machines. For instance, machines requiring
lower magnetic flux densities of $B_{\mathrm{max}}$ $=$
$1.25\text{\,}\mathrm{T}$ are typically used as high-efficiency induction
motors [37] in industrial settings for tasks like driving conveyor belts,
pumps, and compressors. Meanwhile, high-performance applications, for
instance, particle accelerators [38] and nuclear magnetic resonance [39],
demand higher magnetic flux densities with $B_{\mathrm{max}}$ $=$
$1.7\text{\,}\mathrm{T}$ for their operation. We perform experiments for
$B_{\mathrm{max}}$ in this spectrum and examine its _performance for
generalized scenarios_ , tailoring designs for diverse needs, ensuring energy
efficiency for everyday devices, and pushing technological boundaries for
cutting-edge systems.

For all the experiments, the data for the major loop,
$\mathcal{B_{\mathrm{major}}}$, is collected until $\max(B)$ reaches the
saturation value $B_{\mathrm{max}}$. HystRNN and other compared methods LSTM,
GRU, and RNN are trained on $\mathcal{B_{\mathrm{major}}}$. Once the model is
trained, they are tested for four distinct cases. The first and second test
cases correspond to estimating FORC. We denote them as
$\mathcal{C_{\mathrm{FORC_{1}}}}$ and $\mathcal{C_{\mathrm{FORC_{2}}}}$
respectively. Two distinct FORCs are chosen to study the effect of the
distance between the origin of the FORC and $B_{\mathrm{max}}$. The third and
fourth test cases are performed for predicting minor loops, which we denote by
$\mathcal{C_{\mathrm{minor_{1}}}}$ and $\mathcal{C_{\mathrm{minor_{2}}}}$
respectively. These minor loops vary based on the maximum value of $B$ to
which they are subjected. The origin of $\mathcal{C_{\mathrm{FORC_{1}}}}$,
$\mathcal{C_{\mathrm{FORC_{2}}}}$ and the maximum $B$ value of the minor loop
is provided in SM §G.

Detailed performance metrics for HystRNN are outlined in Tables 1 to 4,
corresponding to experiments 1 through 4, respectively. The Tables also
facilitate a comprehensive comparative analysis with RNN, LSTM, and GRU. The
metrics notably emphasize the _superior_ performance of our proposed method
HystRNN across all numerical experimentation scenarios.

####  4.5.1 Experiment 1

In Fig. 3, the top two rows display the predictions of
$\mathcal{C_{\mathrm{FORC_{1,2}}}}$ respectively, wherein training exclusively
occurs on $\mathcal{C_{\mathrm{major}}}$, indicated by the blue color.
Predictions are represented with black color, and ground truth is represented
with red color. The colors are kept consistent for all the following
experiments. The top two rows show that LSTM (Fig. 3(a), 3(d)) and GRU (Fig.
3(b), 3(e)) fail drastically to capture the shape of the FORC accurately. In
contrast, HystRNN effectively captures the _structure_ and _symmetry_ of
reversal curves as shown in Fig. 3(c) and 3(f). The last two rows show the
prediction for minor loop $\mathcal{C_{\mathrm{minor_{1,2}}}}$. For this case
also predictions from LSTM (Fig. 3(g), 3(j)) and GRU (Fig. 3(h), 3(k)) are
inaccurate. Neither LSTM nor GRU could form a closed loop for the predicted
trajectory, posing a major challenge to compute the energy loss without a
closed region, as energy loss depends on the surface area of the hysteresis
loop. In contrast, our proposed method HystRNN predicts the _structure_ of the
loop very well and efficiently models the minor loop (Fig. 3(i), 3(l)).

####  4.5.2 Experiment 2

The top two rows of Fig. 4 present that LSTM (Fig. 4(a), 4(d)) and GRU (Fig.
4(b), 4(e)) fail to predict the trajectory of FORC by a huge margin. On the
other hand, HysRNN shows close agreement with the ground truth for predicting
$\mathcal{C_{\mathrm{FORC_{1,2}}}}$ (Fig. 4(c), 4(f)). Also, the prediction of
HystRNN for $\mathcal{C_{\mathrm{FORC_{1}}}}$ is slightly better than for
$\mathcal{C_{\mathrm{FORC_{2}}}}$, exemplifies that the model performs better
when the origin of FORC is closer to $\max(B)$. A possible reason for this
behavior could be the resemblance in the trajectories of
$\mathcal{C_{\mathrm{major}}}$ and a FORC from a higher origin value. The last
two rows of Fig. 4 present the predictions of
$\mathcal{C_{\mathrm{minor_{1,2}}}}$ respectively. For this case, LSTM (Fig.
4(g), 4(j)) and GRU (Fig. 4(h), 4(k)) almost form a loop-like shape; however,
they are very off from compared to the ground truth. HysRNN, on the other
hand, captures the loop shape efficiently, as presented in Fig. 4(i) and 4(l).

####  4.5.3 Experiment 3

The predictions for the model, the ground truth, and the training data are
presented in Fig. 5. As presented in Fig. 5(a), 5(b), 5(d), and 5(e)
predictions by LSTM and GRU models exhibit a lack of accuracy. In contrast,
predictions of our model HystRNN for the reversal curve are notably precise,
as evidenced in Figures Fig. 5(c) and 5(f). The final two rows within Fig. 5
present that HystRNN accurately captured the characteristics of the minor
loop, as showcased in Fig. 5(i) and 5(l). Prediction by GRU manages to capture
a resemblance of the loop, although not entirely, as revealed in Fig. 5(h) and
5(k). On the other hand, LSTM performs poorly, failing to capture the
intricate structure of the minor loop, as depicted in Fig. 5(g) and 5(j).

####  4.5.4 Experiment 4

The predictions for the model, the ground truth, and the training data are
presented in Fig. 6. Predictions of the reversal curve show agreement with the
nature observed in previous experiments. In this case, $\max(B)$, origin of
$\mathcal{C_{\mathrm{FORC_{2}}}}$, and maximum $B$ value of
$\mathcal{C_{\mathrm{minor_{2}}}}$ vary significantly, posing a challenge for
both LSTM and GRU. However, HystRNN outperforms them for each case, as shown
in Fig. 6. The results underscore the performance of HystRNN as, for neither
of the cases, the accuracy of LSTM or GRU is comparable to our proposed
method. Additional visual results for all the RNN experiments are supplemented
in SM §E.

##  5 Conclusions

We introduced a novel neural oscillator, _HystRNN_ , aimed to _advance_
magnetic hysteresis modeling within _extrapolated regions_. The proposed
oscillator is based upon the foundation of coupled oscillator recurrent neural
networks and _inspired from_ phenomenological hysteresis models. HystRNN was
validated by predicting first-order reversal curves and minor loops after
training the model _solely_ with major loop data. The outcomes underscore the
_superiority_ of HystRNN in adeptly capturing intricate nonlinear dynamics,
_outperforming_ conventional recurrent neural architectures such as RNN, LSTM,
and GRU on _various metrics_. This performance is attributed to its capacity
to assimilate sequential information, history dependencies, and hysteretic
features, ultimately achieving generalization capabilities. Access to the
codes and data will be provided upon publication.

## References

  * [1] Giorgio Bertotti and Isaak D Mayergoyz.  The Science of Hysteresis: 3-volume set.  Elsevier, 2005.
  * [2] Konstantinos Vlachas, Konstantinos Tatsis, Konstantinos Agathos, Adam R Brink, and Eleni Chatzi.  A local basis approximation approach for nonlinear parametric model order reduction.  Journal of Sound and Vibration, 502:116055, 2021.
  * [3] Doğa Ceylan, Reza Zeinali, Bram Daniels, Konstantin O Boynov, and Elena A Lomonova.  A novel modeling technique via coupled magnetic equivalent circuit with vector hysteresis characteristics of laminated steels.  IEEE Transactions on Industry Applications, 59(2):1481–1491, 2022\.
  * [4] Guangzeng Chen, Guangke Chen, and Yunjiang Lou.  Diagonal recurrent neural network-based hysteresis modeling.  IEEE Transactions on Neural Networks and Learning Systems, 33(12):7502–7512, 2021.
  * [5] Giorgio Bertotti.  Hysteresis in magnetism: for physicists, materials scientists, and engineers.  Gulf Professional Publishing, 1998.
  * [6] Ferenc Preisach.  Über die magnetische nachwirkung.  Zeitschrift für physik, 94(5-6):277–302, 1935.
  * [7] David C Jiles and David L Atherton.  Theory of ferromagnetic hysteresis.  Journal of magnetism and magnetic materials, 61(1-2):48–60, 1986\.
  * [8] R Bouc.  Forced vibrations of mechanical systems with hysteresis.  In Proc. of the Fourth Conference on Nonlinear Oscillations, Prague, 1967, 1967.
  * [9] Yi-Kwei Wen.  Method for random vibration of hysteretic systems.  Journal of the engineering mechanics division, 102(2):249–263, 1976\.
  * [10] Abhishek Chandra, Bram Daniels, Mitrofan Curti, Koen Tiels, Elena A Lomonova, and Daniel M Tartakovsky.  Discovery of sparse hysteresis models for piezoelectric materials.  Applied Physics Letters, 122(21), 2023.
  * [11] Miaomiao Lin, Changming Cheng, GuanZhen Zhang, Baoxuan Zhao, Zhike Peng, and Guang Meng.  Identification of bouc-wen hysteretic systems based on a joint optimization approach.  Mechanical Systems and Signal Processing, 180:109404, 2022.
  * [12] Claudio Serpico and Ciro Visone.  Magnetic hysteresis modeling via feed-forward neural networks.  IEEE Transactions on Magnetics, 34(3):623–628, 1998.
  * [13] Dimitre Makaveev, Luc Dupré, Marc De Wulf, and Jan Melkebeek.  Modeling of quasistatic magnetic hysteresis with feed-forward neural networks.  Journal of Applied Physics, 89(11):6737–6739, 2001.
  * [14] Simone Quondam-Antonio, Francesco Riganti-Fulginei, Antonino Laudani, Gabriele-Maria Lozito, and Riccardo Scorretti.  Deep neural networks for the efficient simulation of macro-scale hysteresis processes with generic excitation waveforms.  Engineering Applications of Artificial Intelligence, 121:105940, 2023.
  * [15] M Farrokh, FS Dizaji, and MS Dizaji.  Hysteresis identification using extended preisach neural network.  Neural Processing Letters, pages 1–25, 2022.
  * [16] Chih-Lyang Hwang and Chau Jan.  Recurrent-neural-network-based multivariable adaptive control for a class of nonlinear dynamic systems with time-varying delay.  IEEE transactions on neural networks and learning systems, 27(2):388–401, 2015.
  * [17] Mahmoud Saghafifar, Anjan Kundu, and Andrew Nafalski.  Dynamic magnetic hysteresis modelling using elman recurrent neural network.  International Journal of Applied Electromagnetics and Mechanics, 13(1-4):209–214, 2002.
  * [18] Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio.  Learning phrase representations using rnn encoder-decoder for statistical machine translation.  arXiv preprint arXiv:1406.1078, 2014.
  * [19] Sepp Hochreiter and Jürgen Schmidhuber.  Long short-term memory.  Neural computation, 9(8):1735–1780, 1997.
  * [20] Diego Serrano, Haoran Li, Shukai Wang, Thomas Guillod, Min Luo, Vineet Bansal, Niraj K Jha, Yuxin Chen, Charles R Sullivan, and Minjie Chen.  Why magnet: Quantifying the complexity of modeling power magnetic material characteristics.  IEEE Transactions on Power Electronics, 2023.
  * [21] Steven L Brunton and J Nathan Kutz.  Data-driven science and engineering: Machine learning, dynamical systems, and control.  Cambridge University Press, 2022.
  * [22] T Konstantin Rusch and Siddhartha Mishra.  Coupled oscillatory recurrent neural network (cornn): An accurate and (gradient) stable architecture for learning long time dependencies.  arXiv preprint arXiv:2010.00951, 2020.
  * [23] T Konstantin Rusch and Siddhartha Mishra.  Unicornn: A recurrent model for learning very long time dependencies.  In International Conference on Machine Learning, pages 9168–9178. PMLR, 2021.
  * [24] T Konstantin Rusch, Siddhartha Mishra, N Benjamin Erichson, and Michael W Mahoney.  Long expressive memory for sequence modeling.  arXiv preprint arXiv:2110.04744, 2021.
  * [25] Alejandro Queiruga, N Benjamin Erichson, Liam Hodgkinson, and Michael W Mahoney.  Stateful ode-nets using basis function expansions.  Advances in Neural Information Processing Systems, 34:21770–21781, 2021.
  * [26] T Konstantin Rusch, Ben Chamberlain, James Rowbottom, Siddhartha Mishra, and Michael Bronstein.  Graph-coupled oscillator networks.  In International Conference on Machine Learning, pages 18888–18909. PMLR, 2022.
  * [27] Samuel Lanthaler, T Konstantin Rusch, and Siddhartha Mishra.  Neural oscillators are universal.  arXiv preprint arXiv:2305.08753, 2023.
  * [28] JinHyoung Oh and Dennis S Bernstein.  Semilinear duhem model for rate-independent and rate-dependent hysteresis.  IEEE Transactions on Automatic Control, 50(5):631–645, 2005.
  * [29] Arbaaz Khan, Saikou Ceesay, Yuan-Po Teng, Ruoli Wang, Haipeng Yue, and David Lowther.  Generalizable deep neural network based multi-material hysteresis modeling.  In 2022 IEEE 20th Biennial Conference on Electromagnetic Field Computation-Long papers (CEFC-LONG), pages 1–4. IEEE, 2022.
  * [30] Mohammad Reza Zamani Kouhpanji and Bethanie JH Stadler.  First-order reversal curve (forc) measurements for decoding mixtures of magnetic nanowires.  Magnetic Measurement Techniques for Materials Characterization, pages 651–663, 2021.
  * [31] Dustin Gilbert.  Forc diagrams in magnetic thin films.  Magnetic Measurement Techniques for Materials Characterization, pages 629–650, 2021.
  * [32] Alexandru Stancu.  Characterization of magnetic nanostructures with the first-order reversal curves (forc) diagram technique.  Magnetic Measurement Techniques for Materials Characterization, pages 605–628, 2021.
  * [33] Ricky TQ Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud.  Neural ordinary differential equations.  Advances in neural information processing systems, 31, 2018.
  * [34] Yulia Rubanova, Ricky TQ Chen, and David K Duvenaud.  Latent ordinary differential equations for irregularly-sampled time series.  Advances in neural information processing systems, 32, 2019.
  * [35] Bo Chang, Minmin Chen, Eldad Haber, and Ed H Chi.  Antisymmetricrnn: A dynamical system view on recurrent neural networks.  arXiv preprint arXiv:1902.09689, 2019.
  * [36] Taniya Kapoor, Abhishek Chandra, Daniel M Tartakovsky, Hongrui Wang, Alfredo Nunez, and Rolf Dollevoet.  Neural oscillators for generalization of physics-informed machine learning.  arXiv preprint arXiv:2308.08989, 2023.
  * [37] Aina He, Anding Wang, Shiqiang Yue, Chengliang Zhao, Chuntao Chang, He Men, Xinmin Wang, and Run-Wei Li.  Dynamic magnetic characteristics of fe78si13b9 amorphous alloy subjected to operating temperature.  Journal of Magnetism and Magnetic Materials, 408:159–163, 2016\.
  * [38] Ingars Reinholds, Valdis Kalkis, and Roberts D Maksimovs.  The effect of ionizing radiation and magnetic field on deformation properties of high density polyethylene/acrylonitrile-butadiene composites.  Journal of Chemistry and Chemical Engineering, 6(3), 2012.
  * [39] Yukie Mori, Yoshio Sakaguchi, and Hisaharu Hayashi.  Magnetic field effects on chemical reactions of biradical radical ion pairs in homogeneous fluid solvents.  The Journal of Physical Chemistry A, 104(21):4896–4905, 2000.

## Supplementary Material

### SM §A: Nomenclature

The table provided below presents the abbreviations utilized within this
paper.

Table 5: Abbreviations used in this paper
Symbol | Description
---|---
CoRNN | coupled-oscillatory recurrent neural network
GRU | Gated recurrent unit
LSTM | Long short-term memory
ODE | Ordinary differential equation
RNN | Recurrent neural network

### SM §B: Preisach model of hysteresis and data generation for magnetic
experiments

The modeling of magnetic materials is a critical step when designing
electromechanical devices, mostly to predict the behavior of the ferromagnetic
core. Often, this is achieved by a so-called anhysteretic curve that describes
the ideal magnetic behavior of a soft-magnetic material which is not subjected
to any hysteresis effects. However, for increased insight it is desired to
include this hysteresis behavior into the simulation.

One of the most widely known models to describe the hysteresis relation is the
Preisach model of hysteresis. It is a phenomenological model that describes
the hysteresis effect by a set of hysteresis operators, scattered on a
triangular domain called the Preisach plane, which are scaled by a weight
function, following

$f(t)=\iint\limits_{\alpha\geq\beta}P(\alpha,\beta)\hat{\gamma}_{\alpha,\beta}u(t)d\alpha
d\beta$ (4)

where:

  * •

$u$ is the input,

  * •

$f$ is the output,

  * •

$t$ is a moment in time,

  * •

$\alpha~{}\&~{}\beta$ are two switching variables,

  * •

$P$ is the Preisach weight function,

  * •

$\hat{\gamma}$ represents the hysteresis operators.

Typically, the weight function is constructed from well-known probability
density functions, for which the parameters are tuned to closely match the
magnetic material behavior. Alternatively, the weight function can also be
obtained from magnetic measurement data, which generally results in the best
correspondence, albeit at the cost of a more complicated identification
procedure. Furthermore, in its general form, the model output is not affected
by the rate of change of the input, and the model describes solely the static
scalar hysteresis behavior. However, various generalization exist to include,
e.g. dynamical eddy currents effects, or the vector hysteresis phenomenon.
Ultimately, in this work the static scalar Preisach model was applied, with a
weight function fitted on a set of measurement data.

The measurement data in this work was obtained by a Brockhaus MPG 200 soft-
magnetic material tester, using an Epstein frame calibrated to correspond with
the IEC standard. A set of concentric hysteresis loops up to a maximum of 1.7
T was measured for NO27-1450H, obtained under quasi-DC excitation. Here,
quasi-DC indicates that the rate of change of the magnetic flux density was
controlled such that any eddy current fields are negligible, and the static
hysteresis behavior is obtained. The Epstein sample strips used were obtained
using spark eroding and cut in the rolling direction.

Figure 7: The MPG 200 desk by Brockhaus, with Epstein frame and sample strips
shown on the right.

### SM §C: Data Normalization

The procedure used to normalize the data for training all the models is
described in the following subsections.

#### Min-Max Scaling

Min-Max Scaling is a technique used to transform numerical data so that it
falls within a specific range, typically between 0 and 1. The purpose of this
normalization is to bring all the features to a similar scale, which can be
particularly important for algorithms that are sensitive to the scale of input
data.

$\displaystyle X_{\text{min}}$ $\displaystyle\text{ represents the minimum
value in the original dataset }X.$ $\displaystyle X_{\text{max}}$
$\displaystyle\text{ represents the maximum value in the original dataset }X.$
$\displaystyle X_{\text{scaled}}$ is the result of scaling the original
dataset.

The formula for scaling the data is:

$X_{\text{scaled}}=\frac{X-X_{\text{min}}}{X_{\text{max}}-X_{\text{min}}}\times
2-1$

In this formula:

  * •

$(X-X_{\text{min}})$ calculates the difference between each data point and the
minimum value.

  * •

$(X_{\text{max}}-X_{\text{min}})$ represents the range of the data.

  * •

Dividing by $(X_{\text{max}}-X_{\text{min}})$ scales the data to the range
$[0,1]$.

  * •

Multiplying by 2 and subtracting 1 scales the data to the range $[-1,1]$.

So, $X_{\text{scaled}}$ contains the normalized data in the range of $[-1,1]$.

#### Inverse Min-Max Scaling

After Min-Max Scaling to revert the scaled data back to its original values.
The formula for this Inverse Min-max scaling is given as:

$X_{\text{original}}=\frac{X_{\text{scaled}}+1}{2}\times(X_{\text{max}}-X_{\text{min}})+X_{\text{min}}$

In this formula:

  * •

$\frac{X_{\text{scaled}}+1}{2}$ scales the scaled data back to the range
$[0,1]$.

  * •

$(X_{\text{max}}-X_{\text{min}})$ represents the original range of the data.

  * •

Multiplying by $(X_{\text{max}}-X_{\text{min}})$ scales the data back to the
original range.

  * •

Adding $X_{\text{min}}$ adjusts the scaled data to its original position.

### SM §D: Error Metrics

The error metrics used in this study are described in the following
subsections.

####  $L^{2}$ norm

The formula for the relative $L^{2}$ norm of $\hat{B}$ with respect to ground
truth $B$ is given by:

$\text{Relative $L^{2}$ norm}=\frac{\|\hat{B}-B\|_{2}}{\|B\|_{2}}$

where:

  * •

$\|\hat{B}-B\|_{2}$ is the Euclidean distance between vectors $\hat{B}$ and
$B$,

  * •

$\|B\|_{2}$ is the Euclidean norm (magnitude) of vector $B$.

#### Explained variance score

The formula for the explained variance score is given by:

$\text{Explained Variance
Score}=1-\frac{\sum_{i=1}^{n}(B_{i}-\hat{B_{i}})^{2}}{\sum_{i=1}^{n}(B_{i}-\bar{B})^{2}}$

where:

  * •

$n$ is the number of data points,

  * •

$B_{i}$ represents the ground truth at the $i$-th data point,

  * •

$\hat{B_{i}}$ represents the predicted value at the $i$-th data point,

  * •

$\bar{B}$ represents the mean of the ground truth.

#### Max error

The formula for the maximum absolute error is given by:

$\text{Max Absolute Error}=\max_{i=1}^{n}|B_{i}-\hat{B_{i}}|$

where:

  * •

$n$ is the number of data points,

  * •

$B_{i}$ represents the ground truth at the $i$-th data point,

  * •

$\hat{B_{i}}$ represents the predicted value at the $i$-th data point,

  * •

$|x|$ represents the absolute value of $x$.

#### Mean absolute error

The formula for the mean absolute error is given by:

$\text{Mean Absolute Error}=\frac{1}{n}\sum_{i=1}^{n}|B_{i}-\hat{B_{i}}|$

where:

  * •

$n$ is the number of data points,

  * •

$B_{i}$ represents the ground truth at the $i$-th data point,

  * •

$\hat{B_{i}}$ represents the predicted value at the $i$-th data point,

  * •

$|x|$ represents the absolute value of $x$.

### SM §E: Additional results for RNN

Additional results for RNN, for experiment 1 through 4 are provided in Fig. 8
to 11, respectively.

Figure 8: Exp 1: RNN prediction for (a:) $\mathcal{C_{\mathrm{FORC_{1}}}}$;
(b:) $\mathcal{C_{\mathrm{FORC_{2}}}}$; (c:)
$\mathcal{C_{\mathrm{minor_{1}}}}$; (d:) $\mathcal{C_{\mathrm{minor_{2}}}}$

Figure 9: Exp 2: RNN prediction for (a:) $\mathcal{C_{\mathrm{FORC_{1}}}}$;
(b:) $\mathcal{C_{\mathrm{FORC_{2}}}}$; (c:)
$\mathcal{C_{\mathrm{minor_{1}}}}$; (d:) $\mathcal{C_{\mathrm{minor_{2}}}}$

Figure 10: Exp 3: RNN prediction for (a:) $\mathcal{C_{\mathrm{FORC_{1}}}}$;
(b:) $\mathcal{C_{\mathrm{FORC_{2}}}}$; (c:)
$\mathcal{C_{\mathrm{minor_{1}}}}$; (d:) $\mathcal{C_{\mathrm{minor_{2}}}}$

Figure 11: Exp 4: RNN prediction for (a:) $\mathcal{C_{\mathrm{FORC_{1}}}}$;
(b:) $\mathcal{C_{\mathrm{FORC_{2}}}}$; (c:)
$\mathcal{C_{\mathrm{minor_{1}}}}$; (d:) $\mathcal{C_{\mathrm{minor_{2}}}}$

### SM §F: Phenomenological hysteresis differential models

The Duhem hysteresis model is given by,

$\dot{B}(t)=a|\dot{H}(t)|\cdot[bH(t)-B(t)]+c\dot{H}(t)$

where, $a$,$b$, and $c$ are the parameters that control the shape of the
hysteresis loop. The dot over a quantity denotes the time derivative of the
quantity.

The Bouc-Wen model for hysteresis is given by,

$\dot{B}(t)=\alpha\dot{H}-\beta|\dot{H}(t)|\cdot
B(t)\cdot|B(t)|^{n-1}-\gamma\dot{H}|B(t)|^{n}$

where, $\alpha$, $\beta$, and $\gamma$ are Bouc-Wen parameters that control
the shape of the hysteresis loop.

### SM §G: Details regarding the conducted experiments

#### Experiment 1

For the first experiment, $\max(B)$ $=$ $1.7\text{\,}\mathrm{T}$. The origin
of $\mathcal{C_{\mathrm{FORC_{1,2}}}}$ is taken to be
$1.25\text{\,}\mathrm{T}$ and $0.5\text{\,}\mathrm{T}$ respectively. The
chosen maximum $B$ value of $\mathcal{C_{\mathrm{minor_{1,2}}}}$ is
$1.25\text{\,}\mathrm{T}$ and $1.1\text{\,}\mathrm{T}$. The predictions for
the model, the ground truth, and the training data are presented in Fig.3.

#### Experiment 2

For the second experiment, $\max(B)$ $=$ $1.25\text{\,}\mathrm{T}$. The origin
of $\mathcal{C_{\mathrm{FORC_{1,2}}}}$ is taken to be $1.2\text{\,}\mathrm{T}$
and $1.0\text{\,}\mathrm{T}$ respectively. The chosen maximum $B$ value of
$\mathcal{C_{\mathrm{minor_{1,2}}}}$ is $1.0\text{\,}\mathrm{T}$ and
$0.8\text{\,}\mathrm{T}$. The predictions for the model, the ground truth, and
the training data are presented in Fig.4.

#### Experiment 3

For the third experiment, $\max(B)$ $=$ $1.3\text{\,}\mathrm{T}$. The origin
of $\mathcal{C_{\mathrm{FORC_{1,2}}}}$ is taken to be $1.0\text{\,}\mathrm{T}$
and $0.75\text{\,}\mathrm{T}$ respectively. The chosen maximum $B$ value of
$\mathcal{C_{\mathrm{minor_{1,2}}}}$ is $1.0\text{\,}\mathrm{T}$ and
$0.75\text{\,}\mathrm{T}$.

#### Experiment 4

For the fourth experiment, $\max(B)$ $=$ $1.5\text{\,}\mathrm{T}$. The origin
of $\mathcal{C_{\mathrm{FORC_{1,2}}}}$ is taken to be
$1.25\text{\,}\mathrm{T}$ and $0.75\text{\,}\mathrm{T}$ respectively. The
chosen maximum $B$ value of $\mathcal{C_{\mathrm{minor_{1,2}}}}$ is
$0.9\text{\,}\mathrm{T}$ and $0.7\text{\,}\mathrm{T}$.