The temperature distribution in the square region shown is governed by the Lapla
ID: 2997772 • Letter: T
Question
The temperature distribution in the square region shown is governed by the Laplace equation. The finite difference approximation to this equation yields a system of algebraic equations given by
(Ti,j= Ti+1,j+Ti-1,j+Ti,j+1+Ti,j-1)/4
where i is the the number of the row and j is the column in which a grid point is located. For the nine points shown, obtain nine linear equations for determining the temperatures at these points. Solve this system by the Gauss-Siedel method. Note thatt the temperatures at the boundaries are given and are used in the equations for all the temperatures, except for the one at position 5, Also, using the inv(A) command in MATLAB, solve this problem and compare the results with those obtained earlier.
The temperature distribution in the square region shown is governed by the Laplace equation. The finite difference approximation to this equation yields a system of algebraic equations given by (Ti,j= Ti+1,j+Ti-1,j+Ti,j+1+Ti,j-1)/4 where i is the the number of the row and j is the column in which a grid point is located. For the nine points shown, obtain nine linear equations for determining the temperatures at these points. Solve this system by the Gauss-Siedel method. Note thatt the temperatures at the boundaries are given and are used in the equations for all the temperatures, except for the one at position 5, Also, using the inv(A) command in MATLAB, solve this problem and compare the results with those obtained earlier.Explanation / Answer
clc
clear all
%equations
% 4*T1=T2+T4+40+50;
% 4*T2=T1+T5+T3+40;
% 4*T3=T2+T6+40+20;
% 4*T4=T1+T7+T5+50;
% 4*T5=T2+T4+T6+T8;
% 4*T6=T5+T3+T9+20;
% 4*T7=T8+T4+100+50;
% 4*T8=T7+T5+T9+100;
% 4*T9=T8+T6+20+100;
M=[4 -1 0 -1 0 0 0 0 0;
-1 4 -1 0 -1 0 0 0 0;
0 -1 4 0 0 -1 0 0 0;
-1 0 0 4 -1 0 -1 0 0;
0 -1 0 -1 4 -1 0 -1 0;
0 0 -1 0 -1 4 0 0 -1;
0 0 0 -1 0 0 4 -1 0;
0 0 0 0 -1 0 -1 4 -1;
0 0 0 0 0 -1 0 -1 4];
b=[90 40 60 50 0 20 150 100 120]';
D = diag( M ).^-1;
Moff = M - diag( diag( M ) );
x =zeros(9,1);
for i = 1:100
xold = x;
for j = 1:9
x(j) = D(j)*(b(j) - Moff(j, :)*x);
end
if norm( x - xold ) < 0.001
break;
end
end
x % Temperature
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.