## 4 Numerical Simulations and Measurements  
The principle of monitoring stresses in the real time of diffusion processes (according to Figure 3) has been verified. This verification consisted in comparing the stress values obtained from measurements of glass samples after diffusion processes with the results of a real-time simulation. The measurements were made using the m-line method mentioned above. The effective refractive indexes for TM and TE polarization were determined and the stress values were specified based on (6). The calculation method is shown in Figure 7.  
Figure 6: The exponents matched for the Equation (10) and the determined parameters for the model of short-range stress relaxation (\(\beta\) = 3/5) and structural relaxation (\(\beta\) = 3/7). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Process Number** & **Average Temperature (\({}^{\circ}\)C)** & **Time (h)** & \(\sigma(0,t_{diff})\) **(MPa)** \\ \hline
1 & 400.2 & 24 & 742.8 \\
2 & 399.5 & 96 & 740.4 \\
3 & 399.4 & 144 & 692.1 \\
4 & 399.1 & 216 & 683.9 \\
5 & 399.2 & 264 & 654.3 \\
6 & 399.4 & 312 & 635.0 \\
7 & 399.7 & 360 & 624.3 \\
8 & 399.7 & 432 & 601.4 \\
9 & 399.6 & 504 & 588.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The parameters of long-term K\({}^{+}\)\(\leftrightarrow\)Na\({}^{+}\) ion exchange processes in BK7 glass. The \(N^{\prime}_{TE1}\) values (visible in Figure 7) were calculated using linear interpolation. For each sample, a set of values \(\{x_{i},|\sigma(x_{i})|\}\) for \(i\) = 0..m was obtained, where m is the maximum TM mod row adopted for the calculation. Such calculations are possible for processes that result in multimode waveguides. Figure 8a shows an example of comparison of the measurement results with the final course of the \(\sigma\)(x) function, simulated during the process of diffusion doping of BK7 glass with K\({}^{+}\) ions. The duration of the diffusion process was 91 h and the average temperature of the process was 413.1 \({}^{\circ}\)C. The produced waveguide supported 10 TM and 10 TE modes. The calculations shown in Figure 8a were made in this case for 9 TM modes. Figure 8b shows the recorded course of the process temperature. In the simulation process in the Equation (11) the \(\beta\) = 3/5 exponent was assumed. As can be seen in Figure 8a, the final result of the numerical simulation is in a very good agreement with the measurement results. Figure 9a shows similar comparisons for three diffusion processes carried out in the following conditions: (1) \(t_{diff}\) = 30 h; \(T_{ave}\) = 400.3 \({}^{\circ}\)C, (2) \(t_{diff}\) = 72 h; \(T_{ave}\) = 399.8 \({}^{\circ}\)C and (3) \(t_{diff}\) = 240 h; \(T_{ave}\) = 399.0 \({}^{\circ}\)C. The uncertainties \(\Delta\sigma\) calculated on the basis of measurements were also marked there. A good compliance between the numerical simulations and the results of the final measurements occurs here as well. Also, in these simulations, the exponent \(\beta\) = 3/5 was assumed in the Equation (11). Figure 8: A comparison of the measurement results (\(\lambda\) = 677 nm) with simulation calculation of the \(\sigma\)(x) function (**a**). The time course of the process temperature (**b**). Figure 7: The method of calculating stresses based on the measurements of effective refractive indices of the modes. Figure 9b presents the results of the simulation of the \(\sigma(x)\) function in the case of heating processes. These processes were carried out for a sample of glass previously subjected to a diffusion process with a duration \(t_{diff}\) = 72 h. The \(\sigma(x)\) function for this sample is shown in Figure 9a. After the diffusion process the sample was cut into three pieces and each of them was subjected to heating where the average value of the temperature was 400 \({}^{\circ}\)C. As can be seen from the results presented in Figure 9b, the simulation's compliance with the measurement results is slightly worse here than in the case of diffusion processes.