Starting from first principles we simulate numerically the dynamics of a sy
stem of two-level atoms interacting with a multimode electromagnetic field
in a one-dimensional cavity. in particular, we investigate the spontaneous
emission of an excited two-level atom in the cavity. We show how the decay
depends on the mode spectrum and on the position of the atom in the cavity.
We study how the spontaneous emission is modified when the initially excit
ed atom is surrounded by a material medium modeled as a system of two-level
atoms. We also study the propagation of photon wave packets emitted by the
atom within the material media. Our microscopic model provides us with a d
eeper understanding of the atom-field interaction and offers us a framework
for a systematic investigation of the transition from a microscopic to a m
acroscopic (phenomenological) description of the spontaneous decay in mater
ial media (e.g.. dielectrics).