Unconsistance results with the same parameters

34 views
Skip to first unread message

Tang Wan-Sheng

unread,
Sep 2, 2025, 6:00:12 AM (9 days ago) Sep 2
to mumax2
Dear all,

I am working on the FM-AFM system. However, I met some problems on the MH-loop simulation.

I used exactly the same parameters, but only the range of the simulated magnetic field was different, I had tried ±0.2 T and ±0.3 T by changing Bstart in the following code (seeing the following figure 1). I had also tried to change relax() to run(1e-8). These results are all quite different to each other. I think these unconsistance results are very nonsense, the MH-loop should not depand on the range of the external field as long as the start point of the external field is large enough. However, I have no idea about the problems of the codes. I am hoping someone can give me some help.

Figure 1.
output.png


Best regards,
==================================
===== Follwoing is the source code =====
//============================
//----- Structure Hint -----
/*
Structure := FM_AFM
*/
//============================

//----- Setting the parameter -----//
Num_AFM_b  := 1
Msat_AFM_b := 700e3
Ku1_AFM_b  := 2.5e6
EA_AFM_b  := vector(1, 0, 0) // x-axis
m_init_AFM_b := RandomMag()

Num_AFM  := 3
Msat_AFM := 700e3
Ku1_AFM  := 0.1e6
EA_AFM   := vector(1, 0, 0)
m_init_AFM := RandomMag()

Num_FM  := 1
Msat_FM := 1000e4
Ku1_FM  := 7.5e4
EA_FM  := vector(0, 0, 1)
m_init_FM := uniform(0.01, 0.01, 1)

//============================

// Exchange coupling
Aex_FM        :=  1.0e-11
Aex_FM_AFM    :=  5.0e-13
Aex_AFM       := -1.0e-12
Aex_AFM_AFM_b := -5.0e-13
Aex_AFM_b     := -1.0e-12

//============================
//============================
//----- Setting the number of cell in xyz -----//
thick := Num_FM + Num_AFM + Num_AFM_b
setgridsize(2, 2, thick)

//----- Setting the size of each cell in xyz -----//
setcellsize(2e-9, 2e-9, 1e-9)

//----- Setting the measurement -----//
TableAdd(m_full)
TableAdd(B_ext)
TableAdd(m.region(0))

//----- Setting the subregion -----//
// AFM_b
defregion(2, layer(4))
// AFM
defregion(1, layers(1, 4))
// FM
defregion(0, layer(0))

//----- Enable/Disable the demagnetization field -----//
EnableDemag = False

x_PBC := 20
y_PBC := 20
z_PBC := 0
setPBC(x_PBC, y_PBC, z_PBC)

//----- Setting material parameter -----
// Material property
alpha.setregion(2, 0.1)
alpha.setregion(1, 0.1)
alpha.setregion(0, 0.02)
// ======================================================= //
/* >>>>> AFM_b <<<<< */
Msat.setregion(2, Msat_AFM_b)
Ku1.setregion(2, Ku1_AFM_b)
anisU.setregion(2, EA_AFM_b)
m.setregion(2, m_init_AFM_b)
Aex.setregion(2, Aex_AFM_b)

// ------------------------------------------------------------------
ext_InterExchange(2, 1, Aex_AFM_AFM_b)
// ------------------------------------------------------------------

/* >>>>> AFM <<<<< */
Msat.setregion(1, Msat_AFM)
Ku1.setregion(1, Ku1_AFM)
anisU.setregion(1, EA_AFM)
m.setregion(1, m_init_AFM)
Aex.setregion(1, Aex_AFM)

// ------------------------------------------------------------------
ext_InterExchange(1, 0, Aex_FM_AFM)
// ------------------------------------------------------------------

/* >>>>> FM <<<<< */
Msat.setregion(0, Msat_FM)
Ku1.setregion(0, Ku1_FM)
anisU.setregion(0, EA_FM)
m.setregion(0, m_init_FM)
Aex.setregion(0, Aex_FM)

//======================================================================
// frozenspins.setregion(0, 1)
saveAs(m, "Initial") // store m as .ovf
relax()
saveAs(m, "InitialRelaxed") // store m as .ovf
//======================================================================

//----- Setting external field variation (T) -----
Bstart := 0.30
B_step := 1e-3
for B := Bstart ; B > -Bstart; B-=B_step{
    B_ext = vector(0, 0, B)
   
    relax()
   
    save(m) // store m as .ovf
    tablesave()
}

for B := -Bstart ; B < Bstart; B+=B_step{
    B_ext = vector(0, 0, B)
   
    relax()

    save(m) // store m as .ovf
    tablesave()
}



Tang Wan-Sheng

unread,
Sep 5, 2025, 2:37:03 AM (6 days ago) Sep 5
to mumax2
Dear all,

Hoping someone can help me solving this problem. I also want to ask how to determine to use relax, minimize or run to do the simulation?

Best regards,

Tang Wan-Sheng 在 2025年9月2日 星期二下午6:00:12 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages