require(knitr) require(formatR) require(dplyr) options(width=200) knitr::opts_chunk$set(cache=FALSE,prompt=FALSE,comment=">",message=FALSE,echo=TRUE,warning=FALSE,tidy=TRUE,strip.white=TRUE,size="small", fig.align = "center",fig.show='hold')
In this assignment we will build a more sophisticated growth model in Excel and look at its properties. The model will be the growth model by Van Geert (1991 etc.) as discussed in the book chapter you read. If your are experienced in R
or Matlab
you can try to code the models following the instructions at the end of this assignment.
Before you begin, be sure to check the following settings (same as first asignment):
$
symbol fixes rows and columns when it used in a formula in your preferred spreadsheet program. The growth model by Van Geert has the following form:
$$ L_{t+1} = L_t * (1 + r – r·\frac{L_t}{K}) $$
To build it repeat some of the steps you performed in last week’s assignment on a new worksheet.
A5
, $L_0$ in A6
) and prepare the necessary things you need for building an iterative process. A7
. This is the carrying capacity. It receives the value $1$ in cell B7
.Take good notice of what is constant (parameters $r$ and $K$), for which the $
must be used, and what must change on every iterative step (variable $L_t$). Take about $100$ steps.
You can start playing with the values for the parameters and the initial values in cells B5
, B6
and B7
. To study this model’s behavior, be sure to try the following growth parameters:
For the carrying capacity $K$ (cell B7
) you can try the following values:
Changes in the values of $K$ have an effect on the height of the graph. The pattern itself also changes a bit. Can you explain why this is so?
Suppose we want to model that the growth rate $r$ increases after a certain amount has been learned. In general, this is a very common phenomenon, for instance: when becoming proficient at a skill, growth (in proficiency) is at first slow, but then all of a sudden there can be a jump to the appropriate (and sustained) level of proficiency.
Take the model you just built as a starting point with $r = 0.1$ (B5
)
C5
. This will be the new parameter value for $r$. B
(leave the original in A
).Suppose we want our parameter to change when a growth level of $0.2$ is reached. We’ll need an IF
statement which looks something like this: IF
$L > 0.2$ then use the parameter value in C5
, otherwise use the parameter value in B5
.
IF
function (may be ALS
in Dutch). IF
function, or just type it. TRUE
(then use parameter value in C5
) or when it is FALSE
(then use paramter value in B5
).C5
into: $1, 2, 2.8, 2.9, 3$. Another conditional change we might want to explore is that when a certain growth level is reached the carrying capacity K increases, reflecting that new resources have become available to support further growth.
B7
, $2$ in C7
.Build your model in column C. Follow the same steps as above, but now make sure that when $L > 0.99$, $K$ changes to the value in C7
. Keep $r = 0.2$ (B5
).
If all goes well you should see two stages when you create a graph of the timeseries in column C
. Change $K$ in C7
to other values.
C5
. Start with a value of $0.3$ in C5
. Set $K$ in C7
to $2$ again. You can now easly model coupled growth processes, in which the values in one series serve as the trigger for for parameter changes in the other process. Try to recreate the Figure of the connected growers printed in the chapter by Van Geert.
See the website by Paul Van Geert, scroll down to see models of:
In this assignment we will look at a 2D coupled dynamical system: the Predator-Prey model (aka Lotka-Volterra equations). If your are experienced in R
or Matlab
you can try to code the models following the instructions at the end of this assignment.
The dynamical system is given by the following set of first-order differential equations, one represents changes in a population of predators, (e.g., Foxes: $f_F(R_t,F_t)$ ), the other represents changes in a population of prey, (e.g., Rabbits: $f_R(R_t,F_t)$ ).
$$ \begin{align} \frac{dR}{dt}&=(a-bF)R \ \ \frac{dF}{dt}&=(cR-d)F \end{align} $$
This is not a difference equation but a differential equation, which means building this system is not as straightforward as was the case in the previous assignments. Simulation requires a numerical method to 'solve' this differential equation for time, which means we need a method to approach, or estimate continuous time in discrete time. Below you will receive a speed course in one of the simplest numerical procedures for integrating differential equations, the Euler method.
A general differential equation is given by:
$$\frac{dx}{dt} = f(x)$$
Read it as saying: "a change in $x$ over a change in time is a function of $x$ itself". This can be approximated by considering the change to be over some constant, small time step $\Delta$:
$$\frac{(x_{t+1} – x_t)}{\Delta} = f(x_t)$$
After rearranging the terms a more familiar form reveals itself:
$$ \begin{align} x_{t+1} – x_t &= f(x_t) * \Delta \ x_{t+1} &= f(x_t) * \Delta + x_t \end{align} $$
This looks like an ordinary iterative process, $\Delta$ the time constant determines the size of time step taken at every successive iteration. For a 2D system with variables R and F on would write:
$$ \begin{align} R_{t+1} &= f_R(R_t,Ft) * \Delta + R_t \ F_{t+1} &= f_F(R_t,F_t) * \Delta + F_t \end{align} $$
Implement the model in a spreadsheet by substituting $f_R(R_t,Ft)$ and $f_F(R_t,F_t)$ by the differential equations for Foxes and Rabbits given above.
The coupled predator-prey dynamics in the previous assignment are not a very realistic model of an actual ecological system. Both equations are exponential growth functions, but Rabbits for example, also have to eat! One way to increase realism is to consider coupled logistic growth by introducing a carrying capacity.
This is what interaction dynamics refers to, modeling mutual dependiencies using the
if ... then
conditional rules isn't really about interaction, or coupling between processes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.