Energy approach to the problem of calculating the stresses at the initial stages of plastic deformation of crystalline substances and the appearance of structural defects