
AOE/ESM 2074
Introduction to Computational Methods
Practice Examination
5 December 2000
1. The only new material covered here is from Chapter 6. Material on Chapters 1 - 5 and
the numerical methods is best reviewed by considering the two in-semester exams and
the associated practice exams. You should also look over the homework problems.
2. A rectangular flat plate is instrumented with thermocouples (temperature sensors) to
measure the temperature(s) on the plate. The sensors are arranged in a regular grid
at locations (xı,y
)ı=1,2,...,m , =1,2,...n. The reading (in Celsius) from the
sensorshavebeenimportedinMatlabinanm×narray t. The corresponding arrays
for the sensor locations are also available as x(m×1) and y(n×1). Write a Matlab
code segment to generate a surface plot of the temperature. Include commands to
label the axes and the plot.
3. You are given a complex-valued function of a complex variable (that is w=F(z),
where zand ware complex variables). Suppose you construct a function .m file to
evaluate this function. Write a Matlab script file that will generate a contour plot
of the modulus of Fover a rectangular region of the complex plane given by R=
{z=x+ıy ||x|≤X, |y|≤Y}. Your script should ask the reader for the real values X
and Yand for the name of the function .m file. It should then generate the appropriate
data values and the contour plot. Be sure to include commands to label the axis and
the plot.
4. You are given an ascii file that includes lines of data with comments. All the lines
include the word time whichisfollowedbyanequalsignandatencharacterfieldwith
a decimal representation of the time value. Assume that a line from this file has been
read into the character array str input. Provide a Matlab code segment that will find
the word time in this array and then find the next equal sign (=). Your code should
result in the location within the charracter array str input that has the desired equal
sign. Provide a brief discussion of what error-checking you might consider for this
problem.
1