C++ main module for stochmagnet Package  1.0
StochMagnet Core package

StochMagnet Core package contains all classes used in the Stoch Magnet module.

StochMagnet Core package contains all classes used in the Stoch Magnet module.

The purpose of the code is to simulate the behavior of a ferromagnetic particles with a stochastic perturbation. In the first part , the deterministic part is detailed while in the second part the thermal effect is detailed.

deterministic model

The behavior of ferromagnetic particles submitted is usually modelled by the deterministic dynamical system:

\( \frac{d\mu}{dt}=LL(\mu,H) \)

where :

In the program the preceeding expression is replaced by

\( LL(\mu,H)=\displaystyle \alpha.\left (\mu \wedge H + \beta \left ( <\mu,H> \mu - |\mu|^2 H \right ) \right ) \)

The dedicated class in the SM_LandauLifschitzFunction

The Landau lifschitz equtaion equation can be rewritten as follow :

\( \displaystyle \frac{d\mu}{dt}=\alpha. A(\mu) B \)

where \( A: \mathbb{R}^3 \rightarrow M_{3\times3} \) is defined by

\( \displaystyle A(x)=L(x) + \beta ( x.x^t - x^t.x I ) \)

and \( L((x_1,x_2,x_3))=\begin{pmatrix}0 & -x_3 & x_2 \\ x_3 & 0 & -x_1 \\ -x_2& x_1 & 0 \end{pmatrix} \)

The particles are submitted to

The relation of the energy E with respect of the magnetic field H at point \(P_i\) and the magnetic moment \(\mu_i\) is \(\frac{dE}{d\mu}=- H \).

For reference on operators, see the concerning dedicated class :

Thermal effect

In order to model thermal effects, a stochastic perturbation is introduced. Thermal effect can be embedded in the deterministic system by adding a stochastic perturbation to the field H by considering a standard F-Brownian motion which leads to the following stochastic system

\( \displaystyle d\mu=\alpha. A(\mu_t) H.dt + \epsilon \alpha A(\mu_t)dW_t \)

The brownian motion is modelized by the class SM_StochasticFunction and implemented in SMS_BoostNormalFunction.

The noise rate \( epsilon \) is modelized by the SM_NoiseRateFunction a,d is implemented in

Ito approach

The preceeding system is not physically consistent as it does not preserve the norm of \(\mu \) which must be invariant equals to 1. To preserve the invariance of the norm of \(\mu \), the Ito approach will consist to normalize \(\mu \) at each iteration:

Stratonovich approach

To preserve the invariance of the norm of \( \mu \), the Ito approach et modified in the Stratonovich approach.

It consists in adding a new term \(K_t . dt \) in the equation Ito system and choosing \($K_t\) such that \(d|\mu_t|=0 \).

To compute \(K_t \), we use the followin Ito Theorem:

Let's denote by \(W \) a brownian movement in \(R^d \) and

\( \begin{array}{lll} Xt &:& R \rightarrow R^n \\ & & t \mapsto X_t \\ b &:& R^+ \times R^n \rightarrow R^n \\ & & (t,X) \mapsto b(t,X) \\ \sigma &: & R^+ \times R^n \rightarrow R^n\times R^d \\ & & \displaystyle dX_t=b(t,X_t).dt + \sigma(t,X_t) dW_t\\ \end{array} \)

if we note by

\( \begin{array}{lll} f &:& R^+ \times R^n \rightarrow R \\ & & (t,x) \mapsto f(t,X)\\ \end{array} \)

we have

\( df(t,X_t)=\displaystyle \frac{\partial f}{\partial t} dt + \nabla_xf(X_t).dX_t +\frac{1}{2} \sum_{i,j} \frac{\partial^2 f(t,X_t)}{\partial x_i \partial x_j} .d<x_i,x_j>_t \)

with \( d<x_i,x_j>_t=(\sigma(t,X_t).\sigma(t,Y_t>^T)_{ij} dt \)

So, we apply the Ito theorem to \(f(t,X)=<X,X>\) with \(d\mu_t\) verifiing \(\displaystyle d\mu_t=\alpha. A(\mu_t) B.dt + \epsilon \alpha A(\mu_t)dW_t + K_tdt\).

\(d|\mu_t|^2=2<\mu_t,\alpha.A(\mu_t).B dt+ \epsilon \alpha A(\mu_t)dW_t + K_tdt>+\frac{1}{2}. \sum_{i,j} 2.\delta_{ij}.\varepsilon^2.\alpha^2.A(\mu_t).A(\mu_t)^T dt\)

As we have from that \(<d\mu_t,\alpha.A(\mu_t).B dt+ \epsilon \alpha A(\mu_t)dW_t>=0 \) , we conclude that

\(d|\mu_t|^2=2.<\mu_t,K_t>.dt + \varepsilon^2.\alpha^2 . tr(A(\mu_t).A(\mu_t)^T)dt\)

After some computations, we have

\( tr(A(\mu_t).A(\mu_t)^T)=2|\mu_t|^2+3\beta^2|\mu_t|^4-2\beta^2|\mu_t|^4+\beta^2|\mu_t|^4 \)

So \( d|\mu_t|^2=\displaystyle 2. \varepsilon^2.\alpha^2.dt.|\mu_t|^2.\left( 1+\beta^2.|\mu_t|^2\right)+2.<\mu_t,K_t>.dt \)

To have a null variation of the norm of \(\mu\), we can impose that \( K_t= - \varepsilon^2.\alpha^2.dt.|\mu_t|^2.\left( 1+\beta^2.|\mu_t|^2\right) \cdot \mu_t\)

So the Ito system becomes with \(|\mu_t|=1 \), the Stratonovich system:

\( \displaystyle d\mu_t=\alpha. A(\mu_t) B.dt+ \epsilon \alpha A(\mu_t)dW_t - \varepsilon^2.\alpha^2.\left( 1+\beta^2\right).dt.\mu_t \)

We can assume now that the noise rate \(\varepsilon \) may be dependant on t. It will be denoted by \( \varepsilon_t \).

Algorithm

The algorithm is as follow for the stratonovich or Ito algorithm see SM_System class ( \( \tau=0 \) for Ito algorithm)

Whereas the general \(\mu_t \) simulation by the Stratonovich system algorithm can be illustrated as follow (see SM_System or SM_StratonovichNormalizedSystem )

3 implementations of systemshave been implemented:

package classes

It contains the generic classes:

the specific class are :

The operators are described by this classes:

The stochastic functions are described by this class:

The noise rate functions are described by this classes:

The result of the program are managed by the classes:

The organization of this package is as follow: