CS368 Homework 4
| ||||||||||||||||||||||||||||||||||||||||||||||||
AnnouncementsCheck here periodically.
| ||||||||||||||||||||||||||||||||||||||||||||||||
ProblemsPlease note: Your solution must use techniques that have been discussed and covered in lecture and the on-line readings. Your solution may not use MATLAB commands or constructs that have not been covered in lecture prior to the date of the release of the homework (or in the corresponding on-line readings). For this homework create one main script file named homework4.m and the supporting function named heatPlate (in a file named heatPlate.m). Define the function as it is specified and then, in the main script file, correctly call the function to solve the problem. You can download this MATLAB script to get started: homework4.m Problem 1: (7 points) InterpolationComputer-controlled machines are used to cut and to form metal and other materials when manufacturing products. These machines often use interpolating functions (such as splines) to specify the path to be cut or the contour of the part to be shaped. The data in this table represents the shape of a car's front fender (units are in feet).
Problem 2: (6 points) ApproximationFor the data in the following table, the y data obviously decays as x increases:
Problem 3: (7 points) Heat PlateWe can determine the temperature at various locations across a heat plate by modeling such a problem as a system of linear equations and solving the linear system in MATLAB. Imagine that you wish to know the temperature at all points on a plate that is insulated except for two positions on the edge where heating elements of known temperature are applied. At some point when the temperature at all positions on the plate have stabilized, what will the temperature at each point be? To solve such a problem, we imagine the plate surface divided into equal sized "tiles" and restate the problem to find the temperature at the center of each tile. We know that the temperature of each tile depends upon its neighboring temperatures. In fact, it is a weighted average of those temperatures based on the proportion of our tile's edge that is shared with its neighbor. Here is a square "plate" divided into 9 equal area tiles. Assume that each edge of each tile has identical length, so that the temperature of any one tile is a simple average of the temperatures of all neighboring tiles that share a side with the tile in question. This creates a system of 9 equations, one for each "tile" area. T_{A} and T_{B} are the non-insulated positions along the edge where a heat source of known temperature will be applied. The temperatures at T_{1} through T_{9} are the unknowns that you wish to find. To solve this problem, identify 9 equations. Each equation represents the temperature value for one tile based upon the temperature values of each of its neighboring tiles. For example, the temperature at T_{5} is equal to the average of the temperatures: T_{2}, T_{4}, T_{6}, and T_{8}. What about the corners? Well, since the gray area is insulation, the only effect is from the non-insulating tiles. Thus, T_{3} is equal to the average of only T_{2} and T_{6}. How do T_{A} and T_{B} factor into the equations? They will be in the equations, but since their values will be known when the function is called, the terms with T_{A} and T_{B} should be on the right-hand side of the equations once the equations are reordered. DO NOT SOLVE FOR ANY OF THE TEMPERATURES OF THIS PROBLEM BY HAND. Work out the equations for each tile and then reorder the terms in general form, with the unknown terms on the left-hand side and the known terms on the right-hand side of the equation. Once you have the equations, rewrite the linear system as a matrix equation and put the commands to solve this problem in your heatPlate(TA,TB) function definition.
| ||||||||||||||||||||||||||||||||||||||||||||||||
Handing inUpload your m-files to your Dropbox in Learn@UW. See these instructions for uploading files to a Learn@UW Dropbox. The files you should upload are:
In order for your work to be considered to have been turned in on-time, you must upload your files to your Learn@UW Dropbox by 11:59 pm Friday, March 18. | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Updated: 3/8/2016 © 2016 Beck Hasti, hasti@cs.wisc.edu |