Modeling of Elastic Deformation of Multilayers Due to Residual Stresses and External Bending