Processing FFT with Python

888 views
Skip to first unread message

Stephen Curry

unread,
Jun 16, 2022, 8:55:02 AM6/16/22
to mumax2
Dear all,
      I am using Python to process mumax for 2D-FFT.And I refer to the program example of here.I want to verify the dispersion curve of f-1/k in a paper.But I encountered some problems that I couldn't solve as follows.
     I want to get an image of the paper.png.

paper.png
I took the perturbation fields of 2.88GHz and 50ghz respectively for FFT.But the result was wrong.(first:2.88)

YIG_f_2.88Ghz.png
YIG_f_50Ghz.png

   
  I don't know what went wrong with the program.Is m set incorrectly?
1.png
3.png

In addition, I see that mx stores [time,magnetization component,Z,Y,X].
Why is this Z Y X not X Y Z?
I don't know where to change to get the right result.And I put the program code in the attachment.

Thanks,
Stephen.
yig.txt
yig.py

Felipe Garcia

unread,
Jun 20, 2022, 6:55:10 AM6/20/22
to mumax2
 Dear Stephen,

The initial script is from the mumax3 tutorial https://colab.research.google.com/github/JeroenMulkers/mumax3-tutorial/blob/master/postprocessing.ipynb  Some things that are not included in your script but are useful is the theoretical dispersion relation. Also the sampling has to be at least dt   = 1/(2*fmax) because otherwise the maximum frequency is less than the fmax given by the sinc, due to Shannon. Moreover, one can increase the exciting field intensity and analyze the magnetization parallel to the exciting field. That is my and not mx. One can also include the theoretical values of FMR. After that, your python program becomes yig_varied.py

The result is
Figure_2.png
That shows that your spectra matches the original one but due to some symmetries of your signal and FFT then one achieves only two of the 4 possible branches (this can be seen already in one of your diagrams). Only these branches are valid. The branches for the maximum k correspond to aliasing and numerical errors.
The lines correspond to only two exchange magnons with no gap. That corresponds to your physical system because there is no demag, no anisotropy and no external field. It is necessary one of those elements to get the figure you are trying to reproduce.

If one repeats that using your parameters but the excitation like in the tutorial (yig_cented.py). One gets the following:
Figure_1.png
Therefore, it is a matter of the type of excitation.

Best regards,
Felipe

P.S.: I have left "ha ha ha" in your script.

--
You received this message because you are subscribed to the Google Groups "mumax2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mumax2+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mumax2/1cb2de59-75dc-453e-b115-6b5943bf1444n%40googlegroups.com.
yig_varied.py
yig_centered.py

Stephen Curry

unread,
Jun 21, 2022, 10:05:20 AM6/21/22
to mumax2
Dear Felipe,
Thank you very much for your help. I have benefited a lot and solved many of my problems.
But I still don't know the meaning of the following sentence.

mx = m[:, 1, 0, 0, :]

What does the second position represent when it is set to 0 1 2 3?(I found that only these values can be taken)
And why the third, fourth and fifth positions correspond to Z, Y and X directions.Why not X,Y,Z?
This has bothered me for a long time. Thank you again sincerely.

Best regards,
Stephen

Felipe Garcia

unread,
Jun 22, 2022, 3:31:34 AM6/22/22
to mumax2
Dear Stephen,

The index of the matrices are based on python numbering. The first is zero, the next is 1. In that way X,Y,Z becomes 0,1,2. In mumax3-convert it is the same nomenclature.

The order of the index of the array depends on the way the structure is saved and the indexes cycled in the ovf. First Z, then Y and then X. This is easiest seen in a two dimensional table. If each line corresponds to a different value of y and one increases x, then each row corresponds to a value of Y and each column to a value of X. This order is as natural/artificial as the one you propose. It is only a convention and totally arbitrary and there are programs that use one or the other.

Best regards,
Felipe

Reply all
Reply to author
Forward
0 new messages