Monte Carlo simulations in EM

Electron microscopy is based in the interaction of an electron beam with a solid (in most cases). For the quantification, the interpretation or the investigation of the images or spectra that you collect, it is necessary to be able to describe how a beam of electrons interacts with the specimen. One way of doing this is by using computer simulations. In an older post I mentioned the software CASINO of Shelbroke University which is a free fully functional program with a Graphical User Interface that can be used for performing Monte Carlo simulations of electron interactions with solids.

Nonetheless, if as a researcher you want to study your own particular problems, although CASINO is a very useful and flexible program it is also a black box.

In this post I present Monte Carlo Modeling for electron Microscopy and Microanalysis of DC JOY, a wonderful book that describes some simple physical principles and the mathematical technique of Monte Carlo (or random-number) sampling (see description in Bookshelf) .

Book electron microscopy

Book electron microscopy

When an electron impacts on a sample several types of interactions can occur. The electron can be deflected through elastic collisions. Alternatively, the electron suffer an inelastic interaction and cause the ionization of an atom by removing an inner-shell electron from its orbit, so producing a characteristic x-ray or an ejected Auger electron; the electron could have a collision with a valence electron to produce a secondary electron or to activate plasmonic waves; it could interact with the crystal lattice of the solid to generate phonons vibrations. The incident electron then can lose energy and/or change its direction of travel. After the event can travel a further distance and interact again changing its direction and/or its energy. This process continues until either the electron gives up all its energy to the solid and comes to thermal equilibrium with it or until it manages to escape from the solid in some way. This process is deterministic but random and different for different incident electrons, i.e., every incident electron would experience a different set of scattering events. Since, in a typical electron microscope there are actually about 108-1010 electrons impinging on the sample each second, it is clear that there is not likely to be any simple or compact way to describe the innumerable interactions that can occur at a microscopic level. Nonetheless, Monte Carlo simulations combine probabilities and random numbers to simulate multiple electron-sample interactions and to deal with this type of problems.


The book of DC Joy provides a practical rather than a theoretical guide to Monte Carlo simulations  using two alternative models called the single and the plural scattering models. Then these methods are used for the modeling of important phenomena in electron microscopy with a focus in solving real problems:

  1. Generation of secondary electrons, that can be used for understanding signals in scanning electron microscopy (SEM) and to quantify radiation-induced electrostatic charging.
  2. Backscattered electrons, which are used frequently to form images in SEM.
  3. Electron-hole pairs generation, which is important in solid-state detectors typically used in scanning modes, and more recently also in pixelated direct detectors.
  4. X-ray production what is the main source of chemical information for microanalysis using Energy Dispersive x-ray Spectroscopy (EDXS). Factor such as depth profiles of x-ray generation, spatial resolution degradation and Bremsstrahlung are discussed.

The book contains many routines written in TURBO PASCAL that are fully functional and that with a bit of effort can be translated to other languages.

I have written a routine for being executed with Matlab. The program (download from here) allows to simulate electron trajectories inside a sample using the single scattering model. Several parameters can be changed including:

  1. Atomic number,
  2. atomic mass,
  3. density of the sample,
  4. thickness of the sample,
  5. energy of incident electrons,
  6. number of incident electrons to simulate

First lined of the Matlab program:

% Lionel C Gontard, 2 March 2016
%based on the book of DC Joy
Z=14; %atomic number Silicon
Ein=30; %Incoming energy E in keV
A=28;%Atomic weight g/mole
ro=2.3;%density in gr/cm3
traj_num=40;%number of trajectories or electrons
thick=8000;%Thickness of the sample in A
dotf=1;%draw trayectories on the fly. 1=YES slow, 0=NO fast


The single scattering model can be used for simulating also the generation of secondary electrons (SE) and for tracking their trajectories until they are completely absorved or they leave the sample.

Tracking of secondary electrons using Monte Carlo simulations

Tracking of secondary electrons using Monte Carlo simulations

The yellow dot in the figure on the left is a SE that escapes the boundaries of the sample. If there is not a conductive path that connect the sample with a spource of charge, the sample becomes charged with a positive charge +q (being q the charge of one electron).


Below, you can see a video of the tracks of  electrons in Silicon that includes the generation and tracking of fast secondary electrons.




2 thoughts on “Monte Carlo simulations in EM

  1. Hi,

    This is Datong. Your program is very helpful. Thanks for sharing it. However, there is a bug in there.

    if zn<=0

    Actually, you did that at the end. So you don't need to add the num here. This will make the total yield smaller than expected.


    1. Dear Datong, thanks for your comment. You are right, the global while loop already updates the variable num.
      All the best


Leave a Reply

Your email address will not be published.