We demonstrate for the first time an observation of the peak effect in
simulations of magnetic vortices in a superconductor. The shear modul
us c(66) of the vortex lattice is tuned by adding a fictitious attract
ive short-range potential to the usual long-range repulsion between vo
rtices. The peak effect is found to be most pronounced in low densitie
s of pinning centers, and is always associated with a transition from
elastic to plastic depinning. The simulations suggest in some situatio
ns that over a range of values of c(66) the production of lattice defe
cts by a driving force enhances the pinning of the lattice.