  We simulate the ordering of vortices and its effects on the critical current
in superconductors with varied vortex-vortex interaction strength and varied
pinning strengths for a two-dimensional system. For strong pinning the vortex
lattice is always disordered and the critical depinning force only weakly
increases with decreasing vortex-vortex interactions. For weak pinning the
vortex lattice is defect free until the vortex-vortex interactions have been
reduced to a low value, when defects begin to appear with a simultaneous rapid
increase in the critical depinning force. In each case the depinning force
shows a maximum for non-interacting vortices. The relative height of the peak
increases and the peak width decreases for decreasing pinning strength in
excellent agreement with experimental trends associated with the peak effect.
We show that scaling relations exist between the distance between defects in
the vortex lattice and the critical depinning force.
