The Two-Dimensional Conduction Heat Transfer Equation on a Square Plate: Explicit vs. Crank-Nicolson Method in MS Excel Spreadsheet

In this paper, the two-dimensional conduction heat transfer equation on a square plate is analyzed using a finite difference method. We have developed both the forward time-centered space (FTCS) and Crank-Nicolson (CN) finite difference schemes for the two-dimensional heat equation, employing Taylor series. Subsequently, these schemes were employed to solve the governing equations. The primary objective of this study is to compare the efficiency of the two methods in solving the conduction heat transfer equation. This was accomplished by implementing Spreadsheet Excel instructions. The results are presented, highlighting a comparison between the exact and approximate solutions. Furthermore, to demonstrate the convergence of the numerical schemes, we estimated the error between the actual and approximate solutions for a specific numerical problem and presented the results graphically. The data utilized in this research included the thermal conductivity of the medium of the square plate concerning width, grid, and compliance with initial and boundary conditions. The findings indicate that the Crank-Nicolson method is more accurate than the forward time-centered space method, as it approaches the exact solution more effectively. Furthermore, this study confirms that the solution and simulation of the heat transfer equation on a square plate can be accurately performed using an Excel spreadsheet as well as other numerical software.


Introduction
Heat transfer is a process in which heat moves from one part of a material to another due to a temperature difference.Heat transfer can occur through convection, conduction, and radiation [1,2].Conduction heat transfer refers to the phenomenon where thermal energy is transmitted through a medium (including solids, liquids, or gases) without any significant displacement of the medium itself.In more basic terms, it involves the movement of energy from particles with higher energy levels to those with lower energy levels within a material due to interactions among the particles.Conduction heat transfer is the mechanism by which thermal energy is exchanged between two objects when they are in direct contact with each other [3,4].
Heat transfer in two dimensions can be determined using both analytical and numerical methods [5].Numerical methods are flexible and effective in addressing complex transient heat transfer problems [6].One of the numerical methods that can be employed to solve heat equations is the finite difference method.The finite difference method can transform partial differential equations into a system of linear equations by discretizing the continuous heat equation into a discrete finite difference form using Taylor series.In solving heat transfer equations using the finite difference method, there are two approaches that can be employed: 1) The explicit finite difference method, which utilizes the Taylor series expansion with forward differences for (,  + ∆) around the point  and central differences for ( + ∆, ) and ( − ∆, ) around the point , and 2) The implicit finite difference method, which employs the Taylor series expansion with backward differences for (, ) around the point  + ∆ and central differences for ( + ∆,  + ∆) and ( − ∆,  + ∆) around the point  [7,8,9].
One commonly used numerical method for solving heat transfer equations is the Crank-Nicolson method [10].The extensive adoption of the Crank-Nicolson method for solving heat transfer equations is grounded in the observation that, in certain instances, numerical solutions obtained through the explicit finite difference method display instabilities that can be resolved by employing the Crank-Nicolson method for numerical computations.The Crank-Nicolson method has been demonstrated to possess greater stability compared to the explicit finite difference method and is capable of determining both the expected and extreme values within the context of heat transfer equations [11,12,13].
In this study, the heat transfer process in the form of two-dimensional heat conduction is considered.It is done by comparing the numerical calculation results of the explicit method and the Crank-Nicolson method.All calculation processes are done by utilizing MS Excel Spreadsheet.In the end, the numerical calculation results are then compared with the analytical calculation result.

