# 1D domain wall¶

Author: Marijan Beg

Date: 26/02/2016

## Problem specification¶

The domain wall profile is computed in a one-dimenaional domain of $$L=500 \,\text{nm}$$ length.

Material paremeters of the simulated material are:

• exchange energy constant $$A = 1.3 \times 10^{-11} \,\text{J/m}$$,
• magnetisation saturation $$M_\text{s} = 8.6 \times 10^{5} \,\text{A/m}$$,
• anisotropy constant $$K_{1} = 1.86 \times 10^{5} \,\text{J/m}^{3}$$ with $$(1, 0, 0)$$ axis,
• anisotropy constant $$K_{2} = -0.92 \times 10^{5} \,\text{J/m}^{3}$$ with $$(0, 0, 1)$$ axis.

## Simulation¶

[1]:

from fidimag.micro import Sim
from fidimag.common import CuboidMesh
from fidimag.micro import UniformExchange, UniaxialAnisotropy


Firstly, the mesh is created.

[2]:

# Mesh dimensions.
L = 500  # diameter (nm)

# Mesh discretisation.
dx = dy = dz = 2  # nm

mesh = CuboidMesh(nx=int(L/dx), ny=1, nz=1, dx=dx, dy=dy, dz=dz, unit_length=1e-9)


The simulation object is created, parameters set, and energies added.

[3]:

# PYTEST_VALIDATE_IGNORE_OUTPUT
Ms = 8.6e5  # magnetisation saturation (A/m)
A = 1.3e-11  # exchange energy constant (J/m)
K1 = 1.86e5  # anisotropy energy constant (J/m**3)
K2 = -0.92e5  # anisotropy energy constant (J/m**3)
alpha = 0.5  # Gilbert damping
gamma = 2.211e5  # gyromagnetic ration (m/As)

# Create simulation object.
sim = Sim(mesh)

# Set simulation parameters.
sim.Ms = Ms
sim.driver.alpha = alpha
sim.driver.gamma = gamma

# Since the magnetisation dynamics is not important in this stage,
# the precession term in LLG equation can be set to artificially zero.
sim.driver.do_precession = False


In order to obtain the domain wall as the relaxed state, the system must be appropriatelly initialised. In this case, the initial magnetisation is set to be in $$(0, 0, 1)$$ direction for $$x < 0.4L \,\text{nm}$$, in $$(-1, 0, 0)$$ direction for $$0.4L \,\text{nm} < x < 0.6L \,\text{nm}$$, and in $$(0, 0, 1)$$ direction for $$x > 0.6L \,\text{nm}$$.

[4]:

def m_init(pos):
x = pos[0]

if x < 0.45*L:
return (1,0,0)
elif x > 0.55*L:
return (-1,0,0)
else:
return (0,1,0)


In the next step, the magnetisation is initialised, and the system is relaxed.

[5]:

# NBVAL_IGNORE_OUTPUT
# Initialise the system.
sim.set_m(m_init)

# Relax the system to its equilibrium state.
sim.driver.relax(dt=1e-13, stopping_dmdt=0.01, max_steps=5000, save_m_steps=None, save_vtk_steps=None)

