SIMION® Industry standard charged particle optics simulation software.
About | Documentation | Community/Support | Downloads | Ordering

Info: Magnets

From SIMION

Magnetic field calculations are often a bit more complicated than electrostatic ones since potential is a vector and there are complications of permeability, current density, and hysteresis.

In SIMION, there are two main ways to define a magnetic field:

  • in terms of magnetic scalar potentials
  • in terms of magnetic field vectors

These two cases are explained below:

  • in terms of magnetic scalar potentials -- Scalar magnetic potential is analogous to scalar potential in electric fields (i.e. voltage). The magnetic field vector is the negative gradient of scalar magnetic potential, just as the electric field vector is the negative gradient of electrostatic potential. SIMION can solve scalar magnetic potential using the Laplace equation in the same manner as electric potential is solved, and after doing so the magnetic field vector can be immediately obtained and used for particle trajectory solving. Unfortunately, not all magnetic fields can be expressed as scalars but rather as vectors, and the meaning of potential can be less intuitive with magnetic fields. Magnetic potential will be a scalar under certain conditions, such as when there is no current density in the domain modeled (and in a different way if the system has 2D planar symmetry). Beware also that, unlike the electrostatic case, magnetic pole surfaces do not generally have totally uniform magnetic potential across their surfaces, permeability not being infinite (see p. 2-10 of [chapter 2 (http://www.simion.com/manual/chap2.html)] the SIMION 8.0/7.0 manual for a discussion of this). This presents a difficulty because surfaces of constant potential are normally used to define boundary conditions for the field solver. However, if permeabilities are infinite, or at least very large, and the region is sufficiently defined, then surfaces will have constant potential, and the boundary conditions are more readily definable in SIMION. Often, there is only one potential difference (i.e. between two poles) to define, and that potential can be scaled to give the desired field intensity between the magnetic poles.

    Technically speaking, in SIMION, scalar magnetic potential is typically expressed in terms of a SIMION potential array. In SIMION, you can create a magnetic potential array just like you create an electrostatic potential array; a magnetic potential array can contain magnetic electrodes of arbitrary shape and that are assigned scalar magnetic potentials. You can then have SIMION refine it, in which case SIMION calculates scalar magnetic potential of the non-pole points by using the Laplace equation, just like for electrostatic electrodes. SIMION then uses these to compute magnetic fields in space. You may need to set the magnetic scaling factor so that the fields corresponds to real units of Gauss. The calculated fields can even be non-uniform with fringing effects as seen in SIMION's magnet examples (e.g. see [screenshots (http://www.simion.com/examples/mag90.pdf)] of the 90 degree bending magnet, examples/magnet/mag90.iob, included in SIMION's examples). This calculation does ignore any permeability and hysteresis effects. Another approach is to use the SL Tools utility to convert external field data directly into a SIMION potential array (without refining).
  • in terms of magnetic field vectors -- This is more general. Magnetic fields are defined directly in terms of field vectors. During the trajectory integration the magnetic field vector seen by the ion can be defined programatically. You may have an analytical mathematical expression for it, or you may have field data (calculated from some external program and stored in a text file) that can be interpolated (SIMION 8.0.3 includes field grid interpolation routines), or the magnetic field may be defined via a configuration of wire currents (SIMION 8.0.3 provides support for Biot-Savart calculations). In all these cases, the magnetic field can be superimposed on a system via an mfield_adjust user program segment attached to an empty magnetic potential array. This program segement defines magnetic field vector directly however you like.

Related Resources:

Table of contents

Applying a constant magnetic field

It's very common to require simply a constant magnetic field, so we describe that here. There are two main methods to define a constant magnetic field in SIMION: with a user program or without a user program. Each is explained below. Both methods are almost equally suitable, but the user program approach is recommended because it avoids magnetic potentials and therefore can be more intuitive.

Via a user program in SIMION 6 or 7 (also works in 8)

For this example, we'll assume you want a constant 100 Gauss magnetic field in the +X direction.

  • (1) Create an empty PA of "magnetic" type and add it to your existing workbench (View | PAs | Add). We'll assume you name the PA "mag.pa".
  • (2) Create a user program file "mag.prg" (in the same folder) containing something like this:
defa bx 100    ; Gauss
seg mfield_adjust
  rcl bx sto ion_bfieldx_gu

This works as follows. When you fly particles, SIMION sees the system contains mag.pa. SIMION then looks for a corresponding user program of the same name (mag.prg) and loads it if it finds it. Now, whenever a particle is flying inside mag.pa, the user program applies a constant magnetic field to the particle.

Some important points:

  • mag.pa is an empty PA with no electrode points. It need not even be refined. The magnetic field is applied instead by the associated user program rather than by any potentials in the PA itself.
  • The mag.pa should be large enough to contain the entire volume in which you want the magnetic field applied.
  • To conserve memory, it can be handy to make mag.pa 2D (cylindrical or planar z=1). After all, a constant magnetic field has 2D symmetry, so make use of it. If you use 2D planar, be sure to set the "nz use" value appropriately in "View | PAs".
  • Verify the correctness of the magnetic field with SIMION Data Recording.
  • This approach is taken in the ICR example (_Icrcell).

Via a user program in SIMION 8

Though the above solution works in SIMION 8 too, in SIMION 8 you may alternately write the program in Lua. Create the file "system.lua" (assuming "system.iob" is the name of your workbench) as follows:

simion.workbench_program()
adjustable bx = 100
function segment.mfield_adjust()
  ion_bfieldx_gu = bx  -- gauss
end

Via magnetic potentials in a PA

An alternate method of creating a magnetic field is to create magnetic pole in a magnetic PA. The negative gradient of the scalar magnetic potential then defines the magnetic field. This is suggested on p. 2-10 of the SIMION 7.0 manual. It is illustrated below.

Image:cylindrical_magnets.png

In particular note the annotations in red:

  • The array type is set magnetic.
  • The symmetry is set to 2D cylindrical or 2D planar, i.e. z=1 (not necessary, but this keeps memory usage small as noted previously).
  • The "ng" scaling factor is set to 22, which is equal to the grid unit distance between electrodes. See p. 2-10 of the SIMION 7.0 manual for the explanation of this crucial point and the limitations. All this is is a scaling factor to get the units right.
  • Two electrodes of potentials 0 and V are drawn (here V=1). With the ng factor set as above, this will produce a field of ~V Gauss in the center.
  • Verify the correctness of the magnetic field with SIMION Data Recording or by hovering your mouse over the volume.
  • This method is used by various examples in SIMION's _Magnet folder.

Mu Metals (High Permeability)

Mu metals (i.e. high permeability) can be well handled in SIMION. See the discussion in Floating Conductor and the user group posts linked from that page. The approach for doing Mu metals is similar as noted in the user group posts.

Any comments on this web page? (will be sent to SIS)
[Optional] Your name: email: phone/fax:
(c) 2003-2006 Scientific Instrument Services, Inc. (SIS). Contact SIS.