Method
In our model problem, we consider the two-dimensional time-dependent heat equation [14,15]: Where Γ = (0, ) and Ω = (0,1) with initial condition: while the boundary condition is set on  = 0 at  = 0 for all ,  = 0 at  =  for all ,  =  1 at  = 0 for 0 ≤  ≤ , and  = 0 at  =  for 0 ≤  ≤ . Figure 1 shows the details on the boundary condition used in this study.In Eq. ( 1),  represents thermal conductivity,  denotes temperature, and the solution of the equation, which is a function of both space (in two dimensions) and time.Additionally,  and  signify the directions of heat transfer in two dimensions, while  represents time.To describe finite difference techniques, let's consider the rectangular domain Ω × Γ and divide it into a finite number of nodes (  ,   ), where Ω represents the spatial domain, and Γ represents the temporal domain.We aim to develop an approximation of the finite difference equation of Eq. ( 1), wherein the differential form is discretized using Taylor expansion [16]: (1)   + (ℎ) 2   2!  (2) The first order differentiation of eq.(3) become: In this study, a computational analysis was conducted to solve the two-dimensional conduction heat equation on a square plate.Two numerical methods were compared: the explicit or Forward Time Center Space method and the Crank-Nicolson method.The results obtained from each calculation were then compared with those derived from the analytical method.Microsoft Excel was utilized as the primary software for data entry, formula input, and calculations within spreadsheets.In addition to comparing the two numerical methods, this study was also conducted to review excel's ability to process numerical calculations in the case of two-dimensional heat conduction.Previously, it has been shown that an Excel spreadsheet with Visual Basic for Application (VBA) programming could be used to obtain analytical solutions for Gaussian packet wave propagation on a square membrane [17] as well as to demonstrate 3D perspective of vibration modes on circular membrane waves involving the Bessel function approximation in a certain frequency [18].Similar to the results obtained in those studies, the current study also demonstrates the capability of MS Excel as a numerical calculation software.

Forward Time Centered Space (FTCS) or Explicit Scheme
In the forward scheme, the information of the point considered as  is connected to the point as  + 1.Let ℎ =  +1 −   and  =  +1 −   .Based on eq. ( 4), the forward space scheme and forward time scheme are expressed in eq. ( 5) and ( 6), respectively: In the centered scheme of finite difference method, the information in the point being considered, , is connected to the point  + 1 and  − 1, the centered space scheme finite difference method for first order and second order differentiation is expressed as eq.( 7) and ( 8): The centered space scheme finite difference method for second order differentiation calculation for   and  +1 are expressed as eq.( 9) and ( 10): The forward time finite difference method in eq. ( 6) discretizes the first-order time differentiation.In contrast, the second-order space differentiation is discretized by the centered space finite difference method expressed in eq. ( 9).In this problem, the first-order time differential is written in eq. ( 11), while the second-order space differential in the  and  directions is written in eq. ( 12) Substituting eq. ( 11) and ( 12) into eq.( 1), we obtain Where ∆ = ∆ and  = ∆ ∆ 2 , eq. ( 14) above is the explicit scheme used to calculate heat transfer in two dimensions. is the temperature at the position and time indicated by the superscript .The subscripts  and  represent the  and  positions, respectively.The addition and subtraction of the  The results of the FTCS scheme are shown in Figure 3.

