Math 121 Calculus for Biology
Spring Semester, 2013
Lab Help

08-Feb-12

San Diego State University


Laboratory Help Page for Lab 4

The first question examines exponential and logarithmic functions. These functions are compared to power functions, xr, where the power, r, is either an integer or a fraction. The second problem in this lab parallels the allometric lecture material and extends your work with Power Functions or Allometric Models. Thise question examines the modeling of species biodiversity on islands and is similar to the problem on the volume of trees done last week. The last problem examines Malthusian growth models. You may want to download the Excel spreadsheet for discrete dynamical systems to have a blueprint for how to work Malthusian growth models on Excel spreadsheets. The specific problem examines the U. S. population over its history and considers two methods of fitting census data to Malthusian growth models.

Problem 1: This problem compares the relative rate of growth of exponential functions to power functions and logarithmic functions to fractional power functions. You will be finding points of intersection for these graphs very much like you did last week, using Maple's fsolve command. You will need to search for appropriate intervals in Maple that show you the points of intersection. For the exponential function and the power function, you should find the first two points of intersection in a small interval near the origin, such as -2 < x < 2. The third point of intersection requires a larger interval, but should occur before x = 50. The second pair of graphs are a logarithmic function and a fractional power of x. In this case, you should be able to find your first point of intersection for 0< x < 10 . However, the second point of intersection could require a very large value of x. It should be less than x = 1020. You will want to take intervals 0< x < 10a, increasing the value of a until you see the graphs clearly intersecting.

As you did before, you first create the graphs in Maple, then use the information that you glean from the graphs to help you find the points of intersection (i.e., you restrict the range you search with fsolve for these points of intersection. Your lab report will have your graphs in Excel, but Maple graphs will be the quickest to find the points of intersection. Be sure to make your Excel graphs satisfy the same standards that we have applied to the graphs in the first 3 Labs. The only new Maple command that you will need is that exp(x) is used to give you ex (remember that the natural logarithm is given by ln(x)).

Problem 2: This problem is very similar to last week. The problem addresses the issue of biodiversity and the amount of land required to maintain a certain level of biological diversity. The model you produce gives a more quantitative answer to how much land is required, using Excel's power law. You are also asked to take the logarithm of the data by simply typing "=ln(x)" where x is the value of the data that you want. This part of the problem uses the linear fit, so after modifying the data to the logarithm of the data, then this problem is just like the linear fit problems that you have done before.

Problem 3 : This problem expands our work with the Malthusian growth model. We investigate the growth of the U. S. population over two periods of time with our Malthusian growth model. Furthermore, we fit the data with two different techniques. Recall that the Malthusian growth model is given by

Pn+1 = (1 + r)Pn ,

which given an initial population, P0, has the solution

Pn = (1 + r)nP0.

We want to find the best fitting parameters P0 and r for this model for the population data over a given interval of time.

We are given a range of data of the U. S. population that we want to fit with a Malthusian growth model. You create a table in Excel with the appropriate range of dates and their corresponding populations. (Say these are in Columns A and B with the first entries in A2 and B2. I like to label my columns so the labels are in A1 and B1.) Next we insert a column between A and B, so that we have a column for the time n in years after the starting date. Thus, Column B is labeled n and starts with 0 and goes in steps of 10 years, while Column C contains the census data. Create a graph using Columns B and C. The next step is to add Trendline, selecting the Exponential fit. This is actually a straight line fit to the logarithm of the y-data or a semi-log fit. As always, you select the option to display the equation on the chart and adjust the formula to have enough significant digits. This equation will have the form:

y = cekx,

where the constants c and k are determined by Excel. The solution of the Malthusian growth model has this form if you think Pn = y and n = x. It follows the the constant c = P0 and ek = 1 + r. It follows that the exponential fit by Excel easily gives you your values of P0 and r. To find the sum of square errors, you use the Malthusian growth model to fill down the model values in Column D. Then in Column E, it is easy to compute the square error between the data in Column C and the model in Column D. These are summed at the bottom of Column E to give you the sum of square errors.

The next model fit is the nonlinear least squares best fit to the data. Copy the first 3 columns above (Columns A, B, and C), so that you have the population data and the time n. The next step is to create say in Cells G1 and G2 the names P0 and r. In Cells H1 and H2 you insert reasonable guesses for these values (perhaps the ones you just found from the Trendline Exponential fit.) Proceed to name these variables so they can be used in your model. In Column D, construct the Malthusian growth model using your named variables. Once again, use Column E to compute the square error between the model and the data, then sum these square errors at the bottom of this column. Click on the cell with the sum of square errors. To find the least sum of square errors, we use Excel's Solver. (The first time, you have to add Solver. This is done by going to the File menu item and choosing "Options." Under "Options" select "Add-Ins" and check "Solver Add-in," then click on "Go." This should make Solver available on this computer for the future. Most computers will already have had this done by Math 122 students.) To use Solver, you go to the Data menu item, and Solver should appear on the right. Highlight the cell with the sum of square errors, then click on Solver under the Data menu. A window will pop up with the Set Objective cell being the one you just selected. You will need to check that you want to Min (short for minimize) this Objective Cell, then click in the window for By Changing Variable Cells and highlighting the cells H1:H3, which contain our model parameters. Finally, choose the Solve option, an Excel will automatically adjust your model parameters to minimize the least squares best fit. You should see the sum of square errors drop and the values for P0 and r change. This is you new model best fit, the nonlinear least square best fit to the data. Answering the remainder of the questions should be fairly easy from the work we have done in class.