Problem 2 - aΒΆ

Given two-dimensional steady heat equation (Poisson’s equation:

\[\lambda\left ( \frac{\partial^2T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2}\right ) + Q = 0\]

Discretize the PDE using a central difference scheme to generate a matrix equation \([A]{T}={Q}\).

Applying second order accuracy central scheme to each second derivative with respect to \(x\) and \(y\) gives

\[\lambda\left [ \frac{T_{i-1,j}-2T_{i,j}+T_{i+1,j}}{\Delta x^2} + \frac{T_{i,j-1} - 2T_{i,j} + 2T_{i,j+1}}{\Delta y^2} \right ] + Q_{i,j} = 0\]

To construct the coefficient matrix of system of linear equations, the coefficients of each neighbor point should be organized as shown below:

\[a_{i-1,j}T_{i-1,j} + a_{i+1,j}T_{i+1,j} + a_{i,j-1}T_{i,j-1} + a_{i,j+1}T_{i,j+1} = Q_{i,j}\]

where each coefficietns are recast in terms of diffusivity and grid size:

\[a_{L} = a_{R} = \frac{\lambda}{\Delta x^2}\]
\[a_{B} = a_{U} = \frac{\lambda}{\Delta y^2}\]

and

\[a_{i,j} = -\left ( \frac{2\lambda}{\Delta x^2} + \frac{2\lambda}{\Delta y^2} \right )\]

Here, \(L\), \(R\), \(B\), and \(U\) indicate ‘Left’, ‘Right’, ‘Bottom’ and ‘Up’ neighbors, respectively.

The coefficients based on a single point \((i,j)\) will compose \(i\times j\)-th row.

\[AT=Q\]

where \(T\) and \(Q\) are vector having \(n^4\) elements:

\[\begin{split}\begin{bmatrix} T_{1,1} & T_{1,2} & \cdots & T_{1,n} & T_{2,1} & \cdots & T_{2,n} & \cdots & T_{i,j} & \cdots & T_{n,n} \end{bmatrix}^{T}\end{split}\]
\[\begin{split}\begin{bmatrix} Q_{1,1} & Q_{1,2} & \cdots & Q_{1,n} & Q_{2,1} & \cdots & Q_{2,n} & \cdots & Q_{i,j} & \cdots & Q_{n,n} \end{bmatrix}^{T}\end{split}\]

Here, \(A\) matrix is not formed tridiagonal as it is seen in the first problem because the current set of solution is defined in 2-dimensional domain. For that reason, coefficient matrix should contain all four neighbor’s constant. The resulting \(A\) matrix will have \(N^2 \times N^2\) elements.