A Minor Tool

Magneticians sometimes want to plot curves of spontaneous magnetization as a function of temperature for magnetically ordered materials, usually to compare to experimental results from magnetic neutron scattering or magnetometry.  These curves are based on the Brillouin function. Their shape depends on the total angular momentum, J or sometimes S.  They look something like this:

Brillouin curve for J=1.

Brillouin curve with J=1, plotted along with some experimental data of some sort.

All this program, found here at some silly website does is take the J from the user and write out the numbers for the plot.  The actually machinery is taken from M I Darby 1967 Br. J. Appl. Phys. 18 1415 doi:10.1088/0508-3443/18/10/307.  And it is this paper that should be referenced, or in fact used directly. Comments on g95 for Windows can be found here.

And, yes, I did draw the graph in Excel.  Ugly but good enough…

Advertisements

Tags: , , , , , , , ,

About Darren

I'm a scientist by training, based in Australia.

4 responses to “A Minor Tool”

  1. Tung says :

    Thanks for the very useful information. But could you please help me how to run the program? I downloaded it but have no idea how to make it work. Thanks

    • Darren says :

      I have GFortran installed, and I compile using:

      gfortran -o Brill brillouin.f90

      then run the binary Brill. If you need me to give you a binary (ie, executable) please tell me whether you are on Windows or Linux. I cannot compile for Mac.

      Happy to help, though.

      • Tung says :

        I wasn’t notified when you replied me even though I checked that option. Sorry for replying late.
        Now, I have GFortran installed already. Please send me the binary. I’m on Windows. Thanks!

  2. Darren says :

    Do you know how to use the command line? If you have GFortran, you should be able to go to the directory where the source code file is (brillouin.f90) and type:

    gfortran -o Brill.exe brillouin.f90

    If GFortran is working, you can compile the code yourself. If you want an executable you do not need the compiler (GFortran).

    I have compiled a Windows binary (on Windows 7) which is available from http://djg.4t.com

    It needs to be unzipped. It is best to run it from the command line, but the binary should also work if you double-click on it. It will create a file called something like “Brillouin_curve.XXX” where XXX is 1.0, 1.5 or whatever you give for J. The file will be created in the subdirectory where the .exe file lives.

    Let me know if you have any problems.

    A couple more comments: The step size and number of points used to draw the curve can be changed by editing the Fortran code and recompiling. It is the array red_temps(17) (reduced temperatures). You can increase the number of temperatures by increasing 17 to something bigger, then adding in the new values below, then changing the line:

    do i = 2,16

    to loop over your new temperatures. Don’t try to get a value at T=0 or T=1! You need a denser selection of temperatures neat T=1 since the curve drops so quickly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: