Natural resource mathematics
Q1. Consider a Discrete Logistic stock recruitment relationship,
Rt+1 = rRt(1 − Rt/k), (1)
where Rt
is recruit biomass at time t.
(a) Define a function in R that takes the current recruit size and the parameters
r and k and outputs the recruit biomass in the next time step.
Here is an example of how to write a function in R:
WeightedSum = function(x, y, w){
#weighted sum of x and y with weight w
wSum = w*x + (1-w)*y
return(wSum)
}
(b) Define a vector of R values from 0 to 100 with with increment 1. There are
several ways to do this. You can use the function in R called seq, or ‘:’. To
get help using a function in R type ‘?’ before the function name, for example
?seq. If you are using the RStudio text editor, a help file will appear on
the right explaining how to use the function. Now what if you don’t know
an increment width, but you know you want 250 values for R between 0 and
20. Use seq to generate this vector.
(c) Use your function in (a) and your vector in (b) to plot the recruitment
function evaluated at all values in your R vector (This is a plot of Rt+1
against Rt). Label the axes of your plot. Make the plot a smooth curve
rather than dots. You will need to include arguments in plot such as xlab
= “Rt”, and type = “l”. Let r = 1.5 and k = 100.
(d) Plot Population size Rt vs t for r = 1.5 and k = 100 for 25 time steps, and
an initial population size of 10 individuals. You will need to use a for loop
to do this.
Here is an example of a for loop which prints out the numbers 1 through
10 in the terminal
1
for(i in 1:10){
print(i)
}
(e) Generate an orbit diagram for this discrete time version of the logistic equation. In other words plot Rt
, for all t ∈ [1, 000 , 1, 500], vs. r, from r = 2.5
to r = 4. Think about this plot. What does it mean? Is it problematic for a
manager. Why would a manager might not want to use this model for large
values of r.
