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);

Define simulation parameters. See High-Level Interface.

julia
args = (
    name = "sw",
    task = "Relax",
    mesh = mesh,
    Ms=1.0e6,
    A=1.3e-11,
    m0=(-1, 1, 0),
    Ku=5e4,
    axis=(1, 1, 0),
    stopping_dmdt = 0.05,
    H_s = [(i*1mT, 0, 0) for i=-100:5:100]
);

sim_with(args);
[ Info: MicroSim has been created.
[ Info: Exchange has been added.
[ Info: Uniaxial Anisotropy has been added.
[ Info: Static Zeeman has been added.
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=8, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=5, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=5, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=9, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=7, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=4, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!
[ Info: Running Driver : MicroMagnetic.EnergyMinimization{Float64}.
[ Info: max_dmdt is less than stopping_dmdt=0.05 @steps=3, Done!

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

julia
using DelimitedFiles
using CairoMakie

function plot_loop()
    data = readdlm("./sw_sd.txt"; skipstart=2)
    m, H = data[:, 3], data[:, 8]

    fig = Figure(; size=(600, 400))
    ax = Axis(fig[1, 1]; xlabel="H (A/m)", ylabel="mx")

    scatterlines!(ax, H, m; markersize=8, color=:blue, markercolor=:orange)
    scatterlines!(ax, -H, -m; markersize=8, color=:blue, markercolor=:orange)

    expected = 39788.736 # A/m
    vlines!(ax, [expected, -expected]; color=:red, linestyle=:dash)

    return fig
end

fig = plot_loop();