Labfans是一个针对大学生、工程师和科研工作者的技术社区。 论坛首页 | 联系我们(Contact Us)
MATLAB爱好者论坛-LabFans.com
返回   MATLAB爱好者论坛-LabFans.com > 工程数学软件 > MATLAB论坛
MATLAB论坛 一切MATLAB相关问题在此讨论。
回复
 
主题工具 显示模式
旧 2011-09-15, 00:46   #1
SuperOliver
初级会员
 
注册日期: 2011-09-15
帖子: 1
声望力: 0
SuperOliver 正向着好的方向发展
默认 这是一个MATLAB 基本建模问题,哪位大大可以帮帮忙啊,周五就交了。。。

1. Heat Transfer Simulation
Consider a rectangular metal plate with top and side edges held at some constant temperature, and the bottom edge held constant at some differing temperature. We can represent the temperature variations across the plate as a grid of temperatures by dividing the plate into a discrete array of cells. We store the temperature values in an array T such that T(i,j) is the average temperature of grid cell (i,j).
We wish to study the equilibrium temperature distribution of this plate. We model the heat transfer between the cells by iterating over the whole array, each time replacing the temperature of a cell by the average temperature of itself and its four neighbouring cells (above, below, left and right). This averaging process forms a very crude modelling of the flow of heat. We stop iterating when no cell changes by more than some specified amount.
Consider the following example: Our plate is represented by a 4 x 4 grid of cells. The top and side cells are held at 100 degrees and the bottom cells are held at 50 degrees. All other cells are set initially to zero (just an arbitrary value)
100 100 100 100
100 0 0 100
100 0 0 100
50 50 50 50
After one iteration this becomes
100 100 100 100
100 40 40 100
100 30 30 100
50 50 50 50
since for cell(2,2) we have (100 + 100 + 0 + 0 + 0)/5 = 40,
and for cell(3,2) we have (100 + 50 + 0 + 0 + 0)/5 = 30
The boundary cell temperatures remain fixed.
This averaging process is then repeated on these new values. Note that two arrays of cell temperatures must be maintained, one for the old temperatures, and one for the new. Once all the new temperatures have been calculated they can then be copied over and become the 'old' ones for the next iteration. You cannot do the averaging 'in place' using just one array because you would overwrite the previous cell values before you had finished using them.


To simulate this system you must write a function
T = tempsim(rows, cols, topNsideTemp, bottomTemp, tol)
This function takes as arguments the number of rows and columns of cells to divide the plate into, the boundary temperatures, and a tolerance value - if no cell temperature changes by more than this tolerance the iteration process stops. The function then returns an array T giving the final distribution of temperatures.
SuperOliver 当前离线   回复时引用此帖
回复


发帖规则
不可以发表新主题
不可以发表回复
不可以上传附件
不可以编辑自己的帖子

启用 BB 代码
论坛启用 表情符号
论坛启用 [IMG] 代码
论坛禁用 HTML 代码



所有时间均为北京时间。现在的时间是 12:46


Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.