As is known, the Lorentz formula can be used to calculate the local electri
c field at atoms on cubic lattice sites and to calculate the electrical pol
arization of the lattice. While in this case the lattice consists of only o
ne species of atoms, the present article describes a numerical method to ca
lculate the local field and the polarization of materials with two species
of atoms in a lattice of finite size. The atoms are different with respect
to their polarizabilities. To calculate the local fields in a finite system
of dipoles embedded between electrodes, the method of images is used. In a
ddition, the effect of the electrodes with their image dipoles on the polar
ization is investigated for the case of identical atoms, i.e., atoms with t
he same polarizability: an air gap between the dipole lattice and one of th
e two electrodes is assumed and varied, and the local fields and induced mo
ments on the lattice sites are calculated.