R/SCOC.R

Defines functions SCOC

Documented in SCOC

SCOC <- function(times, y=NULL, parms, Flux, ...) {

  if (is.null(y)){
    meanDepo <- mean(approx(Flux[,1],Flux[,2], xout=seq(1,365,by=1))$y)
    y <- meanDepo/parms
  } else if (length(y) != 1)
    stop ("length of state variable vector should be 1")

  if (length(parms) != 1)
    stop ("length of parameter vector should be 1")

  names(y) <- c("C")

  out <- vode(y, times, func = "scocder",
    parms = parms, dllname = "deSolve",
    initforc="scocforc",  forcings=Flux,
    initfunc = "scocpar", nout = 2,
    outnames = c("Mineralisation","Depo"),...)
  out
}

Try the deSolve package in your browser

Any scripts or data that you put into this service are public.

deSolve documentation built on Nov. 28, 2023, 1:11 a.m.