aboutsummaryrefslogtreecommitdiff
path: root/R/HS.solution.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-10-25 00:37:42 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2019-10-25 02:03:54 +0200
commit0a3eb0893cb4bd1b12f07a79069d1c7f5e991495 (patch)
tree1bf0ffeb710b3438fee224d0a657606b4c36b495 /R/HS.solution.R
parent053bf27d3f265c7a7378e2df3e00cf891e0d1bb2 (diff)
Use roxygen for functions and methods
Diffstat (limited to 'R/HS.solution.R')
-rw-r--r--R/HS.solution.R35
1 files changed, 29 insertions, 6 deletions
diff --git a/R/HS.solution.R b/R/HS.solution.R
index 4651a6a8..890ad8ff 100644
--- a/R/HS.solution.R
+++ b/R/HS.solution.R
@@ -1,6 +1,29 @@
-HS.solution <- function(t, parent.0, k1, k2, tb)
-{
- parent = ifelse(t <= tb,
- parent.0 * exp(-k1 * t),
- parent.0 * exp(-k1 * tb) * exp(-k2 * (t - tb)))
-}
+#' Hockey-Stick kinetics
+#'
+#' Function describing two exponential decline functions with a break point
+#' between them.
+#'
+#' @param t Time.
+#' @param parent.0 Starting value for the response variable at time zero.
+#' @param k1 First kinetic constant.
+#' @param k2 Second kinetic constant.
+#' @param tb Break point. Before this time, exponential decline according to
+#' \code{k1} is calculated, after this time, exponential decline proceeds
+#' according to \code{k2}.
+#' @return The value of the response variable at time \code{t}.
+#' @references FOCUS (2006) \dQuote{Guidance Document on Estimating Persistence
+#' and Degradation Kinetics from Environmental Fate Studies on Pesticides in
+#' EU Registration} Report of the FOCUS Work Group on Degradation Kinetics,
+#' EC Document Reference Sanco/10058/2005 version 2.0, 434 pp,
+#' \url{http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics}
+#' @examples
+#'
+#' plot(function(x) HS.solution(x, 100, 2, 0.3, 0.5), 0, 2, ylim=c(0,100))
+#'
+#' @export
+HS.solution <- function(t, parent.0, k1, k2, tb)
+{
+ parent = ifelse(t <= tb,
+ parent.0 * exp(-k1 * t),
+ parent.0 * exp(-k1 * tb) * exp(-k2 * (t - tb)))
+}

Contact - Imprint