The relation between dislocation density and stress