Skip to content

Stoner–Wohlfarth model

link: https://en.wikipedia.org/wiki/Stoner%E2%80%93Wohlfarth_model

When the size of the studied system is below the exchange length, the magnetization of the system is uniform and thus can be described using a single 3d vector. In this situation, the demagnetization field can be calculated by simply multiplying the demagnetization tensor and the magnetization. Therefore, the demagnetization energy is equivalent to an effective anisotropy. Assuming that the external field H=(H,0,0), easy axis u^=(cosθ,sinθ,0) and unit magnetization vector m^=(cosϕ,sinϕ,0), we have

E=K(mu^)2μ0MsHcosϕ=K2[1+cos(2(θϕ))+4hcosϕ]

where h=H/Hk and Hk=2K/(μ0Ms). In the equilibrium state, the first derivative of the energy with respect to the magnetization direction is zero, i.e.,

Eϕ=K[sin(2(θϕ))+2hsinϕ]=0

In principle, there will be a solution of ϕ for each given h and θ. The hysteresis loops can be constructed by plotting cosϕ as a function of h. The switching field can be obtained by extra setting the second derivative of the energy with respect to the magnetization direction to zero, i.e.,

2Eϕ2=2K[cos(2(θϕ))+hcosϕ]=0

The obtained switching field is

hs=(1t2+t4)1/21+t2

where t=tan1/3θ. Specifically, hs=1/2 if θ=π/4. In this example, we use MicroMagnetic to demostrate this result.

We chose the system to be a cubic sample, so the demagnetization tensor is Nx=Ny=Nz=1/3. That is, the demagnetization itself does not contribute to the effective anisotropy. So in this simulation, we have ignored the demagnetization field. The MicroMagnetic script is shown below:

julia
using MicroMagnetic

We create a mesh for a cubic geometry 4nm x 4nm x 4nm

julia
mesh = FDMesh(; nx=4, ny=4, nz=4, dx=1e-9, dy=1e-9, dz=1e-9);

We create a simulation instance with the LLG driver and the BS23 integrator.

julia
sim = Sim(mesh, driver="LLG", integrator="BS23", name="SW")

sim.driver.alpha = 0.5
sim.driver.integrator.tol = 1e-7

set_Ms(sim, 1e6)
init_m0(sim, (-1,1,0))

add_exch(sim, 1.3e-11)
add_anis(sim, 5e4, axis=(1, 1, 0))
add_zeeman(sim, (0,0,0))
[ Info: MicroSim (FD) has been created.
[ Info: Exchange has been added.
[ Info: Uniaxial Anisotropy has been added.
[ Info: Static Zeeman has been added.

We use the hysteresis function to simulate the hysteresis loops.

julia
Hs = [i*mT for i=-100:5:100]
hysteresis(sim, Hs, direction=(1,0,0), full_loop=false, stopping_dmdt=0.05, output="vts")
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=439, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=87, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=88, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=90, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=91, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=93, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=94, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=96, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=98, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=99, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=101, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=103, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=105, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=107, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=109, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=111, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=113, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=115, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=117, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=120, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=122, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=125, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=129, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=133, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=138, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=144, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=150, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=158, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=168, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=180, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=782, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=102, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=100, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=98, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=96, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=95, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=93, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=92, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=90, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=88, Done!
[ Info: Running Driver : MicroMagnetic.LLG{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=87, Done!

For the used anisotropy Ku=5×104 A/m3, the expected switch field is Hc=(1/2)HK=39788.7 A/m. We plot the hysteresis loops using the plot_ts function

julia
using CairoMakie
fig = plot_ts("SW_llg.txt", x_key="Hx", ["m_x", "m_y"], x_unit=1/mT, xlabel="H (mT)", ylabel="m", mirror_loop=true);