Free-electron lasers and masers use a relativistic electron beam as their light source, meaning that being able to study and understand the behavior of free-electron lasers requires being able to model electron beams. Here, we give a description of the mathematics and particularly the numerical methods used for modelling electron beams, electron guns, undulators, and other related systems.
Note: Also see Guide to modelling lasers and masers for more information about free-electron lasers/masers (as well as other types of lasers/masers).
Modelling of undulator electron beams
Here, we will use slightly different coordinate conventions compared to Free-electron maser physics. In our new conventions, is the optical axis, is the direction parallel to the north-south axis of the magnets, and the direction perpendicular to the magnets. The electrons travel in the plane in the undulator.
The electron beam trajectory follows the relativistic Lorentz force equation for magnetic fields:
This is a highly-nonlinear differential equation, one we will need to solve (either through analytical or numerical means) to determine the trajectory of the electron beam through undulator.
A heuristic derivation of the beam energy threshold
A good way to try to estimate the beam energy necessary is to consider the following case. Let be a uniform field oriented transverse to the motion of a charged particle. By Newton’s second law, we know that the particle will follow a circular path if its velocity satisfies:
Thus upon rearrangement we have:
Therefore, only a particle with an “escape velocity” would not end up in a circular orbit. Note that we can rearrange in terms of as follows:
For an electron, we can rearrange in terms of natural constants to obtain:
Where is the electron mass-energy. Since the electron beam should be fairly paraxial, we know that (where is the width of the undulator), which allows us to obtain a rough order-of-magnitude estimate for (in addition, we can take known values of for other free-electron maser and laser installations). At a field and a radius beam, this yields a minimum velocity of (or around 6% of the speed of light, corresponding to a beam energy of around 1 keV) for . Note, however, that this is less for off-axis electrons, i.e. for . While this calculation is ultimately a very rough approximation, it does set a theoretical minimum for the energy necessary for an electron to escape the rotational pull of the magnetic field.
We may obtain a more accurate approximation from , the analytical expression for the displacement of an electron beam from the centerline in an ideal undulator (from Jackson, Classical Electrodynamics), where , , and . Thus after the substitution , one has:
This result gives around 1% the speed of light for , and around 8% the speed of light for , rising to around 14% the speed of light for due to the quadratic dependence on .
Approximate solution in the highly-relativistic regime
The analytical solution to the problem is based on the famous EM textbook Classical Electrodynamics by Jackson. On pg. 684 (in chapter 14.7, 3rd. ed.), the solution for the beam trajectories is given as (here Jackson uses but we would write this as in our notation). He then claims that one can divide between wigglers (which emit incoherent radiation) and undulators (which emit coherent radiation) via the value of . For a wiggler, , but for an undulator, . This is a result that we have regarded as implicitly-known.
On pg. 687, Jackson then defines (in our notation, ) and . This definition of is clearly in Gaussian units due to his extra factor of , since in SI we have , which we can also write in our notation as . Rearranging gives us . If we then define we can write this more elegantly as . Thus (in our notation):
Thus we see that the electrons exhibit oscillatory “wiggling” motion with period , and a maximum displacement proportional to . Since , the maximum displacement of the electron oscillations decreases for faster electrons, but the period remains constant, which is the result of relativistic length contraction.
Note: For the electrons to not smash into the undulator walls, we obviously need , where is the width of the undulator. Note that so the maximum displacement of the electrons from the axis is strongly dependent on the separation between the magnets. In practice, even with very strong fields of and a long magnet separation of , is only around 3.7 cm.
However, exactly how Jackson’s initial claim that is derived is not directly shown; we can assume that it is just an ansatz. A hint comes from when Jackson states that:
“If the periodicity of the magnetic field structure is , the particle’s path will be approximately sinusoidal in the transverse direction with the same period.” (pg. 684)
He does explain that (on pg. 686) that working from the Lorentz force equation the -component can be written as , which is the only meaningful component since is assumed to be “negligible or zero”. Note that since he is working in Gaussian units, the relativistic Lorentz force equation reads as , which has an extra factor of compared to SI units. He assumes that (its components may change but its magnitude stays relatively constant) so and he can factor it out, giving .
With the approximations and , he arrives at an expression for the magnetic field, where . Afterwards, he acknowledges that “an actual magnet structure will be periodic, but not sinusoidal” and that is better represented as a Fourier series in , though he keeps only the fundamental mode of the series for simplicity.
On the following page, he gives (which can be written as using his previous approximation), so at we have . And since it is assumed that then , where he claims that and thus he uses a binomial approximation to derive (specifically, ). We may infer that it is reasonable to assume that the electrons are initially moving nearly purely along the axis as they enter the undulator (by definition the direction of motion points in the same direction as the velocity vector, and thus points along ).
However, note that the solution from Jackson is only valid under a wide range of simplifying assumptions, including (but not limited to) a magnetic field that is close to a pure harmonic, highly-relativistic electrons, , and . These are assumptions that generally do not hold in the mildly-relativistic regime that free-electron masers typically operate at, so we need better approximations.
Derivation of Jackson’s analytical solution
Since Jackson does not derive his analytical solution for directly, we will sketch out a derivation here. To start, we know (or at least Jackson tells us) that the magnetic field inside the undulator is given by:
(Note that here is the same thing as ; it is just a different notation that we’ll use interchangeably). Here, is the magnetic field amplitude, is the wavenumber, and is the spatial period (distance between every pair of magnets with same polarity).
To solve the problem approximately, we assume that the initial velocity of the electrons (when they are fed into the undulator) is almost entirely along the axis. Since there is no or component, by substituting and expanding the cross-products in the Lorentz force formula, we have:
Thus, we find that the electrons move purely in the -plane, and their equations of motion are given by:
Now, we will make the assumption that the -component of the electron’s velocity is assumed to be essentially constant (). This means that the second differential equation becomes , which has the trivial solution of . It also means that we have just one differential equation left, that being the one for . But given that we know , the first differential equation simplifies to:
This is still a nonlinear differential equation, and indeed if we expand it it takes the rather-ugly-looking form1:
Where we once again define . This is made even worse by the fact that the Lorentz factor itself depends on , making this even harder to solve. It certainly cannot be solved analytically in this form. However, if we assume that , then it can be factored away, giving us:
Solving is then simply a matter of twice-integrating the above, giving us:
Defining as the “relativistic” form of gives us:
Note that with the approximation (the strongly-relativistic limit) this is the same result as Jackson (where ), up to a sign difference; the sign difference comes from the negative charge of the electrons, so . This result clearly shows that the electrons move in sinusoidal trajectories, “wiggling” from left to right along the plane - which is indeed what we would expect. However, remember that this is an approximate solution!
Approximate solution in the non-relativistic and mildly-relativistic regime
A more rigorous approximate solution can be found by linearizing the system about the critical points. This solution works in the non-relativistic and mildly-relativistic limit, where we can assume that . However, it is not too difficult to extent it to the strongly-relativistic limit as long as we assume that .
To start, let us begin with the exact equations of motion with no simplifications:
As a reminder, these are highly-nonlinear differential equations that are not easy to solve using SciPy’s native differential equation solver. However, we can quasi-linearize them by taking which holds in the non-relativistic and mildly-relativistic limit (meaning it is valid to around , more than enough for our purposes). This gives us:
Or in vector form:
Note that if (we may call this constant field ) then it would be possible to solve this system of differential equations analytically. We would then have , and the system simplifies to:
Using a computer algebra system or by just using the general methods of solving ODEs, we can solve the (simplified) system exactly; the solution is simply in terms of sines and cosines. An example implementation for solving the system symbolically using SymPy is given below:
# first show symbolic solution
import sympy as sp
from sympy import symbols, Eq, Function, re, Matrix
from sympy.solvers.ode.systems import dsolve_system
t, q, By, m = symbols("t q B_0 m", real=True)
x = Function("x")(t)
z = Function("z")(t)
# define derivatives
xdot = x.diff(t)
xddot = xdot.diff(t)
zdot = z.diff(t)
zddot = zdot.diff(t)
w0 = q*By/m
# define the simplified system of ODEs
ode1 = Eq(xddot, -w0*zdot)
ode2 = Eq(zddot, w0*xdot)
# solve the simplified system
symbolic_sols = dsolve_system([ode1, ode2])
# print out the solutions from SymPy
symbolic_sols[0][0]
symbolic_sols[0][1]The solutions (from SymPy or worked-out manually) are given by:
Thus we find that if (that is, if it were a uniform field) we have where here is an angular frequency. Therefore, in the case of a uniform field (or alternatively, in the limit of ), we have formally shown the electrons just orbit in circles with characteristic orbital frequency .
We can also use a classical method for solving nonlinear ODEs to obtain an approximate solution without assuming . This involves linearizing the system about its steady-states. To do so, let us start with the system with only the simplification . This gives us:
The system can then be rewritten in the following (phase-space) form, where :
The steady-states of the system can be found by setting the RHS of the above equation to zero; they are at and (for odd ), with in both cases. Since the steady-state is trivial, the first non-trivial steady state occurs at . Now expanding about this steady state is equivalent to evaluating the Jacobian at . The Jacobian in this case is given (in general) by:
Evaluating at gives us:
The linearized version of the differential equation is then given by . The solution can be found by first finding the eigenvalues and eigenvectors of the Jacobian (which we’ll notate as from now on for short). They can be manually, or (more conveniently) with a computer algebra system; an example code using SymPy is shown below:
from sympy import symbols, Matrix
# calculate eigenvalues & eigenvecs of Jacobian
w0 = symbols("w_0")
J_star = Matrix([
[0, 0, 1, 0],
[0, 0, 0, 1],
[0, 0, 0, -w0],
[0, 0, w0, 0]
])
J_eigenvecs = J_star.eigenvects()
print(J_eigenvecs)Whether calculated manually or on computer, the result should be the same: there are three sets of eigenvalues and eigenvectors. The first is the trivial eigenvalue with multiplicity 2, with associated eigenvectors and . The second is the eigenvalue with multiplicity 1, with associated eigenvector . The third is simply the conjugate of the second, with the eigenvalue of and associate eigenvector . Thus the general solutions are:
Simplifying with some new constants gives us:
Which…is a fairly underwhelming result, since we have essentially arrived at our circling-particle solution once again, although this time in a much more mathematically-formal manner. However, this result is not useless; an important aspect of any numerical solver is that it must reproduce this solution in the appropriate limits.
Numerical solution of electron beam trajectories
To solve the highly-nonlinear ODE system, we need to use numerical methods for solving differential equations. While there are commercial software that can be used like EGUN, we will describe a general treatment that is (mostly) software-agnostic. For example code, we will use Python, but any other programming language works fine.
To begin, we will start with the exact, relativistic Lorentz force equations:
The presence of the Lorentz factor makes them incredibly difficult to solve. However, if we take which holds in the non-relativistic and mildly-relativistic limit (meaning it is valid to around , more than enough for our purposes), we have:
Or in vector form:
Since the electron charge and mass are so small while the speed of light is so big (in SI units), substituting in the raw values will lead to numerical overflows and break the solvers. To avoid this we will perform nondimensionalization. To begin, the (non-relativistic) Lorentz force law with zero electric field can be written in the form:
Where is the -th component of the velocity vector and is the -th component of the acceleration vector (in tensor notation), and the two are always perpendicular to each other. Now, we will make a change of variables by defining two new variables , where and . Then:
Likewise:
Substituting back into the Lorentz force law gives us:
Simplifying and rearranging, we have:
If we make the identification and define , we have thus nondimensionalized the differential equation:
Note: The choice for is somewhat arbitrary since it is divided from both sides. This freedom in specifying will be important soon.
In its raw form, this differential equation can be numerically-unstable for very fast-moving electrons, since the electrons move so fast that blows up, leading to numerical overflows and errors. Thus, we need to perform some manipulations to make the differential equation stable enough for numerical integration. First, note that by multiplying both sides by and defining , one may obtain an equivalent differential equation, though now expressed in terms of and :
This has the advantage of keeping our velocities expressed as reasonably small values, instead of being massive numbers on the order of ! For electron beams with electrons travelling at a substantial percentage of the speed of light, which is standard for free-electron lasers and masers, this is indeed essential.
Note that this expression is very general since any magnetic field can be written in the form , and we need only perform a simple transformation to obtain from .
We will now substitute our particular case, where the only nonzero component of the field is and we have , and thus and . Thus in our case, the previous equation takes the form:
Meanwhile, since is arbitrary, we may define freely. We thus choose ,. This choice is convenient because if we then also define , we thus have , allowing us to get rid of all the remaining factors of in the differential equation, and thus avoid all the numerical issues that having a factor of causes. Thus we have the fully nondimensionalized variant of our differential equation:
In our specific case, we have where and , , and . Thus, we may write the above in explicit vector form as:
Or equivalently:
Note: assuming that the electrons move reasonably close to the beam axis and that the magnitude of their velocity stays reasonably constant (as Jackson assumes), one needs only to replace with to obtain a fully-relativistic result that applies in the strongly-relativistic regime (where is, as usual, the Lorentz factor).
Note that to convert the above back to standard SI units (that is, to recover and from the numerically-computed and ), we make use of the conversions:
Where the former expression is derived from , and the latter expression is derived from combining , , and . Equivalently, in vector notation, we have:
One must be careful to recognize that is actually negative to due to the fact that the electron has negative charge, so we must specify the magnitude of when discussing its value. For an undulator spatial period of and a magnetic field strength of we have and . Thus one finds that:
Note that since is dimensionless, must also be for dimensional consistency; in addition, it is not difficult to see via dimensional analysis that has units of (inverse length). We will now describe several methods for solving the system using different software.
Approximate solution with leapfrog integration
We’ll start by writing a custom solver to numerically integrate the differential equation. It turns out that this is actually easier than using a ODE solving library, for reasons that will become apparent later. To do so, we use a method that is commonly-used in plasma physics, known as leapfrog integration. Leapfrog integration starts by approximating the continuous solution as a series of points separated by finite intervals. As the number of intervals grows larger, the approximation grows more and more accurate.
The leapfrog integrator is a type of symplectic integrator, which roughly means that it ensures that physical systems that must follow conservation laws have generally-stable solutions that (approximately) preserve conserved quantities. It is an iterative algorithm that computes the position and velocity of a particle (or in our case, and ) for the next step from the current step as follows:
Where and is defined (in our case) by:
This can be implemented by the following (simplified) Python code:
def leapfrog(fun, x0, v0, t_span, step_size=1E-4):
t0, t_end = t_span
N = int((t_end - t0)/step_size) # num steps
t = np.linspace(t0, t_end, N)
x = np.zeros((N, len(x0)))
v = np.zeros((N, len(v0)))
x[0] = x0
v[0] = v0
h = step_size
for i in range(N-1):
# calculate a[i]
a_current_step = fun(t[i], x[i], v[i])
x[i+1] = x[i] + v[i]*h + 1/2 * a_current_step*h**2
# calculate a[i+1]
if fun_args is not None:
a_next_step = fun(t[i], x[i+1], v[i], **fun_args)
else:
a_next_step = fun(t[i], x[i+1], v[i])
v[i+1] = v[i] + (a_current_step + a_next_step)/2 * h
return {
"t": t,
"x": x,
"v": v
}Note: The code for the numerical solver can be found in the Jupyter notebook
Simulations/UndulatorDesignSimulations.ipynbin the laser research repository. We have found that it has yielded the best results of any numerical method for computing beam trajectories of any of the methods discussed.
Validation of numerical solution with SciPy
To check that the solution of the leapfrog integrator is correct, an alternative (though very-similar) formulation of the ODEs can be solved via solve_ivp’s ODE solver. To start, we have:
Or alternatively, after dividing both sides by :
Where . Now after defining , as well as we have:
Where is a precomputed constant (of the order in units of THz), and is of the same order of magnitude (in units of THz). We thus solve for the scaled positions and the scaled velocities , which has the advantage that the latter are direct derivatives of the former, without needing to multiply by a factor of . Note also that , the electron charge-to-mass ratio, has a well-established CODATA value that can be used when computing . However, since the oscillation frequencies are still so high (in the THz range), we perform a transformation of variables and . Thus:
Therefore, after substitution, we have transformed the system into two second-order quasilinear differential equations for and :
Or equivalently, in matrix-vector form:
This completely removes dependence on the frequencies, which are now entirely contained within the definitions of the new variables . Note that in our initial conditions, we must use the following transforms:
Note: The code for the SciPy solver can be found in the Jupyter notebook
Simulations/UndulatorDesignSimulations.ipynbin the laser research repository. However, the results are still work-in-progress and yield inconclusive results at the present time.
Approximate solution with OSCARS
We can also use the dedicated OSCARS code to numerically compute the results. A table of the results for different beam energies are shown below; all tests are done with and .
| Magnetic field | Beam energy | Current* | Orientation | Success? |
|---|---|---|---|---|
| 0.1 T | 1 MeV | 1.0 A | Yes | |
| 0.05 | 520 keV | 1.0 A | Yes | |
| 0.03 | 515 keV | 1.0 A | Yes | |
| 0.03 | 510 keV | 1.0 A | No | |
| 0.01 | 510 keV | 1.0 A | No | |
| 0.01 | 512 keV | 1.0 A | No | |
| 0.01 | 512 keV | 1.0 A | No | |
| 0.01 | 512 keV | 1.0 A | Yes | |
| 0.005 | 512 keV | 1.0 A | Yes | |
| 0.005 | 510 keV | 1.0 A | No | |
| 0.005 | 510 keV | 1.0 A | No |
*: Here (in coordinates) is the initial direction of the particles, with being the angle to the -axis (optical axis).
Note: The code for the numerical solver can be found in
Oscars/OscarsBasicSimulation.ipynbin the laser research repository.
The results indicate a cutoff beam energy of 512 keV would be required, which is indeed monstrously high. This, however, may be due to the fact that OSCARS was designed for simulating free-electron lasers with electron beam energies in the GeV range, not free-electron masers with beam energies in the keV range, which is a difference of 6 orders of magnitude.
Approximate solution with SciPy (archived)
Note: This section is an older section, and is preserved here only for archival purposes.
We’ll now cover an alternative method for numerically calculating the beam trajectories using the solve_ivp solver from the SciPy library.
Typically, ODE solvers expect coupled ODEs to be written in vector ODE form . This means we must write the system in its phase-space form. Let us define such that we have:
This can then be numerically implemented with the following code:
# right-hand side of differential equation
def f_vector(t, y_vec, omega0=1E9, ku=2*np.pi/5):
# decompose the phase-space vector y into its components
x, z, vx, vz = y_vec
# prefactor
fac = omega0 * sin(ku*z)
return [vx, vz, -fac*vz, fac*vx]Then, supplying f_vector as the first argument to solve_ivp yields the solution. See the SciPy solve_ivp docs for further information.
Fully relativistic solution with SciPy
Our previous analysis assumed that we could set , which holds in the non-relativistic and mildly-relativistic regime. However, if we want our solution to hold in the relativistic regime, we cannot make this assumption, and must solve with explicitly in the differential equations.
Unfortunately, since the Lorentz factor itself also depends on and , it cannot simply be factored out of the derivative; instead, we must use the expanded form, given by:
Which can be rearranged to yield:
However, since we now have second-order time derivatives, we must perform a reduction of order. We can do this by converting the two differential equations into four first-order differential equations:
Note that , the time derivative of the Lorentz factor, is given by:
Where and (since we have from our system of differential equations). Thus, substituting, we have:
We note that since we can also write our result as follows:
However, our system is still not in the correct form, since we have a term involving time derivatives of on both the left- and right-hand sides for the 4th ODE in the system (the one for ). To see why, we can expand the 4th ODE using our definition of , giving us:
By slight rearrangement, we can resolve our issue by moving the term to the left-hand side, giving us (after multiplying again by ):
Thus, our system of ODEs becomes:
Which can be written in the matrix form as follows:
We can translate this system to Python code as follows:
import numpy as np
c = 3E8 # m/s
electron_charge = -1.602E-19 # coulomb
B0 = 1.2 # tesla
electron_mass = 9.109E-31 # kilograms
# calculate the speed (scalar) from
# a velocity vector
def speed(vx, vz):
return np.linalg.norm([vx, vz])
# calculate the magnitude of the acceleration
# from an acceleration vector
def accel(ax, az):
return np.linalg.norm([ax, az])
# calculate the lorentz factor from the velocity
def lorentz(v, c=c):
return 1/np.sqrt(1 - v**2 / c**2)
# right-hand side of differential equation
def f_vector(t, y_vec,
c=c, v0=0.6*c, q=electron_charge, B0=B0, m=electron_mass):
# decompose the phase-space vector y into its components
x, z, vx, vz = y_vec
v = speed(vx, vz)
# calculate the Lorentz factor
gamma = lorentz(v, c)
# now supply the derivatives
dx_dt = v0
dz_dt = vz
dvx_dt = 0
dvz_dt = vx/(v * vz * gamma**3/c**2 - gamma) * q*B0/m * sin(k0 * x)
return [dx_dt, dz_dt, dvx_dt, dvz_dt]Note: A real electron beam is not a perfect curve and has a nonzero beam cross-section, which is caused by electrons having different energies (and thus different velocities) and some electrons travelling off-centerline. We can simulate this by numerically integrating with different starting positions and with different initial velocities . This gives us multiple trajectories that we can overlay together to get a better picture of what a realistic beam would look like. An alternative approach is detailed when we get to electron gun modelling (which will come later).
Modelling of permanent magnets for undulators
The magnetic field can be found using the magnetostatic equations of motion:
Note: Here is the permeability of the magnets, which can be found on tables of material properties and is also usually provided by the manufacturer that made the magnets. For our purposes we can assume
Analytical and numerical solution
For the undulator, we have so far used a simple analytical expression for the magnetic field , which comes from Jackson. It is given by:
The reason this expression for the field works reasonably well is that we expect the dominant mode in the Fourier expansion of the field to be the fundamental mode. To describe a realistic beam, however, will involve a Fourier series and will depend on and , that is:
Where is the wavevector associated with the -th mode, and where we assume a Gaussian cross-section of the field. It is possible to find the coefficients by either fitting to an experimentally-measured beam or approximating it with some theoretical assumptions, but here we will not do so to avoid needless complexity and verbosity. To be able to find more accurate solutions for fields within the undulator, please see Numerical simulations for magnetostatics.
Electron gun modelling
Understanding electron beams also involves being able to model electron guns, which are what produce electron beams in the first place. Electron guns come in a wide variety of designs, but here we will focus on electrostatic electron guns, and discuss how they can be modelled and simulated. In an electrostatic electron gun, a potential is maintained between a cathode (negatively-charged plate) and anode (positively-charged plate). This potential difference is what “pushes” free electrons between the plates, which can then be collimated to form a beam (see Vacuum tube Lorentz factor calculation for more details). We will explain how to model an (electrostatic) electron gun below.
Modelling electron trajectories through electron gun
The key aim in electron gun modelling is beam tracing: tracing the paths of electrons as they exit the cathode surface and are propelled and collimated into a beam. This is significant because the whole point of an electron gun is to create a collimated beam of free electrons. Since power is proportional to both current and voltage, the more free electrons are in the beam, the more efficient the electron gun will be.
In an electron gun, several key physical mechanisms are at play, which must all be accounted for in a realistic model of an electron gun. First, electrons “boil off” the cathode due to primarily thermionic emission, at which point the electrons have random velocities and are moving in random directions2. To be able to focus the electrons into a beam, a potential is applied. The applied potential difference between the cathode and anode is a constant value , that is:
Note: Be careful to note that while the potential difference is constant, the electric potential itself isn’t! Indeed, if it was, we would have an equipotential surface, meaning that there would be no electrostatic acceleration at all!
Considering the problem in 1 dimension, we may solve for the potential via the boundary conditions3 and , where is the distance between the cathode and anode. Thus, by solving Laplace’s equation for electrostatics (that is, ) in one dimension (in which case it becomes where is the beam’s axis of propagation), one finds that:
Where is the linear potential density (potential per unit length). The applied electric field is thus given by:
However, the applied electric field is not the only field that affects the motion of the electrons. First, we must consider the effects of the electron self-potential, caused by the electrostatic repulsion of the electrons within the beam. This causes the beam to diverge, which requires collimating magnetic lenses to correct for the divergence and collimate the beam. Second, we must model the collimating magnets themselves, in which case we must consider the magnetic term in the Lorentz force law as well as the electric term.
Given the complexity of the dynamics involved, it is easiest to model the magnetic field the electron beam divergence caused by the self-potential as two separate problems. Of course, the underlying assumption is that they are indeed able to be treated as separate systems; mathematically, this assumption is valid if the self-potential-caused beam divergence is minimal over the length scales where the magnetic field is strong. We will assume this for the rest of our discussion.
We will now consider the behavior of the electrons after they boil off the cathode (we’ll discuss what happens prior in a section later down), excluding the electrostatic acceleration from the anode-cathode-potential. The velocity distribution of the electrons are thus encoded in the initial conditions, which is decoupled from their equations of motion. To compute the electron trajectories, we will once again need to use the Lorentz force law, whose most general form is given by:
In the non-relativistic regime, we have:
This is a reasonable approximation if the transverse acceleration of the electrons is generally non-relativistic or mildly-relativistic, which is the case for most electron guns used in free-electron masers. We now consider the electron self-potential caused by electron-electron repulsion in the beam. We may state it as follows:
By tracing the paths of the electrons chosen from different positions across the plate, one may find the general shape of the electron beam. As for their velocities, since the magnitude of the electron velocities must be equal or greater than the work function, the kinetic energy of the electrons is thus (non-relativistically):
Assuming the minimal kinetic energy to overcome the material’s work function and thus allow the electrons within the material to escape, we must have:
The problem can then be solved numerically with suitable assumptions for the initial conditions (for instance, and ). There are different algorithms for this purpose, such as the Barnes-Hut algorithm in electrostatics and the multigrid method for Poisson’s equation. A promising alternative is the particle-in-cell method, commonly used in plasma physics. However, a discussion of all of these algorithms would be far, far too lengthy here. Instead, we will simply show the analytical solution to the problem.
Analytical solution for electron trajectories with self-potential
In the absence of a magnetic field, the only interaction that shapes the electron beam is the inter-electron repulsion, which leads to beam divergence. The analytical solution of the problem, which is valid for both the non-relativistic and relativistic regimes, is given in implicit form by4:
Where is the axis of propagation for the beam, is the beam waist (the initial width of the beam at ), is the ratio of the beam radius to the beam waist, is a constant, and is a dimensionless variable known as the generalized beam perveance, given by5:
Where is the magnitude of the elementary charge, is the permittivity of free space, is the electron rest mass, is the Lorentz factor, is the beam current, and is the electron velocity in the direction. Note that the Lorentz factor can be computed from the beam energy (see Vacuum tube Lorentz factor calculation for more details), and if we assume that the divergence is fairly small () then:
Finally, is defined by the following logarithmic integral:
Note: it is also possible to write the solution in the more familiar (implicit) form with . However, when the beam divergence is very small (on the order of micrometers), this becomes difficult to evaluate numerically, so it is preferred to use the dimensionless variable rather than .
Note that as long as the distance between the cathode and anode is short (i.e. is small), the solution can be approximated via:
In which case it is possible to write out the solution explicitly as a function of , as follows:
This comes from the leading-order term in the series expansion for , which is a Puisseux series in the form:
One may derive this with the substitution 6, . This then gives us:
Where . This integral can be evaluated by means of the following identity:
Where is the incomplete upper gamma function, given by:
In our case, we have and , therefore:
Note that by the properties of the incomplete gamma function, where is the error function and is the complementary error function Thus the above reduces to:
The Maclaurin series of the error function is given by:
Thus we have:
And thus:
Thus, the solution of the integral can be written in series form as:
And thus, to leading-order, we obtain the following approximation, which we may then substitute into :
Magnetic lens modelling
Now, as the electrons pass through the magnetic lens comprised of 2 sextupole magnets, we also need to factor in the effect of the magnetic field. Here it is easiest to work with the (magnetic) vector potential rather than the magnetic field ; they are related by . In our case, the vector potential satisfies the differential equation:
This is simply Laplace’s equation for magnetostatics, and it can be solved via the multipole expansion. In polar coordinates one finds that the vector potential takes the form:
Where are some constants determined by the boundary conditions. This polar form is useful because the sextupole magnet is rotationally-symmetric. We will ignore the component here since it turns out it is unimportant.7
Note: See a visualization of the magnetic vector potential at https://www.math3d.org/DSWoli41Gv. Note that the magnetic field is always perpendicular to the vector potential .
The equations of motion are easiest to find from the electromagnetic Hamiltonian, which may be written in terms of the position and canonical momentum as follows:
This gives you Hamilton’s equations, a system of two first-order differential equations, which are respectively given by:
Excluding the electric potential (since we are considering only the effects of the magnetic lens) and noting that is time-independent (since we are considering only magnetostatics), we have:
Note that since , the first-order equations obtained from the Hamiltonian approach end up exactly equivalent to the Lorentz force law. Now expanding with the formulas for the curl in polar coordinates8, we obtain a system of differential equations for , given by:
Where , , and:
It should be more than obvious that this system is impossible to solve analytically without a slew of approximations. However, it can be solved numerically using the same techniques as described previously for the undulator beam.
Note: See
notebooks/magnetic-lens-calculations.ipynbfor the derivation of the equations of motion in explicit form.
Thermocathode modelling
The last part, which we have left out so far, is how the electrons are ejected from the first place from the cathode prior to being collimated into a beam. This is a complex topic, so it is out of scope for this page, but please see Thermocathode design for electron gun for more details.
Software implementation of numerical simulations
For our simulations of the undulator, we use OSCARS (an open-source specialized electron beam/undulator modelling software from Brookhaven). OSCARS has an advanced beam-tracing algorithm that calculates the magnetic fields and beam trajectories inside an undulator. However, we also use our own custom-written codes. The simulations are all open-source and can be found here here.
References
- OSCARS reference examples
- Magnetic field modelling (also includes information on how to load magnetic fields from external softwares)
- Undulator electron trajectory simulations
- Particle beam modelling (this also includes multi-particle beam modelling, which is very important for our use case)
Footnotes
-
We substituted in into and then substituted in to obtain this result. ↩
-
Note that electrons that “boil off” the cathode are initially randomly-spread out and have a wide distribution of velocities (and thus kinetic energies) that is roughly a Gaussian distribution (see Guide to modelling lasers and masers for more details), although more accurately it is a Fermi-Dirac distribution given that electrons are fermions. ↩
-
Technically speaking, since the cathode is negatively-charged and the anode positively-charged (with equal charges on both), we would have and . However, since the electric potential is arbitrary and only the potential difference can be measured, we simply add the constant to make the problem nicer to work with (without changing the physics). ↩
-
This result comes from the following COMSOL tutorial, which itself references the book Charged Particle Beams by Stanley Humphries. Also, the Wikipedia article on charged particle beams may be useful reading. ↩
-
Some other texts (including this document from CERN’s accelerator school, see eq. 24) write out the formula with , where . This form is reasonable if the beam is paraxial (i.e. does not diverge too much) such that . ↩
-
As suggested by this Physics forum article. ↩
-
Discussed on pg. 23 of the lecture notes from the US particle accelerator school ↩
-
See this Wikipedia article, which lists the vector differential operators in Cartesian, cylindrical, and spherical coordinates. ↩