- #1
grufff
- 4
- 0
1. The problem statement
I'd like to use Matlab to help me model and solve a simple 2D steady state heat conduction problem:
A square section duct is buried in the Earth some distance below the surface. This duct is at a steady temperature of 60 degrees C. I need to use the central divided difference method to show how the heat from the duct propagates into the surrounding earth, and provide temperatures at different points across a 2D section (end on) view.
Below is 8x8 matrix representing the known and initial value guesses for temperatures: 4 degrees all across the surface, -17 degrees at lowest depth of interest, linear temperature gradient between those two values at some distance to the right of the duct, and the duct itself on the left hand side at 60 degrees (rows 4 & 5, columns 1 & 2). All of the 10 degree values are initial guesses to get the iterative process under way.
4 4 4 4 4 4 4 4
10 10 10 10 10 10 10 1
10 10 10 10 10 10 10 -2
60 60 10 10 10 10 10 -5
60 60 10 10 10 10 10 -8
10 10 10 10 10 10 10 -11
10 10 10 10 10 10 10 -14
-17 -17 -17 -17 -17 -17 -17 -17
(sorry, can't get my matrix properly aligned in here)
Intend to write an m file script setting A = above matrix. Start a for loop with i = 1:(some value, however many iterations I might need).
Define a new 8x8 matrix B, using central divided differencing with data pulled from A to create each element of matrix B
Once this process is complete, set A = B (to map all the newly calculated values from B onto A), and return to start of loop to run through next iteration. Repeat until desired accuracy is reached.
Central differencing requires me to sum values from "north, south, east and west" of my point of interest and divide by 4 to find a new value. For example, to calculate value of B(2,2), I use values around that point from A as follows:
B(2,2) = (A(1,2)+A(3,2)+A(2,1)+A(2,3))/4
I've guessed at that syntax, can anyone please give me a working example?
Also can I build my 8x8 B matrix from a simple list of expressions similar to above, one for each element to be defined?
ie:
B(2,2) = (A(1,2)+A(3,2)+A(2,1)+A(2,3))/4
B(2,3) = (A(1,3)+A(3,3)+A(2,2)+A(2,4))/4
etc.
I'd really appreciate any advice or comments anyone might have for me, this is my first Matlab experience.
I'd like to use Matlab to help me model and solve a simple 2D steady state heat conduction problem:
A square section duct is buried in the Earth some distance below the surface. This duct is at a steady temperature of 60 degrees C. I need to use the central divided difference method to show how the heat from the duct propagates into the surrounding earth, and provide temperatures at different points across a 2D section (end on) view.
Below is 8x8 matrix representing the known and initial value guesses for temperatures: 4 degrees all across the surface, -17 degrees at lowest depth of interest, linear temperature gradient between those two values at some distance to the right of the duct, and the duct itself on the left hand side at 60 degrees (rows 4 & 5, columns 1 & 2). All of the 10 degree values are initial guesses to get the iterative process under way.
4 4 4 4 4 4 4 4
10 10 10 10 10 10 10 1
10 10 10 10 10 10 10 -2
60 60 10 10 10 10 10 -5
60 60 10 10 10 10 10 -8
10 10 10 10 10 10 10 -11
10 10 10 10 10 10 10 -14
-17 -17 -17 -17 -17 -17 -17 -17
(sorry, can't get my matrix properly aligned in here)
The Attempt at a Solution
Intend to write an m file script setting A = above matrix. Start a for loop with i = 1:(some value, however many iterations I might need).
Define a new 8x8 matrix B, using central divided differencing with data pulled from A to create each element of matrix B
Once this process is complete, set A = B (to map all the newly calculated values from B onto A), and return to start of loop to run through next iteration. Repeat until desired accuracy is reached.
Central differencing requires me to sum values from "north, south, east and west" of my point of interest and divide by 4 to find a new value. For example, to calculate value of B(2,2), I use values around that point from A as follows:
B(2,2) = (A(1,2)+A(3,2)+A(2,1)+A(2,3))/4
I've guessed at that syntax, can anyone please give me a working example?
Also can I build my 8x8 B matrix from a simple list of expressions similar to above, one for each element to be defined?
ie:
B(2,2) = (A(1,2)+A(3,2)+A(2,1)+A(2,3))/4
B(2,3) = (A(1,3)+A(3,3)+A(2,2)+A(2,4))/4
etc.
I'd really appreciate any advice or comments anyone might have for me, this is my first Matlab experience.