From SIMION
"How can a voltage gradient be defined on an electrode in SIMION (such as due to a resistive material)?"
This is possible in SIMION, but it requires a few tricks to input the geometry.
Why voltage gradients on electrodes? Voltage gradients on electrodes (e.g. resistive materials) can be useful in ion mobility tubes (e.g. Burle resistive glass), reflectrons, and cycloidal mass specs in order to generate a linearly increasing potential (constant electric field) over space. Sometimes, a series of conductive electrodes at increasing potential are used instead of resistive material, but this is more complicated and is only an approximation.
There are at least two methods of applying a voltage gradient on electrodes:
- Method 1: A trick using Refine
- Method 2: Programmatically modifying the PA file
Method 1: A trick using Refine
This trick works only in cases where the system can be altered to omit electrodes in such a way that the Refine process will calculate the desired potentials at the omitted electrodes. After refining, the points on the omitted electrodes can be changes from non-electrode points to electrode points while preserving the potentials (e.g. using the Find/Replace function in Modify).
The reflecton (TOF/MIRROR.PA) example in SIMION 7.0 was created using this method.
Example: First, draw two electrodes as shown (we omit the electrodes at the top and bottom, which will have a voltage gradient):
Refine this. The potential energy map of the result is shown below:
Now, open this refined PA in Modify. You will see that the potentials at the non-electrode points have been calculated. Let’s change some of these points into electrode points.
First, select the points you want to change to electrodes, and enable "Non-Electrode", "0 Volts", "Find", and "Find +- 1000 V" (some large value). This finds all non-electrode points of voltages 0 +- 1000 V.
Next, click "Replace", and enable "Electrode" and "Only Change Type" to change these points to electrode points (without altering the potentials).
Below is the result:
Do the same for the bottom electrode as well:
You may wish to re-refine at this point (in this case, it should not make any difference). Below is the potential energy map of the result:
Method 2: Programmatically modifying the PA file
This method is the more general method and will work in all cases. Here, we use the SIMION SL Toolkit and in particular the SL Libraries (http://www.simion.com/sl/libraries.html) to programmatically edit the PA file.
Example: First, create a potential array without voltage gradients on electrodes:
Now, run the below apply_resistance.py Python program (which uses the SIMION SL Toolkit’s SL Libraries for Python), which reads in mod_in.pa and writes out mod.pa. This program modifies the potentials on the electrodes. (Note: You'll need to tell Python where to find the SL Libraries, e.g. via the PYTHONPATH environment variable.)
# apply_resistance.py
# Python program that modifies SIMION PA file to apply
# resistive material effects (e.g. voltage gradients
# along electrodes)
#
# Reads in mob_in.pa as input and writes out mob.pa as output.
#
# This requires the SIMION SL Toolkit (SL Libraries for Python).
# Tested with version 1.2.
#
# David Manura, Scientific Instrument Services, Inc. 2005-06-17
from SIMION.PA import *
# linear interpolation
# given fixed points (x1, v1) and (x2, v2), find another point
# (x, v) on the line, where x is given as well.
def interp(x1, v1, x2, v2, x):
m = (v2 - v1) / (x2 - x1 + 0.0)
v = v1 + m*(x - x1)
return v
# load the input PA
pa = PA(file = 'mob_in.pa')
print pa.header_string() # print some debug info
# iterative over all the points, changing the potentials
# so as to simulate resistive material effects.
for z in range(0, pa.nz()):
for y in range(0, pa.ny()):
for x in range(0, pa.nx()):
pot = pa.potential(x, y, z)
#print pot
if pot == 1 or pot == 2 or pot == 3:
new_pot = interp(0, 10, 53, 20, z)
elif pot == 4 or pot == 5:
new_pot = interp(53, 20, 100, 50, z)
else:
new_pot = pot
pa.potential(x, y, z, new_pot)
pa.save('mob.pa')
print "done"
Then refine the mod.pa in SIMION. The final results are shown below.











