Substitutional Impurities: Introduction and Exploration
A substitutional impurity is when one of the atoms in the crystal is not of the same type as the others. It "substitutes" for one of them, occupying the same lattice site as the main atoms of the crystal.
NetLogo model 1.5.1 below is a molecular dynamics model of a crystal with a single substitutional impurity atom. You can increase and decrease its size, and its relative size compared to the atoms of the host lattice is displayed next to it (it starts with a size of 1, i.e., the same as the other atoms).
The way this is modeled is that instead of a single $\sigma$ parameter in the Lennard-Jones potential (Eq. 1.2.1), each atom $i$ has its own $\sigma_i$ and the interatomic potential between two atoms, $i$ and $j$ is calculated using the average: $\sigma = \frac{\sigma_i + \sigma_j}{2}$.
Note also, in this model, temperature (and therefore kinetic energy) is held constant at the value of the temp slider. This means that the velocities of the atoms are scaled each time step so that the average kinetic energy of the atoms results in the set temperature.