---
title: "A nanomagnet’s shape sets its easy axis and how it switches"
description: "A flat element’s own field makes it point along its long side. Derive its two stiffnesses and ringing frequency, then flip it slowly or with a short pulse."
canonical_url: "https://sandboxphysics.com/stories/micromagnetics/shape-anisotropy-and-switching/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/micromagnetics/shape-anisotropy-and-switching/"
last_modified: "2026-10-29"
---

[Micromagnetics · A course with experiments](https://sandboxphysics.com/stories/micromagnetics/)

L2 · Chapter 2

# A nanomagnet’s shape sets its easy axis and how it switches

A magnetized element makes its own field, and that field opposes the magnetization most where the element is thin. For the 500 by 125 by 3 nm element of muMAG standard problem 4 this leaves the long axis as the easy direction, with an in-plane stiffness of 29.1 mT and an out-of-plane stiffness of 948 mT. A slowly applied field has to reach the Stoner-Wohlfarth astroid to reverse it. A 140 ps pulse of 25 mT across the element reverses it faster by using precession.

Sandbox Physics · 2026-10-29

In this chapter

[All eight chapters](https://sandboxphysics.com/stories/micromagnetics/)

Before you start

Chapter 1: precession and damping. Trigonometric identities for the double angle.

## The element’s own field

Magnetization that ends at a surface leaves magnetic poles there, and the poles make a field inside the element that points back against the magnetization. It is called the demagnetizing field; in general it is a convolution over the whole body (Abert 2019, Sec. 2.3). For a uniformly magnetized rectangular prism it reduces to three numbers, the demagnetizing factors, one per edge direction.

Aharoni gave the factors of a prism in closed form. We evaluated them with the formula reproduced on the magpar calculator page; for the standard-problem element they are $N_x=0.009180$ along the 500 nm edge, $N_y=0.038176$ along the 125 nm edge and $N_z=0.952644$ through the 3 nm thickness. They add to 1, as they must. The energy per volume is then a weighted sum of the squared components.

$$
\mathbf{H}_{\mathrm{d}}=-M_s\,(N_xm_x,\;N_ym_y,\;N_zm_z),\qquad E=\frac{\mu_0M_s^{2}}{2}\left(N_xm_x^{2}+N_ym_y^{2}+N_zm_z^{2}\right)
$$

## Two stiffnesses, one easy axis

Keep the moment in the film plane, at angle $\varphi$ from the long edge. With $m_x=\cos\varphi$ and $m_y=\sin\varphi$ the energy becomes a constant plus $K\sin^2\varphi$, with $K=\mu_0M_s^{2}(N_y-N_x)/2=11.7\,\mathrm{kJ/m^3}$. The minima are at $\varphi=0$ and $\pi$: the long axis is easy, and the two directions along it are the two stored states.

The stiffness is easiest to read as a field. Tilting the moment toward $y$ meets a restoring field $(N_y-N_x)M_s$, which is 29.1 mT. Tilting it out of the plane meets $(N_z-N_x)M_s$, which is 948 mT, about 33 times stiffer.

$$
\mu_0H_K=\mu_0(N_y-N_x)M_s=29.1\,\mathrm{mT},\qquad \mu_0(N_z-N_x)M_s=948\,\mathrm{mT}
$$

Worked example

## The ringing frequency of the element

Let the moment sit near $+x$, so $\mathbf{m}\approx(1,m_y,m_z)$ with small $m_y$ and $m_z$. The effective field is $\mathbf{H}_{\mathrm{d}}$. Keeping first-order terms in $-\gamma_0\,\mathbf{m}\times\mathbf{H}_{\mathrm{d}}$ gives $\dot m_y=-\gamma_0(N_z-N_x)M_s\,m_z$ and $\dot m_z=\gamma_0(N_y-N_x)M_s\,m_y$.

Differentiate the first and insert the second: $\ddot m_y=-\omega^2m_y$ with $\omega=\gamma_0M_s\sqrt{(N_y-N_x)(N_z-N_x)}$. The ringing frequency is set by the geometric mean of the two stiffnesses, 166 mT, which gives 4.66 GHz. The orbit is a flat ellipse: $m_z$ swings only $\sqrt{(N_y-N_x)/(N_z-N_x)}=0.175$ times as far as $m_y$.

This is the Kittel formula for the element. The Lab computes it for the well the moment ends in; the free-ringing preset reads 4.65 GHz from the trajectory itself. In the benchmark, small oscillations at three bias fields match the formula to better than 3 parts in 100 000.

$$
f_K=\frac{\gamma_0}{2\pi}\sqrt{(N_y-N_x)M_s\,(N_z-N_x)M_s}=28.0\,\mathrm{GHz\,T^{-1}}\times166\,\mathrm{mT}=4.66\,\mathrm{GHz}
$$

## A slow field reverses it on the astroid

Now apply a field slowly, at angle $\psi$ from the direction opposite to the moment, and keep the moment in the plane. In units of $H_K$, with $h=H/H_K$, the energy is $E/K=\sin^2\varphi-2h\cos(\varphi-\psi)$. The moment stays in its well until the well disappears, which happens when the first and second derivatives of the energy vanish together.

Solving the two conditions gives the Stoner-Wohlfarth switching field, whose plot against angle is the astroid. We give the derivation here and did not open the 1948 paper. At $\psi=45^{\circ}$ it is half the stiffness field, 14.6 mT; along the axis it is the full 29.1 mT. The Lab ramps the field slowly at angles from 5 to 80 degrees and finds the reversal at most 0.006 above the astroid, in units of $H_K$.

$$
h_{\mathrm{sw}}(\psi)=\left(\cos^{2/3}\psi+\sin^{2/3}\psi\right)^{-3/2}
$$

## A short pulse uses precession instead

The default pulse in the Lab is 25 mT along $+y$ for 140 ps. A field across the axis never reaches the astroid on its own: a slow 25 mT field would only pull the moment part of the way toward $y$. The pulse instead makes the moment precess. Its first effect, from $-\gamma_0\,\mathbf{m}\times\mathbf{H}$, is to tip the moment slightly out of the plane.

That small tilt meets the 948 mT out-of-plane stiffness, and the moment precesses quickly about the resulting field, which turns it within the plane. In the default run the tilt never exceeds 7.6 degrees, yet the moment crosses the hard axis after 90 ps. If the pulse ends then, damping brings the moment down into the opposite well. If it lasts 350 ps, the moment completes the turn and falls back where it started.

The switching map in the Lab is built from 1280 full trajectories, one per pulse field and length, each decided by whether its energy drops below the saddle in the start well or in the other. The map’s bands come straight from this half-turn timing.

An experiment to think through

## Predict, change, explain

1. A slow field at 45 degrees to the axis reverses the element at 14.6 mT. Predict whether a short pulse pointing that way needs more field or less than the 25 mT pulse across the element, and whether its timing still matters.
2. In the macrospin Lab start from “A half-turn pulse flips it” and set “Pulse direction from the easy axis” to $135^{\circ}$, which is 45 degrees from the reversed direction. Then click cells of the switching map.
3. Explain which part of the reversal the pulse does at 90 degrees and which part it does at 135 degrees, using the two stiffnesses.

[Kick a nanomagnet with a field pulse](https://sandboxphysics.com/labs/macrospin-switching/)

The macrospin Lab treats the strip of muMAG Standard Problem 4 as one moment. The wall and skyrmion Labs use the Pt/Co film of Thiaville et al. with local stray-field terms. All three run at zero temperature.

## Try explaining it yourself

### 1. A cube has $N_x=N_y=N_z$. What are the factors, and what shape stiffness does it have?

Read an explained answer

Each is one third, from the sum rule. The energy is then the same in every direction, so the cube has no shape stiffness at all.

### 2. An element of the same material has $N_y-N_x=0.05$. What is its in-plane stiffness field?

Read an explained answer

$\mu_0M_s=1.005\,\mathrm{T}$ for 800 kA/m, so $\mu_0H_K=0.05\times1.005\,\mathrm{T}=50.3\,\mathrm{mT}$.

### 3. What is the slow switching field of the standard-problem element at $\psi=30^{\circ}$?

Read an explained answer

$h_{\mathrm{sw}}=0.524$, so 15.3 mT. The astroid is lowest at 45 degrees.

## Sources to read alongside

1. [Abert, Micromagnetics and spintronics: models and numerical methods, European Physical Journal B 92, 120 (2019), arXiv:1810.12365v2](https://arxiv.org/abs/1810.12365v2)

   Read: the exchange energy (Eq. 10), the demagnetizing field (Sec. 2.3), uniaxial anisotropy (Sec. 2.4), interfacial DMI (Eq. 33) and its boundary term (Sec. 3.5), the Landau-Lifshitz-Gilbert equation in Gilbert and explicit form (Eqs. 117 and 118), the conservation of the magnetization length and the energy dissipation (Eqs. 120 to 125), the Zhang-Li torque (Eq. 134) and the finite-difference method (Sec. 6.1). Other sections were not read.

2. [muMAG Standard Problem #4, NIST Center for Theoretical and Computational Materials Science](https://www.ctcms.nist.gov/~rdm/std4/spec4.html)

   Full specification page: a film 500 nm long, 125 nm wide and 3 nm thick, with saturation magnetization 800 kA/m, exchange 13 pJ/m, damping 0.02, gyromagnetic ratio 221.1 km/(A s) and two reversal fields. The macrospin Lab borrows the geometry and constants only; it does not solve the problem.

3. [magpar, Calculator for magnetostatic energy and demagnetizing factor (implements Aharoni, Journal of Applied Physics 83, 3432, 1998)](http://www.magpar.net/static/magpar/doc/html/demagcalc.html)

   Calculator page opened; its closed form for the demagnetizing factors of a rectangular prism agrees term by term with the Lab code. Aharoni’s paper itself was not opened.

[Previous A magnetic moment circles a field before it settles](https://sandboxphysics.com/stories/micromagnetics/precession-and-damping/) [Next Exchange smooths the magnetization and sets how fine the mesh must be](https://sandboxphysics.com/stories/micromagnetics/exchange-and-the-mesh/)
