CS410P UC Davis Two Dimensional Lists Simulation Python Solve the entire HW assignment. The HW is related with 2-D dimensional list and computation. CS410P SUMMER 2019
DUE: 6/26/19
ASSIGNMENT 6P
Purpose
The purpose of this assignment is to have you work with two-dimensional lists in the context of a
simulation.
Scenario
The scenario is a heat-flow simulation of the transfer of heat from two sides of a metal plate across the
entire plate. A metal plate, as shown below, begins at a pair of fixed temperature. Heater/cooler A is
placed up against the top and left (north and west) sides of the plate. Heater/cooler B is placed up against
the bottom and right (south and east) sides of the plate. The plate itself starts at two initial temperatures:
T1 and T2, as shown below.
For example, the plate might start at T1=10 degrees and at T2=35 degrees, the first heater/cooler might be
at 80 degrees and the second heater/cooler might be at 60 degrees. As the simulation starts the sides of the
plate will begin to heat up and thus take on temperatures closer to the heaters. This transfer of heat will
continue across the plate until it reaches a stable temperature, where stable is defined, roughly, as not
changing significantly.
Method
To implement this simulation, we will use a finite state element approximation, that is, we will model the
plate with a 2-D list. Only the plate is represented by the 2-D list; thus the heater/coolers are outside (but
exactly adjacent to) the list. The plate will be represented by an (8×6) list: 8 rows and 6 columns, thus 48
elements. The temperature of all the plate elements will be initially set to the two initial plate
temperatures.
To simulate the transfer of heat, you will traverse the entire list over and over. On each traversal, you will
visit each element in your list and compute the new temperature in the following fashion: To determine
the new temperature of a specific element, take the average of its four neighbors (north, east, south, west)
from the previous cycle. Be careful, if you are updating an element on an edge of the plate, then you will
have only THREE plate values and ONE “outside” value, where an “outside” value is the temperature of
one of the heater/coolers. And a corner has two “outside” values. After you complete each traversal you
should print out the two 2-D list of updated temperatures. Then replace the values of the old temperature
by the new one for the next cycle. The simulation of traversals continues until no element in the list
changes by a significant relative amount, where the significant amount is determined by the value of the
last input item (see below). A relative amount means a percent change. Thus a value of .01 signifies a1%
change; it does not mean a change of .01 degree.
Data Structure
To store the simulated transfer of heat, you will store the heat temperatures in a pair of 2-D (8×6) list of
floats, one for the previous temperature values and the other for the new ones being computed. (You are
not allowed to use packages like numPy to simulate arrays).
Input
All input values will come from keyboard input. The input includes 5 floating point values:
The first heater/cooler temperature (A)
The second heater/cooler temperature (B)
The first initial plate temperature (T1)
The second initial temperature (T2)
The stabilizing criterion value
The stabilizing criterion value is a value to indicate when to stop the simulation. The halting condition is
defined as: If NO element in the list changes by a relative amount MORE THAN the stabilizing criterion
then the simulation can stop. (This means that the temperature in the plate is settling down to its final
temperature and continued traversals will only slightly change the temperature distribution). See the
posted files for examples of input.
Output
The output will first echo the input data then display the heat-plate temperatures. You should display each
plate as the temperatures change until the halt criterion is satisfied. Be sure to look at the posted output
examples and follow them closely. Make sure that you have the correct number of iterations.
(sample output shown below which shows the inputs as well as the initial plate temperatures, the first
plate after simulation begins and the last two plates). Sample output files in the public folder contain
complete output.
Details
?
Remember that the stabilization criterion is a relative change, not a degree change. Relative
change is defined as:
|to tn|/to
?
where to is the old temperature and tn is the new temperature
You must use at least the following functions (all of them must be commented):
o
o
o
o
?
?
A function to display the plate temperatures as in the examples. You can assume that the
temperature values will be in the range 0 99.99 and your display should look good for
all temperatures in this range. Your display should look very similar to the sample output.
Display temperatures with 2 decimal places.
A function to initialize the plate
A function that does one update of the plate temperatures i.e. one cycle of simulation
You may have as many other functions as you wish
The program must be split into multiple files:
o The main function must be the only function in one source (code) file
o All the other functions should be in a second source (code) file
o You must not use any global variables
As always test your program carefully and follow good programming style.
.
.
.
.
.
.
.
.
.
.
.
.
.
Grade Key:
A
Printing of plate reasonable showing all temperatures
15
B
Initial plate accurate
10
C
Computation for next cycle accurate
25
D
E
F
K
Stability criteria enforced correctly to stop simulation
Program works correctly for each input file
Programming style, modularity, comments
Late Penalty
15
15
20
Purchase answer to see full
attachment
Why Choose Us
Top quality papers
We always make sure that writers follow all your instructions precisely. You can choose your academic level: high school, college/university or professional, and we will assign a writer who has a respective degree.
Professional academic writers
We have hired a team of professional writers experienced in academic and business writing. Most of them are native speakers and PhD holders able to take care of any assignment you need help with.
Free revisions
If you feel that we missed something, send the order for a free revision. You will have 10 days to send the order for revision after you receive the final paper. You can either do it on your own after signing in to your personal account or by contacting our support.
On-time delivery
All papers are always delivered on time. In case we need more time to master your paper, we may contact you regarding the deadline extension. In case you cannot provide us with more time, a 100% refund is guaranteed.
Original & confidential
We use several checkers to make sure that all papers you receive are plagiarism-free. Our editors carefully go through all in-text citations. We also promise full confidentiality in all our services.
24/7 Customer Support
Our support agents are available 24 hours a day 7 days a week and committed to providing you with the best customer experience. Get in touch whenever you need any assistance.
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.
Essays
You are welcome to choose your academic level and the type of your paper. Our academic experts will gladly help you with essays, case studies, research papers and other assignments.
Admissions
Admission help & business writing
You can be positive that we will be here 24/7 to help you get accepted to the Master’s program at the TOP-universities or help you get a well-paid position.
Reviews
Editing your paper
Our academic writers and editors will help you submit a well-structured and organized paper just on time. We will ensure that your final paper is of the highest quality and absolutely free of mistakes.
Reviews
Revising your paper
Our academic writers and editors will help you with unlimited number of revisions in case you need any customization of your academic papers