Hello Serban!
Thank you for your software. I found it very user-friedly.
I am beginer in micromagnetic simulations and currently struggling with typical NIST problems. I stuck on NIST problem 4 (which is exercise 2 in the BORIS manual). The results I got for M vs time differ significanlty from the ones presented in the manual and NIST website. Could you please check my script and give a hint of what I am doing wrong? Thank you in advance.
#script for NiFe (permaloy) switching
import matplotlib.pyplot as plt
import math as mth
import numpy as np
from NetSocks import NSClient
ns = NSClient(); ns.configure(True)
#Make a ferromagnetic mesh with given rectangle, cubic cellsize, and set modules
Py = ns.Ferromagnet([500e-9, 125e-9, 3e-9], [3e-9])
Py.modules(['demag','exchange', 'Zeeman'])
ns.fmscellsize([3e-9, 3e-9, 3e-9])
#setting material parameters
ns.setparam(meshname='Py', paramname='K1', value=0)
ns.setparam(meshname='Py', paramname='A', value=13e-12)
ns.setparam(meshname='Py', paramname='Ms', value=800e3)
ns.setparam(meshname='Py', paramname='damping', value=1e-2)
#setting initial configuration of magnetization
ns.setangle(meshname='Py', polar='55', azimuthal='45')
#setting ODE configuration
ns.setode(equation='LLGStatic',evaluation='SDesc')
ns.setdt(1e-12)
#ground state calculation
ns.Hpolar_seq([Py, [1e6, 55, 45, 0, 55, 45, 20], 'mxh', 1e-5, 'none'])
ns.saveovf2mag('Py', filename = 'ground_state_Py_NP_500_125_3nm_(111).ovf')
ns.reset()
H_value = 25e-3 * 0.8e6 #from T to A/m
H_value_y = H_value*np.sin(170*mth.pi/180)
H_value_x = H_value*np.cos(170*mth.pi/180)
H_value_z = H_value*np.sin(5*mth.pi/180)
ns.setode(equation='LLGStatic',evaluation='RKF45')
ns.setdt(5e-12)
ns.setsavedata('switching_dynamics_Py_NP.txt', ['time'], ['<M>'])
ns.Hxyz([Py, [H_value_x, H_value_y, 0], 'time', 1e-12, 'none'])
ns.reset()
ns.Relax(['time', 5e-9, 'time', 5e-12])
#output file has field (x, y, z components) in columns 0, 1, 2, and average magnetisation (x, y, z components) in columns 3, 4, 5
switching_data = ns.Get_Data_Columns('switching_dynamics_Py_NP.txt', [0, 1, 2, 3])
#plot time vs <Mxyz>
plt.axes(xlabel = 'Time (ns)', ylabel = '<M> (kA/m)')
plt.plot(np.array(switching_data[0])*1e9, np.array(switching_data[1])/800e3, label='Mx')
plt.plot(np.array(switching_data[0])*1e9, np.array(switching_data[2])/800e3, label='My')
plt.plot(np.array(switching_data[0])*1e9, np.array(switching_data[3])/800e3, label='Mz')
plt.legend()
plt.show()