# hwk9 - HOMEWORK #9 Due: October 29 November 4 1. Reading...

This preview shows pages 1–3. Sign up to view the full content.

HOMEWORK #9 Due: October 29 – November 4 1. Reading Assignment Complete the reading assignment posted on the Course Schedule on the ENGR 126 Blackboard homepage. 2. Additional Conditional Statements This section to be completed individually. Assume that we are designing a metal cover plate as part of the shielding for a nuclear reactor. We don’t need to know anything about how heat transfers in the plate to know what the steady state temperature distribution will be – the temperature at every location will be the average of the surrounding temperatures. The plate is broken up into a grid (matrix) with a temperature value (either known or calculated) assigned to each element within the grid. The figure below shows an example grid for the plate with the edge elements shown in grey. T 1 T 6 T 4 T 0 T 2 T 3 T 5 Create a script that determines an updated temperature of a location in the grid based on the surrounding temperatures. It must compute this average differently depending upon the location in the grid (matrix). The temperature for an element in the middle of the grid (white region) is calculated by averaging the temperatures of the four surrounding cells: 1 2 3 4 0 4 T T T T T + + + = The temperature for an element along an edge (grey region) is calculated by averaging the temperatures of the three surrounding cells (2 times the interior cell + edge cells) 0 5 6 2 2 4 T T T T + + = The temperature for an element in a corner is calculated by averaging the temperatures of the two neighboring cells: 1 2 6 2 T T T + =

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
1. Open your probtemplate.m file and save it as hw9problem2.m . Modify the Comments section for this problem. 2. Under the Input section, assign the following temperature matrix. [ ] 100 100 100 100 100 50 50 100 100 37.5 37.5 100 50 50 50 50 Temp = 3. Under the Input section, use input commands to ask the user which location (row and column) within the grid to recalculate. 4. Under the Calculation section, use the size command to determine the size (m x n) of the temperature matrix. 5. Under the Calculation section, use conditional statements to determine if the location is in the middle, along an edge, or in a corner of the grid. (Hint: use the information from step 4 in your logic statements to allow for any size temperature matrix.) 6. Under the Calculation section, calculate the average depending upon the location in the grid. 7.
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/12/2012 for the course ENGR 126 taught by Professor Oakes during the Fall '08 term at Purdue University-West Lafayette.

### Page1 / 5

hwk9 - HOMEWORK #9 Due: October 29 November 4 1. Reading...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online