Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java code Description Thin square metal plates are to be tested for its thermal conductivity. Starting with the metal plate at room temperature (68), a

image text in transcribedimage text in transcribed

Java code

Description Thin square metal plates are to be tested for its thermal conductivity. Starting with the metal plate at room temperature (68), a constant (but possibly different) temperature is applied to each of its four edges. The temperature of the metal plate changes as the temperature applied to the edges flows into the plate. Its thermal conductivity is measured by the time it takes to reach a steady state. The steady state occurs when each interior point of the metal plate reaches a temperature which does not change significantly from one time unit to the next. Since we will not go into the physics laboratory to perform this experiment, the purpose of this assignment is to write a program that will model (simulate) this experiment. To perform a simulation, we must design representations for the objects involved in the simulation. The only object in this simulation is the metal plate. The metal plate is best simulated by a two- dimensional array. Each element of the array represents a particular square on the plate. The contents of each element of the array will contain the current temperature of that square. The temperature of a square is affected by its horizontally and vertically adjacent squares. Finding the new temperature of each square is accomplished by averaging the old temperatures of the square and its four neighbors. If Ty denotes the old temperature of the square in row i and column jat time then i, will be its new temperature at time t The simulation will start at time to with the initial state as described below and continue until sometime tn when the steady state has been reached. We will specify that the steady state occurs when the temperature of every square at time t differs from the temperature of the square at time toby at most 0.1. The initial temperature of the plate for any simulation will be 68o. The size of the plate should be 10 squares by 10 squares. However, I would create an array of size 12 by 12 so that I also have room to store the edge temperatures. This simplifies the calculations since you don't have to worry about squares along the edges of the plate. The comers of the 12 by 12 array will then be void of data. Note: All new temperatures (at time t ) must be calculated from all old temperatures (at time t.). Input None Output: None. Return an array of Plate*classes containing 2-dim arrays with the resulting state of the plate after it has reached a "steady state." The required method is provided below. Each line in the file will contain 4 numbers separated by a comma. The file can/will have multiple lines, each line should be treated as a unique execution and the plate should be reset to room temperature. A sample of the correct output has been provided for a file containing the values: 50, 50, 50, 50. The values are provided in the order of Top, Right, Bottom, Left Note: For your output use the following decimal formatter on your calculation line. Required Method(s) (Lab 3 Class): public static Plate] processTempsFromFile(File f, int numPlates) throws FileNotFoundException First Parameter: File object-this may or may not be a valid file, check it! Second Parameter: Number of plates (four #'s on a line) in the file. Essentially this tells you the number of lines in the file Required Method(s) (Lab 3 Class): public static Plate] processTempsFromFile(File f, int numPlates) throws FileNotFoundException First Parameter: File object-this may or may not be a valid file, check it! Second Parameter: Number of plates (four #'s on a line) in the file. Essentially this tells you the number of lines in the file . Required Method(s) (Plate Class) public Plate(double[] plate) pub blic double getPlate() Packaging: Fully qualified class names are listed below: (Note: the bold is the class itself) edu.ben.labs.lab3.Lab3 edu.ben.labs.lab3.Lab3Test er hen lahs lah? Plate Sample Solution 0.0e, 58.8e, 5e.8e, 5e.8e, se.ee, 5e.e0, 5e.e0, 5e.ee, 5e.e0, 5e.e0, 50.ee, e.e0 50.00, 50.23, 50.44, 50.61, 50.74, 50.80, 50.80, 58.74, 50.61, 50.44, 50.23, 50.88 50.00, 50.44, 50.84, 51.17, 51.41, 51.54, 51.54, 51.41, 51.17, 50.84, 50.44, 50.ee 50.00, 50.61, 51.17, 51.64, 51.98, 52.15, 52.15, 51.98, 51.64, 51.17, 50.61, 50.ee 50.00, 50.74, 51.41, 51.98, 52.38, 52.59, 52.59, 52.38, 51.98, 51.41, 50.74, 50.ee 50.00, 50.80, 51.54, 52.15, 52.59, 52.82, 52.82, 52.59, 52.15, 51.54, 50.80, 50.ee 50.00, 50.80, 51.54, 52.15, 52.59, 52.82, 52.82, 52.59, 52.15, 51.54, 50.80, 50.e0 50.00, 50.74, 51.41, 51.98, 52.38, 52.59, 52.59, 52.38, 51.98, 51.41, 50.74, 50.0e 50.00, 50.61, 51.17, 51.64, 51.98, 52.15, 52.15, 51.98, 51.64, 51.17, 50.61, 50.ee 50.00, 50.44, 50.84, 51.17, 51.41, 51.54, 51.54, 51.41, 51.17, 50.84, 50.44, 50.ee 50.00, 50.23, 50.44, 50.61, 50.74, 5e.80, 5e.80, 50.74, 50.61, 50.44, 50.23, 50.ee 0.00, 50.00, 5e.ee, 5e.00, 50.0e, 50.ee, 50.ee, 50.e0, 50.e, 50.ee, 50.ee, e.00 Description Thin square metal plates are to be tested for its thermal conductivity. Starting with the metal plate at room temperature (68), a constant (but possibly different) temperature is applied to each of its four edges. The temperature of the metal plate changes as the temperature applied to the edges flows into the plate. Its thermal conductivity is measured by the time it takes to reach a steady state. The steady state occurs when each interior point of the metal plate reaches a temperature which does not change significantly from one time unit to the next. Since we will not go into the physics laboratory to perform this experiment, the purpose of this assignment is to write a program that will model (simulate) this experiment. To perform a simulation, we must design representations for the objects involved in the simulation. The only object in this simulation is the metal plate. The metal plate is best simulated by a two- dimensional array. Each element of the array represents a particular square on the plate. The contents of each element of the array will contain the current temperature of that square. The temperature of a square is affected by its horizontally and vertically adjacent squares. Finding the new temperature of each square is accomplished by averaging the old temperatures of the square and its four neighbors. If Ty denotes the old temperature of the square in row i and column jat time then i, will be its new temperature at time t The simulation will start at time to with the initial state as described below and continue until sometime tn when the steady state has been reached. We will specify that the steady state occurs when the temperature of every square at time t differs from the temperature of the square at time toby at most 0.1. The initial temperature of the plate for any simulation will be 68o. The size of the plate should be 10 squares by 10 squares. However, I would create an array of size 12 by 12 so that I also have room to store the edge temperatures. This simplifies the calculations since you don't have to worry about squares along the edges of the plate. The comers of the 12 by 12 array will then be void of data. Note: All new temperatures (at time t ) must be calculated from all old temperatures (at time t.). Input None Output: None. Return an array of Plate*classes containing 2-dim arrays with the resulting state of the plate after it has reached a "steady state." The required method is provided below. Each line in the file will contain 4 numbers separated by a comma. The file can/will have multiple lines, each line should be treated as a unique execution and the plate should be reset to room temperature. A sample of the correct output has been provided for a file containing the values: 50, 50, 50, 50. The values are provided in the order of Top, Right, Bottom, Left Note: For your output use the following decimal formatter on your calculation line. Required Method(s) (Lab 3 Class): public static Plate] processTempsFromFile(File f, int numPlates) throws FileNotFoundException First Parameter: File object-this may or may not be a valid file, check it! Second Parameter: Number of plates (four #'s on a line) in the file. Essentially this tells you the number of lines in the file Required Method(s) (Lab 3 Class): public static Plate] processTempsFromFile(File f, int numPlates) throws FileNotFoundException First Parameter: File object-this may or may not be a valid file, check it! Second Parameter: Number of plates (four #'s on a line) in the file. Essentially this tells you the number of lines in the file . Required Method(s) (Plate Class) public Plate(double[] plate) pub blic double getPlate() Packaging: Fully qualified class names are listed below: (Note: the bold is the class itself) edu.ben.labs.lab3.Lab3 edu.ben.labs.lab3.Lab3Test er hen lahs lah? Plate Sample Solution 0.0e, 58.8e, 5e.8e, 5e.8e, se.ee, 5e.e0, 5e.e0, 5e.ee, 5e.e0, 5e.e0, 50.ee, e.e0 50.00, 50.23, 50.44, 50.61, 50.74, 50.80, 50.80, 58.74, 50.61, 50.44, 50.23, 50.88 50.00, 50.44, 50.84, 51.17, 51.41, 51.54, 51.54, 51.41, 51.17, 50.84, 50.44, 50.ee 50.00, 50.61, 51.17, 51.64, 51.98, 52.15, 52.15, 51.98, 51.64, 51.17, 50.61, 50.ee 50.00, 50.74, 51.41, 51.98, 52.38, 52.59, 52.59, 52.38, 51.98, 51.41, 50.74, 50.ee 50.00, 50.80, 51.54, 52.15, 52.59, 52.82, 52.82, 52.59, 52.15, 51.54, 50.80, 50.ee 50.00, 50.80, 51.54, 52.15, 52.59, 52.82, 52.82, 52.59, 52.15, 51.54, 50.80, 50.e0 50.00, 50.74, 51.41, 51.98, 52.38, 52.59, 52.59, 52.38, 51.98, 51.41, 50.74, 50.0e 50.00, 50.61, 51.17, 51.64, 51.98, 52.15, 52.15, 51.98, 51.64, 51.17, 50.61, 50.ee 50.00, 50.44, 50.84, 51.17, 51.41, 51.54, 51.54, 51.41, 51.17, 50.84, 50.44, 50.ee 50.00, 50.23, 50.44, 50.61, 50.74, 5e.80, 5e.80, 50.74, 50.61, 50.44, 50.23, 50.ee 0.00, 50.00, 5e.ee, 5e.00, 50.0e, 50.ee, 50.ee, 50.e0, 50.e, 50.ee, 50.ee, e.00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

Does it avoid use of underlining?

Answered: 1 week ago