Numerical Code for 2D -Transient heat conduction equation
%% Given Values clear all; L=1; %edge length A=0.01; %area under consideration alpha=9.7e-05; %thermal diffusivity aluminium n=input('grid size'); %enter grid size dx=L/n; dy=dx; dt=dx/100; x=linspace(0,1,n); y=linspace(1,0,n); time=input('enter time');%enter time t=zeros(n,n); t(:,:)=200; %initial condition %% Linear boundary condition t(1,:)=linspace(300,320,n); t(:,1)=linspace(300,330,n); t(n,:)=linspace(330,270,n); t(:,n)=linspace(320,270,n); %% solving f.d.e convrg=1; ts=0; tol=1e-06; while ts<=time && convrg>=tol %convergence criterion tpast=t; for i=2:n-1 for j=2:n-1; ...