SDSU Math 122 Calculus for Biology II
Fall Semester, 2000
Lab Help
11-Oct-00
San Diego State University

Laboratory Help Page

This page is designed to provide helpful information about the laboratory questions. Begin this lab and every lab by introducing yourself to your partner. Detemine the times when you can meet together during the week before the lab is due on Friday, Oct. 20. If your schedules are totally incompatible, then notify me immediately.

You will probably want to download your specific lab page (and may want to convert it to a Word document). On the cover page you begin by typing in the name of each team member and your group number.

Question 1: This question is a standard optimization problem from classical Calculus that involves trigonometric functions and their understanding. You begin by taking the diagram provided in the lab and noting that the area of the trapezoid is readily broken into two parts, the central rectangle, which has a width of x and a height associated with the cos(q), and the two similar triangles on either side of this rectangle, which have heights the same as the rectangle and base related to the sin(q). You need to create the area formula based on these trigonometric functions. (Note that the volume for this trough is simply the area of the trapezoid times the length of the metal strip, which is a constant multiple of the area, but do be careful of the units of length in the problem.) Clearly, the only variable in the area function is q, so graphing the area on the given domain is relatively simple. The optimization of this area is a problem that you can do either on paper or by taking advantage of Maple and its ability to differentiate.

Question 2: This problem asks you to repeat some of the calculations required to produce the graphs that appear in the derivative of the trigonometric functions section on tides. Much of the most difficult work has already been done for you and is provided by a downloadable Excel worksheet. On this sheet there are two pages. One page has the data that was downloaded from the NOAA website on tide tables. This is then converted to data in hours for the entire month of October 2000 and the height of the tides in feet for San Diego. (You do NOT do anything to this particular sheet!) The second sheet contains the converted data transferred to columns A and C for use in your calculations for this lab. The mathematical model is in column D (which you will not change, but simply fill down), which sums together the four main forces that are in columns E through H. The entry in E2 is provided to help guide you in how you construct the entries in F2, G2, and H2. Create the entries in F2, G2, and H2, using the appropriate parameters from the entries in the table on the spreadsheet in cells L1 to O7. Note that these parameters already have an initial “guess” values for Ai and fi in cells L1 to O7. The computed height of the model now appears in D2, which sums cells E2 through H2. The square of the error is computed in cell I2.

The next step is to fill down all the entries in columns D through I to row 110. The sum of the square of the errors appears in J2. Now use Solver ( found under Tools), Set Target Cell as J2, equal to Min by changing cellsN3:O7. By selecting all the cells, Excel will find the combination of all these constants which gives the smallest difference from the actual values. This is the least squares fit that we have used before.

To create the graphs for either a week or a day, you need to first set in column A (below the current information or on a separate sheet) the appropriate range of hours for the desired graph, stepping 1 hour at a time. Do not forget to account for the fact that Oct. 1 goes from 0-24 hours. Column B will be found by taking the entries in column A and dividing by 24. In column C, you will want to put the model (which can be done by copying the model from above with appropriate reference changes or simply putting it in column D with the accompanying entries from columns E through H). Use chart wizard to create your graph and simply add the data from the appropriate range of the data already given to you.

To find the minima and maxima, you are going to use Maple. You enter the function in Maple from the numbers on your Excel spreadsheet. (You may find it easier to type in h1 := t -> A1*cos(2*Pi*t/P1 + phi1); using the correct values for A1, P1, and phi1, then do the same for h2, h3, and h4, and finally setting h := t -> A0 + h1(t) + h2(t) + h3(t) + h4(t);) Use the information on the spreadsheet to narrow the range of search for the key values (in hours) of the highest and lowest tides (or any other high or low tide), then proceed as you have always done to differentiate your function for the height of the tides and set the derivative equal to zero (diff and fsolve commands). Finally, you will need to convert your decimal times into times with hours and minutes to compare to the tide tables information. The remainder of the questions should follow readily from the answers provided above.

Question 3: The last question addresses the ideas of fitting data with Fourier series. This question uses data from the Hudson Bay company on either lynx or hares and has a downloadable Excel file to help you get started with the problem. Begin by downloading the Excel file from your particular lab, which contains the data. This sheet also has a good start to setting up Part a. of this problem.

To find an approximation for a0, you want the average of the data (which is readily found using the Excel function =average(B2:B22) and should be entered below the data). This number provides an initial guess to be typed into cell F2. (Copy the cell but paste using the use "paste special" from the edit menu, and select the "values" option)  The spreadsheet has 0.5 as first guesses for all the other parameters, a1, w, and f1.

The model is put in column H and the square of the difference between the model and the data is in column I. Next you fill down columns C, H, and I to row 22. In I23, you sum the square of the errors (column I). Use Solver under Tools to set this summation to the minumum value by changing cells F2 to F5.

In columns K, L, and M, we simulate the model every 0.25 year to get a smooth curve, filling down until you have completed 20 years. Graph the model using columns L and M, then add the real data to your graph. Remember to make the model a line and the data points as solitary points. You can compute the extrema by putting this model into Maple, differentiating and setting the derivative equal to zero, as we have done many times before.

Now we want to add in another sine function to the Fourier series model. We want to make a copy of this sheet. Go to the tab which says "sheet 1" at the bottom of the sheet and right click. Choose "Move or Copy", and then click the "create a copy" box. You can use the same right-click process to rename the second sheet if you wish.

In E6 and E7, we add the new parameters a2 and f2, giving them initial guesses of 0.5 in F6 and F7. (Note that we will be using the same frequency w for both sine functions.) You modify the model in both columns H and M by adding the additional sine function. For example, in H2, we now type =$F$2+$F$3*SIN($F$4*C2-$F$5)+$F$6*SIN(2*$F$4*C2-$F$7). This is only changing the original sheet by adding the last sine function with the new parameters a2 = $F$6 and f2 = $F$7 and multiplying the frequency w = $F$4 by 2. Again you fill down the new model columns and use the Excel solver to minimize the parameters now in cells F2 through F7.

Note that the period of this function is still computed from the period of the first sine function.

The procedure for the second sheet can be repeated two more times to give better Fourier approximations as asked for in Part c. The factors in front of the w are 3 and 4, respectively, for the next two approximations.