# 2D Heat equation using FDM

## Homework Statement

Given a steady-state heat transfer for a 100mx100m plate, to be discretized to 6 nodes, governed by a heat tranfer equation:

U_xx + U_yy = 0

Given dirichlet boundary conditions: U(0,y)=50, U(100,y) = 100,, neumann boundary: U_y(x,0)=0, U_y(x,100) = 0.

Find the solution using FDM, applying a 5 point laplacian stencil. Use Gauss-Seidel method to solve for the system of equations arising from the FDM approximation. Use 0.01% relative error as stopping criterion.

## Homework Equations

U_xx = (U_x-1,y -2U_x,y +U_x+1,y)/(Δx)^2
U_yy = (U_x,y-1 -2U_x,y +U_x,y+1)/(Δy)^2

Assume equal spacing of nodes.
Use Δx=Δy for simplicity.

## The Attempt at a Solution

Substituting the FDM approximations into the given PDE,

U_x,y = .25*(U_x-1,j + U_x+1,j + U_x,j-1 + U_x,j+1)

I'm not really sure about how I did the Gauss-Seidel part because what I got is that the temperature just linearly varies along X.

U(0,y) = 50
U(20,y) = 60
U(40,y) = 70
U(60,y) = 80
U(80,y) = 90
U(100,y) = 100

I'm not really confident about the answer so I tried using Gaussian elimination and I got a different answer.