step=1, time=1e-13, max_dmdt=2.97e+04 ode_step=0
step=2, time=2e-13, max_dmdt=2.79e+04 ode_step=2.13e-14
step=3, time=3e-13, max_dmdt=2.6e+04 ode_step=3.28e-14
step=4, time=4e-13, max_dmdt=2.41e+04 ode_step=3.28e-14
step=5, time=5e-13, max_dmdt=2.21e+04 ode_step=5.31e-14
step=6, time=6e-13, max_dmdt=2.02e+04 ode_step=5.31e-14
step=7, time=7e-13, max_dmdt=1.83e+04 ode_step=5.31e-14
step=8, time=8e-13, max_dmdt=1.66e+04 ode_step=5.31e-14
step=9, time=9e-13, max_dmdt=1.5e+04 ode_step=8.16e-14
step=10, time=1e-12, max_dmdt=1.36e+04 ode_step=8.16e-14
step=11, time=1.1e-12, max_dmdt=1.22e+04 ode_step=8.16e-14
step=12, time=1.2e-12, max_dmdt=1.1e+04 ode_step=8.16e-14
step=13, time=1.3e-12, max_dmdt=9.97e+03 ode_step=8.16e-14
step=14, time=1.4e-12, max_dmdt=9.01e+03 ode_step=8.16e-14
step=15, time=1.5e-12, max_dmdt=8.16e+03 ode_step=8.16e-14
step=16, time=1.6e-12, max_dmdt=7.4e+03 ode_step=8.16e-14
step=17, time=1.7e-12, max_dmdt=6.73e+03 ode_step=8.16e-14
step=18, time=1.8e-12, max_dmdt=6.44e+03 ode_step=8.16e-14
step=19, time=1.9e-12, max_dmdt=6.27e+03 ode_step=8.16e-14
step=20, time=2e-12, max_dmdt=6.1e+03 ode_step=8.16e-14
step=21, time=2.1e-12, max_dmdt=5.93e+03 ode_step=8.16e-14
step=22, time=2.2e-12, max_dmdt=5.76e+03 ode_step=8.16e-14
step=23, time=2.3e-12, max_dmdt=5.58e+03 ode_step=8.16e-14
step=24, time=2.4e-12, max_dmdt=5.41e+03 ode_step=8.16e-14
step=25, time=2.5e-12, max_dmdt=5.24e+03 ode_step=8.16e-14
step=26, time=2.6e-12, max_dmdt=5.07e+03 ode_step=8.16e-14
step=27, time=2.7e-12, max_dmdt=4.91e+03 ode_step=8.16e-14
step=28, time=2.82e-12, max_dmdt=4.73e+03 ode_step=1.23e-13
step=29, time=2.95e-12, max_dmdt=4.55e+03 ode_step=1.23e-13
step=30, time=3.07e-12, max_dmdt=4.37e+03 ode_step=1.23e-13
step=31, time=3.19e-12, max_dmdt=4.2e+03 ode_step=1.23e-13
step=32, time=3.32e-12, max_dmdt=4.04e+03 ode_step=1.23e-13
step=33, time=3.44e-12, max_dmdt=3.88e+03 ode_step=1.23e-13
step=34, time=3.56e-12, max_dmdt=3.74e+03 ode_step=1.23e-13
step=35, time=3.69e-12, max_dmdt=3.6e+03 ode_step=1.23e-13
step=36, time=3.81e-12, max_dmdt=3.47e+03 ode_step=1.23e-13
step=37, time=3.93e-12, max_dmdt=3.35e+03 ode_step=1.23e-13
step=38, time=4.06e-12, max_dmdt=3.23e+03 ode_step=1.23e-13
step=39, time=4.18e-12, max_dmdt=3.12e+03 ode_step=1.23e-13
step=40, time=4.3e-12, max_dmdt=3.02e+03 ode_step=1.23e-13
step=41, time=4.43e-12, max_dmdt=2.92e+03 ode_step=1.23e-13
step=42, time=4.55e-12, max_dmdt=2.83e+03 ode_step=1.23e-13
step=43, time=4.74e-12, max_dmdt=2.77e+03 ode_step=1.86e-13
step=44, time=4.92e-12, max_dmdt=2.71e+03 ode_step=1.86e-13
step=45, time=5.11e-12, max_dmdt=2.64e+03 ode_step=1.86e-13
step=46, time=5.3e-12, max_dmdt=2.58e+03 ode_step=1.86e-13
step=47, time=5.48e-12, max_dmdt=2.52e+03 ode_step=1.86e-13
step=48, time=5.67e-12, max_dmdt=2.46e+03 ode_step=1.86e-13
step=49, time=5.86e-12, max_dmdt=2.4e+03 ode_step=1.86e-13
step=50, time=6.04e-12, max_dmdt=2.34e+03 ode_step=1.86e-13
step=51, time=6.23e-12, max_dmdt=2.29e+03 ode_step=1.86e-13
step=52, time=6.41e-12, max_dmdt=2.24e+03 ode_step=1.86e-13
step=53, time=6.6e-12, max_dmdt=2.18e+03 ode_step=1.86e-13
step=54, time=6.79e-12, max_dmdt=2.13e+03 ode_step=1.86e-13
step=55, time=6.97e-12, max_dmdt=2.09e+03 ode_step=1.86e-13
step=56, time=7.26e-12, max_dmdt=2.03e+03 ode_step=2.82e-13
step=57, time=7.54e-12, max_dmdt=1.97e+03 ode_step=2.82e-13
step=58, time=7.82e-12, max_dmdt=1.9e+03 ode_step=2.82e-13
step=59, time=8.1e-12, max_dmdt=1.85e+03 ode_step=2.82e-13
step=60, time=8.38e-12, max_dmdt=1.79e+03 ode_step=2.82e-13
step=61, time=8.67e-12, max_dmdt=1.74e+03 ode_step=2.82e-13
step=62, time=8.95e-12, max_dmdt=1.69e+03 ode_step=2.82e-13
step=63, time=9.23e-12, max_dmdt=1.64e+03 ode_step=2.82e-13
step=64, time=9.51e-12, max_dmdt=1.61e+03 ode_step=2.82e-13
step=65, time=9.8e-12, max_dmdt=1.59e+03 ode_step=2.82e-13
step=66, time=1.01e-11, max_dmdt=1.56e+03 ode_step=2.82e-13
step=67, time=1.04e-11, max_dmdt=1.54e+03 ode_step=2.82e-13
step=68, time=1.06e-11, max_dmdt=1.51e+03 ode_step=2.82e-13
step=69, time=1.11e-11, max_dmdt=1.48e+03 ode_step=4.23e-13
step=70, time=1.15e-11, max_dmdt=1.45e+03 ode_step=4.23e-13
step=71, time=1.19e-11, max_dmdt=1.42e+03 ode_step=4.23e-13
step=72, time=1.23e-11, max_dmdt=1.39e+03 ode_step=4.23e-13
step=73, time=1.28e-11, max_dmdt=1.36e+03 ode_step=4.23e-13
step=74, time=1.32e-11, max_dmdt=1.33e+03 ode_step=4.23e-13
step=75, time=1.36e-11, max_dmdt=1.3e+03 ode_step=4.23e-13
step=76, time=1.4e-11, max_dmdt=1.27e+03 ode_step=4.23e-13
step=77, time=1.45e-11, max_dmdt=1.25e+03 ode_step=4.23e-13
step=78, time=1.49e-11, max_dmdt=1.22e+03 ode_step=4.23e-13
step=79, time=1.53e-11, max_dmdt=1.2e+03 ode_step=4.23e-13
step=80, time=1.57e-11, max_dmdt=1.18e+03 ode_step=4.23e-13
step=81, time=1.61e-11, max_dmdt=1.16e+03 ode_step=4.23e-13
step=82, time=1.68e-11, max_dmdt=1.15e+03 ode_step=6.4e-13
step=83, time=1.74e-11, max_dmdt=1.13e+03 ode_step=6.4e-13
step=84, time=1.81e-11, max_dmdt=1.11e+03 ode_step=6.4e-13
step=85, time=1.87e-11, max_dmdt=1.09e+03 ode_step=6.4e-13
step=86, time=1.93e-11, max_dmdt=1.08e+03 ode_step=6.4e-13
step=87, time=2e-11, max_dmdt=1.06e+03 ode_step=6.4e-13
step=88, time=2.06e-11, max_dmdt=1.04e+03 ode_step=6.4e-13
step=89, time=2.13e-11, max_dmdt=1.03e+03 ode_step=6.4e-13
step=90, time=2.19e-11, max_dmdt=1.01e+03 ode_step=6.4e-13
step=91, time=2.26e-11, max_dmdt=994 ode_step=6.4e-13
step=92, time=2.32e-11, max_dmdt=980 ode_step=6.4e-13
step=93, time=2.42e-11, max_dmdt=969 ode_step=9.91e-13
step=94, time=2.52e-11, max_dmdt=956 ode_step=9.91e-13
step=95, time=2.62e-11, max_dmdt=943 ode_step=9.91e-13
step=96, time=2.72e-11, max_dmdt=929 ode_step=9.91e-13
step=97, time=2.81e-11, max_dmdt=915 ode_step=9.91e-13
step=98, time=2.91e-11, max_dmdt=901 ode_step=9.91e-13
step=99, time=3.01e-11, max_dmdt=887 ode_step=9.91e-13
step=100, time=3.11e-11, max_dmdt=872 ode_step=9.91e-13
step=101, time=3.21e-11, max_dmdt=863 ode_step=9.91e-13
step=102, time=3.31e-11, max_dmdt=854 ode_step=9.91e-13
step=103, time=3.41e-11, max_dmdt=844 ode_step=9.91e-13
step=104, time=3.51e-11, max_dmdt=834 ode_step=9.91e-13
step=105, time=3.61e-11, max_dmdt=823 ode_step=9.91e-13
step=106, time=3.71e-11, max_dmdt=811 ode_step=9.91e-13
step=107, time=3.81e-11, max_dmdt=798 ode_step=9.91e-13
step=108, time=3.9e-11, max_dmdt=786 ode_step=9.91e-13
step=109, time=4.07e-11, max_dmdt=768 ode_step=1.61e-12
step=110, time=4.23e-11, max_dmdt=748 ode_step=1.61e-12
step=111, time=4.39e-11, max_dmdt=730 ode_step=1.61e-12
step=112, time=4.55e-11, max_dmdt=711 ode_step=1.61e-12
step=113, time=4.71e-11, max_dmdt=690 ode_step=1.61e-12
step=114, time=4.87e-11, max_dmdt=669 ode_step=1.61e-12
step=115, time=5.03e-11, max_dmdt=646 ode_step=1.61e-12
step=116, time=5.19e-11, max_dmdt=623 ode_step=1.61e-12
step=117, time=5.35e-11, max_dmdt=600 ode_step=1.61e-12
step=118, time=5.51e-11, max_dmdt=576 ode_step=1.61e-12
step=119, time=5.67e-11, max_dmdt=552 ode_step=1.61e-12
step=120, time=5.83e-11, max_dmdt=530 ode_step=1.61e-12
step=121, time=5.99e-11, max_dmdt=509 ode_step=1.61e-12
step=122, time=6.15e-11, max_dmdt=488 ode_step=1.61e-12
step=123, time=6.31e-11, max_dmdt=468 ode_step=1.61e-12
step=124, time=6.48e-11, max_dmdt=447 ode_step=1.61e-12
step=125, time=6.64e-11, max_dmdt=434 ode_step=1.61e-12
step=126, time=6.8e-11, max_dmdt=422 ode_step=1.61e-12
step=127, time=6.96e-11, max_dmdt=410 ode_step=1.61e-12
step=128, time=7.12e-11, max_dmdt=397 ode_step=1.61e-12
step=129, time=7.28e-11, max_dmdt=384 ode_step=1.61e-12
step=130, time=7.44e-11, max_dmdt=371 ode_step=1.61e-12
step=131, time=7.6e-11, max_dmdt=357 ode_step=1.61e-12
step=132, time=7.76e-11, max_dmdt=344 ode_step=1.61e-12
step=133, time=7.92e-11, max_dmdt=331 ode_step=1.61e-12
step=134, time=8.08e-11, max_dmdt=318 ode_step=1.61e-12
step=135, time=8.24e-11, max_dmdt=306 ode_step=1.61e-12
step=136, time=8.4e-11, max_dmdt=293 ode_step=1.61e-12
step=137, time=8.56e-11, max_dmdt=281 ode_step=1.61e-12
step=138, time=8.72e-11, max_dmdt=269 ode_step=1.61e-12
step=139, time=8.88e-11, max_dmdt=258 ode_step=1.61e-12
step=140, time=9.05e-11, max_dmdt=246 ode_step=1.61e-12
step=141, time=9.21e-11, max_dmdt=235 ode_step=1.61e-12
step=142, time=9.37e-11, max_dmdt=225 ode_step=1.61e-12
step=143, time=9.53e-11, max_dmdt=215 ode_step=1.61e-12
step=144, time=9.77e-11, max_dmdt=202 ode_step=2.41e-12
step=145, time=1e-10, max_dmdt=188 ode_step=2.41e-12
step=146, time=1.03e-10, max_dmdt=175 ode_step=2.41e-12
step=147, time=1.05e-10, max_dmdt=162 ode_step=2.41e-12
step=148, time=1.07e-10, max_dmdt=151 ode_step=2.41e-12
step=149, time=1.1e-10, max_dmdt=140 ode_step=2.41e-12
step=150, time=1.12e-10, max_dmdt=129 ode_step=2.41e-12
step=151, time=1.15e-10, max_dmdt=120 ode_step=2.41e-12
step=152, time=1.17e-10, max_dmdt=111 ode_step=2.41e-12
step=153, time=1.19e-10, max_dmdt=103 ode_step=2.41e-12
step=154, time=1.22e-10, max_dmdt=94.9 ode_step=2.41e-12
step=155, time=1.24e-10, max_dmdt=87.7 ode_step=2.41e-12
step=156, time=1.27e-10, max_dmdt=81 ode_step=2.41e-12
step=157, time=1.29e-10, max_dmdt=74.9 ode_step=2.41e-12
step=158, time=1.31e-10, max_dmdt=69.1 ode_step=2.41e-12
step=159, time=1.34e-10, max_dmdt=63.8 ode_step=2.41e-12
step=160, time=1.36e-10, max_dmdt=58.9 ode_step=2.41e-12
step=161, time=1.4e-10, max_dmdt=53.3 ode_step=3.72e-12
step=162, time=1.44e-10, max_dmdt=47.1 ode_step=3.72e-12
step=163, time=1.47e-10, max_dmdt=41.6 ode_step=3.72e-12
step=164, time=1.51e-10, max_dmdt=36.8 ode_step=3.72e-12
step=165, time=1.55e-10, max_dmdt=32.5 ode_step=3.72e-12
step=166, time=1.59e-10, max_dmdt=28.7 ode_step=3.72e-12
step=167, time=1.62e-10, max_dmdt=25.4 ode_step=3.72e-12
step=168, time=1.66e-10, max_dmdt=22.5 ode_step=3.72e-12
step=169, time=1.7e-10, max_dmdt=19.9 ode_step=3.72e-12
step=170, time=1.73e-10, max_dmdt=17.6 ode_step=3.72e-12
step=171, time=1.77e-10, max_dmdt=15.5 ode_step=3.72e-12
step=172, time=1.81e-10, max_dmdt=13.7 ode_step=3.72e-12
step=173, time=1.85e-10, max_dmdt=12.1 ode_step=3.72e-12
step=174, time=1.88e-10, max_dmdt=10.7 ode_step=3.72e-12
step=175, time=1.92e-10, max_dmdt=9.5 ode_step=3.72e-12
step=176, time=1.96e-10, max_dmdt=8.41 ode_step=3.72e-12
step=177, time=2e-10, max_dmdt=7.44 ode_step=3.72e-12
step=178, time=2.03e-10, max_dmdt=6.58 ode_step=3.72e-12
step=179, time=2.07e-10, max_dmdt=5.83 ode_step=3.72e-12
step=180, time=2.11e-10, max_dmdt=5.16 ode_step=3.72e-12
step=181, time=2.14e-10, max_dmdt=4.56 ode_step=3.72e-12
step=182, time=2.2e-10, max_dmdt=3.91 ode_step=5.7e-12
step=183, time=2.26e-10, max_dmdt=3.25 ode_step=5.7e-12
step=184, time=2.31e-10, max_dmdt=2.7 ode_step=5.7e-12
step=185, time=2.37e-10, max_dmdt=2.24 ode_step=5.7e-12
step=186, time=2.43e-10, max_dmdt=1.86 ode_step=5.7e-12
step=187, time=2.49e-10, max_dmdt=1.54 ode_step=5.7e-12
step=188, time=2.54e-10, max_dmdt=1.28 ode_step=5.7e-12
step=189, time=2.6e-10, max_dmdt=1.07 ode_step=5.7e-12
step=190, time=2.66e-10, max_dmdt=0.886 ode_step=5.7e-12
step=191, time=2.71e-10, max_dmdt=0.737 ode_step=5.7e-12
step=192, time=2.77e-10, max_dmdt=0.614 ode_step=5.7e-12
step=193, time=2.83e-10, max_dmdt=0.511 ode_step=5.7e-12
step=194, time=2.89e-10, max_dmdt=0.425 ode_step=5.7e-12
step=195, time=2.94e-10, max_dmdt=0.354 ode_step=5.7e-12
step=196, time=3e-10, max_dmdt=0.295 ode_step=5.7e-12
step=197, time=3.06e-10, max_dmdt=0.246 ode_step=5.7e-12
step=198, time=3.11e-10, max_dmdt=0.205 ode_step=5.7e-12
step=199, time=3.2e-10, max_dmdt=0.163 ode_step=8.66e-12
step=200, time=3.29e-10, max_dmdt=0.123 ode_step=8.66e-12
step=201, time=3.37e-10, max_dmdt=0.0936 ode_step=8.66e-12
step=202, time=3.46e-10, max_dmdt=0.071 ode_step=8.66e-12
step=203, time=3.55e-10, max_dmdt=0.0539 ode_step=8.66e-12
step=204, time=3.63e-10, max_dmdt=0.041 ode_step=8.66e-12
step=205, time=3.72e-10, max_dmdt=0.0311 ode_step=8.66e-12
step=206, time=3.81e-10, max_dmdt=0.0236 ode_step=8.66e-12
step=207, time=3.89e-10, max_dmdt=0.018 ode_step=8.66e-12
step=208, time=3.98e-10, max_dmdt=0.0137 ode_step=8.66e-12
step=209, time=4.07e-10, max_dmdt=0.0104 ode_step=8.66e-12
step=210, time=4.2e-10, max_dmdt=0.0073 ode_step=1.36e-11


After the system is relaxed, the magnetisation profile can be plotted.

[6]:

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

m = np.copy(sim.spin)

m.shape = (-1, 3)

mx = m[:, 0]
my = m[:, 1]
mz = m[:, 2]

x_array = np.arange(0, L, dx)

plt.figure(figsize=(10,6))
plt.plot(x_array, mx, label='mx')
plt.plot(x_array, my, label='my')
plt.plot(x_array, mz, label='mz')
plt.xlabel('x (nm)')
plt.ylabel('<m>')
plt.xlim([0.4*L, 0.6*L])
plt.ylim([-1, 1])
plt.grid()
plt.legend()

[6]:

<matplotlib.legend.Legend at 0x7f234cebbba8>