TVE-F 17 005 maj
Examensarbete 15 hp Juni 2017
A Comparison of Three Time-stepping Methods for the LLG Equation in
Dynamic Micromagnetics
Anton Kroner
Tomas Berg
Simon Wredh
Teknisk- naturvetenskaplig fakultet UTH-enheten
Besöksadress:
Ångströmlaboratoriet Lägerhyddsvägen 1 Hus 4, Plan 0
Postadress:
Box 536 751 21 Uppsala
Telefon:
018 – 471 30 03
Telefax:
018 – 471 30 00
Hemsida:
http://www.teknat.uu.se/student
Abstract
A Comparison of Three Time-stepping Methods for the LLG Equation in Dynamic Micromagnetics
Anton Kroner & Tomas Berg & Simon Wredh
Micromagnetism is the study of magnetic materials on the microscopic length scale (of nano to micrometers), this scale does not take quantum mechanical effects into account, but is small enough to neglect certain macroscopic effects of magnetism in a material.
The Landau-Lifshitz-Gilbert (LLG) equation is used within micromagnetism to determine the time evolution of the magnetisation vector field in a ferromagnetic solid. It is a partial differential equation with high non linearity, which makes it very difficult to solve analytically. Thus numerical methods have been developed for approximating the solution using computers.
In this report we compare the performance of three different numerical methods for the LLG equation, the implicit midpoint method (IMP), the midpoint with
extrapolation method (MPE), and the Gauss-Seidel Projection method (GSPM).
It was found that all methods have convergence rates as expected; second order for IMP and MPE, and first order for GSPM. Energy conserving properties of the schemes were analysed and neither MPE or GSPM conserve energy. The computational time required for each method was determined to be very large for the IMP method in comparison to the other two. Suggestions for different areas of use for each method are provided.
Handledare: Doghonay Arjmand & Gunilla Kreiss
Popul¨ arvetenskaplig sammanfattning
Mikromagnetism ¨ ar ett omr˚ ade som studerar magnetism p˚ a mikroskopiska (dock ej kvant- mekaniska) l¨ angdskalor. Omr˚ adet ¨ ar av intresse bland annat inom h˚ arddiskindustrin, d¨ ar magnetiska material anv¨ ands f¨ or att lagra information.
Inom mikromagnetism finns Landau-Lifshitz-Gilberts (LLG) ekvation. L¨ osningar till denna beskriver hur magnetiseringen f¨ or¨ andras inom ett material ¨ over tid. LLG- ekvationen ¨ ar en partiell differentialekvation med variabler i rum och tid, vilket inneb¨ ar att l¨ osningen ¨ ar en funktion som beror p˚ a position och tidpunkt.
Ekvationen har en komplicerad struktur och att hitta exakta l¨ osningar ¨ ar inte l¨ att.
F¨ oljdaktligen anv¨ ander man numeriska metoder och datorer f¨ or att ber¨ akna ett n¨ armev¨ arde till l¨ osningen. Det finns ett antal olika metoder som ¨ ar anpassade f¨ or LLG-ekvationen och syftet med det h¨ ar projektet ¨ ar att j¨ amf¨ ora egenskaper f¨ or tre av dessa: implicita mittpunktsmetoden (IMP), den extrapolerade mittpunktsmetoden (MPE), samt Gauss- Siedel projektionsmetoden (GSPM).
Det uppt¨ acktes att alla metoder uppfyllde sina f¨ orv¨ antade noggranhetsordningar, andra ordningen f¨ or IMP och MPE, samt f¨ orsta ordningen f¨ or GSPM. Energibevar- ingsf¨ orm˚ agan unders¨ oktes och varken GSPM eller MPE klarade av att ber¨ akna energin korrekt. Ber¨ akningstiden som kr¨ avdes f¨ or IMP best¨ ammdes till att vara mycket h¨ ogre ¨ an f¨ or de andra tv˚ a metoderna. GSPM ¨ ar l¨ ampig f¨ or snabba och onoggranna simuleringar.
MPE b¨ or anv¨ andas f¨ or ber¨ akningar som inte kr¨ aver exakt energibevaring och som upp- fyller dess stabilitetsvillkor. IMP ger mest korrekta l¨ osningar oavsett diskretisering men
¨
ar relativt l˚ angsam.
Contents
1 Introduction 1
1.1 Background . . . . 1
1.2 Purpose . . . . 1
1.3 Simplifications . . . . 1
2 Theory 2 2.1 The LLG equation . . . . 2
2.2 Energy . . . . 3
2.3 Numerical properties . . . . 4
2.4 Numerical methods . . . . 4
2.4.1 Implicit midpoint method . . . . 4
2.4.2 Midpoint with explicit extrapolation . . . . 8
2.4.3 Gauss-Seidel projection . . . . 9
3 Method of comparison 11 3.1 Physical requirements . . . . 11
3.2 Numerical viability . . . . 11
4 Results 12 4.1 Magnitude conservation . . . . 13
4.2 Energy conservation . . . . 13
4.3 Stability analysis . . . . 15
4.4 Convergence studies . . . . 17
4.5 Computation time . . . . 18
5 Discussion 18 5.1 Conservative properties . . . . 18
5.2 Numerical performance . . . . 18
6 Conclusion 19
1 Introduction
1.1 Background
Magnetism in a material arises from the electron spin and orbital angular momentum in the atoms of which the material consists of. However, on larger scales, it is possible to analyse magnetism without taking these quantum mechanical effects into account.
The field of micromagnetics studies magnetism at the microscopic size scale of nano to micrometers, and has been of interest since the advent of modern computers. In the year 1960, the field had developed enough to be useful in the development of the magnetic hard drive [1].
A commonly used mathematical model in micromagnetics is the LLG equation. It was introduced by Landau and Lifshitz in 1935 and later modified by Thomas Gilbert.
The equation is a vectorial partial differential equation (PDE) and is used to describe the precessional motion of magnetisation in solids, as seen in figure 1. Analytical solutions can only be found in special cases and consequently numerical schemes have been developed to reliably solve the equation using computers. [1]
1.2 Purpose
The purpose of this project it to implement three different time stepping methods for the LLG equation and numerically compare their properties. A classical implicit midpoint method, known to be a good performer albeit slow is to be put up against two presumably faster methods: A mid point method with explicit extrapolation and a projection based scheme implemented with a Gauss-Seidel correction. Most importantly the magnitude of the solution vector has to be conserved for every time step. Furthermore energy conserva- tion is to be studied together with numerical stability, convergence rates and computation time. These properties are to be weighed against each other to draw conclusions about efficiency. The methods are to be implemented and tested with Matlab.
1.3 Simplifications
Due to the complexity of the equation we have limited ourself to a 1-dimensional setting,
whereas in general the problem is formulated over bounded domains in R
3. The LL
equation, see equation (2.2), includes parameters, which are assumed equal to 1 in all
the simulations here. Moreover, due to the nature of the LL equation, the length of
the magnetisation m remains constant for all the time. Without loss of generality, the
magnitude is also assumed to be 1. As the interest of this project is the time stepping,
we have as much as possible kept to a constant space discretisation of 100 grid points on
the interval [0,100].
2 Theory
2.1 The LLG equation
The Landau-Lifshitz-Gilbert-equation is used to determine the time-evolution of the mag- netisation field in a ferromagnetic material (for a derivation see: [2]). To simplify equa- tions this paper will only consider its normalised form which can be written as
∂m
∂t = −
m × h
ef f− am × ∂m
∂t
, (2.1)
where m(x, t) is the normalised magnetisation vector field of the ferromagnetic material, h
ef fis an effective magnetisation field and a is a damping constant. The equation can also be written on the equivalent [3] Landau-Lifshitz (LL) form
∂m
∂t = −βm × h
ef f− αm × (m × h
ef f), (2.2) which is explicit with respect to the time derivative of the magnetisation field. In this formulation β is a gyromagnetic constant and α is a damping constant. The LL version is suitable for explicit numerical schemes whereas the LLG variant can be beneficial for implicit schemes [4]. The effective magnetisation field is given by
h
ef f= 2A
µ
0M
s2∇
2m + h
ani+ h
ext+ h
d, (2.3) where A is an exchange constant, µ
0is the permeability and M
sis the magnitude of the unnormalised magnetisation field. h
aniis the anisotropic magnetisation field, h
extis the external magnetisation field and h
dis the demagnetisation field. To calculate h
dwe would need to couple the LLG equation with one of Maxwell’s equations, however in this study we only want to study methods for the LLG equation so the demagnetisation field has been set to zero.
This study is limited to one space dimension which reduces the laplacian to a single second order derivative. If we have uniaxial anisotropy, along a unit vector, p, we can write the anisotropy field as [5]
h
ani= hm, pip (2.4)
and as the external field is any known applied field, we can write the effective field as h
ef f= B ∂
2m
∂x
2+ hm, pip + h
ext. (2.5)
By taking the inner-product of equation (1.2) with m it is easy to see that |m(t, x)| =
|m(0, x)| for all x. Moreover, it is assumed that |m(0, x)| = 1. This is because the
magnitude of the magnetisation must be equal to the magnetisation saturation of the
material [6]. Figure 1 shows the precessional motion of a single magnetisation vector
under the effect of an effective h-field.
b a
H
effm y
z
x
Figure 1: The path of the magnetisation vector, m, as it precesses around the effective H field, where a and b are the first and second terms in the LLG equation, respectively [4].
2.2 Energy
Magnetic materials exhibit very complex behaviour due to the competition between dif- ferent energy terms. There are several contributions describing different phenomena that add up to a total free energy [4]. In this report we are considering three of these contri- butions.
The exchange energy is given by E
exc= 1
2 Z
J
exc|∇m|
2, (2.6)
where J
excis a material constant.
The anisotropy energy is given by E
ani= − 1
2 Z
K
anihm, pi
2, (2.7)
where K
aniis a material constant and p is the direction of an easy axis in a uniaxial material.
The applied field energy is given by E
ext= −
Z
µ
0hh
ext, mi, (2.8)
where h
extis an externally applied field. Important to note is that when the damping term vanishes the LL equation (2.2) conserves energy [4]. This conservative property is typically sought after when designing a numerical method for approximating the solution.
With N space steps the total continuous energy can be discretised as follows: [7]
E = − 1 2
N
X
k
J
exc(m
k· m
k−1+ m
k· m
k+1) − 1 2
N
X
k
K
ani(m
k· p)
2−
N
X
k
µ
0h
ext· m
k(2.9)
2.3 Numerical properties
In numerical analysis there are certain core properties that play vital roles for the viability of a method. First of all, an explicit method calculates the solution using only current and previous time states. Comparatively a method of implicit nature expresses the solution at the upcoming time state in terms of the solution itself. Consequently an equation needs to be solved for every time step when using an implicit scheme.
The notion of stability, in general, is used to describe the sensitivity of the solution when the data in a given model problem are perturbed slightly. A necessary condition for the convergence of a numerical solution towards the exact solution is the stability of the numerical method, which may be fulfilled under some constraints on the discretisation parameters, as is the case for most explicit methods. Nevertheless, there are methods (implicit methods) which are unconditionally stable. Naturally, for a conditionally stable scheme to be usable at all the discretisation constraint has to be fulfilled.
To determine how accurate the solution of a method is one can analyse the order of convergence/accuracy. This is a number p that gives information about how the error relates to a discretisation ∆t as shown in equation (2.10).
∝ ∆t
p(2.10)
Different methods use different algorithms that require certain amount of computing power. For large problems or small discretisation parameters the computational time can increase to unfeasible scales. Although dependent on hardware and code optimisations, a comparison can be achieved by simply timing the execution time.
2.4 Numerical methods
The nonlinearity of the LL and the LLG equations makes it very difficult to determine a solution analytically, this results in the use of numerical methods to reliably solve the equations. The part that gives rise to interesting problems is the time discretisation and there are different numerical methods that can be used to solve the equations, with their own strengths and weaknesses. This report will focus on analysing the properties of three specific methods.
2.4.1 Implicit midpoint method
Finite difference methods work by replacing the derivatives with finite differences that approximate the derivative at a discrete point,
dy(t
n+1)
dt ≈ y
n+1− y
n∆t (2.11)
where n denotes the time step and y
nis an approximation to the solution at y(t
n). The differential equation then reduces to a series of simple algebraic equations that can be solved by ”stepping” as long as y
0is known.
The popular Crank-Nicolson method uses an average of the Euler forward and Euler
backward methods to achieve second order accuracy. It may also be referred to as the
implicit midpoint (IMP) scheme and can be written on the form y
n+1− y
n∆t = f (t
n+12
, y
n+12), (2.12)
where
y
n+12= 1
2 (y
n+1+ y
n). (2.13)
Implicit means that unlike equation (2.11), it can not be directly solved because y
n+1depends on itself.
However, methods for solving non linear algebraic equations have been known for a long time, and the Newton-Rhapson method is commonly applied for solving problems of this type. Say we have some function g(x), the Newton-Rhapson method can is used to approximate a root, x ,that solves this equation by iteration given a starting ”guess”
x
0x
i+1= x
i− g(x
i)
g
0(x
i) (2.14)
where g
0(x) is the derivative of g(x). The stopping criterion for the algorithm is kx
i+1− x
ik <
tol for a given value of tol.
We can apply equation (2.14) to solve (2.12) by rearranging it and giving it a new name, G(y
n+1), we would then iterate the solution y
n+1in each time step, and use y
0n+1= y
n, the solution in the previous time step, as a starting guess.
Even though the LL equation is a vector PDE, the method works exactly the same.
We discretise in time by replacing the time derivative in equation (2.2) with a finite difference
∂m(t
n)
∂t ≈ m
n+1− m
n∆t (2.15)
and using the midpoint average, equation (2.13), on the right hand side we get m
n+1− m
n∆t = −βm
n+12× h
ef f− γm
n+12× (m
n+12× h
ef f). (2.16) Now define G(m
n+1) by rearranging equation (2.16) into
G(m
n+1) = m
n+1− m
n∆t + βm
n+12× h
ef f+ γm
n+12× (m
n+12× h
ef f). (2.17) Now we want to use Newton-Rhapsons method to solve for m
n+1, however, both G and m
n+1are vectors. Equation (2.14) can be expanded into solving systems of equations by replacing the scalar quantities by their respective vector equivalents. The derivative in equation (2.14) is replaced by the Jacobian matrix of G, J, which gives us
m
n+1i+1= m
n+1i− J
−1G(m
n+1i) (2.18)
where as before we use m
n+10= m
n. Notice that at this point, it is important to not
confuse the Newton-Rhapson iteration index, i, with the time stepping index, n. The
time stepping index increases only when the km
n+1i+1− m
n+1ik < tol condition is met, and
m
n+1i”becomes” the solution for that time step after a series of iterations of over i. That
value is then used as an initial guess for calculating the solution at the next time step.
To calculate h
ef fwe must now choose a discretisation in space. Even a one-dimensional domain has three components of the vector m at each point in space, so it is useful to represent the magnetization field by a N × 3 matrix, where N is the number of discrete space points, and the columns contain the components of the vector at each point in space.
m =
m
x0m
y0m
z0m
x1m
y1m
z1m
x2m
y2m
z2.. . .. . .. . m
xN −1m
yN −1m
zN −1m
xNm
yNm
zN
Figure 2: Space discretisation matrix, where m
x,y,zdenotes a component of m We replace the derivative in equation (2.5) by a finite difference approximation
∂
2m(x
k)
∂x
2≈ m
k−1− 2m
k+ m
k+1∆x
2(2.19)
where k ∈ {0, 1, 2, . . . , N } denotes a point in space. By expanding equation (2.19) into the component form
∂2mx(xk)
∂x2
∂2my(xk)
∂x2
∂2mz(xk)
∂x2
≈ 1
∆x
2
m
xk−1− 2m
xk+ m
xk+1m
yk−1− 2m
yk+ m
yk+1m
zk−1− 2m
zk+ m
zk+1
(2.20)
we can see that this discrete derivative can be represented by a multiplication of each column of the space discretisation matrix, m, by a matrix
A = 1
∆x
2
−2 1
1 −2 1
1 −2 . ..
. .. ... 1 1 −2
N ×N
(2.21)
containing the coefficients of the finite difference approximation. This leads to
∂
2m
∂x
2≈ Am (2.22)
which is the second order space derivative. However, equation (2.22) is not complete
without providing boundary conditions. One type of boundary conditions are the periodic
boundary conditions, which means that we imagine the domain as a circle. To implement this, we modify A to contain two additional non zero elements in the corners
A = 1
∆x
2
−2 1 1
1 −2 1
1 −2 . ..
. .. ... 1
1 1 −2
N ×N
(2.23)
which will make it so that m
x,y,zN +1= m
x,y,z0and m
x,y,z−1= m
x,y,zN, completing equation (2.22).
We can now define a discrete version of the effective field, h
ef f, from equation (2.5).
In place of the derivative we use equation (2.22) and the other terms follow from their discrete counterparts and we can write
h
ef f= BAm + hm, pip + h
ext(2.24)
where p, h
extand h
ef fhave been extended to be matrices that contain their respective vector components at a point n at each row, analogous to m (see: figure 2.4.1). The inner product is taken at each individual row of m and p to return a scalar that scales each row of p.
Finally, we can combine both the time and space discretisations. We extend equation (2.17) by replacing each m with m and h
ef fby h
ef fG(m
n+1) = m
n+1− m
n∆t + βm
n+12× h
ef f+ γm
n+12× (m
n+12× h
ef f) (2.25) where G has been extended to a matrix, as before. And
h
ef f= BAm
n+12+ hm
n+12, pip + h
ext(2.26) uses the midpoint average
m
n+12= 1
2 (m
n+1+ m
n) (2.27)
from equation (2.13) just like previously.
G is now three systems of N equations, but equation (2.18) still applies, except that for each iteration we have to compute a Jacobian for each column of G, multiply them together separately, and finally put them back into a matrix together. We write this as
m
n+1i+1= m
n+1i− J
−1xG
x(m
n+1i) J
−1yG
y(m
n+1i) J
−1zG
z(m
n+1i)
(2.28) where, just as before, we use m
n+10= m
nas an initial value, J
x,y,zare the Jacobians of G
x,y,z, which are the columns of G, and i is the iteration index that runs until the tolerance km
n+1i+1− m
n+1ik < tol is fulfilled.
The Jacobians in each iteration are calculated by a central finite difference J
kx= G
kx(m
kx+
d2, m
ky, m
kz) − G
kx(m
kx−
d2, m
ky, m
kz)
d
J
ky= G
ky(m
kx, m
ky+
d2, m
kz) − G
ky(m
kx, m
ky−
d2, m
kz) d
J
kz= G
kz(m
kx, m
ky, m
kz+
d2) − G
kz(m
kx, m
ky, m
kz−
d2) d
(2.29)
where k runs over every row of the spatial discretisation matrix, and d is a small number (≈ 10
−6) used to compute the finite difference.
2.4.2 Midpoint with explicit extrapolation
The midpoint with explicit extrapolation (MPE) uses, just like Runge-Kutta methods for ordinary differential equations, a weighted average of several different time-steps when calculating the next time-step [4].
If one considers the LL equation (2.2), we see that it can be written on the following
form ∂m
∂t = −γm × H, (2.30)
where
H = h
ef f+ αm × h
ef f, (2.31)
where α is a damping constant. We can see in equation 2.30 that m ·
∂m∂t= 0 and as a consequence that kmk = const [8].
To create a numerical method we introduce the following midpoint approximation
dm dt
n+12= m
n+1− m
n∆t + O(∆t
2), (2.32)
m
n+12= m
n+1+ m
n2 + O(∆t
2), (2.33)
where the subscript n indicates the time-step. The O(∆t
2) is used to denote the order of accuracy in the time region, this being a order of accuracy of 2.
To derive a numerical method we also need to express H in the midpoint, we can do this by extrapolating H as follows
H
n+12= h
n+12+ O(∆t
2), (2.34) where
h
n+12= 3
2 H
n+ 1
2 H
n−1. (2.35)
We can now substitute equations 2.32, 2.33 and 2.34 into the LL equation 2.30. This gives us the following expression
m
n+1− m
n= γ∆t
2 (m
n+1+ m
n) × h
n+12, (2.36) which can be expressed as
m
n+1+ γ∆t
2 m
n+1× h
n+12= m
n− γ∆t
2 m
n× h
n+12. (2.37)
This gives rise to a system of equations that can be expressed as a product of matrices
1
γ∆t2h
n+1
z 2
−
γ∆t2h
n+1
y 2
−
γ∆t2h
n+1
z 2
1
γ∆t2h
n+1
x 2
γ∆t 2
h
n+1
y 2
−
γ∆t2h
n+1
x 2
1
m
n+1xm
n+1ym
n+1z
=
m
nx−
γ∆t2(m
nyh
n+1
z 2
− m
nzh
n+1
y 2
) m
ny−
γ∆t2(m
nzh
n+1
x 2
− m
nxh
n+1
z 2
) m
nz−
γ∆t2(m
nxh
n+1
y 2
− m
nyh
n+1
x 2
)
,
where the subscripts x,y and z represents the components of the corresponding vectors.
Now that we have a numerical method for temporal discretisation we can take a look at the spatial discretisation. The spatial discretisation lies in the effective field h
ef for more precisely the exchange field
µ2A0Ms2
∇
2m. To descretizise this we use a second order finite difference scheme with an order of accuracy of 2:
∇
2m = ∂
2m
∂x
2= m
k+1− 2m
k+ m
k−1∆x
2+ O(∆x
2). (2.38)
This is then simply substituted into the effective field and solved for every k 2.4.3 Gauss-Seidel projection
The Gauss-Seidel projection method (GSPM) applies a Gauss-Seidel correction to a frac- tional step scheme for symplectic flow of harmonic maps and couples the solution with a projection method for heat flow of harmonic maps [9]. Considering the undamped LL equation with only the gyromagnetic term present
∂m
∂t = −m × ∆m, (2.39)
it can be linearised using a fractional step scheme [9]
m
∗− m
n∆t = ∆
hm
∗, m
n+1= m
n− m
n× m
∗,
(2.40)
where ∆t is the time step size and ∆
his the discrete laplacian. Combining the two equations one gets
m
n+1= m
n− m
n× (I − ∆t∆
h)
−1m
n. (2.41) This scheme can be shown to be unstable when applied to a PDE such as the LLG equation [10]. Due to its vectorial product structure the stability of the scheme can be significantly improved by implementing an implicit Gauss-Seidel correction where new component values are reused immediately. In its component form the improved scheme looks as follows
g
n= (I − ∆t∆
h)
−1m
n(2.42)
m
n+1xm
n+1ym
n+1z
=
m
nx+ (g
nym
nz− g
znm
ny) m
ny+ (g
znm
n+1x− g
xn+1m
nz) m
nz+ (g
xn+1m
n+1y− g
yn+1m
n+1x)
. (2.43)
When the gyromagnetic term is omitted and we have a case of infinite damping the LL equation becomes
∂m
∂t = −m × (m × ∆m), (2.44)
or equivalently
∂m
∂t = ∆m + ∇|m|
2m. (2.45)
(2.45) describes heat flow for harmonic maps. An unconditionally stable two-step pro- jection scheme for the equation is shown in [11]. The term ∇|m|
2m is considered a point wise constraint: hm,mi = 1. First solve
m
∗− m
n∆t = ∆
hm
∗(2.46)
for m
∗, then project onto the unit sphere
m
n+1= m
∗km
∗k . (2.47)
The two above methods for solving equations (2.39) and (2.45) can be coupled together to solve the full LL equation as the Gauss-Seidel projection method [10]. Considering a splitting of the effective field
h
ef f= ∆m + f, (2.48)
where
f = h
ani+ h
ext, (2.49)
the full equation can be written as
∂m
∂t = −βm × (∆m + f) − αm × m × (∆m + f). (2.50) GSPM can be applied to (2.50) in three steps:
Step 1: Implicit Gauss-Seidel for gyromagnetic term g
n= (I − ∆t∆
h)
−1(m
n− f)
g
∗= (I − ∆t∆
h)
−1(m
∗− f) (2.51)
m
∗xm
∗ym
∗z
=
m
∗x+ (g
ynm
nz− g
znm
ny) m
∗y+ (g
nzm
∗x− g
x∗m
nz) m
∗z+ (g
∗xm
∗y− g
∗ym
∗x)
. (2.52)
Step 2: Projection method for heat flow of harmonic maps
f
∗= h
∗ani+ h
ext(2.53)
m
∗∗xm
∗∗ym
∗∗z
=
m
∗x+ α∆t(∆
hm
∗x∗ +f
x∗) m
∗y+ α∆t(∆
hm
∗y∗ +f
y∗) m
∗z+ α∆t(∆
hm
∗z∗ +f
z∗)
. (2.54)
Step 3: Projection onto unit sphere
m
n+1xm
n+1ym
n+1z
= 1
km
∗∗k
m
∗∗xm
∗∗ym
∗∗z
. (2.55)
3 Method of comparison
To make a comparison several numerical properties and physical constraints have been investigated for each method. The specific initial value problem we have studied is
∂m
∂t
= −m × h
ef f− m × (m × h
ef f), m(0, t) = m(L + ∆x, t),
m(x, 0) = [cos(
2πxL), sin(
2πxL), 0],
(3.1)
with h
ef f=
∂∂x2m2+ h
ani+ h
ext, where h
ani= hm, pip , p =
√13
[1, 1, 1] and h
ext= [0, 0, 1].
For error estimations an ”exact” solution calculated using IMP with ∆t = 10
−5has been used.
3.1 Physical requirements
Essential from a physical viewpoint is that the magnitude is conserved for every time step, as explained in section 2.1. The restrictions of this project forces a constant magnitude of 1. To investigate whether the methods fulfilled this constraint correctly the maximum norm was calculated for every time step. Its deviation from 1 was then plotted to see the evolution of the magnitude error.
The gyromagnetic term of the LL equation is of energy conserving Hamiltonian struc- ture [12] . For a numerical method to correctly model the physics this implies that energy has to be conserved in the case of no damping. The energy conserving properties of the methods were checked by calculating and plotting the time evolution of the discrete en- ergy as seen in equation (2.9). Although a method does not compute energy correctly it may still result in a correct solution. This is a consequence of the interaction between the magnetic moments and the laplacian in the term for the exchange energy.
3.2 Numerical viability
To determine how viable a numerical method is, certain core properties should be anal- ysed, as detailed in section 2.3. To determine which discretisations satisfy correct solu- tions for a method its stability needs to be analysed. Due to the non linearity of the LL equation, performing an analytical stability analysis is difficult. Aside for IMP, which is implicit, we have performed numerical tests where the error is looked at for increasing time steps with different space steps. If there is a major error increase for a certain dis- cretisation it can be concluded that stability has been lost. Stability results were double checked by comparing energy values.
How accurate a method is can be concluded from its order of accuracy. This prop- erty determines how fast the error decreases with smaller step sizes and is consequently important for the choice of discretisation. The orders of accuracies were calculated for each scheme by looking at the errors for different time steps and inserting these values in equation (2.10).
The last property analysed was the computation time. It is obviously preferable for
a method to be as fast as possible and for large simulations the feasibility might even be
constrained by long execution times. The computation time was investigated by timing
the three methods for different amounts of time steps. Linear regression was performed on the results to get an approximate function for the computation time.
4 Results
General results are compiled in table 1 and a time evolution of the solution can be seen in figure 3.
Table 1: General results for the three schemes
Scheme Mag. conserv. Energy conserv. Stability Conv. rate Comp. time
IMP Yes Yes Uncond. 2 Long
MPE Yes No Cond. 2 Short
GSPM Yes No Uncond. 1 Short
t = 0
0 50 100
x -1
0 1
y -1
0 1
z
-1 1 0
100
z
t = 0.5
y 0
x 1
-1 0 50
-1 1 0
100
z
t = 1
y 0
x 1
50 -1 0
-1 1 0
100
z
t = 2
y 0
x 1
50 -1 0
-1 1 0
100
z
t = 3
y 0
x 1
-1 0 50
-1 1 0
100
z
t = 5
y 0
x 1
-1 0 50