This article presents a study of the viscoelastic behavior of an epoxy polymer and a glass-reinforced composite based on it under cyclic thermomechanical loading. The goal is to model and explain the experimentally observed stress state formation, including the accumulation of residual stresses under various initial mechanical stress levels and heating/cooling cycle durations. An improved material model, implemented as a Python script, is used, allowing for the consideration of memory effects on thermomechanical loading depending on the level and nature (mechanical or thermal) of the initial stresses. A Python script was developed to determine the viscoelastic parameters (elastic modulus E