Ion Optics Simulation in Mathematica

This is a project I worked on two years ago for a Computational Physics class.  I had worked with SIMION, an ion optics simulator, the summer before and was wondering how difficult it would be to write a similar simulator.  Of course, the simulator I wrote in Mathematica pales in comparison to the well-developed SIMION software, but it was fun to see what's required to get a basic simulator going.

Similar to SIMION, the user first defines a grid of a certain size, and then defines certain parts of the grid as electrodes with certain voltages.  The black dots in the images below represent the electrodes in the discretized world.  From this, the Laplace Equation is solved using a matrix inversion technique.  Then the initial conditions for the ions are set, i.e. where they start from, how many there are, their charge and mass, initial velocities.  The ions are the purple dots in the images below.  The Verlet Method is used to incrementally calculate the motion of the ions.  The force on each ion is approximated as the sum of the electric field (due to the electrodes) at the nearest grid point and the Coulomb repulsion of the other ions, to include space charge effects.

This first gif shows an example of a lens.  Again, the black dots are the solid electrodes in the discretized world, the purple dots represent the ions, and the lines in the image are the equipotential lines.  Imagining a target at the bottom of the image, we see how this lens focuses the ions onto a smaller target.


These next 2 gifs show how increased beam current would fight the lensing because of space charge effects.


And here is a 3D surface representing the electric field in the simulated world.  Ions flow downhill, and one can see the focusing effect that the two middle electrodes have by the electric field surface in that region.



A PDF of my rather word-heavy poster can be found here.  In the end, it was pretty fun to have built a generic 2D ion optics simulator; it wasn't very optimized or the most user-friendly as a Mathematica Notebook, but it got the job done.

No comments:

Post a Comment