  We study the formation of vortices in a dilute Bose-Einstein condensate
confined in a rotating anisotropic trap. We find that the number of vortices
and angular momentum attained by the condensate depends upon the rotation
history of the trap and on the number of vortices present in the condensate
initially. A simplified model based on hydrodynamic equations is developed, and
used to explain this effect in terms of a shift in the resonance frequency of
the quadrupole mode of the condensate in the presence of a vortex lattice.
Differences between the spin-up and spin-down response of the condensate are
found, demonstrating hysteresis phenomena in this system.
