sdsu logo

Math 122 Calculus for Biology II
Fall Semester, 2012
Lab Help

14-Sep-12

San Diego State University


Laboratory Help Page

This page is designed to provide helpful information about the laboratory questions. You should start with your Cover Page and be sure that you have all the important contact information about your lab partner for coordination later in the week. On the cover page you begin by typing in the name of each team member and your Computer numbers. For your WeBWork answers, it is important that you keep all calculations to 5 or 6 significant figures. Too few digits have been one of the leading causes of errors that we have found when approached by students.

The first problem in this lab examines optimal foraging by seagulls consuming butter clams. The last two problems use sine or cosine models to fit periodic data. One considers the length of daylight over the course of a year. The other considers the periodic fluctuation of body temperature of a normal female during her menstrual cycle.

Problem 1: This problem is very similar to the material in the lecture notes, where crows drop whelks in an optimal foraging manner. This question examines the foraging behavior of Glaucous-winged gulls eating butter clams. The first part of the problem uses Excel's Solver under Data. Below are more detailed instructions for using this Solver. After obtaining the parameters for fitting the data, then the remainder of Part b. should be relatively straightforward application of the optimization techniques in the lecture notes, i.e., use the lectures notes to guide your computations. The last part of the problem notes that other biological factors must be entering into the gull foraging behavior, so this part requires you to think more biologically for the discussion rather than precise mathematical formulae. (It would be an interesting project for someone to run experiments to determine the precise amount of kleptoparasitism amongst these gulls, and then find a mathematical formula (penalty function) for the loss of food to other gulls in the area.)

Here are more detailed instructions on how to find the least squares best fit to the data.

Put the height data in column A, and the number of drops in column B. Put a label a in cell E1, then give it a value of 1 in cell F1. This is your starting guess for the value a. Similarly, put a label b in cell E2, then give it a value of 0 in cell F2. This is your starting guess for the value b. As you did in the previous lab, create names a and b for your two parameters.

In column C, use the values of a and b to calculate the number of drops, =1+a/(A1-b).  This can be copied down the column. In column D, find the square of the difference between the theory and experiment =(B1-C1)^2 for each data entry.  Then you find the sum of the squares by going to the cell at the bottom of these values in the D column and clicking the summation sign  S on your toolbar.

If you recall from our early lecture in Math 121, the most common scientific method of fitting data is to adjust your parameters in the problem to minimize the sum of the squares. This is known as finding the minimum of the Least Squares Estimate or the Least Squares Best Fit. This Least Squares Best Fit uses Excel's Solver (under Data), as we did in the previous lab. Once again, the Set Objective is the cell that you have just filled with the summation. You minimize (Min) this sum By Changing Variable Cells the values of a and b, in cells F1 and F2.

Create a graph of the data from columns A and B, then make a smooth function with the values of a and b found by solver. This is created by the instructions below where both the function N(H) and the energy function are created in small evenly spaced points. Overlay the graph of N(H) from columns G and H.

To calculate the energy, use column G and put in suitable values for H (from 0.5 every 0.1 units). Go to cell G1 and put in the value 0.5, then in G2 you insert =G1+0.1. In column H use your values of a and b to find the calculated value of N(H)  =1+a/(G1-b).  Use column I to calculate the energy function =k*G1*H1. Use the fill down feature to complete your values of the functions. By graphing the values in column I against those in column G, you can produce the energy graph. You may want to use Maple to find the actual value of the minimum as you want your answer to 5 significant figures.

Problem 2: You begin this problem by finding the date of the summer and winter solstices from the Navy tables provided in the hyperlink of the problem. These dates are used to determine the length of the longest and shortest days for your particular city (even though a date nearby might appear shorter because of rounding the times). Use the provided hyperlink to generate the length of all days for the calendar year. You will use the longest and shortest daylight times to give the best values of the parameters a, which is just the average of these times, and the amplitude b, which is the difference between the maximum length of daylight and the average amount of daylight. The frequency, w, is computed using the length of the year, which we take to be 365.2425 days. The phase shift, f, is based on the number of days from the beginning of the year to the time when the maximum amount of daylight occurs. This phase shift will also depend on where your particular trigonometric function has its maximum. You may want to consult how this is computed from the lecture notes. The easiest way to determine the day that a particular date occurs on is to start in one column in your Excel spreadsheet and type 01/01, which Excel will interpret as January 1. In the column beside that you insert 0. You pull down updating the dates and adding 1 to each cell below the 0, giving you the number of days after January 1 each date occurs. Most of the questions should be easy to answer using this information. You may find it interesting to see that the earliest and latest sunsets and sunrises do not occur on the shortest and longest days of the year due to the elliptical nature of Earth's orbit. 

Since we have not yet found the derivative of the sine and cosine functions in lecture, you will want to use Maple to compute these derivatives. You enter trigonometric functions in Maple just as you would expect:

> f := t -> 730 + 152*sin(0.054*(t - 110));

Problem 3: This problem is very similar to the one above. The daily body temperatures are averaged to estimate the coefficient A, while B is estimated by half the distance between the maximum and minimum temperatures over the month. The frequency, w, is computed by estimating the period to be 28 days (T = 28), then taking w = 2p/T. The phase shift depends on whether you have the cosine function, in which case you estimate d to be the time of the maximum temperature in the menstrual cycle, or the sine function, where you estimate d to be the time in the middle of the menstrual cycle where the temperature nearly matches the average temperature, A. With these estimates you create the trigonometric model and use Solver to find the best fitting parameters. After finding the best fitting model, you use Maple to compute the first and second derivatives. From the derivatives or a good understanding of these trigonometric functions you find the model's minimum, maximum, and point of inflection. From the notes last semester we learned that peak fertility is usually associated with the most rapid rise in the body temperature.