Code Summary (2D Heat Conduction – Plate)
•
•
•
clc → Clears the command window.
clear all → Clears all variables from memory.
close all → Closes all open figures.
•
•
•
•
The plate size is 0.75m×0.75m0.75m \times 0.75m0.75m×0.75m.
The grid resolution is defined by dx and dy.
The time step (dt) is small to ensure numerical stability.
Epsilon (1e-4) is used as a stopping condition for steady-state.
•
T_new is a 2D matrix storing temperature values at each grid point.
•
•
•
•
Fixed boundary conditions:
Top boundary → T=100 ∘C
Other three boundaries → T=1 ∘C
This ensures that heat flows from the top while other boundaries remain at low
temperature.
•
Loop runs until steady-state is reached (error < epsilon).
•
Error measures the maximum change in temperature between iterations.
•
Error Calculation:
o The loop stops when the maximum temperature change between iterations is less
than epsilon.
Plotting the Temperature Distribution:
o contourf(T_new) → Creates a filled contour plot of temperature.
o colorbar → Adds a colour scale for temperature values.
•