首页 > > 详细

讲解Mechanical Engineering、辅导MATLAB程序设计、讲解MATLAB语言讲解数据库SQL|调试Matlab程序

Assignment 4: Mechanical Engineering Case Study –
Temperature Distribution Simulation
Available: November 24th
Due: December 7th @ 11:55pm
Programming aspects to get familiarized with:
Ø MATLAB Metrics
Ø MATLAB Functions
Ø MATLAB Animations
Ø MATLAB Figures
The Task
The temperature distribution in a thin metal plate with constant (isothermal) temperatures on each side
can be modeled using a 2D grid, as shown in the Figure below. Typically, the number of points in the
grid is specified (N number of rows by M number of columns), as are the constant temperatures on the
four sides. The temperatures of the interior points are initialized to zero, but they change according to
the temperatures around them. Assuming that the temperature of an interior point can be computed as
the average of the four adjacent temperatures; the points shaded in the figure below represent the
adjacent temperatures for the pointed labeled x in the grid. Each time that the temperature of an interior
point changes, the temperatures of the points adjacent to it change. These changes continue until a
thermal equilibrium is achieved and all temperatures become constant. A thermal equilibrium is
reached when the difference between the previous and current temperature of every element in the grid
becomes smaller than a specific threshold (entered by the user).
The Software
Develop a software to model this temperature distribution for a grid with N rows (between 50 and 200)
and M columns (between 50 and 200). Allow the user to enter the temperatures for the four sides (initial
conditions). Use a one-dimensional array to store these temperatures (top, bottom, left, and right values
are between 0 and 255). Thus, when a point is updated, its new value is used to update the next point.
Continue updating the points, moving across the rows until the temperature differences (between the
previous temperature and the newly calculated temperature) for all the grid elements are less than a
tolerance value (provided by the user, the threshold is between 0 and 0.05). The software must provide
a visual display (animation) for the temperature distribution. You may use any form of input
mechanism (such as text fields to receive the required data from the user). You may design this program
using multiple functions.
Given test cases:
Test Case 1: Hot edges
Dimensions of grid: 200 x 200
Boundary conditions: 255, 255, 255, 255
Simulation Threshold: 0.02
Test Case 2: Mixed boundary conditions
Dimensions of grid: 200 x 200
Boundary conditions: 255, 0, 255, 0
Simulation Threshold: 0.05
Test Case 3: Zero boundary conditions
Dimensions of grid: 200 x 200
Boundary conditions: 0, 0, 0, 0
Simulation Threshold: 0.01
Write your report using the five steps model for software development (as discussed in class):
a) Step 1: Problem Identification and Statement (5 points)
b) Step 2: Gathering Information (10 points)
c) Step 3: Test Cases and algorithm (35 points)
d) Step 4: Code or implementation (35 points)
e) Step 5: Test and Verification (15 points)

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!