1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
//clc()
//since, insulation is done at one end,the general equation becomes(j=0),
//T(i+1,0) + T(i-1,0) + 2*T(i,1) -2*y*(dT/dy) - 4*T(i,0) = 0
//the derivative is zero and we get , T(i+1,0) + T(i-1,0) + 2*T(i,1) - 4*T(i,0) = 0
//the simultaneous equations obtained can be written in matrix form as follows,
A = [4,-1,0,-2,0,0,0,0,0,0,0,0;-1,4,-1,0,-2,0,0,0,0,0,0,0;0,-1,4,0,0,-2,0,0,0,0,0,0;-1,0,0,4,-1,0,-1,0,0,0,0,0;0,-1,0,-1,4,-1,0,-1,0,0,0,0;0,0,-1,0,-1,4,0,0,-1,0,0,0;0,0,0,-1,0,0,4,-1,0,-1,0,0;0,0,0,0,-1,0,-1,4,-1,0,-1,0;0,0,0,0,0,-1,0,-1,4,0,0,-1;0,0,0,0,0,0,-1,0,0,4,-1,0;0,0,0,0,0,0,0,-1,0,-1,4,-1;0,0,0,0,0,0,0,0,-1,0,-1,4];
disp(A,"A = ")
B = [75;0;50;75;0;50;75;0;50;175;100;150];
disp(B,"B = ")
T = inv(A)*B;
T10 = det(T(1,1));
T20 = det(T(2,1));
T30 = det(T(3,1));
T11 = det(T(4,1));
T21 = det(T(5,1));
T31 = det(T(6,1));
T12 = det(T(7,1));
T22 = det(T(8,1));
T32 = det(T(9,1));
T13 = det(T(10,1));
T23 = det(T(11,1));
T33 = det(T(12,1));
disp(T10,"T10 = ")
disp(T20,"T20 = ")
disp(T30,"T30 = ")
disp(T11,"T11 = ")
disp(T21,"T21 = ")
disp(T31,"T31 = ")
disp(T12,"T12 = ")
disp(T22,"T22 = ")
disp(T32,"T32 = ")
disp(T13,"T13 = ")
disp(T23,"T23 = ")
disp(T33,"T33 = ")
|