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

22-Aug-12

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 (the person next to you).

This semester we plan to conduct the Computer Labs as I did last year in Math 121 and 122. There will be two components to your Computer Lab. You will still be answering two or three questions each week, except for the weeks that have Exams (see HW Assignment Page for this information). The questions will be obtained through WeBWorK. There are related problems available for you to observe on my website, but the questions will be slightly changed to take advantage of the WeBWorK format. You should begin each lab by answering the questions related to the Help page for the Lab. We highly recommend that you do this before you enter the lab so that you are prepared for the main lab. Next you will bring up your specific lab questions on WeBWorK. Every student is likely to have different data based on the version of the problem selected for you and the random numbers generating certain data. However, the lab techniques employed are the same for every student. Thus, you will need to construct parallel Excel and Maple worksheets to get the correct answers for WeBWorK. You will be entering formulae and numerical answers into WeBWorK. This part of the Lab will account for a little over half of your grade (~60%). (Note: I will strongly discourage the use of Wolfram Alpha.)

The second part of the Lab is the graphics and writing component of the lab. This will be similar to what you did before. The Lab runs Excel and Word 2010. This part of the lab is written as a team. You select one version of each question from either partner, and use this to create your graphs. You will be creating good looking graphs in Excel much as you have before. These graphs will be graded based on if the graph looks correct and how good the formatting is. In addition, you will be writing brief paragraphs discussing aspects of the lab and summarizing the results. These paragraphs will be graded on grammar, spelling, and content related to answering the questions. You will create a lab report that has 2 cover sheets (unless there are more in the group), then simply include the question number with the graphs and paragraphs. You will not copy the specific Lab questions from WeBWorK.

Log onto the computer and download the Cover Page. Write the important contact information on you and your partner for compiling your written lab before turning it in as a pair. On the cover page you type in the name of each team member and your computer numbers.

Question 1: The von Bertalanffy's equation is a standard model used to fit data on the length of a fish as a function of its age. Also, we create an allometric model for the weight of a fish as a function of its length. The questions that you answer are very similar to the ones in Problem 13 in the Review of Differentiation (Set Bioc2revdiff) homework problems.

The von Bertalanffy equation is given by the model

L(t) = L0(1 - e-bt),

where the parameters L0 and b must be fit. You begin this problem by copying the data from the lab to an Excel spreadsheet. Place a label t (Age) in Cell A1 and label L (Length) in Cell B1. Put the Time data in Column A and Length data in Column B. These data are graphed (as data points) to see the length of the fish with age. Before writing our model equation, we make initial guesses for the parameters. Begin with a label L0 in G1, then guess an initial value in H1, which should correspond to the longest fish observed in the data and place this in H2. Label G2 as b, then as a rough guess, take b = 0.5 and place this in H2.

The next step is to use the feature in Excel that makes the labels into variables. Highlight the Column A, go to Formulas on the menu line. From there select "Create from Selection" and choose the option "Top Row." This gives the variable t. Then highlight G1 through H2. Repeat the procedure of going to Formulas on the menu line and selecting "Create from Selection." The option "Left Column" should be highlighted, so select "OK." This gives the variables L0 and b.

The formula above gives the equation for the model that is put in Column C. With the labels we can place in the cell C2 the formula for the model:

= L0*(1 - exp(-b*t))

Next you fill down the model to the end of the data.

In Column D, you compute the square error between the model and the data (= (C2-B2)^2). In the cell below the last square error computation, use the S symbol to sum the square error between the data and the model. This is the quantity we want to minimize. 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.) 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 minimize this Objective Cell, then click in the window for By Changing Variable Cells and highlighting the cells H1:H2, 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 L0 and bchange. This gives you your best model through the data.

To fit the allometric model we follow the techniques learned in Math 121 using Excel's trendline. This is readily accessed by right clicking on the data. You may need to increase the number of significant digits given to you by trendline. To obtain 5 significant figures, we right click on the formula, selecting Format Trendline Label, choose Number and Scientific, and finally select 5 Decimal Places. As in the first problem, the use of Maple might be valuable for helping with the differentiations (though you can practice your skills by doing them by hand). For this problem, the first and second derivatives are zero at t = 0, because the curve is very flat there. To get the point of inflection and the value of the function and the derivative at the point of inflection you need the following commands (assuming you see the point of inflection is between t = 1 and t = 20:

> L := t -> model goes here;

> dL := diff(L(t),t); # This gives the derivative

> sdL := diff(dL,t); # This gives the second derivative

> tp := fsolve(sdL=0, t = 1..20); # This gives the point of inflection

> L(tp); evalf(%); # This gives the population at the point of inflection

> subs(t = tp, dL); # This gives the derivative at the point of inflection

Question 2: This is another problem using real data. The first part of this problem has you finding a discrete logistic growth model for these beetles based on the data. Follow the directions carefully to obtain the right alignment of the data to use Excel's trendline polynomial fit and to get the right quadratic function here. Note that the function you are producing here is the updating function for finding the next population. The second part of Part a has you finding equilibria and determining the stability of the equilibria with derivatives. This part is probably best done using Maple. (You can probably do the logistic model by hand, but the other models will be much easier using Maple.) The next 3 parts of this question have you using Excel's Solver, much like you did in the Question 1 to find the best fitting models, then you will answer the same questions that you did for Part a. In Part e, you exercise your graphing skills that are important on tests. Again this will be made easier if you use Maple to help you accurately find derivatives and second derivatives to find critical points and points of inflection. Part e also asks you to step back and compare the different models. Try to get an overview of what you accomplished in this lab on the updating functions.

The last two parts have you simulate the models to compare the models to the time series data (the type most usually found). You take the original data (t in weeks and populations), then simulate each of the 4 models using the best updating functions that you found in the first part of the problem. (Simulation of these models is like the other simulations you did in Math 121 labs using discrete dynamical models.) You set the initial condition to agree with the actual data at t = 0. Use Excel's Solver to minimize the sum of square errors between the data and the model simulation by changing only the initial value. The rest of the problem is just extracting information and writing a discussion.