We propose a phenomenological model that accounts for the history effects observed in ac susceptibility measurements in YBa2Cu3O7 single crystals [Phys. Rev. Lett. 84, 4200 (2000) and Phys. Rev. Lett. 86, 504 (2001)]. Central to the model is the assumption that the penetrating ac magnetic field modifies the vortex lattice mobility, trapping different robust dynamical states in different regions of the sample. We discuss in detail on the response of the superconductor to an ac magnetic field when the vortex lattice mobility is not uniform inside the sample. We begin with an analytical description for a simple geometry (slab) and then we perform numerical calculations for a strip in a transverse magnetic field which include relaxation effects. In calculations, the vortex system is assumed to coexist in different pinning regimes. The vortex behavior in the regions where the induced current density j has been always below a given threshold (j_c^>) is described by an elastic Campbell-like regime (or a critical state regime with local high critical current density, j_c^>). When the VS is shaken by symmetrical (e.g. sinusoidal) ac fields, the critical current density is modified to j_c^< (which is smaller than j_c^>) at regions where vortices have been forced to oscillate by a current density larger than j_c^>. Experimentally, an initial state with high critical current density (j_c^>) can be obtained by zero field cooling, field cooling (with no applied ac field) or by shaking the vortex lattice with an asymmetrical (e.g. sawtooth) field. We compare our calculations with experimental ac susceptibility results in YBa2Cu3O7 single crystals.