  In this work we investigate the dynamical Casimir effect in a nonideal cavity
by deriving an effective Hamiltonian. We first compute a general expression for
the average number of particle creation, applicable for any law of motion of
the cavity boundary. We also compute a general expression for the linear
entropy of an arbitrary state prepared in a selected mode, also applicable for
any law of motion of the cavity boundary. As an application of our results we
have analyzed both the average number of particle creation and linear entropy
within a particular oscillatory motion of the cavity boundary. On the basis of
these expressions we develop a comprehensive analysis of the resonances in the
number of particle creation in the nonideal dynamical Casimir effect. We also
demonstrate the occurrence of resonances in the loss of purity of the initial
state and estimate the decoherence times associated with these resonances.
