-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathresource_logistic.Rd
88 lines (72 loc) · 3.05 KB
/
resource_logistic.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/resource_logistic.R
\name{resource_logistic}
\alias{resource_logistic}
\alias{balance_resource_logistic}
\title{Project resource using logistic model}
\usage{
resource_logistic(
params,
n,
n_pp,
n_other,
rates,
t,
dt,
resource_rate,
resource_capacity,
...
)
balance_resource_logistic(params, resource_rate, resource_capacity)
}
\arguments{
\item{params}{A \link{MizerParams} object}
\item{n}{A matrix of species abundances (species x size)}
\item{n_pp}{A vector of the resource abundance by size}
\item{n_other}{A list with the abundances of other components}
\item{rates}{A list of rates as returned by \code{\link[=mizerRates]{mizerRates()}}}
\item{t}{The current time}
\item{dt}{Time step}
\item{resource_rate}{Resource replenishment rate}
\item{resource_capacity}{Resource carrying capacity}
\item{...}{Unused}
}
\value{
Vector containing the resource number density in each size class at
the next timestep
}
\description{
If you set your resource dynamics to use this function then the time
evolution of the resource spectrum is described by a logistic equation
\deqn{\frac{\partial N_R(w,t)}{\partial t} = r_R(w) N_R(w)\Big[ 1 - \frac{N_R(w,t)}{c_R (w)} \Big] - \mu_R(w, t) N_R(w,t)}{dN_R(w,t)/d t = r_R(w) N_r(w)( 1 - N_R(w,t) / c_R (w)) - \mu_R(w,t ) N_R(w,t)}
}
\details{
Here \eqn{r_R(w)} is the resource regeneration rate and \eqn{c_R(w)} is the
carrying capacity in the absence of predation. These parameters are changed
with \code{\link[=setResource]{setResource()}}. The mortality \eqn{\mu_R(w, t)} is
due to predation by consumers and is calculate with \code{\link[=getResourceMort]{getResourceMort()}}.
This function uses the analytic solution of the above equation to calculate
the resource abundance at time \code{t + dt} from all abundances and rates at time
\code{t}, keeping the mortality fixed during the timestep.
To set your model to use logistic dynamics for the resource you do
\if{html}{\out{<div class="sourceCode">}}\preformatted{params <- setResource(params,
resource_dynamics = "resource_logistic",
resource_level = 0.5)
}\if{html}{\out{</div>}}
where you should replace \code{params} with the name of the variable holding your
MizerParams object. You can of course choose any value between 0 and 1 for
the resource level.
The \code{\link[=balance_resource_logistic]{balance_resource_logistic()}} function is called by \code{\link[=setResource]{setResource()}} to
determine the values of the resource parameters that are needed to make the
replenishment rate at each size equal the consumption rate at that size, as
calculated by \code{\link[=getResourceMort]{getResourceMort()}}. It should be called with only one of
\code{resource_rate} or \code{resource_capacity} should and will return a named list
with the values for both.
}
\seealso{
\code{\link[=setResource]{setResource()}}
Other resource dynamics functions:
\code{\link{resource_constant}()},
\code{\link{resource_semichemostat}()}
}
\concept{resource dynamics functions}