  Using a two-component model for charmonium production, which includes
contributions from both the initial hard nucleon-nucleon scattering and from
the regeneration in the quark-gluon plasma, we study the nuclear modification
factor $R_{AA}$ and elliptic flow $v_2$ of $J/\psi$ in relativistic heavy ion
collisions. For the expansion dynamics of produced hot dense matter, we
introduce a schematic fireball model with its transverse acceleration
determined from the pressure gradient inside the fireball and azimuthally
anisotropic expansion parameterized to reproduce measured $v_2$ of light
hadrons. We assume that light hadrons freeze out at the temperature of 120 MeV
while charmonia at 160 MeV, similar to the kinetic and chemical freeze-out
temperatures in the statistical model, respectively. For the properties of
charmonia in the quark-gluon plasma, we use the screening mass between their
charm and anticharm quarks and their dissociation cross sections given by the
perturbative QCD (pQCD) in the leading order and up to the next-to-leading
order, respectively. For the relaxation time of charm and anticharm quarks in
the quark-gluon plasma, we also use the one calculated in the leading order of
pQCD. Modeling the effect of higher-order corrections in pQCD by introducing
multiplicative factors to the dissociation cross section of charmonia and the
elastic scattering cross sections of charm and anticharm quarks, we find that
this effect is small for the $R_{AA}$ of $J/\psi$ as they suppress the number
of initially produced $J/\psi$ but enhance the number of regenerated ones. The
higher-order corrections increase, however, the $v_2$ of $J/\psi$. Our results
suggest that the $v_2$ of $J/\psi$ can play an important role in discriminating
between $J/\psi$ production from the initial hard collisions and from the
regeneration in the quark-gluon plasma.
