Ions and Electrons

Golfballs rolling down hills

Electric fields
Aerial golf course photo by Tom Piotrowski from Pexels

A helpful, but sometimes misleading, mental model of the movement of charged particles is to think of them as golf balls rolling down hills. Despite the differences between charged particles and golf balls, the kinematics equations governing them are largely the same — in the absence of relativistic effects. The force on the charged particle depends on the surrounding electric gradient in much the same way that the force on the golf ball depends on the slope of the hill. That is to say, that at any instantaneous change between two moments for, for instance, an ion:

force on the ion = electric field at the ions’ location × opposite charge of the ion;
acceleration = mass of the ion ÷ force on the ion
new velocity = old velocity + acceleration × change-in-time
new position = old position + new velocity × change-in-time

or:

F = −E · q
a = F ÷ m
vnew = vold + a · dt
snew = sold + vnew · dt

And for a golf ball:

acceleration = force of gravity × sine of the slope
new velocity = old velocity + acceleration × change-in-time
new position = old position + new velocity × change-in-time

or:

a = g · sinθ
vnew = vold + a · dt
snew = sold + vnew · dt

As g, q, and m are constant — or at least assumed constant, acceleration depends on the electric field, E, for an ion much as acceleration depends on the slope, sinθ, for a golf ball. These equations mean that if we know a charged particles’ (or a golf balls’) position and the electric field (or slope) at that position, then we can find its new position a short time (dt) later. For me, sometimes looking at math in code helps make it more concrete. Here is a snippet of Python code that performs this update function:

electric_vector = get_electric_vector(electric_field_map, position)
force = charge * electric_vector
acceleration = force / mass
velocity += acceleration * dt
position += velocity * dt

Where “charge”, “mass”, and “dt” are single numbers; “electric_vector”, “force”, “acceleration”, “velocity”, and “position” are each two, paired numbers (corresponding to the x and y components — these are internally NumPy ndarrays); and “electric_field_map” which is an array of the electric fields that is the output of the process of refining and scaling the electrical fields (i.e., it’s the numbers represented by the rainbow-colored electric field canvas).

The only real differences between the code and the math are the “get_electric_vector” function and the “+=” operator. In the Simulation Playground the get_electric_vector function performs a lookup of the electric values immediately around the position of the particle (thus, it needs to be passed the particle’s position and the electric_field_map; which is the table to do the lookup). In SIMION, there is an equivalent function to “get_electric_vector” that is a bit more accurate. The “+=” operator adds the left-hand-side to the right-hand-side and updates the left-hand-side with the resulting value (so a short-hand notation for the sold and vold addition).

Obviously the analogy of charged particles as golf balls has a few inaccuracies: