2d temperature in a plate using Matrix Inversion and MATLAB

Click For Summary
SUMMARY

The discussion focuses on solving a heat transfer problem using MATLAB to compute the two-dimensional temperature distribution in a rectangular plate. The user is required to develop a MATLAB code that constructs a matrix equation of the form [A][T] = [C], where [A] contains coefficients derived from energy balance equations. The user successfully implements a one-dimensional solution but struggles to extend this to a two-dimensional matrix, specifically a 5x5 mesh. The final output for the one-dimensional case is verified to be correct, but the user seeks guidance on integrating multiple node types into a cohesive two-dimensional solution.

PREREQUISITES
  • Understanding of heat transfer principles and boundary conditions.
  • Proficiency in MATLAB programming, particularly matrix operations.
  • Knowledge of numerical methods for solving linear equations.
  • Familiarity with energy balance equations in thermal analysis.
NEXT STEPS
  • Learn how to construct and manipulate matrices in MATLAB for multi-dimensional problems.
  • Research the implementation of boundary conditions in finite difference methods.
  • Explore MATLAB's built-in functions for solving linear systems, such as 'linsolve' or 'mldivide'.
  • Study the derivation of energy balance equations for various node types in heat transfer analysis.
USEFUL FOR

Students and professionals in mechanical engineering, thermal analysis, and computational modeling who are working on heat transfer problems using MATLAB.

jackfrost1031
Messages
4
Reaction score
0
Hi,

I think i should have posted here instead of where I posted before. I don't know how I missed the homework help section... anyway

Well, I'm required to solve this heat transfer problem.

Develop a MATLAB code that computes the two-dimensional
temperature distribution in the rectangular plate. Load coefficients
into a matrix array of the form [A][T] = [C] where [A] is an M by
N matrix containing the leading coefficients of the temperature
nodes derived from the energy balance procedure of Task 1.

Solve the system of equations using MATLAB’s routine [T]= [A ]^-1*[C]

20fw9b7.jpg


T1 is 25c and q'' is 100w/m2

Ok, so I can get it to do it in 1 dimension and my numbers are correct based upon past work done in Excel (checked by Prof). I am not sure how to combine two dimensions into one matrix.

Currently my code is as follows:

Code:
%{
Zach Cross
7-17-2010
Computes 2D temperature distribution in a rectangular plate
%}

clear all; close all; format short g
%boundaries
T1 = 25;
TE = T1;
TS = T1;
TW = T1;
%degrees C

q = 100;
%w/m^2

L = 0.2;
W = 0.1;
% meter

k = 0.1;
%W/(m*K)

%size of matrix
i = 5;
j = 5;
dx = L/i;
dy = W/j;

%set some helpful constants
dx_ = dx/dy;
dy_ = dy/dx;
d1 = (3*k*dx_ + 3*k*dy_);
d2 = (3*k*dx_ + 2*k*dy_);
d3 = (2*k*dx_ + 3*k*dy_);
d4 = (2*k*dx_ + 2*k*dy_);

%west interior node going from north to south (not accounting for 25c west boundary condition)
A1 = [1, -1, 0, 0, 0, 0, 0;
      -2*k*dx_/d1, 1, -k*dx_/d1, 0, 0, 0, 0;
      0, -k*dx_/d3, 1, -k*dx_/d3, 0, 0, 0;
      0, 0, -k*dx_/d3, 1, -k*dx_/d3, 0, 0;
      0, 0, 0, -k*dx_/d3, 1, -k*dx_/d3, 0;
      0, 0, 0, 0, -k*dx_/d1, 1, -2*k*dx_/d1;
      0, 0, 0, 0, 0, 0, 1];
C1 = [q*dy/(2*k);
    0;
    0;
    0;
    0;
    0;
    TS];
T1 = inv(A1)*C1

T1 comes out to

T1 =

25.901
15.901
7.8263
5.6215
7.6328
15.369
25

which is precisely what it should be [if this were a 1D problem].

I realize that it's stuck at the current size and I can work on making it capable of whatever size later; right now I want a 5x5 mesh plus the boundaries so, really 7x7.

I have derived equations from an energy balance for all the different types of nodes (corner, interior, boundary, etc) but I'm unsure how to get them to work together in this scheme. I can do it iteratively but it's not what he wants.

Could someone help me out a little here? Do I need to have a 7x7 solution matrix? (ugh, please not!)
 
Physics news on Phys.org
Well, I figured it out. I'll post up how later as I have time. Thanks!
 

Similar threads

Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
8K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K