Hi all,
I made some adjustments to an existing simulation, but the results became very strange afterward. To troubleshoot, I removed all the newly added elements from the modified simulation, reverting it to match the original setup. However, the results still appear abnormal.
While the two codes are syntactically different, they should logically perform the same task. Why do their simulation results differ so drastically?
code1
//
SetGridSize(200, 100, 2)
SetCellSize(2e-9, 2e-9, 2e-9)
wire := cuboid(6e-9, 200e-9, 2e-9).transl(0, 0, 1e-9)
bottom_layer := cuboid(400e-9, 200e-9, 2e-9).transl(0, 0, -1e-9)
setgeom(wire.add(bottom_layer))
defregion(1, wire)
defregion(2, bottom_layer)
Msat.setregion(1, 580e3)
Aex.setregion(1, 15e-12)
alpha.setregion(1, 0.01)
m.setregion(1, uniform(0, -1, 0))
Msat.setregion(2, 140e3)
Aex.setregion(2, 3e-12)
Ku1.setregion(2, 1e4)
AnisU.setregion(2, vector(0, 1, 0))
alpha.setregion(2,1e-4)
m.setregion(2, uniform(0, 1, 0))
ext_interexchange(1,2,0)
minimize()
autosave(m, 2e-12)
tableautosave(2e-12)
f := 25.6e9
B0 := 2e-3
B_ext.setregion(1, vector(B0*sin(2*pi*f*t), 0, 0))
run(400e-12)
//
code2
//
SetGridSize(200, 100, 2)
SetCellSize(2e-9, 2e-9, 2e-9)
wire := cuboid(4e-9, 200e-9, 2e-9).transl(0, 0, 1e-9)
bottom_layer := cuboid(400e-9, 200e-9, 2e-9).transl(0, 0, -1e-9)
setgeom(wire.add(bottom_layer))
defregion(201, wire)
Msat.setregion(201, 580e3)
Aex.setregion(201, 15e-12)
alpha.setregion(201, 0.01)
m.setregion(201, uniform(0, -1, 0))
for i := 1;i<201;i++{
defregion(i, xrange(-200e-9+(i-1)*2e-9, -200e9+i*2e-9).intersect(zrange(0, inf).rotx(pi)))
Msat.setregion(i, 140e3)
Aex.setregion(i, 3e-12)
Ku1.setregion(i, 1e4)
AnisU.setregion(i, vector(0, 1, 0))
alpha.setregion(i,1e-4)
m.setregion(i, uniform(0, 1, 0))
}
ext_interexchange(201 , 100, 0)
ext_interexchange(201 , 101, 0)
minimize()
autosave(m, 2e-12)
tableautosave(2e-12)
f := 25.6e9
B0 := 2e-3
B_ext.setregion(0, vector(B0*sin(2*pi*f*t), 0, 0))
run(400e-12)
//
Additionally, when I set the "wire" region to 0 versus 201, the outcomes are completely different. Why does this happen? Is region 0 a special label that cannot be overwritten or occupied?
I’d be very grateful for any thoughts or suggestions you might have.
Best regards,
Qwenthur