Here we are going to find the stationary solution of the temperature field in a square beam cross-section. In the top and left side of the cross-section the temperature is known (Dirichlet boundary condition), and on the right and bottom side the derivative is known (Neumann boundary condition), see Figure 1.
Figure 1: Cross-section with boundary conditions

If we assume isotropic heat conduction we can write the stationary heat conduction equation as: $$ \begin{align} \frac{\partial^2T}{\partial x^2} + \frac{\partial^2T}{\partial y^2} = 0. \label{eq:heat} \end{align} $$
a) Write the general discretized version of \eqref{eq:heat}, using centered finite differences for a grid node that is not influenced by boundary conditions. Use equal spacing in x and y directions (\( \Delta x = \Delta y \)).
b) Using \( \Delta x = \Delta y = \frac{1}{3} \) and ghost nodes for the Neumann boundary conditions (centered finite differences), write out the resulting discretized equations for all mesh nodes where the temperature is unknown. Draw a sketch of the corresponding grid (also including treatment of boundary conditions). Furthermore, write out the matrix \( \boldsymbol{A} \) and right hand side \( \boldsymbol{b} \) of the corresponding system of linear algebraic equations, \( \boldsymbol{A}\cdot \boldsymbol{T}=\boldsymbol{b} \), where \( \boldsymbol{T} \) is a vector holding the unknown temperatures. Number the components of \( \boldsymbol{T} \) by starting in the lower left part of the grid and increase index in the \( x \)-direction first.
c) Now choose \( \Delta x = \Delta y = \frac{1}{N} \), where N may be chosen arbitrary, and briefly show/explain the pattern of the corresponding \( \boldsymbol{A} \) matrix; which diagonals are non-zero, and what pattern do they follow?