# Study of Heat Distribution in Railway Switch Using Resistive Heater in Cold Climate Conditions
## 2 Materials and Methods
The experimental results gained from the thermocouples and infrared thermography of the rail track were compared with the simulation model. For that purpose, a 2D rail track geometry surrounded by cool air was modeled in MATLAB(r)2022a and analyzed under heat transfer equations of conduction and convection. Conduction is supposed to take place over metallic rail tracks while natural convection occurs in the air. The rail cross-section model used in the MATLAB simulation is shown in Figure 4.  
The distribution of conductive heat transfer over a spatial domain with the transition of time can be expressed by a 2 nd order differential equation:  
\[\frac{\partial\Gamma}{\partial t}=\alpha\bigg{(}\frac{\partial^{2}\Gamma}{ \partial x^{2}}+\frac{\partial^{2}\Gamma}{\partial y^{2}}\bigg{)};\left\{ \begin{aligned} &\text{t}\geq 0\\ & 0\leq\text{x}\leq\text{L}\\ & 0\leq\text{y}\leq\text{W}\end{aligned} \right. \tag{1}\]  
where \(\alpha\) is the diffusion coefficient of the material, t is the time, and (x,y) are spatial dimensions for length (L) and width (W). The solution for this transient heat equation can be obtained for a finite time if initial conditions (at t = 0) and boundary conditions at (x,y) = (0,0) and (x,y) = (L,W) are known. In order to solve this partial differential equation, it was discretized using the finite difference method, which meshes the whole surface geometry and transforms continuous time derivatives into difference equations to calculate the solution at all mesh nodes. There are different explicit and implicit integration schemes for finite difference discretization, such as Forward Time-Centered Space (FTCS), Backward Time-Centered Space (BTCS), and Crank-Nicolson. These schemes leverage each other in terms of temporal truncation error, computational effort, and sensitivity towards the selection of time step (\(\Delta\)t) and spatial domain step (\(\Delta\)x, \(\Delta\)y). FTCS was chosen in the case of rail heat transfer as the geometry was simple, and extra computational effort was not required. The transient term for rate of \begin{table}
\begin{tabular}{c c c} \hline \hline
**Scenarios** & **Initial Temperature (K)** & **Target Temperature (K)** \\ \hline
1 & 268 & 278 \\
2 & 253 & 278 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Scenarios for lab experiments. Figure 4: Schematic overview of rail geometry from MATLAB model. heat transfer (\(\partial\Gamma\partial\mathrm{t}\)) was replaced by forward difference and spatial terms for heat transfer rate (\(\partial\Gamma\partial\mathrm{x}\), \(\partial\Gamma\partial\mathrm{y}\)) were replaced with central difference terms, i.e.,:  
\[\frac{\mathrm{T}_{\mathrm{ij}}^{\mathrm{t+1}}-\mathrm{T}_{\mathrm{ij}}^{ \mathrm{t}}}{\Delta\mathrm{t}}=\alpha\Bigg{(}\frac{\mathrm{T}_{\mathrm{i+1} \mathrm{j}}^{\mathrm{t}}-2\mathrm{T}_{\mathrm{ij}}^{\mathrm{t}}+\mathrm{T}_{ \mathrm{i-1}\mathrm{j}}^{\mathrm{t}}}{\left(\Delta\mathrm{x}\right)^{2}}+ \frac{\mathrm{T}_{\mathrm{i,j+1}}^{\mathrm{t}}-2\mathrm{T}_{\mathrm{ij}}^{ \mathrm{t}}+\mathrm{T}_{\mathrm{ij-1}}^{\mathrm{t}}}{\left(\Delta\mathrm{y} \right)^{2}}\Bigg{)} \tag{2}\]  
\[\mathrm{T}_{\mathrm{i,j}}^{\mathrm{t+1}}=\mathrm{T}_{\mathrm{i,j}}^{\mathrm{t}} +\alpha\Bigg{(}\frac{\mathrm{T}_{\mathrm{i+1}\mathrm{j}}^{\mathrm{t}}-2 \mathrm{T}_{\mathrm{ij}}^{\mathrm{t}}+\mathrm{T}_{\mathrm{i-1}\mathrm{j}}^{ \mathrm{t}}}{\left(\Delta\mathrm{x}\right)^{2}}+\frac{\mathrm{T}_{\mathrm{i,j+ 1}}^{\mathrm{t}}-2\mathrm{T}_{\mathrm{i,j}}^{\mathrm{t}}+\mathrm{T}_{\mathrm{ i,j-1}}^{\mathrm{t}}}{\left(\Delta\mathrm{y}\right)^{2}}\Bigg{)}\Delta \mathrm{t} \tag{3}\]  
where subscript i, j denote computational points in the spatial domain (x, y plane), (\(\Delta\mathrm{x}\), \(\Delta\mathrm{y}\)) formulate the mesh spacing, and \(\Delta\mathrm{t}\) is the time step for simulation. The solution for FTCS methodology resembles that of a hyperbolic differential equation, which can become unstable for certain values of \(\alpha\), \(\Delta\mathrm{x}\), \(\Delta\mathrm{y}\), \(\Delta\mathrm{t}\).