Simulating Fields, Ions, and Optics

A guide for learning about ion simulations

This website is intended to serve as an introduction to many of the concepts that you will encounter with more professional ion simulation programs – specifically SIMION, a program to perform complex ion simulations. As SIMION is mostly intended to simulate mass spectrometry (MS)-related components, this text is biased towards concepts and examples relevant for MS. Although this text is intended as an introduction, it assumes familiarity with terms such as: ion, electron, electrode, electric field, voltage, and mass.

This website deals with the concepts for simulating gas phase ions in high vacuum environments, such as those that might be found in outer space. It does not deal with simulating liquid-phase ions, such as those that might be found in a battery. It simulates the translational motion of ions, not their internal states, so inter and intra-molecular forces and interactions are largely ignored, except for the pages on Ion mobility and Other behavior.


Motivation, history, & influences

When I first started studying MS instrumentation I was exposed to SIMION. Entire literature articles, or even PhD dissertations, could be written with little or no experimental data – with only the data collected from rigorous simulations performed with SIMION. We had a copy of SIMION in the research lab where I worked. Loading SIMION for the first time, I was greeted by its rather unfriendly user interface. After clicking around a bit and becoming frustrated with not understanding what I was doing, or how to do what I’d have liked, I closed the program and didn’t reopen it for years. In fact, when I did reopen it, it was because I was attempting to develop course material that related to ion simulations. (Those who can, do; those who cannot…)

My fresh attempts to learn SIMION to make some course materials were also a bit of a non-starter. I persisted through flying ions in the SIMION time-of-flight tutorial the second time, but felt my motivation waning as my understanding did not improve. Luckily, there was an ex-colleague of mine that I remembered had developed a MATLAB script for performing rudimentary, 2D-based ion simulations. I contacted him and he happily provided me the script. It loaded a little 200×200 bitmap – that could be made and edited with Microsoft Paint – and flew a single ion from some x and y coordinate (from 0 to 200 units). I read through the code, translated the it into Python, and suddenly I was able to understand those high-level papers on SIMION-based ion simulations that had eluded me for so long.

Excited by my newfound learning crutch, I proceeded to simplify the Python script, heavily comment it, and write a thorough tutorial on how to use it. I presented it to the students I was teaching, hoping that they would find it useful. Even if they didn’t know Python, the comments should allow them to get it working…

And it turns out not understanding Python isn’t the biggest hurdle to running and manipulating a Python script. There are a lot more little stumbling blocks – installing the Python toolchain, downloading libraries, working with the command line, and small differences between operating systems lead to a lot of cognitive overhead, like the overhead I’d experienced with SIMION originally. Those that understood Python already, or who were more persistent at learning than I, really learned a lot. The rest, well they found some point where they became frustrated and, understandably, gave up.

That brings us back to this site and specifically the Simulation Playground. The Simulation Playground is yet another translation and expansion of the code that was so helpful to me. The Simulation Playground is the crux of this site and the text serves to provide context and meaning behind it.


Praise and stealing

The layout and idea behind this site is stolen directly from Jack Schaelder’s SEEING CIRCLES, SINES, AND SIGNALS. Everything from the title of this site to the header for this section has been shamelessly pilfered. Jack Schaedler’s site helped me tremendously as a graduate student and I continually refer people and students interested in signal processing there. I think the world could use a few more visual “compact primers” on different topics and SEEING CIRCLES, SINES, AND SIGNALS is perfect.

Most, and possibly all, of the information in this site can be found in the SIMION User Manual.1 Although my own failures to initially learn SIMION might seem to indicate that it doesn’t have enough learning materials, nothing could be further from the truth. The SIMION User Manual and SIMION itself are full of tutorials, helpful explanations, and information about where to find out more. These just didn’t click with me until I’d already learned a bit about ion simulations. These tutorials are immensely helpful and go into much more depth than this site.

Although the layout and visual design of the website is stolen, the underlying code is entirely bespoke and mostly hand-rolled without the use of libraries. The underlying code for the playground is almost entirely written in Rust and then compiled to Webassembly. If SEEING CIRCLES, SINES, AND SIGNALS is an exploration of the D3.js library, this site is an exploration of Rust and Webassembly. More information about the creation of this site can be found in the Code page.

Dahl, D.; Manura, D. “SIMION (R) Version 8.0/8.1 User Manual”, Scientific Instrument Services., Ringoes, NJ. 2011.