PROBLEM SET 1 Simulation Models PART I: You will write a simple model of population growing in a resource-limited environment. You will create two version of the model: One version (Model 1) will be done in a spreadsheet and your second version (Model 2) will be done in a module of the spreadsheet using Visual Basic (VB). In doing so, you will have to do the following steps: 1. Activate EXCEL 2. Prepare spreadsheet by a. Naming the following worksheets “Parameters” “Model1” “Model2” b. Insert a macro module in the VB Editor” 3. In the “Parameter” worksheet set the initial conditions where N is the initial size of the population, TF is final time, R is the growth constant, K is the carrying capacity and dT is delta T. Assign them the following values: N = 5, R = 0.5 , K = 30, TF = 30, dT = 1 Both versions must create predictions of N at an annual interval for 30 years where N = N + dN and dN = R * N * (1-N/K) STEPS: For Model 1, use “Model 1” worksheet to write your program directly on the spreadsheet. You will need a column for T, N, and dN. In the same page create a N vs T graph. For Model 2, create a VB program in a VB Macro module. Read the initial conditions from the “Parameter” worksheet. You will need a time loop to calculate dN and to update N and T. Print the updated T and N in the “Model2” worksheet. On the same page create a graph of N vs T. PART II: Obtain a numerical solution of a model in the form of an ordinary differential equation. You will use the Euler and Runge-Kutta (RK) methods. You will have to write two models for the numerical integration of the Lotka-Volterra (LV) equations: dN/dt r * N - pr * N * P dP / dt = l * pr * N * P - c * P Where: N = population densities of the prey P = population densities of the predator r = the growth rate constant for the prey pr = the predation rate constant l = the assimilation constant c = the death rate constant for predators 1 The solution will require either very short time intervals or more advanced methods such as the Runge-Kutta. The results should include time, number of predators and number of prey. The amplitude of oscillations for both predator and prey should remain constant through time. The following parameters may be used to demonstrate the behavior of this model: No= 1500, Po = 50, r = .1, pr = 0.0002, c = 0.2, l = 0.1 Print the results of the simulations for one full prey-predator cycle. You must have at least 20 data points. Take care not to have the print intervals identical to the dt interval. STEPS: 1. You must write two programs (Euler and RK) in same EXCEL file. You could modify your previous population model (PART I) by altering the change rules. 2. For each of your programs do the following graphs 1. Prey and Predator dynamics (Prey and Predator Population vs time). 2. Phase plot of Prey vs Predator. 3. Explore the two models by changing their time intervals (dt) and look at the consequences for each of them. Submit: 1. You will need to submit one EXCEL file that contains: PART I (20 points) The two versions of the model Two graphs (N vs T), one for each version. PART II (20 points) Two VB Modules of the L-V model based on the Euler and Runge-Kutta solution procedures. For each model include two graphs: o Prey and Predator dynamics (Populations vs time) o Phase plot of Prey vs Predator 2. Also submit a document file consist of one page written report. You must start your report with the goals or objectives of the problem set. The report must end with a conclusion paragraph. PART I (20 points): A short discussion paragraph comparing the two approaches used in PART I, including their weakness and their strengths. PART II (20 points) A second discussion paragraph, comparing the two methods (RK vs Euler). Use your four graphs and the results of the model exploration in your discussion. Indicate when will be appropriate to use each of these procedures. 2