Crank-Nicolson Scheme
Crank-Nicolson method is developed from explicit and implicit scheme.Its form is the average of the explicit and implicit method.The first order time differentiation is approximated at  +1 2  ⁄ and the second order space differentiation is determined at the middle point by the average of approximation difference at the beginning ( +1 2  ⁄ ) and the end ( +1 ) of time increment [19]: The approximation of  2 / 2 is written in explicit method.In a square lattice problem where ∆ = ∆ and = ∆ ∆ 2 , eq. ( 18) is then written as The following procedure was the input of all the necessary variables in the spreadsheet.The  and  variables are the length of the plate in two dimension.The increment formula for  and  are =  −1 + ∆ (22) In eq. ( 21) and ( 22

Exact Solution (Analytic Scheme)
Analytic methods are also called exact methods because they provide exact solutions that have an error equal to zero.Unfortunately, analytical methods are only excellent for a limited number of problems, namely problems that have simple and low geometric interpretations.Meanwhile, when analytical methods can no longer be applied, the true solution of the problem can still be found using numerical methods.In the problem of 2D conduction heat transfer equation, the analytical solution is solved by separation of variables.Suppose an infinitely thin square plate is a free heat source.The steady-state temperature distribution on the plate of constant thermal conductivity must satisfy the differential equation by using separating variable form  (, ) = ()(), and then subtituting in eq. ( 1), we have the solution of equation [20]: (, ) = (A cosh  +  sinh )(C cos  +  sin ) A, B, C, and D are the constants to be found from four boundary conditions.The first boundary condition gives (0, ) = (0).() = 0.It yields (0) = 0 =  →  = 0.The second boundary condition gives (, ) = ().() = 0 where () = 0 =  sin .The eigen condition for this problem is  = , where  = 0, 1, 2, … ,  − 1.The conditioned eigenfunction is given by The exact solution is written in form The last step is determining the expansion coefficients of   and   that is done by examining the third and fourth boundary condition.At  = 0 the condition is 0 = ∑ (  + 0)  () which is satisfied by   = 0 for all .While the boundary condition  = ∞ gives: To find   the above equation is integrated over  from 0 to 1.And   () is an eigenfunction that is orthogonal over the interval (0, 1) by weighting the unitary function, and each side of the equation is multiplied by   () to yield: This equation results in   equaling zero for  even functions.Therefore, the index  can be replaced by 2 − 1, and  = 1, 2, … (31)  is the temperature,  is the number of the point position,  and  are the position in  and  direction.After organized in spread shell that displayed in figure 5, we find the exact solution of heat distribution in two dimension showed in Figure 6.In this study, the two-dimensional conduction heat transfer equation is analyzed in a timedependent manner.theoretically, heat conduction occurs when the temperature difference within an object, and the direction of the conduction heat flow depends not only on the temperature distribution in this state, but also on the shape of the object itself.According to this research, the Crank-Nicholson method produces results closer to the exact solution than the explicit method.In the explicit solution method, the temperature distribution exceeds in the boundary wall of space.The magnitude of the temperature distribution from the explicit solution results in a decrease in temperature as the surface area of the object increases.Compared to the solution from the analytical process, the temperature is proportional to the surface area of the object.This makes the temperature distribution unstable in the explicit solution; compared to the Crank-Nicholson method, the magnitude of the temperature distribution is proportional to the surface area of the object.The explicit method for finding the temperature at a point depends on the temperatures at six previous points in time.In the present study, these six temperature points depend on boundary conditions.Compared to the analytical method, the solution for the temperature distribution does not depend on predetermined boundary conditions.As a result, this situation leads to instability in explicit schemes.Whereas in the explicit method, the solution of the temperature analysis depends on the previous temperatures, the analytical calculation does not depend on those points, leading to instability in the scheme, which manifests itself as an amplification of the calculation results from the initial conditions.
In contrast to the Crank-Nicolson scheme, this method is unconditionally stable when converted to the Alternating Direction Implicit (ADI) solution method; as Tadjeran and Meerschaert describe in their study, the Crank-Nicolson discretization The stability and consistency of the classical heat conduction solution method using the ADI method for the ADI method is a well-established method [21].The method is consistently and unconditionally stable throughout the computational process.The Crank-Nicholson scheme is inherently stable and allows the conductivity coefficient to be chosen to any value within the numerical program [22].
Based on the data obtained in this study, the results presented by the Crank-Nicholson scheme are nearly identical to the analytical solution, indicating that this scheme offers higher accuracy than the explicit scheme.Furthermore, since the temperature does not depend on boundary conditions as in the analytical solution, the graphical plots of the Crank-Nicholson method show the same stability as the exact solution.Furthermore, the equations are solved numerically and analytically using MS Excel spreadsheets, demonstrating MS Excel's capabilities as a numerical analysis software.

Conclusion
In this study, we present two finite difference schemes for the two-dimensional heat equation.First, explicit and Crank-Nicholson methods are developed.The explicit method provides a simpler twodimensional conduction heat solution than the Crank-Nicholson method.This simplicity is due to the fact that the temperature at a given point can be determined directly by entering initial and boundary conditions.Conversely, the Crank-Nicholson method presents a more complex two-dimensional conduction heat solution.However, it compensates for this complexity with greater accuracy and produces results closer to the analytical solution.Furthermore, the use of MS Excel spreadsheets in this study demonstrates the competitiveness of MS Excel software used for numerical analysis.However, in order to verify the efficiency of the numerical scheme, it is necessary to include in the discussion the error between the exact and approximate solutions of the 2-D heat equation.

Figure 1 .
Figure 1.The boundary condition used in this study

10th 1 𝑛 1
Asian Physics Symposium (APS 2023) Journal of Physics: Conference Series 2734 (2024) 012050 subscripts represent the right/down and left/up positions from the / point of the current position, respectively.On the other hand, the addition of the superscript represents the time step after the current time step.Organized in an Excel spreadsheet, for example the  value (1,1,2) placed in cell E13 has the form  1details are as follows based on the boundary condition  = 0 at  = ,  −1the boundary condition  = 0 with  = ,  ,−in cell E12 and  value in cell G5, moreover, the formula for the value  1,1 2 in cell E13 is E12+1*$G$5*(F12-2*E12+F12+D12-2*E12+D12.For time iteration  = 0.1 the Excel spreadsheet presented in figure 2.

Figure 5 .
Figure 5. Calculation of T-values using analytic method