Solving the steady and unsteady 2D heat conduction problem
Objective: clear all close all clc % solving the 2d steady state problem dt/dx=0 % nx=ny %tolerance =1e-4 % inputs for the problem L=1; nx=50; ny=nx; x=linspace(0,L,nx); y=linspace(0,L,ny); dx=x(2)-x(1); dy=y(2)-y(1); T=300*ones(nx,ny); Told=T; error=1e9; tolerance=1e-4; % assign boundary conditions T(:,1)=400; % left boundary T(end,:)=900;…