  Using the Remler formalism for the creation of composed particles, we study
charmonium production both in thermalized and thermalizing boxes, which contain
charm and anticharm quarks. The thermalizing box studies include the lowering
of the box temperature, the spatial diffusion of charm and anticharm quarks,
which are initially confined in the central region, as well as the combination
of both, what imitates heavy-ion collisions. Comparing numerical and analytical
results we demonstrate that the rate of the original Remler formalism has to be
supplemented by two rates to obtain, for $t\to \infty$, results, which are
consistent with the statistical model predictions: i) a rate, which takes into
account the temperature dependence of the Wigner density of the quarkonium
during the expansion and, in the case that a heavy quark potential is not
implemented in the Monte Carlo approach, ii) a rate which comes from the change
of the relative distance between the heavy quark and antiquark. These results
provide the basis for future applications of the Remler formalism to heavy-ion
collisions.
