Anisotropy energy becomes zero when field is applied

40 views
Skip to first unread message

Aarthi Tamil maran

unread,
Jul 7, 2026, 12:36:50 AMJul 7
to mumax2
Hi, 

I am working under field-induced reversal. I have used two ways of using Field reversal, 
1. by relaxing at each field
2. by using run (time)
-- When using run time, I am getting a non-zero anisotropy energy term. 
-- Relaxing at each field gives me zero anisotropy energy after the field is applied. (If I try to switch the magnetization without DMI, then my output data file shows an anisotropy value in the minimization file, but soon after, when the field is applied, the anisotropy energy remains completely zero)  
I have enclosed both codes. I request you to check whether my code is correct and whether anisotropy acts or not. Kindly give your suggestions. 

Thank you.
log.txt
log.txt
table.txt
log.txt
table.txt
table.txt

Josh Lauzier

unread,
Jul 7, 2026, 2:18:19 AMJul 7
to mumax2
Hi,

The anisotropy is being applied.

A couple things:

Briefly running your script with relax, your magnetization is in-plane. This means the demag field/shape anisotropy and external is stronger than your out-of-plane anisotropy, and pulls your initialized magnetization in-plane. The magnetocrystalline anisotropy field goes as 2*K/Msat (u dot m) u, where u is the anisotropy direction, and m is the magnetization direction. When m is in plane and u is (0,0,1), u dot m is 0; the dot product is of two perpendicular vectors. (This does not mean it is not being applied, just that it is strongest when m and u are parallel or anti-parallel, and weakest/0 when they are perpendicular)

Second, in the run case, it will still be pulled in-plane, but you are probably not running long enough for the magnetization to shift from your initial state (out of plane) to in-plane. To get to equilibrium with run() can take quite a long time (i would also recommend using a larger alpha, to damp out the transient behavior faster. If you're just doing hysteresis you don't care about the transient behavior). The fact that run takes so long to get to equilibrium is why it is suggested to use relax/minimize for hysteresis loops.  I would also double check your settings- if you view your magnetization, it is bouncing around like crazy at each field step, in a way that isn't evident just from printing out.

Last, you are likely running into symmetry issues, you can find discussions on this in previous discussions. You will likely want to break this (the previously mentioned magnetization bouncing around is likely tied to not getting to equilibrium and also this symmetry confusing the solver).

Best,
Josh L.
Reply all
Reply to author
Forward
0 new messages