SIMION® Industry standard charged particle optics simulation software.
Newsflash: SIMION 8.1.0 is here.
About | Documentation | Community/Support | Downloads | Ordering

Magnets

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 three main ways to define a magnetic field:

  • in terms of magnetic scalar potentials
  • in terms of magnetic vector potential (experimental in 8.1.0.45).
  • in terms of magnetic field vectors

These 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. However, 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 symmetry). See Magnetic Potential for details.
  • in terms of magnetic vector potential – Magnetic vector potential can take into account a non-zero current density in space. SIMION 8.1.0.45 has experimental support for magnetic vector potential. See Magnetic Potential.
  • in terms of magnetic field vectors – Magnetic fields hre are defined directly in terms of field vectors. During the trajectory integration the magnetic field vector seen by the particle can be defined programmatically. 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, and SIMION 8.1.0 allows regular PA files to represent this), or the magnetic field may be defined via a configuration of wire currents (SIMION 8.0.3 provides support for Biot-Savart Law 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 segment defines magnetic field vector directly however you like. SIMION 8.1.0.22 ads some capabilities and examples that make this easier to use in terms of storing vector data in regular PA files and visualizing the field vectors (and/or Biot-Savart wires) on the View screen (see SIMION Example: contour (contourlib81), SIMION Example: helmholtz_coil, and SIMION Example: solenoid).

Related Resources:

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 8

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

  1. Create an empty basic PA of “magnetic” type. We’ll assume this PA is named “mag.pa”. This PA should be appropriately sized since only particles inside the array will see magnetic fields.
  2. Add an instance of the PA to a workbench (View | PAs | Add). We’ll assume this IOB is named “system.iob”. Appropriately size and position it in the workbench (View | PAs | Positioning).
  3. Create a user program file “system.lua” (i.e. with the same base file name “system” as the IOB file and in the same folder) containing something like this:
simion.workbench_program()
adjustable bx = 100   -- Gauss
adjustable by = 0     -- Gauss
adjustable bz = 0     -- Gauss
function segment.mfield_adjust()
  ion_bfieldx_gu = bx
  ion_bfieldy_gu = by
  ion_bfieldz_gu = bz
end

This works as follows. SIMION sees the system.iob has a corresponding system.lua, and whenever a particle is flying inside mag.pa, this user program applies a constant magnetic field to the particle.

Some important points:

  • The mag.pa merely defines a volume in which the user program is to be applied, and the magnetic field defined in the user program overrides any field that may be defined in mag.pa. Therefore, mag.pa may be an empty magnetic PA with no electrode points, and it need not even be refined.
  • The mag.pa should be large enough to contain the entire volume in which you want the magnetic field applied. The user program will only apply the magnetic field to the volume inside the PA.
  • To conserve memory, it can be handy to make mag.pa only 2D (e.g. cylindrical or planar z=1) with a relatively small number of grid points. It doesn’t matter if your field has this same symmetry or not. If you use 2D planar, be sure to set the “nz use” value appropriately in “View | PAs”. You may rescale the rearray size on the workbench too (“View | PAs | Positioning | scale”).
  • Verify the correctness of the magnetic field with SIMION Data Recording. Caution: The magnetic field defined via a user program (rather than without one) will not normally be visible with the PE/Contours viewing options.
  • This approach is taken in the ICR example (icrcell).

SIMION Example: mfield_adjust (added in SIMION 8.1.0.19) demonstrates a simple mfield_adjust segment as described above.

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

SIMION 7 can do this with a PRG program. Create a user program file “mag.prg” (i.e. with the same base file name “mag” as the PA file, not IOB file, and in the same folder):

defa bx 100    ; Gauss
defa by 0      ; Gauss
defa bz 0      ; Gauss
seg mfield_adjust
  rcl bx sto ion_bfieldx_gu
  rcl by sto ion_bfieldy_gu
  rcl bz sto ion_bfieldz_gu

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 8.0 and 7.0 manuals. This is described in Magnetic Potential.

Combining electric and magnetic fields

Electric and magnetic fields cannot be combined in the same PA. Rather, you need two PA’s, one electric and one magnetic. You then overlap the PAs on the workbench. If a particle is inside multiple PA’s, it will see the electric field from the electric PA of highest priority number (in the PA Instances list on the PAs tab) and the magnetic field of the magnetic PA of highest priority number. See also the SIMION Example: magnet (magnet1.iob) example, which does this, or SIMION Example: icrcell.

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.

See Also

Poisson Solver in SIMION - offers some new capabilities for magnetic fields with vector magnetic potential.

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.