OOmmf 3

In this new OOmmf post/tutorial I want to go through the on how to define problems as files instead of using the problem editor. Again it is for 2D problems. I think this is something important if you want to optimize the usage of the program and do lots of simulations (e.g. like when trying to optimize a device geometry).

oommf3

Before I start, remember to check the other 2 tutorials

OOmmf

Where I show the basics of how to set a problem and run a simulation using an image to define the geometry.

OOmmf 2

Where I describe how to save magnetization and convert the files into images to build an animation of the simulation.

So the problem for today is being able to simulate these 3 geometries which I draw using Inkscape (you can download them or draw ones yourself).

4um_2um_0nm

As you can see I’m changing where the wire joins the disk.4um_2um_250nm

The size of the images is 4 by 2 micrometers, and the material is going to be Permalloy (magnetization along the plane of the device), 20 nm thick.

 

4um_2um_500nmThe names of the files are going to be:

4um_2um_0nm.png
4um_2um_250nm.png
4um_2um_500nm.png

Now for the script to run a single program. Create a txt file named example and copy this (extracted from the documentation about how to set problems as MIF files and modified for our case). We are going to simulate the first of the geometries, applying a field along the x axis from -100 mT to 100 mT.

# MIF 1.1
#
# All units are SI.
#
####################### MATERIAL PARAMETERS ############################
Ms:  800e3                 # Saturation magnetization in A/m.
A:   13e-12                # Exchange stiffness in J/m.
K1:  0.5e3                 # Anisotropy constant in J/m^3.
Anisotropy Type: uniaxial  # One of <uniaxial|cubic>.
Anisotropy Dir1: 1 0 0     # Directional cosines wrt to coordinate axes

####################### DEMAG SPECIFICATION ############################
Demag Type: ConstMag # One of <ConstMag|3dSlab|2dSlab|3dCharge|FastPipe|None>.

########################## PART GEOMETRY ###############################
Part Width:     4.0e-6    # Nominal part width in m
Part Height:    2.0e-6     # Nominal part height in m
Part Thickness: 20e-9       # Part thickness in m.
Cell Size:      20e-9     # Cell size in m.
#Part Shape:
Part Shape: mask {I:\Oommf simulations\oommf12a5rc_20120928_85_x64\oommf-1.2a5\4um_2um_0nm.png}
###################### INITIAL MAGNETIZATION ###########################
Init Mag: Random # Initial magnetization routine and parameters

###################### EXPERIMENT PARAMETERS ###########################
Field Type: Uniform
Field Range: -.100 0. 0. .100 0. 0. 20 # Start_field Stop_field Steps
Field Range: .100 0. 0. -.100 0. 0. 20
# The above applies a uniform field stepped from (-.1, 0. ,0.) to (.1,0.,0.) (Tesla), and
# back, in approximately 0.01 T steps.

Default Control Point Spec: -torque 1e-6 # Assume equilibrium has been
# reached, and step the applied field, when the reduced torque |mxh|
# drops below 1e-6.

###################### OUTPUT SPECIFICATIONS ###########################
Base Output Filename: samplerun
Magnetization Output Format: text %g # Save magnetization states

########################## MISCELLANEOUS ###############################
Randomizer Seed: 1   # Value to seed random number generator with.
User Comment: This is an example MIF file, with lots of comments.

Save the file, close the text editor and change the file format to *.mif.

As you can see the definition of the problem in this way is very similar as using mmProbEd. You can also define the problem using mmProbEd and save it as a mif.

To run this problem start Oommf open for example  mmDisp and File>Show Console

In the console simply run

Tclsh oommf.tcl batchsolve {I:\Oommf simulations\oommf12a5rc_20120928_85_x64\oommf-1.2a5\example.mif}

This will automatically run the problem and save the output in *.omf format (magnetization).

Remember OOmmf 2 post on how to convert in images the output. We run

tclsh oommf.tcl avf2ppm *.omf -config magnetic.txt -opatsub .jpg
 -filter "tclsh oommf.tcl any2ppm -format jpeg"

and with Gimp we can construct the animation.

oommf3The cell size is very big (so the example will finish fast) but we can see that it worked because in the animation we can see how the colour changes in one of the ends.

Can we visualize this process and extract exactly when the transition happens? Yes we can.

At the same time as the magnetization was saved, a file named *.odt is created. This file can be opened in mmGraph in order to plot the different outputs from the problem.Remember that if you run again the same problem the vector files will be rewritten, but the odt file will not be deleted, new results will be appended.

In the next graph I ploted in x the magnetic field along x and in y I ploted the magnetization along x Mx respect to the magnetization at saturation. We are interested in Mx/Ms against Bx because the jumps are going to tell us when the structure reverses magnetization.

magnetization

Here is possible to see 2 effects combined, the big cell size and the few field steps. Their effect is that it is not possible to see where the transition happens.

In the next graph I have double the number of field steps to show how transitions are now more clear.

magneti

