Three-dimensional PBCs are useful for approximating the behavior of macro-scale systems of gases, liquids, and solids. Three-dimensional PBCs can also be used to simulate planar surfaces, in which case two-dimensional PBCs are often more suitable. Two-dimensional PBCs for planar surfaces are also called
slab boundary conditions; in this case, PBCs are used for two Cartesian coordinates (e.g., x and y), and the third coordinate (z) extends to infinity. PBCs can be used in conjunction with
Ewald summation methods (e.g., the particle mesh Ewald method) to calculate
electrostatic forces in the system. But PBCs also introduce correlational artifacts that do not respect the translational invariance of the system, requiring constraints on the composition and size of the simulation box. In simulations of solid systems, the
strain field arising from any inhomogeneity in the system will be artificially truncated and modified by the periodic boundary. Similarly, the wavelength of sound or shock waves and
phonons in the system is limited by the box size. In simulations containing ionic (Coulomb) interactions, the net
electrostatic charge of the system must be zero to avoid summing to an infinite charge when PBCs are applied. In some applications it is appropriate to obtain neutrality by adding
ions such as
sodium or
chloride (as
counterions) in appropriate numbers if the molecules of interest are charged. Sometimes ions are even added to a system in which the molecules of interest are neutral, to approximate the
ionic strength of the solution in which the molecules naturally appear. Maintenance of the minimum-image convention also generally requires that a spherical cutoff radius for nonbonded forces be at most half the length of one side of a cubic box. Even in electrostatically neutral systems, a net
dipole moment of the unit cell can introduce a spurious bulk-surface energy, equivalent to
pyroelectricity in
polar crystals. Another consequence of applying PBCs to a simulated system such as a liquid or a solid is that this hypothetical system has no contact with its "surroundings", due to it being infinite in all directions. Therefore, long-range energy contributions such as the
electrostatic potential, and by extension the energies of charged particles like electrons, are not automatically aligned to experimental energy scales. Mathematically, this energy level ambiguity corresponds to the sum of the electrostatic energy being dependent on a surface term that needs to be set by the user of the method. The size of the simulation box must also be large enough to prevent periodic artifacts from occurring due to the unphysical topology of the simulation. In a box that is too small, a macromolecule may interact with its own image in a neighboring box, which is functionally equivalent to a molecule's "head" interacting with its own "tail". This produces highly unphysical dynamics in most macromolecules, although the magnitude of the consequences and thus the appropriate box size relative to the size of the macromolecules depends on the intended length of the simulation, the desired accuracy, and the anticipated dynamics. For example, simulations of
protein folding that begin from the
native state may undergo smaller fluctuations, and therefore may not require as large a box, as simulations that begin from a
random coil conformation. However, the effects of
solvation shells on the observed dynamics – in simulation or in experiment – are not well understood. A common recommendation based on simulations of
DNA is to require at least 1 nm of solvent around the molecules of interest in every dimension. == Practical implementation: continuity and the minimum image convention ==