# AMSC 660 / CMSC 660 Fall 2010

## Frequently Asked Questions for Homework 1

Question: 09-09-10 What is the due date? How should I submit it?

Answer: This assignment is due by 9:30am on Tuesday September 28.

• Submit your code by email attachment to zhouyunumd@gmail.com. Use tar or zip to bundle the code into a single file. Yun Zhou should be able to run your code.
• Submit your discussion, plots, Matlab diaries, etc. by hardcopy to me before class begins on the due date. You can bring it to class, or drop it off in my office. (It is ok to slide it under the door if I am not there, but not after I have left for class on the due date.) Do not put it in my mailbox.
• Question: 09-09-10 What are the point values for the challenges?

Challenge 1 : 5 points
Challenge 2 : 7 points
Challenge 3 : 10 points
Challenge 4 : 8 points
Challenge 5 : 10 points

Question: 09-09-10 What should I submit?

Answer: We grade everyone's Challenge 1, then everyone's Challenge 2, etc., to help insure uniformity in grading, so I would really appreciate your help in making this easy.

• Start each of the challenges on a new sheet of paper (or a new side of a sheet of paper), and keep them in order, stapled together. Your answer to each challenge might include a written derivation, a diary of the output, plots, and a discussion. Keep all of these together.
• Don't forget to email your Matlab code.
• Partial credit is given for partially-working programs.
• Late penalties (see syllabus) are calculated challenge-by-challenge, so if you are finished with some challenges but not all, submit what you have finished.
• Question: 09-10-10 Challenge 0.3 (b) asks us to partition the phantom into two halves and find the area using quad. I was wondering if, since we have already converted everything to polar coordinates, we could find the area using polar coordinates? That is, use the fact that Area = \int_0^{2\pi} 1/2 r(\theta)^2 d\theta where we have found r(\theta) by our interpolation?

Answer: That is a fine way to find the area, and it is ok to substitute it for Challenge 3b and 4b, using quad to estimate the area.

Question: 09-14-10 I was wondering if the regular "spline" function can be substituted for the spap2, spaps, or csaps functions from the Spline Toolbox, since the student version of MATLAB doesn't come with the Spline Toolbox.

Answer: Sorry, but you will need to use a machine from which you can access the Spline Toolbox. The "spline" function will interpolate the data rather than smoothing it. Since the data has error in it, following every wiggle is probably not the correct way to deal with the data.

Question: 09-14-10 The pointer labeled "Stokes Theorem" doesn't seem to be right.

Question: 09-15-10 In Challenge 0.2, are (b) and (c) asking the same question?

Answer: I mean them to be different, but it is not written clearly. In (b), I'm asking for a plot with theta on the horizontal axis and dhat on the vertical. In (c), I'm asking you to take Figure 1 and add to it your boundary curve.

Question: 09-19-10 I am working on the fourth part of the project (using the least-squares splines), and when I attempt to run on the Math computers and the Terpconnect computers), I received the following error:

Maximum number of users for Spline_Toolbox reached.
Try again later.
To see a list of current users use the lmstat utility.

Answer: Try typing "lmstat" into Matlab to see how many licenses there are.

Also, everyone should "quit" their Matlab session promptly when finished, so the licenses are released.

Question: 09-21-10 OK, if I understand parts (b) and (c) correctly, the former is a plot in polar coordinates and the latter is Cartesian.

Answer: (b) is Cartesian (d vs theta) and (c) is polar (giving a picture like Figure 1 in the assignment).

Question: 09-21-10 What are the units of the measurements?

Question: 09-22-10 In Challenge 3b, we should integrate a piecewise linear approximation that we get from calling spline with 3 arguments?

Answer: No, this is not good. You need to find the area determined by the cubic spline, not by a piecewise linear approximation to it. Call spline with 2 arguments so that it returns "pp". Then Matlab's ppval can be used in the function you pass to quad to evaluate the spline at any point.

Question: 09-23-10 How do we estimate the error in the answer that quad returns?

Answer: One thing you might do is call quad again with a smaller value of the "tol" parameter and see what happens.

Question: 09-23-10 As far as an estimate of the number of evaluations... do we just simply take how many times these things are called in the loops or is there something more basic that I am missing.

Answer: Yes, the number of times they are called in loops. For quad, there is a fcnt output variable that you can use.

Question: 09-24-10 I still don't understand Challenge 2c.

Answer: Let's use the 10th value of theta, theta_10, as an example. Take a piece of paper and draw the x-axis, Then draw a line, at an angle theta_10, starting at (0,0), with length d(theta_10). theta_10 is the angle between the line and the axis. Use geometry to figure out the (x,y) coordinates of the endpoint of the line. Now think about repeating this for all of the theta values and plotting the resulting set of (x,y) values as a curve. That is what 2c is asking for, along with the original data points plotted as circles. (Either use one "plot" statement, or use two "plot" statements with "hold on" in between.)

Question: