Modelling dependence of magnetic memory effect on plastic deformation in ferromagnetic materials