The problem of increasing the thermal stability of structural elements made of heat-resistant metals and alloys operating in a complex force and thermal field is one of the key priorities of modern high technology research. The most important case is the study of the thermal stability of structural elements in real conditions of heat fluxes with varying intensity, with a complex configuration of heat-insulated local surfaces and internal point heat sources. Many basic load-bearing structural elements operating in a large thermal field (elements of gas turbine and jet engines, etc.), are made of heat-resistant alloys. The physical feature of such alloys is that the coefficient of thermal expansion and the modulus of elasticity of the material strictly depends on the temperature distribution field, that is, the coefficients are a function of temperature. The purpose of this study is to simulate a thermo-stressed state in rod elements of a structure based on the law of conservation of energy, in the presence of a heat flux applied on the lateral surface, which varies along the coordinate in a linear manner. To solve the outlined problem, a potential energy minimisation method is used in combination of a quadratic finite element with three nodes. As a result, from the condition of the minimum of the functional defining the potential energy, a resolving system of linear algebraic equations is obtained. All possible natural boundary conditions are taken into account. In this system, all integrals used are calculated analytically. Moreover, the law of conservation of energy is fulfilled for each of the equations of the resulting system. As a result, the values of displacement, deformation and stresses were calculated, as well as the values of elastic temperature and thermoelastic components of deformations and stresses for a specific example.