mumax runs incorrectly

75 views
Skip to first unread message

jiawen xu

unread,
Dec 26, 2024, 9:45:36 PM12/26/24
to mumax2
My program has been checked, there is no obvious error, but when running, there is a prompt as shown in the following figure, it is not clear where the specific problem occurs. Hope to get your help.e6832da1edecb426ed169e6ceddad54.png
snapshot-A0.5-randnorm360nm-a0.3.txt

Josh Lauzier

unread,
Dec 27, 2024, 2:26:04 AM12/27/24
to mumax2
Hi,

I believe the issue is when you set the magnetization. In (and also the following 6 lines)

m. setRegion(1, Uniform(sin(pi/36)*RandNorm(), sin(pi/36)*sqrt(1-(RandNorm()*RandNorm())), cos(pi/36)))

RandNorm() is not guaranteed to be < 1 in magnitude. The definition is normally distributed float64 in the range [-math.MaxFloat64, +[math.MaxFloat64]] with standard normal distribution (mean = 0, stddev = 1)  (source). This will tend to be less than one, given the mean and standard definition, but some tails of the distribution extend beyond +/-1 . So you can end up taking the square root of a negative number. You can instead use Rand() instead of RandNorm(), which is between 0 and 1 only. Best, Josh L.

jiawen xu

unread,
Dec 27, 2024, 3:22:29 AM12/27/24
to mumax2
Thank you very much for your help, it can run normally.
Reply all
Reply to author
Forward
0 new messages