Debian Codegraph @

man/SCOC.Rd

raw
1 \name{SCOC}
2 \alias{SCOC}
3 \title{A Sediment Model of Oxygen Consumption}
4 \description{A model that describes oxygen consumption in a marine sediment.
5
6 One state variable:
7 \itemize{
8 \item sedimentary organic carbon,
9 }
10
11 Organic carbon settles on the sediment surface (forcing function Flux)
12 and decays at a constant rate.
13
14 The equation is simple:
15
16 \deqn{\frac{dC}{dt} = Flux - k C}
17
18 This model is written in \code{FORTRAN}.
19 }
20 \usage{SCOC(times, y = NULL, parms, Flux, ...)}
21 \arguments{
22 \item{times}{time sequence for which output is wanted; the first value
23 of times must be the initial time,}
24 \item{y}{the initial value of the state variable; if \code{NULL} it
25 will be estimated based on \code{Flux} and \code{parms},}
26 \item{parms }{the model parameter, \code{k},}
27 \item{Flux }{a data set with the organic carbon deposition rates, }
28 \item{...}{any other parameters passed to the integrator \code{ode}
29 (which solves the model).}
30 }
31 \author{Karline Soetaert <[email protected]>}
32 \examples{
33
34 ## Forcing function data
35 Flux <- matrix(ncol = 2, byrow = TRUE, data = c(
36 1, 0.654, 11, 0.167, 21, 0.060, 41, 0.070, 73,0.277, 83,0.186,
37 93,0.140,103, 0.255, 113, 0.231,123, 0.309,133,1.127,143,1.923,
38 153,1.091,163,1.001, 173, 1.691,183, 1.404,194,1.226,204,0.767,
39 214, 0.893,224,0.737, 234,0.772,244, 0.726,254,0.624,264,0.439,
40 274,0.168,284 ,0.280, 294,0.202,304, 0.193,315,0.286,325,0.599,
41 335, 1.889,345, 0.996,355,0.681,365,1.135))
42
43 parms <- c(k = 0.01)
44
45 times <- 1:365
46 out <- SCOC(times, parms = parms, Flux = Flux)
47
48 plot(out[,"time"], out[,"Depo"], type = "l", col = "red")
49 lines(out[,"time"], out[,"Mineralisation"], col = "blue")
50
51 ## Constant interpolation of forcing function - left side of interval
52 fcontrol <- list(method = "constant")
53
54 out2 <- SCOC(times, parms = parms, Flux = Flux, fcontrol = fcontrol)
55
56 plot(out2[,"time"], out2[,"Depo"], type = "l",col = "red")
57 lines(out2[,"time"], out2[,"Mineralisation"], col = "blue")
58 }
59 \references{
60 Soetaert, K. and P.M.J. Herman, 2009. A Practical Guide to Ecological
61 Modelling. Using \R as a Simulation Platform. Springer, 372 pp.
62 }
63 \details{
64 The model is implemented primarily to demonstrate the linking of
65 FORTRAN with \R-code.
66
67 The source can be found in the \file{doc/examples/dynload}
68 subdirectory of the package.
69 }
70 \seealso{
71 \code{\link{ccl4model}}, the CCl4 inhalation model.
72
73 \code{\link{aquaphy}}, the algal growth model.
74 }
75 \keyword{models}
76