## 1 Introduction  
Residual stress refers to the stress remaining inside materials after the manufacturing process when they are not in use and are not subjected to any thermal gradients or external loads. Engineering properties of industrial equipment, notably brittle fracture, corrosion resistance, dimensional stability, distortion, and fatigue life, can be significantly affected by residual stress [1]. Residual stress is also a factor affecting the fatigue and fracture characteristics of rails. This stress is formed during the manufacturing and heat treatment of the rails, and it is also caused by vertical loads applied to a wheel due to the weight of the vehicle it supports. Rail damage tends to accelerate under conditions where the number of passes continues to increase and the speed of passing vehicles is above a certain level. Therefore, techniques to evaluate and analyze the residual stress in rails accurately are very important because this can have a direct effect on accidents affecting safety. Residual stress measurement is a very important step in structural design and fabrication, as well as in safety assessment of mechanical equipment under operating conditions. There are several ways of measuring stress, and these can be divided into two main categories: destructive and nondestructive [2]. To determine the mechanical strength of a rail in service, it is very important to use non-destructive methods to determine what level of residual stress is in the rail [3,4]. Non-destructive methods, including ultrasonic [5], neutron diffraction [6], X-ray diffraction [7], magnetic and electro-magnetic methods [8; 9; 10], measure some parameters commonly associated with stress because rails must be prevented from serious damage or failure through periodic inspection. It should be noted that there is no absolute way to give full satisfaction via non-destructive measurement of the stress of a rail. Therefore, when selecting a technique suitable for rail inspection, many parameters must be considered: shape, material, surface quality, temperature, time, inspection cost, and measurement accuracy. Ultrasonic testing for stress measurement has the advantages of being safe, fast, relatively inexpensive, easy to use, and non-destructive. Comparing with previously cited methods for measuring stress, the instrument is convenient to use, quick to install, easy to carry, inexpensive, and has high spatial resolution and a wide range of measurement depth. In addition, it has an advantage compared to the X-ray diffraction method in that there is no radiation damage to the human body. Unlike magnetic and electro-magnetic methods, it can be applied to non-ferromagnetic objects and can obtain a stress gradient. Propagation of ultrasonic waves in a solid medium is affected by the stresses in the medium, and this property allows the internal stress to be measured non-destructively. When ultrasonic waves propagate in a fixed acoustic path, the time-of-flight (TOF) of the waves exhibits a linear relationship with material stress in the elastic region. Within the elastic limits, this correlation is termed the acoustoelastic effect, indicating that the TOF of the ultrasonic wave varies depending on stress. Stress in materials can be measured using ultrasound based on this linear relationship between the ultrasonic wave speed and the material stress. However, most of the research on ultrasound has limited industrial applications. This is because characteristics of ultrasonic wave propagation are influenced by multiple factors, including temperature [11], water environment [12; 13], material texture [14; 15], particle size [16; 17], structure [18; 19], and coupling conditions [20; 21]. Internal stress measurements by ultrasonic testing can be classified into three methods depending on the type of waveform used [5]. The first method is to use the TOF for only longitudinal waves to measure internal stress. The second method uses not only longitudinal but also transverse waves.