Now the different transitions are more clear. Also is possible to see that is not necessary to reach 100 mT to saturate the device. Actually, 50 mT is enough. That is going to reduce quite a lot the simulations for the next part.

Before going to the last part, let me notice that is possible to open this data file in Matlab. (Remember that I have a script for uploading the vector files into Matlab)

bg_header_mwlogo_notag

It’s not straigth forward opening the *.odt file into Matlab, but I wrote an script that is available to download in matlabfile exchange.

With this script you can extract the data from a *odt file and plot it in Matlab. (It will only work when the odt file corresponds to a single problem, several problems in the same odt file will produce an error).

Running the script will allow you to get the same graph and you can extract the data more easily.
matlab

Now for the last part.

My original idea was to try the batch processing available in Oommf to automatize the simulations, but it seems the batch processing has a bug with most of the Windows OS. It is something related to the usage of the ports by Oommf and the system… and it’s not easy to solve. It seems in Linux that problem doesn’t exists.

So let’s do the next part just running 3 problems one after the other.

First thing is to create 3 *.mif files as the one we just run just changing the name of the image used for the geometry and the name used for saving the files.

4um_2um_0nm.png -> 4um_2um_0nm.mif

4um_2um_250nm.png -> 4um_2um_250nm.mif

4um_2um_500nm.png -> 4um_2um_500nm.mif

Running each one of the problems as in the first example we will obtain 3 *.odt files that once opened in Matlab allow us to compare the devices. The result is shown in the next graph.hysteresis2Despite the simulations were made with very big cell size and few field steps, is possible to see that there is a big difference between having the joint between the nanowire and the disk in the centre or in one side.

Sheldon Cooper T-shirts

T-shirts worn by Sheldon Cooper (Jim Parsons) on The Big Bang Theory, by episode, Seasons 1-6. By Riptapparel.

sheldon-t-shirts1-442x9999

LPoW

1370621128m_SPLASH

By Nick Brick

Explorers

IMAG1890[1]
Original title: Explorers.

Title of this edition: Exploradores.

Author: George Gipe.

Gender: Fantasy / Science Ficction.

Saga:

Editorial: Plaza y Janes Editores S.A.

Edition year: 1, 1985.

Prizes: …

Synopsis [Warning: Spoiler]: Ben has a dream about an electric circuit. His friend Wolfgang builds it and their new friend Darren helps them. The circuit seems to be able to generate a force field using only the energy from a battery. Soon the kids realize they can use the force field to fly and go into space. Together the build a spaceship that placed inside the force field allows them to go to the moon… and farther because two aliens are controlling the field. The aliens are 2 kids that wants to communicate with earth kids. Once the father of the aliens finds them the adventure finish. But this is not the end, after being back at the earth the dreams start again!

Personal Review:  Actually, this book has its own movie.

I watched the movie when I was a kid… only once. Since that I was trying to find it again, because I didn’t knew the title. When I discovered the title (15 years later) I couldn’t find a copy anywhere. After a few years trying to find it… it become available through the expansion of internet and online shopping. It was as I remembered it! Ok, it is not a great movie, I admit it, but is a movie that if you watch it as a kid, you want to watch it again, because is the kind of innocence that teen movies had in the 80′s. The special effects or the aliens are not important, what makes it glow is the fact of the three kids working together and the dream of actually being able to go to space.

It was a few years later in a trip to Urueña (a medieval town in Spain where every house has been converted into a library) where I found the book. I even knew there was a book… and suddenly there it was… I bought it straight away, no hesitation. That was about 2 years ago…. and I just finish reading it (it took me about a week, but I had other pending readings).

To be honest, the film is word by word the same as the book, omitting only a few sentences. Are those sentences essential? One of them is a birthday that only adds the fact that the beautiful girl doesn’t likes Ben (she does in the end).  This girl doesn’t appear as a main character, is only a side character…. so I think it was good deleting this scene. The same happens with the others.

So what about the book? The book is very funny, but the aliens part breaks the story completely. It was bad in the movie and it was in the book. I understand that the author tries to mirror the three human kids with 2 alien kids, but is not funny and not exciting, is just… wierd. What I liked the most is the part about the force field, because they build something, program it with computer and is actually able to generate something very cool.

And that’s all…

.

.

.

.

.

.

Nah!

Moon missions

By Margot Trudell. Flickr and designer website. (List of missions to the Moon)

missions-to-the-moon1

missions-to-the-moon-21

 

ASFoW

Today M.E. (Mysterious Explorer) send to me this.

The Baywheux Tapestry – Doctor Who Tapestry

You want buy this 6 square feet tapestry of Doctor Who? It is available here.

10823163455_83c3f82222_o

tapestry_final_cartel2 tapestry_final_cartel4

LPoW

1278102721m_SPLASH

By Space Pirate

Mario Warfare

It was introduced long ago as an extra in the post about Dan the Man, now here it is complete at last. Enjoy!

Transformers, Back to the Future Batman and… racing

Follow

Get every new post delivered to your Inbox.

Join 480 other followers

%d bloggers like this: