I’m a physics student focusing my degree on studying magnetic phenomena via micromagnetic simulations for magnetic memory devices. I’m working on a simulation using Mumax3, a tool that basically uses Go. But I’m having problems with the data type of some variables. Here’s the code I used
// set effective perpendicular anisotropy field
B_anis_mag := sqrt(B_anis.Comp(0)*B_anis.Comp(0) + B_anis.Comp(1)*B_anis.Comp(1) + B_anis.Comp(2)*B_anis.Comp(2)) // Magnitude of B_anis
B_demag_mag := sqrt(B_demag.Comp(0)*B_demag.Comp(0) + B_demag.Comp(1)*B_demag.Comp(1) + B_demag.Comp(2)*B_demag.Comp(2)) // Magnitude of B_demag
Hk := B_anis_mag - B_demag_mag
// send current
Jc0 := (2 * e * 0.015 * mi0 * 1209e3 * Hk * sizeZ)/(hcut * 0.5)
overdrive := 1.5
area := sizeX*sizeY*pi/4
Jtot := overdrive*Jc0 // total current in A
jc := Jtot / area // current density in A/m2
J = vector(0, 0, jc)
This is the error:
**/home/jmulkers/GO/src/github.com/mumax/3/cmd/mumax3/main.go:110 script line 36: B_anis_mag := sqrt(B_anis.Comp(0)*B_anis.Comp(0) + B_anis.Comp(1)B_anis.Comp(1) + B_anis.Comp(2)B_anis.Comp(2)) // Magnitude of B_anis: type mismatch: can not use type engine.ScalarField as float64
Here is the website with the list of APIs that the tool has natively, in case it helps:
https://mumax.github.io/api.html