aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2022-11-18 09:12:49 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2022-11-18 09:12:49 +0100
commit13b3daaaa7c47d178ee59ab116aa71b7bf2f5c9b (patch)
tree5241148230437590a835b4400f817a3d07f37b6f
parent72c4bb7b4bb3b9f1f6cceba484f1de7adcc104a3 (diff)
Remove candidate patches that were accidentally committed
-rw-r--r--custom_lsoda_call.patch1587
-rw-r--r--custom_lsoda_call_edited.patch116
2 files changed, 0 insertions, 1703 deletions
diff --git a/custom_lsoda_call.patch b/custom_lsoda_call.patch
deleted file mode 100644
index d91a22c7..00000000
--- a/custom_lsoda_call.patch
+++ /dev/null
@@ -1,1587 +0,0 @@
-diff --git a/DESCRIPTION b/DESCRIPTION
-index de0fab8..a006a44 100644
---- a/DESCRIPTION
-+++ b/DESCRIPTION
-@@ -1,8 +1,8 @@
- Package: mkin
- Type: Package
- Title: Kinetic Evaluation of Chemical Degradation Data
--Version: 1.2.0
--Date: 2022-11-16
-+Version: 1.3.0
-+Date: 2022-11-15
- Authors@R: c(
- person("Johannes", "Ranke", role = c("aut", "cre", "cph"),
- email = "johannes.ranke@jrwb.de",
-@@ -22,8 +22,8 @@ Description: Calculation routines based on the FOCUS Kinetics Report (2006,
- Ranke et al. (2021) <doi:10.3390/environments8080071>. Please note that no
- warranty is implied for correctness of results or fitness for a particular
- purpose.
--Depends: R (>= 2.15.1),
--Imports: stats, graphics, methods, parallel, deSolve, R6, inline (>= 0.3.19),
-+Depends: R (>= 2.15.1), deSolve
-+Imports: stats, graphics, methods, parallel, R6, inline (>= 0.3.19),
- numDeriv, lmtest, pkgbuild, nlme (>= 3.1-151), saemix (>= 3.1), rlang, vctrs
- Suggests: knitr, rbenchmark, tikzDevice, testthat, rmarkdown, covr, vdiffr,
- benchmarkme, tibble, stats4, readxl
-diff --git a/NAMESPACE b/NAMESPACE
-index 107ffc5..4a41acc 100644
---- a/NAMESPACE
-+++ b/NAMESPACE
-@@ -147,7 +147,6 @@ export(status)
- export(tex_listing)
- export(transform_odeparms)
- export(which.best)
--import(deSolve)
- import(graphics)
- import(nlme)
- importFrom(R6,R6Class)
-diff --git a/NEWS.md b/NEWS.md
-index 22d5071..846c7c5 100644
---- a/NEWS.md
-+++ b/NEWS.md
-@@ -1,11 +1,5 @@
- # mkin 1.2.0 (unreleased)
-
--- 'R/saem.R': 'logLik', 'update' and 'anova' methods for 'saem.mmkin' objects.
--
--- 'R/saem.R': Automatic estimation of start parameters for random effects for the case of mkin transformations, nicely improving convergence and reducing problems with iterative ODE solutions.
--
--- 'R/status.R': New generic to show status information for fit array objects with methods for 'mmkin', 'mhmkin' and 'multistart' objects.
--
- - 'R/mhmkin.R': New method for performing multiple hierarchical mkin fits in one function call, optionally in parallel.
-
- - 'R/mhmkin.R': 'anova.mhmkin' for conveniently comparing the resulting fits.
-@@ -14,6 +8,12 @@
-
- - 'R/multistart.R': New method for testing multiple start parameters for hierarchical model fits, with function 'llhist' and new generic 'parplot' for diagnostics, and new generics 'which.best' and 'best' for extracting the fit with the highest likelihood
-
-+- 'R/saem.R': 'logLik', 'update' and 'anova' methods for 'saem.mmkin' objects.
-+
-+- 'R/saem.R': Automatic estimation of start parameters for random effects for the case of mkin transformations, nicely improving convergence and reducing problems with iterative ODE solutions.
-+
-+- 'R/status.R': New generic to show status information for fit array objects with methods for 'mmkin', 'mhmkin' and 'multistart' objects.
-+
- - 'R/summary.mmkin.R': Summary method for mmkin objects.
-
- - 'R/saem.R': Implement and test saemix transformations for FOMC and HS. Also, error out if saemix transformations are requested but not supported.
-diff --git a/R/mkinfit.R b/R/mkinfit.R
-index 693778f..0d9246d 100644
---- a/R/mkinfit.R
-+++ b/R/mkinfit.R
-@@ -500,6 +500,15 @@ mkinfit <- function(mkinmod, observed,
- }
- }
-
-+ # Get native symbol before iterations info for speed
-+ call_lsoda <- getNativeSymbolInfo("call_lsoda", PACKAGE = "deSolve")
-+ if (solution_type == "deSolve" & use_compiled[1] != FALSE) {
-+ mkinmod$diffs_address <- getNativeSymbolInfo("diffs",
-+ PACKAGE = mkinmod$dll_info[["name"]])$address
-+ mkinmod$initpar_address <- getNativeSymbolInfo("initpar",
-+ PACKAGE = mkinmod$dll_info[["name"]])$address
-+ }
-+
- # Get the error model and the algorithm for fitting
- err_mod <- match.arg(error_model)
- error_model_algorithm = match.arg(error_model_algorithm)
-@@ -610,7 +619,8 @@ mkinfit <- function(mkinmod, observed,
- solution_type = solution_type,
- use_compiled = use_compiled,
- method.ode = method.ode,
-- atol = atol, rtol = rtol, ...)
-+ atol = atol, rtol = rtol,
-+ call_lsoda = call_lsoda, ...)
-
- observed_index <- cbind(as.character(observed$time), as.character(observed$name))
- observed$predicted <- out[observed_index]
-@@ -892,7 +902,10 @@ mkinfit <- function(mkinmod, observed,
- fit$calls <- calls
- fit$time <- fit_time
-
-- # We also need the model and a model name for summary and plotting
-+ # We also need the model and a model name for summary and plotting,
-+ # but without address info that will become invalid
-+ mkinmod$diffs_address <- NULL
-+ mkinmod$initpar_address <- NULL
- fit$mkinmod <- mkinmod
- fit$mkinmod$name <- mkinmod_name
- fit$obs_vars <- obs_vars
-diff --git a/R/mkinmod.R b/R/mkinmod.R
-index d8740ae..b1fb57c 100644
---- a/R/mkinmod.R
-+++ b/R/mkinmod.R
-@@ -45,7 +45,9 @@
- #' @param dll_dir Directory where an DLL object, if generated internally by
- #' [inline::cfunction()], should be saved. The DLL will only be stored in a
- #' permanent location for use in future sessions, if 'dll_dir' and 'name'
--#' are specified.
-+#' are specified. This is helpful if fit objects are cached e.g. by knitr,
-+#' as the cache remains functional across sessions if the DLL is stored in
-+#' a user defined location.
- #' @param unload If a DLL from the target location in 'dll_dir' is already
- #' loaded, should that be unloaded first?
- #' @param overwrite If a file exists at the target DLL location in 'dll_dir',
-diff --git a/R/mkinpredict.R b/R/mkinpredict.R
-index 0dc9cf5..11a3b35 100644
---- a/R/mkinpredict.R
-+++ b/R/mkinpredict.R
-@@ -19,26 +19,24 @@
- #' @param solution_type The method that should be used for producing the
- #' predictions. This should generally be "analytical" if there is only one
- #' observed variable, and usually "deSolve" in the case of several observed
--#' variables. The third possibility "eigen" is faster but not applicable to
--#' some models e.g. using FOMC for the parent compound.
-+#' variables. The third possibility "eigen" is fast in comparison to uncompiled
-+#' ODE models, but not applicable to some models, e.g. using FOMC for the
-+#' parent compound.
- #' @param method.ode The solution method passed via [mkinpredict] to [ode]] in
--#' case the solution type is "deSolve". The default "lsoda" is performant, but
--#' sometimes fails to converge.
-+#' case the solution type is "deSolve" and we are not using compiled code.
- #' @param use_compiled If set to \code{FALSE}, no compiled version of the
- #' [mkinmod] model is used, even if is present.
--#' @param atol Absolute error tolerance, passed to [ode]. Default is 1e-8,
--#' lower than in [lsoda].
--#' @param rtol Absolute error tolerance, passed to [ode]. Default is 1e-10,
--#' much lower than in [lsoda].
--#' @param maxsteps Maximum number of steps, passed to [ode].
-+#' @param atol Absolute error tolerance, passed to the ode solver.
-+#' @param rtol Absolute error tolerance, passed to the ode solver.
-+#' @param maxsteps Maximum number of steps, passed to the ode solver.
- #' @param map_output Boolean to specify if the output should list values for
- #' the observed variables (default) or for all state variables (if set to
- #' FALSE). Setting this to FALSE has no effect for analytical solutions,
- #' as these always return mapped output.
- #' @param na_stop Should it be an error if [ode] returns NaN values
-+#' @param call_lsoda The address of the compiled function "call_lsoda"
- #' @param \dots Further arguments passed to the ode solver in case such a
- #' solver is used.
--#' @import deSolve
- #' @return A matrix with the numeric solution in wide format
- #' @author Johannes Ranke
- #' @examples
-@@ -116,9 +114,10 @@ mkinpredict.mkinmod <- function(x,
- outtimes = seq(0, 120, by = 0.1),
- solution_type = "deSolve",
- use_compiled = "auto",
-- method.ode = "lsoda", atol = 1e-8, rtol = 1e-10, maxsteps = 20000,
-+ method.ode = "lsoda", atol = 1e-8, rtol = 1e-10, maxsteps = 20000L,
- map_output = TRUE,
- na_stop = TRUE,
-+ call_lsoda = NULL,
- ...)
- {
-
-@@ -173,20 +172,80 @@ mkinpredict.mkinmod <- function(x,
- if (solution_type == "deSolve") {
- if (!is.null(x$cf) & use_compiled[1] != FALSE) {
-
-- out <- deSolve::ode(
-- y = odeini,
-- times = outtimes,
-- func = "diffs",
-- initfunc = "initpar",
-- dllname = if (is.null(x$dll_info)) inline::getDynLib(x$cf)[["name"]]
-- else x$dll_info[["name"]],
-- parms = odeparms[x$parms], # Order matters when using compiled models
-- method = method.ode,
-- atol = atol,
-- rtol = rtol,
-- maxsteps = maxsteps,
-- ...
-+# out <- deSolve::ode(
-+# y = odeini,
-+# times = outtimes,
-+# func = "diffs",
-+# initfunc = "initpar",
-+# dllname = x$dll_info[["name"]],
-+# parms = odeparms[x$parms], # Order matters when using compiled models
-+# method = method.ode,
-+# atol = atol,
-+# rtol = rtol,
-+# maxsteps = maxsteps,
-+# ...
-+# )
-+#
-+ # Prepare call to "call_lsoda"
-+ # Simplified code from deSolve::lsoda() adapted to our use case
-+ if (is.null(call_lsoda)) {
-+ call_lsoda <- getNativeSymbolInfo("call_lsoda", PACKAGE = "deSolve")
-+ }
-+ if (is.null(x$diffs_address)) {
-+ x$diffs_address <- getNativeSymbolInfo("diffs",
-+ PACKAGE = x$dll_info[["name"]])$address
-+ x$initpar_address <- getNativeSymbolInfo("initpar",
-+ PACKAGE = x$dll_info[["name"]])$address
-+ }
-+ rwork <- vector("double", 20)
-+ rwork[] <- 0.
-+ rwork[6] <- max(abs(diff(outtimes)))
-+
-+ iwork <- vector("integer", 20)
-+ iwork[] <- 0
-+ iwork[6] <- maxsteps
-+
-+ n <- length(odeini)
-+ lmat <- n^2 + 2 # from deSolve::lsoda(), for Jacobian type full, internal (2)
-+ # hard-coded default values of lsoda():
-+ maxordn <- 12L
-+ maxords <- 5L
-+ lrn <- 20 + n * (maxordn + 1) + 3 * n # length in case non-stiff method
-+ lrs <- 20 + n * (maxords + 1) + 3 * n + lmat # length in case stiff method
-+ lrw <- max(lrn, lrs) # actual length: max of both
-+ liw <- 20 + n
-+
-+ on.exit(.C("unlock_solver", PACKAGE = "deSolve"))
-+
-+ out_raw <- .Call(call_lsoda,
-+ as.double(odeini), # y
-+ as.double(outtimes), # times
-+ x$diffs_address, # derivfunc
-+ as.double(odeparms[x$parms]), # parms
-+ rtol, atol,
-+ NULL, NULL, # rho, tcrit
-+ NULL, # jacfunc
-+ x$initpar_address, # initfunc
-+ NULL, # eventfunc
-+ 0L, # verbose
-+ 1L, # iTask
-+ as.double(rwork), # rWork
-+ as.integer(iwork), # iWork
-+ 2L, # jT full Jacobian calculated internally
-+ 0L, # nOut
-+ as.integer(lrw), # lRw
-+ as.integer(liw), # lIw
-+ 1L, # Solver
-+ NULL, # rootfunc
-+ 0L, as.double(0), 0L, # nRoot, Rpar, Ipar
-+ 0L, # Type
-+ list(fmat = 0L, tmat = 0L, imat = 0L, ModelForc = NULL), # flist
-+ list(), # elist
-+ list(islag = 0L) # elag
- )
-+
-+ out <- t(out_raw)
-+ colnames(out) <- c("time", mod_vars)
- } else {
- mkindiff <- function(t, state, parms) {
-
-diff --git a/R/nlme.mmkin.R b/R/nlme.mmkin.R
-index 09cb84b..e193e5e 100644
---- a/R/nlme.mmkin.R
-+++ b/R/nlme.mmkin.R
-@@ -186,10 +186,24 @@ nlme.mmkin <- function(model, data = "auto",
- thisCall[["control"]] <- control
- }
-
-+ # Provide the address of call_lsoda to the fitting function
-+ call_lsoda <- getNativeSymbolInfo("call_lsoda", PACKAGE = "deSolve")
-+ if (model[[1]]$solution_type == "deSolve" & !is.null(model[[1]]$mkinmod$cf)) {
-+ # The mkinmod stored in the first fit will be used by nlme
-+ model[[1]]$mkinmod$diffs_address <- getNativeSymbolInfo("diffs",
-+ PACKAGE = model[[1]]$mkinmod$dll_info[["name"]])$address
-+ model[[1]]$mkinmod$initpar_address <- getNativeSymbolInfo("initpar",
-+ PACKAGE = model[[1]]$mkinmod$dll_info[["name"]])$address
-+ }
-+
- fit_time <- system.time(val <- do.call("nlme.formula", thisCall))
- val$time <- fit_time
-
- val$mkinmod <- model[[1]]$mkinmod
-+ # Don't return addresses that will become invalid
-+ val$mkinmod$diffs_address <- NULL
-+ val$mkinmod$initpar_address <- NULL
-+
- val$data <- thisCall[["data"]]
- val$mmkin <- model
- if (is.list(start)) val$mean_dp_start <- start$fixed
-diff --git a/R/read_spreadsheet.R b/R/read_spreadsheet.R
-index 7ad09c3..a20af6d 100644
---- a/R/read_spreadsheet.R
-+++ b/R/read_spreadsheet.R
-@@ -37,7 +37,7 @@
- #' and moisture normalisation factors in the sheet 'Datasets'?
- #' @export
- read_spreadsheet <- function(path, valid_datasets = "all",
-- parent_only = FALSE, normalize = TRUE)
-+ parent_only = TRUE, normalize = TRUE)
- {
- if (!requireNamespace("readxl", quietly = TRUE))
- stop("Please install the readxl package to use this function")
-diff --git a/R/saem.R b/R/saem.R
-index 696ea0e..5b8021d 100644
---- a/R/saem.R
-+++ b/R/saem.R
-@@ -120,12 +120,12 @@ utils::globalVariables(c("predicted", "std"))
- #' summary(f_saem_dfop_sfo, data = TRUE)
- #'
- #' # The following takes about 6 minutes
--#' #f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve",
--#' # control = list(nbiter.saemix = c(200, 80), nbdisplay = 10))
-+#' f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve",
-+#' nbiter.saemix = c(200, 80))
- #'
--#' #saemix::compare.saemix(list(
--#' # f_saem_dfop_sfo$so,
--#' # f_saem_dfop_sfo_deSolve$so))
-+#' #anova(
-+#' # f_saem_dfop_sfo,
-+#' # f_saem_dfop_sfo_deSolve))
- #'
- #' # If the model supports it, we can also use eigenvalue based solutions, which
- #' # take a similar amount of time
-@@ -580,6 +580,15 @@ saemix_model <- function(object, solution_type = "auto",
- transform_rates <- object[[1]]$transform_rates
- transform_fractions <- object[[1]]$transform_fractions
-
-+ # Get native symbol info for speed
-+ call_lsoda <- getNativeSymbolInfo("call_lsoda", PACKAGE = "deSolve")
-+ if (solution_type == "deSolve" & !is.null(mkin_model$cf)) {
-+ mkin_model$diffs_address <- getNativeSymbolInfo("diffs",
-+ PACKAGE = mkin_model$dll_info[["name"]])$address
-+ mkin_model$initpar_address <- getNativeSymbolInfo("initpar",
-+ PACKAGE = mkin_model$dll_info[["name"]])$address
-+ }
-+
- # Define the model function
- model_function <- function(psi, id, xidep) {
-
-@@ -613,7 +622,8 @@ saemix_model <- function(object, solution_type = "auto",
- odeparms = odeparms, odeini = odeini,
- solution_type = solution_type,
- outtimes = sort(unique(i_time)),
-- na_stop = FALSE
-+ na_stop = FALSE,
-+ call_lsoda = call_lsoda
- )
-
- out_index <- cbind(as.character(i_time), as.character(i_name))
-diff --git a/docs/dev/articles/mkin.html b/docs/dev/articles/mkin.html
-index 27e532a..6bfb63b 100644
---- a/docs/dev/articles/mkin.html
-+++ b/docs/dev/articles/mkin.html
-@@ -34,7 +34,7 @@
- </button>
- <span class="navbar-brand">
- <a class="navbar-link" href="../index.html">mkin</a>
-- <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">1.2.0</span>
-+ <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">1.1.0</span>
- </span>
- </div>
-
-@@ -44,7 +44,7 @@
- <a href="../reference/index.html">Functions and data</a>
- </li>
- <li class="dropdown">
-- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
-+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
- Articles
-
- <span class="caret"></span>
-@@ -60,17 +60,11 @@
- <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a>
- </li>
- <li>
-- <a href="../articles/web_only/dimethenamid_2018.html">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models</a>
-- </li>
-- <li>
-- <a href="../articles/web_only/multistart.html">Short demo of the multistart method</a>
-+ <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a>
- </li>
- <li>
- <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a>
- </li>
-- <li>
-- <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a>
-- </li>
- <li>
- <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a>
- </li>
-@@ -78,10 +72,7 @@
- <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a>
- </li>
- <li>
-- <a href="../articles/web_only/benchmarks.html">Benchmark timings for mkin</a>
-- </li>
-- <li>
-- <a href="../articles/web_only/saem_benchmarks.html">Benchmark timings for saem.mmkin</a>
-+ <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a>
- </li>
- </ul>
- </li>
-@@ -112,7 +103,7 @@
- <h1 data-toc-skip>Introduction to mkin</h1>
- <h4 data-toc-skip class="author">Johannes Ranke</h4>
-
-- <h4 data-toc-skip class="date">Last change 15 February 2021 (rebuilt 2022-11-16)</h4>
-+ <h4 data-toc-skip class="date">Last change 15 February 2021 (rebuilt 2022-02-28)</h4>
-
- <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/HEAD/vignettes/mkin.rmd" class="external-link"><code>vignettes/mkin.rmd</code></a></small>
- <div class="hidden name"><code>mkin.rmd</code></div>
-@@ -127,34 +118,34 @@
- </h2>
- <p>In the regulatory evaluation of chemical substances like plant protection products (pesticides), biocides and other chemicals, degradation data play an important role. For the evaluation of pesticide degradation experiments, detailed guidance has been developed, based on nonlinear optimisation. The <code>R</code> add-on package <code>mkin</code> implements fitting some of the models recommended in this guidance from within R and calculates some statistical measures for data series within one or more compartments, for parent and metabolites.</p>
- <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
--<code class="sourceCode R"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
--<span><span class="co"># Define the kinetic model</span></span>
--<span><span class="va">m_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>,</span>
--<span> M1 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M2"</span><span class="op">)</span>,</span>
--<span> M2 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>,</span>
--<span> use_of_ff <span class="op">=</span> <span class="st">"max"</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
--<span></span>
--<span></span>
--<span><span class="co"># Produce model predictions using some arbitrary parameters</span></span>
--<span><span class="va">sampling_times</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">28</span>, <span class="fl">60</span>, <span class="fl">90</span>, <span class="fl">120</span><span class="op">)</span></span>
--<span><span class="va">d_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinpredict.html">mkinpredict</a></span><span class="op">(</span><span class="va">m_SFO_SFO_SFO</span>,</span>
--<span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>k_parent <span class="op">=</span> <span class="fl">0.03</span>,</span>
--<span> f_parent_to_M1 <span class="op">=</span> <span class="fl">0.5</span>, k_M1 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log</a></span><span class="op">(</span><span class="fl">2</span><span class="op">)</span><span class="op">/</span><span class="fl">100</span>,</span>
--<span> f_M1_to_M2 <span class="op">=</span> <span class="fl">0.9</span>, k_M2 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log</a></span><span class="op">(</span><span class="fl">2</span><span class="op">)</span><span class="op">/</span><span class="fl">50</span><span class="op">)</span>,</span>
--<span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fl">100</span>, M1 <span class="op">=</span> <span class="fl">0</span>, M2 <span class="op">=</span> <span class="fl">0</span><span class="op">)</span>,</span>
--<span> <span class="va">sampling_times</span><span class="op">)</span></span>
--<span></span>
--<span><span class="co"># Generate a dataset by adding normally distributed errors with</span></span>
--<span><span class="co"># standard deviation 3, for two replicates at each sampling time</span></span>
--<span><span class="va">d_SFO_SFO_SFO_err</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/add_err.html">add_err</a></span><span class="op">(</span><span class="va">d_SFO_SFO_SFO</span>, reps <span class="op">=</span> <span class="fl">2</span>,</span>
--<span> sdfunc <span class="op">=</span> <span class="kw">function</span><span class="op">(</span><span class="va">x</span><span class="op">)</span> <span class="fl">3</span>,</span>
--<span> n <span class="op">=</span> <span class="fl">1</span>, seed <span class="op">=</span> <span class="fl">123456789</span> <span class="op">)</span></span>
--<span></span>
--<span><span class="co"># Fit the model to the dataset</span></span>
--<span><span class="va">f_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">m_SFO_SFO_SFO</span>, <span class="va">d_SFO_SFO_SFO_err</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
--<span></span>
--<span><span class="co"># Plot the results separately for parent and metabolites</span></span>
--<span><span class="fu"><a href="../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">f_SFO_SFO_SFO</span>, lpos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"topright"</span>, <span class="st">"bottomright"</span>, <span class="st">"bottomright"</span><span class="op">)</span><span class="op">)</span></span></code></pre></div>
-+<code class="sourceCode R"><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="st"><a href="https://pkgdown.jrwb.de/mkin/">"mkin"</a></span>, quietly <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
-+<span class="co"># Define the kinetic model</span>
-+<span class="va">m_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinmod.html">mkinmod</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M1"</span><span class="op">)</span>,
-+ M1 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"M2"</span><span class="op">)</span>,
-+ M2 <span class="op">=</span> <span class="fu"><a href="../reference/mkinmod.html">mkinsub</a></span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>,
-+ use_of_ff <span class="op">=</span> <span class="st">"max"</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
-+
-+
-+<span class="co"># Produce model predictions using some arbitrary parameters</span>
-+<span class="va">sampling_times</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">1</span>, <span class="fl">3</span>, <span class="fl">7</span>, <span class="fl">14</span>, <span class="fl">28</span>, <span class="fl">60</span>, <span class="fl">90</span>, <span class="fl">120</span><span class="op">)</span>
-+<span class="va">d_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinpredict.html">mkinpredict</a></span><span class="op">(</span><span class="va">m_SFO_SFO_SFO</span>,
-+ <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>k_parent <span class="op">=</span> <span class="fl">0.03</span>,
-+ f_parent_to_M1 <span class="op">=</span> <span class="fl">0.5</span>, k_M1 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log</a></span><span class="op">(</span><span class="fl">2</span><span class="op">)</span><span class="op">/</span><span class="fl">100</span>,
-+ f_M1_to_M2 <span class="op">=</span> <span class="fl">0.9</span>, k_M2 <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/Log.html" class="external-link">log</a></span><span class="op">(</span><span class="fl">2</span><span class="op">)</span><span class="op">/</span><span class="fl">50</span><span class="op">)</span>,
-+ <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>parent <span class="op">=</span> <span class="fl">100</span>, M1 <span class="op">=</span> <span class="fl">0</span>, M2 <span class="op">=</span> <span class="fl">0</span><span class="op">)</span>,
-+ <span class="va">sampling_times</span><span class="op">)</span>
-+
-+<span class="co"># Generate a dataset by adding normally distributed errors with</span>
-+<span class="co"># standard deviation 3, for two replicates at each sampling time</span>
-+<span class="va">d_SFO_SFO_SFO_err</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/add_err.html">add_err</a></span><span class="op">(</span><span class="va">d_SFO_SFO_SFO</span>, reps <span class="op">=</span> <span class="fl">2</span>,
-+ sdfunc <span class="op">=</span> <span class="kw">function</span><span class="op">(</span><span class="va">x</span><span class="op">)</span> <span class="fl">3</span>,
-+ n <span class="op">=</span> <span class="fl">1</span>, seed <span class="op">=</span> <span class="fl">123456789</span> <span class="op">)</span>
-+
-+<span class="co"># Fit the model to the dataset</span>
-+<span class="va">f_SFO_SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu"><a href="../reference/mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">m_SFO_SFO_SFO</span>, <span class="va">d_SFO_SFO_SFO_err</span><span class="op">[[</span><span class="fl">1</span><span class="op">]</span><span class="op">]</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span>
-+
-+<span class="co"># Plot the results separately for parent and metabolites</span>
-+<span class="fu"><a href="../reference/plot.mkinfit.html">plot_sep</a></span><span class="op">(</span><span class="va">f_SFO_SFO_SFO</span>, lpos <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"topright"</span>, <span class="st">"bottomright"</span>, <span class="st">"bottomright"</span><span class="op">)</span><span class="op">)</span></code></pre></div>
- <p><img src="mkin_files/figure-html/unnamed-chunk-2-1.png" width="768"></p>
- </div>
- <div class="section level2">
-@@ -233,10 +224,10 @@
- <p>Ranke, J. 2021. <em>‘mkin‘: Kinetic Evaluation of Chemical Degradation Data</em>. <a href="https://CRAN.R-project.org/package=mkin" class="external-link">https://CRAN.R-project.org/package=mkin</a>.</p>
- </div>
- <div id="ref-ranke2012">
--<p>Ranke, J., and R. Lehmann. 2012. “Parameter Reliability in Kinetic Evaluation of Environmental Metabolism Data - Assessment and the Influence of Model Specification.” In <em>SETAC World 20-24 May</em>. Berlin. <a href="https://jrwb.de/posters/Poster_SETAC_2012_Kinetic_parameter_uncertainty_model_parameterization_Lehmann_Ranke.pdf" class="external-link">https://jrwb.de/posters/Poster_SETAC_2012_Kinetic_parameter_uncertainty_model_parameterization_Lehmann_Ranke.pdf</a>.</p>
-+<p>Ranke, J., and R. Lehmann. 2012. “Parameter Reliability in Kinetic Evaluation of Environmental Metabolism Data - Assessment and the Influence of Model Specification.” In <em>SETAC World 20-24 May</em>. Berlin.</p>
- </div>
- <div id="ref-ranke2015">
--<p>———. 2015. “To T-Test or Not to T-Test, That Is the Question.” In <em>XV Symposium on Pesticide Chemistry 2-4 September 2015</em>. Piacenza. <a href="https://jrwb.de/posters/piacenza_2015.pdf" class="external-link">https://jrwb.de/posters/piacenza_2015.pdf</a>.</p>
-+<p>———. 2015. “To T-Test or Not to T-Test, That Is the Question.” In <em>XV Symposium on Pesticide Chemistry 2-4 September 2015</em>. Piacenza. <a href="http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf" class="external-link">http://chem.uft.uni-bremen.de/ranke/posters/piacenza_2015.pdf</a>.</p>
- </div>
- <div id="ref-ranke2019">
- <p>Ranke, Johannes, and Stefan Meinecke. 2019. “Error Models for the Kinetic Evaluation of Chemical Degradation Data.” <em>Environments</em> 6 (12). <a href="https://doi.org/10.3390/environments6120124" class="external-link">https://doi.org/10.3390/environments6120124</a>.</p>
-@@ -271,7 +262,7 @@
-
- <div class="pkgdown">
- <p></p>
--<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
-+<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.2.</p>
- </div>
-
- </footer>
-diff --git a/docs/dev/articles/web_only/saem_benchmarks.html b/docs/dev/articles/web_only/saem_benchmarks.html
-index afff038..e54bc38 100644
---- a/docs/dev/articles/web_only/saem_benchmarks.html
-+++ b/docs/dev/articles/web_only/saem_benchmarks.html
-@@ -112,7 +112,7 @@
- <h1 data-toc-skip>Benchmark timings for saem.mmkin</h1>
- <h4 data-toc-skip class="author">Johannes Ranke</h4>
-
-- <h4 data-toc-skip class="date">Last change 14 November 2022 (rebuilt 2022-11-16)</h4>
-+ <h4 data-toc-skip class="date">Last change 14 November 2022 (rebuilt 2022-11-15)</h4>
-
- <small class="dont-index">Source: <a href="https://github.com/jranke/mkin/blob/HEAD/vignettes/web_only/saem_benchmarks.rmd" class="external-link"><code>vignettes/web_only/saem_benchmarks.rmd</code></a></small>
- <div class="hidden name"><code>saem_benchmarks.rmd</code></div>
-@@ -309,10 +309,10 @@
- <td align="left">Linux</td>
- <td align="left">1.2.0</td>
- <td align="left">3.2</td>
--<td align="right">2.156</td>
--<td align="right">4.647</td>
--<td align="right">4.296</td>
--<td align="right">4.951</td>
-+<td align="right">2.11</td>
-+<td align="right">4.632</td>
-+<td align="right">4.264</td>
-+<td align="right">4.93</td>
- </tr></tbody>
- </table>
- <p>Two-component error fits for SFO, DFOP, SFORB and HS.</p>
-@@ -332,10 +332,10 @@
- <td align="left">Linux</td>
- <td align="left">1.2.0</td>
- <td align="left">3.2</td>
--<td align="right">5.645</td>
--<td align="right">7.415</td>
--<td align="right">7.848</td>
--<td align="right">7.967</td>
-+<td align="right">5.602</td>
-+<td align="right">7.373</td>
-+<td align="right">7.815</td>
-+<td align="right">7.831</td>
- </tr></tbody>
- </table>
- </div>
-@@ -357,8 +357,8 @@
- <td align="left">Linux</td>
- <td align="left">1.2.0</td>
- <td align="left">3.2</td>
--<td align="right">24.182</td>
--<td align="right">783.932</td>
-+<td align="right">24.014</td>
-+<td align="right">749.699</td>
- </tr></tbody>
- </table>
- </div>
-@@ -379,7 +379,7 @@
- <td align="left">Linux</td>
- <td align="left">1.2.0</td>
- <td align="left">3.2</td>
--<td align="right">1322.5</td>
-+<td align="right">1249.834</td>
- </tr></tbody>
- </table>
- </div>
-diff --git a/docs/dev/news/index.html b/docs/dev/news/index.html
-index 3353922..8448ebc 100644
---- a/docs/dev/news/index.html
-+++ b/docs/dev/news/index.html
-@@ -89,13 +89,13 @@
-
- <div class="section level2">
- <h2 class="page-header" data-toc-text="1.2.0" id="mkin-120-unreleased">mkin 1.2.0 (unreleased)<a class="anchor" aria-label="anchor" href="#mkin-120-unreleased"></a></h2>
--<ul><li><p>‘R/saem.R’: ‘logLik’, ‘update’ and ‘anova’ methods for ‘saem.mmkin’ objects.</p></li>
--<li><p>‘R/saem.R’: Automatic estimation of start parameters for random effects for the case of mkin transformations, nicely improving convergence and reducing problems with iterative ODE solutions.</p></li>
--<li><p>‘R/status.R’: New generic to show status information for fit array objects with methods for ‘mmkin’, ‘mhmkin’ and ‘multistart’ objects.</p></li>
--<li><p>‘R/mhmkin.R’: New method for performing multiple hierarchical mkin fits in one function call, optionally in parallel.</p></li>
-+<ul><li><p>‘R/mhmkin.R’: New method for performing multiple hierarchical mkin fits in one function call, optionally in parallel.</p></li>
- <li><p>‘R/mhmkin.R’: ‘anova.mhmkin’ for conveniently comparing the resulting fits.</p></li>
- <li><p>‘R/illparms.R’: New generic to show ill-defined parameters with methods for ‘mkinfit’, ‘mmkin’, ‘saem.mmkin’ and ‘mhmkin’ objects.</p></li>
- <li><p>‘R/multistart.R’: New method for testing multiple start parameters for hierarchical model fits, with function ‘llhist’ and new generic ‘parplot’ for diagnostics, and new generics ‘which.best’ and ‘best’ for extracting the fit with the highest likelihood</p></li>
-+<li><p>‘R/saem.R’: ‘logLik’, ‘update’ and ‘anova’ methods for ‘saem.mmkin’ objects.</p></li>
-+<li><p>‘R/saem.R’: Automatic estimation of start parameters for random effects for the case of mkin transformations, nicely improving convergence and reducing problems with iterative ODE solutions.</p></li>
-+<li><p>‘R/status.R’: New generic to show status information for fit array objects with methods for ‘mmkin’, ‘mhmkin’ and ‘multistart’ objects.</p></li>
- <li><p>‘R/summary.mmkin.R’: Summary method for mmkin objects.</p></li>
- <li><p>‘R/saem.R’: Implement and test saemix transformations for FOMC and HS. Also, error out if saemix transformations are requested but not supported.</p></li>
- <li><p>‘R/read_spreadsheet.R’: Conveniently read in data from a spreadsheet file.</p></li>
-diff --git a/docs/dev/pkgdown.yml b/docs/dev/pkgdown.yml
-index 44bd60f..e0c11a8 100644
---- a/docs/dev/pkgdown.yml
-+++ b/docs/dev/pkgdown.yml
-@@ -13,7 +13,7 @@ articles:
- dimethenamid_2018: web_only/dimethenamid_2018.html
- multistart: web_only/multistart.html
- saem_benchmarks: web_only/saem_benchmarks.html
--last_built: 2022-11-16T14:17Z
-+last_built: 2022-11-14T23:45Z
- urls:
- reference: https://pkgdown.jrwb.de/mkin/reference
- article: https://pkgdown.jrwb.de/mkin/articles
-diff --git a/docs/dev/reference/mkinmod.html b/docs/dev/reference/mkinmod.html
-index d0e192e..5d362f7 100644
---- a/docs/dev/reference/mkinmod.html
-+++ b/docs/dev/reference/mkinmod.html
-@@ -21,7 +21,7 @@ components."><meta name="robots" content="noindex"><!-- mathjax --><script src="
- </button>
- <span class="navbar-brand">
- <a class="navbar-link" href="../index.html">mkin</a>
-- <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">1.2.0</span>
-+ <span class="version label label-info" data-toggle="tooltip" data-placement="bottom" title="In-development version">1.1.0</span>
- </span>
- </div>
-
-@@ -30,7 +30,7 @@ components."><meta name="robots" content="noindex"><!-- mathjax --><script src="
- <a href="../reference/index.html">Functions and data</a>
- </li>
- <li class="dropdown">
-- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
-+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
- Articles
-
- <span class="caret"></span>
-@@ -45,17 +45,11 @@ components."><meta name="robots" content="noindex"><!-- mathjax --><script src="
- <a href="../articles/FOCUS_L.html">Example evaluation of FOCUS Laboratory Data L1 to L3</a>
- </li>
- <li>
-- <a href="../articles/web_only/dimethenamid_2018.html">Example evaluations of dimethenamid data from 2018 with nonlinear mixed-effects models</a>
-- </li>
-- <li>
-- <a href="../articles/web_only/multistart.html">Short demo of the multistart method</a>
-+ <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a>
- </li>
- <li>
- <a href="../articles/web_only/compiled_models.html">Performance benefit by using compiled model definitions in mkin</a>
- </li>
-- <li>
-- <a href="../articles/web_only/FOCUS_Z.html">Example evaluation of FOCUS Example Dataset Z</a>
-- </li>
- <li>
- <a href="../articles/twa.html">Calculation of time weighted average concentrations with mkin</a>
- </li>
-@@ -63,10 +57,7 @@ components."><meta name="robots" content="noindex"><!-- mathjax --><script src="
- <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a>
- </li>
- <li>
-- <a href="../articles/web_only/benchmarks.html">Benchmark timings for mkin</a>
-- </li>
-- <li>
-- <a href="../articles/web_only/saem_benchmarks.html">Benchmark timings for saem.mmkin</a>
-+ <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a>
- </li>
- </ul></li>
- <li>
-@@ -101,22 +92,22 @@ components.</p>
- </div>
-
- <div id="ref-usage">
-- <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">mkinmod</span><span class="op">(</span></span>
--<span> <span class="va">...</span>,</span>
--<span> use_of_ff <span class="op">=</span> <span class="st">"max"</span>,</span>
--<span> name <span class="op">=</span> <span class="cn">NULL</span>,</span>
--<span> speclist <span class="op">=</span> <span class="cn">NULL</span>,</span>
--<span> quiet <span class="op">=</span> <span class="cn">FALSE</span>,</span>
--<span> verbose <span class="op">=</span> <span class="cn">FALSE</span>,</span>
--<span> dll_dir <span class="op">=</span> <span class="cn">NULL</span>,</span>
--<span> unload <span class="op">=</span> <span class="cn">FALSE</span>,</span>
--<span> overwrite <span class="op">=</span> <span class="cn">FALSE</span></span>
--<span><span class="op">)</span></span>
--<span></span>
--<span><span class="co"># S3 method for mkinmod</span></span>
--<span><span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">x</span>, <span class="va">...</span><span class="op">)</span></span>
--<span></span>
--<span><span class="fu">mkinsub</span><span class="op">(</span><span class="va">submodel</span>, to <span class="op">=</span> <span class="cn">NULL</span>, sink <span class="op">=</span> <span class="cn">TRUE</span>, full_name <span class="op">=</span> <span class="cn">NA</span><span class="op">)</span></span></code></pre></div>
-+ <div class="sourceCode"><pre class="sourceCode r"><code><span class="fu">mkinmod</span><span class="op">(</span>
-+ <span class="va">...</span>,
-+ use_of_ff <span class="op">=</span> <span class="st">"max"</span>,
-+ name <span class="op">=</span> <span class="cn">NULL</span>,
-+ speclist <span class="op">=</span> <span class="cn">NULL</span>,
-+ quiet <span class="op">=</span> <span class="cn">FALSE</span>,
-+ verbose <span class="op">=</span> <span class="cn">FALSE</span>,
-+ dll_dir <span class="op">=</span> <span class="cn">NULL</span>,
-+ unload <span class="op">=</span> <span class="cn">FALSE</span>,
-+ overwrite <span class="op">=</span> <span class="cn">FALSE</span>
-+<span class="op">)</span>
-+
-+<span class="co"># S3 method for mkinmod</span>
-+<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">x</span>, <span class="va">...</span><span class="op">)</span>
-+
-+<span class="fu">mkinsub</span><span class="op">(</span><span class="va">submodel</span>, to <span class="op">=</span> <span class="cn">NULL</span>, sink <span class="op">=</span> <span class="cn">TRUE</span>, full_name <span class="op">=</span> <span class="cn">NA</span><span class="op">)</span></code></pre></div>
- </div>
-
- <div id="arguments">
-@@ -136,108 +127,72 @@ If the argument <code>use_of_ff</code> is set to "min"
- additional <code>mkinsub()</code> argument can be <code>sink = FALSE</code>, effectively
- fixing the flux to sink to zero.
- In print.mkinmod, this argument is currently not used.</p></dd>
--
--
- <dt>use_of_ff</dt>
- <dd><p>Specification of the use of formation fractions in the
- model equations and, if applicable, the coefficient matrix. If "max",
- formation fractions are always used (default). If "min", a minimum use of
- formation fractions is made, i.e. each first-order pathway to a metabolite
- has its own rate constant.</p></dd>
--
--
- <dt>name</dt>
- <dd><p>A name for the model. Should be a valid R object name.</p></dd>
--
--
- <dt>speclist</dt>
- <dd><p>The specification of the observed variables and their
- submodel types and pathways can be given as a single list using this
- argument. Default is NULL.</p></dd>
--
--
- <dt>quiet</dt>
- <dd><p>Should messages be suppressed?</p></dd>
--
--
- <dt>verbose</dt>
- <dd><p>If <code>TRUE</code>, passed to <code><a href="https://rdrr.io/pkg/inline/man/cfunction.html" class="external-link">inline::cfunction()</a></code> if
- applicable to give detailed information about the C function being built.</p></dd>
--
--
- <dt>dll_dir</dt>
- <dd><p>Directory where an DLL object, if generated internally by
- <code><a href="https://rdrr.io/pkg/inline/man/cfunction.html" class="external-link">inline::cfunction()</a></code>, should be saved. The DLL will only be stored in a
- permanent location for use in future sessions, if 'dll_dir' and 'name'
- are specified.</p></dd>
--
--
- <dt>unload</dt>
- <dd><p>If a DLL from the target location in 'dll_dir' is already
- loaded, should that be unloaded first?</p></dd>
--
--
- <dt>overwrite</dt>
- <dd><p>If a file exists at the target DLL location in 'dll_dir',
- should this be overwritten?</p></dd>
--
--
- <dt>x</dt>
- <dd><p>An <code>mkinmod</code> object.</p></dd>
--
--
- <dt>submodel</dt>
- <dd><p>Character vector of length one to specify the submodel type.
- See <code>mkinmod</code> for the list of allowed submodel names.</p></dd>
--
--
- <dt>to</dt>
- <dd><p>Vector of the names of the state variable to which a
- transformation shall be included in the model.</p></dd>
--
--
- <dt>sink</dt>
- <dd><p>Should a pathway to sink be included in the model in addition to
- the pathways to other state variables?</p></dd>
--
--
- <dt>full_name</dt>
- <dd><p>An optional name to be used e.g. for plotting fits
- performed with the model. You can use non-ASCII characters here, but then
- your R code will not be portable, <em>i.e.</em> may produce unintended plot
- results on other operating systems or system configurations.</p></dd>
--
- </dl></div>
- <div id="value">
- <h2>Value</h2>
--
--
--<p>A list of class <code>mkinmod</code> for use with <code><a href="mkinfit.html">mkinfit()</a></code>,
-+ <p>A list of class <code>mkinmod</code> for use with <code><a href="mkinfit.html">mkinfit()</a></code>,
- containing, among others,</p>
- <dl><dt>diffs</dt>
- <dd><p>A vector of string representations of differential equations, one for
- each modelling variable.</p></dd>
--
- <dt>map</dt>
- <dd><p>A list containing named character vectors for each observed variable,
- specifying the modelling variables by which it is represented.</p></dd>
--
- <dt>use_of_ff</dt>
- <dd><p>The content of <code>use_of_ff</code> is passed on in this list component.</p></dd>
--
- <dt>deg_func</dt>
- <dd><p>If generated, a function containing the solution of the degradation
- model.</p></dd>
--
- <dt>coefmat</dt>
- <dd><p>The coefficient matrix, if the system of differential equations can be
- represented by one.</p></dd>
--
- <dt>cf</dt>
- <dd><p>If generated, a compiled function calculating the derivatives as
- returned by cfunction.</p></dd>
--
--
- </dl><p>A list for use with <code>mkinmod</code>.</p>
- </div>
- <div id="details">
-@@ -275,16 +230,16 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p>
-
- <div id="ref-examples">
- <h2>Examples</h2>
-- <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span></span></span>
--<span class="r-in"><span><span class="co"># Specify the SFO model (this is not needed any more, as we can now mkinfit("SFO", ...)</span></span></span>
--<span class="r-in"><span><span class="va">SFO</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span>parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></span></span>
--<span class="r-in"><span></span></span>
--<span class="r-in"><span><span class="co"># One parent compound, one metabolite, both single first order</span></span></span>
--<span class="r-in"><span><span class="va">SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span></span></span>
--<span class="r-in"><span> parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>,</span></span>
--<span class="r-in"><span> m1 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></span></span>
-+ <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"></span>
-+<span class="r-in"><span class="co"># Specify the SFO model (this is not needed any more, as we can now mkinfit("SFO", ...)</span></span>
-+<span class="r-in"><span class="va">SFO</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span>parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></span>
-+<span class="r-in"></span>
-+<span class="r-in"><span class="co"># One parent compound, one metabolite, both single first order</span></span>
-+<span class="r-in"><span class="va">SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span></span>
-+<span class="r-in"> parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>,</span>
-+<span class="r-in"> m1 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span><span class="op">)</span></span>
- <span class="r-msg co"><span class="r-pr">#&gt;</span> Temporary DLL for differentials generated and loaded</span>
--<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">SFO_SFO</span><span class="op">)</span></span></span>
-+<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">SFO_SFO</span><span class="op">)</span></span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> &lt;mkinmod&gt; model generated with</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> Use of formation fractions $use_of_ff: max </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> Specification $spec:</span>
-@@ -297,32 +252,30 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p>
- <span class="r-out co"><span class="r-pr">#&gt;</span> Differential equations:</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> d_parent/dt = - k_parent * parent</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> d_m1/dt = + f_parent_to_m1 * k_parent * parent - k_m1 * m1</span>
--<span class="r-in"><span></span></span>
--<span class="r-in"><span><span class="co"># \dontrun{</span></span></span>
--<span class="r-in"><span> <span class="va">fit_sfo_sfo</span> <span class="op">&lt;-</span> <span class="fu"><a href="mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOCUS_2006_D</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, solution_type <span class="op">=</span> <span class="st">"deSolve"</span><span class="op">)</span></span></span>
--<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>Observations with value of zero were removed from the data</span>
--<span class="r-in"><span></span></span>
--<span class="r-in"><span> <span class="co"># Now supplying compound names used for plotting, and write to user defined location</span></span></span>
--<span class="r-in"><span> <span class="co"># We need to choose a path outside the session tempdir because this gets removed</span></span></span>
--<span class="r-in"><span> <span class="va">DLL_dir</span> <span class="op">&lt;-</span> <span class="st">"~/.local/share/mkin"</span></span></span>
--<span class="r-in"><span> <span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="fu"><a href="https://rdrr.io/r/base/files2.html" class="external-link">dir.exists</a></span><span class="op">(</span><span class="va">DLL_dir</span><span class="op">)</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/base/files2.html" class="external-link">dir.create</a></span><span class="op">(</span><span class="va">DLL_dir</span><span class="op">)</span></span></span>
--<span class="r-in"><span> <span class="va">SFO_SFO.2</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span></span></span>
--<span class="r-in"><span> parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span>, full_name <span class="op">=</span> <span class="st">"Test compound"</span><span class="op">)</span>,</span></span>
--<span class="r-in"><span> m1 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span>, full_name <span class="op">=</span> <span class="st">"Metabolite M1"</span><span class="op">)</span>,</span></span>
--<span class="r-in"><span> name <span class="op">=</span> <span class="st">"SFO_SFO"</span>, dll_dir <span class="op">=</span> <span class="va">DLL_dir</span>, unload <span class="op">=</span> <span class="cn">TRUE</span>, overwrite <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
--<span class="r-msg co"><span class="r-pr">#&gt;</span> Copied DLL from /tmp/Rtmpp1dECS/file32009e039f7a.so to /home/jranke/.local/share/mkin/SFO_SFO.so</span>
--<span class="r-in"><span><span class="co"># Now we can save the model and restore it in a new session</span></span></span>
--<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">saveRDS</a></span><span class="op">(</span><span class="va">SFO_SFO.2</span>, file <span class="op">=</span> <span class="st">"~/SFO_SFO.rds"</span><span class="op">)</span></span></span>
--<span class="r-in"><span><span class="co"># Terminate the R session here if you would like to check, and then do</span></span></span>
--<span class="r-in"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/mkin/">mkin</a></span><span class="op">)</span></span></span>
--<span class="r-in"><span><span class="va">SFO_SFO.3</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">readRDS</a></span><span class="op">(</span><span class="st">"~/SFO_SFO.rds"</span><span class="op">)</span></span></span>
--<span class="r-in"><span><span class="va">fit_sfo_sfo</span> <span class="op">&lt;-</span> <span class="fu"><a href="mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">SFO_SFO.3</span>, <span class="va">FOCUS_2006_D</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, solution_type <span class="op">=</span> <span class="st">"deSolve"</span><span class="op">)</span></span></span>
--<span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>Observations with value of zero were removed from the data</span>
--<span class="r-in"><span></span></span>
--<span class="r-in"><span><span class="co"># Show details of creating the C function</span></span></span>
--<span class="r-in"><span><span class="va">SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span></span></span>
--<span class="r-in"><span> parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>,</span></span>
--<span class="r-in"><span> m1 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, verbose <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
-+<span class="r-in"></span>
-+<span class="r-in"><span class="co"># \dontrun{</span></span>
-+<span class="r-in"> <span class="va">fit_sfo_sfo</span> <span class="op">&lt;-</span> <span class="fu"><a href="mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">SFO_SFO</span>, <span class="va">FOCUS_2006_D</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, solution_type <span class="op">=</span> <span class="st">"deSolve"</span><span class="op">)</span></span>
-+<span class="r-in"></span>
-+<span class="r-in"> <span class="co"># Now supplying compound names used for plotting, and write to user defined location</span></span>
-+<span class="r-in"> <span class="co"># We need to choose a path outside the session tempdir because this gets removed</span></span>
-+<span class="r-in"> <span class="va">DLL_dir</span> <span class="op">&lt;-</span> <span class="st">"~/.local/share/mkin"</span></span>
-+<span class="r-in"> <span class="kw">if</span> <span class="op">(</span><span class="op">!</span><span class="fu"><a href="https://rdrr.io/r/base/files2.html" class="external-link">dir.exists</a></span><span class="op">(</span><span class="va">DLL_dir</span><span class="op">)</span><span class="op">)</span> <span class="fu"><a href="https://rdrr.io/r/base/files2.html" class="external-link">dir.create</a></span><span class="op">(</span><span class="va">DLL_dir</span><span class="op">)</span></span>
-+<span class="r-in"> <span class="va">SFO_SFO.2</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span></span>
-+<span class="r-in"> parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span>, full_name <span class="op">=</span> <span class="st">"Test compound"</span><span class="op">)</span>,</span>
-+<span class="r-in"> m1 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span>, full_name <span class="op">=</span> <span class="st">"Metabolite M1"</span><span class="op">)</span>,</span>
-+<span class="r-in"> name <span class="op">=</span> <span class="st">"SFO_SFO"</span>, dll_dir <span class="op">=</span> <span class="va">DLL_dir</span>, unload <span class="op">=</span> <span class="cn">TRUE</span>, overwrite <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
-+<span class="r-msg co"><span class="r-pr">#&gt;</span> Copied DLL from /tmp/Rtmp6NiOcv/fileb89c01ace19ec.so to /home/jranke/.local/share/mkin/SFO_SFO.so</span>
-+<span class="r-in"><span class="co"># Now we can save the model and restore it in a new session</span></span>
-+<span class="r-in"><span class="fu"><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">saveRDS</a></span><span class="op">(</span><span class="va">SFO_SFO.2</span>, file <span class="op">=</span> <span class="st">"~/SFO_SFO.rds"</span><span class="op">)</span></span>
-+<span class="r-in"><span class="co"># Terminate the R session here if you would like to check, and then do</span></span>
-+<span class="r-in"><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://pkgdown.jrwb.de/mkin/">mkin</a></span><span class="op">)</span></span>
-+<span class="r-in"><span class="va">SFO_SFO.3</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/readRDS.html" class="external-link">readRDS</a></span><span class="op">(</span><span class="st">"~/SFO_SFO.rds"</span><span class="op">)</span></span>
-+<span class="r-in"><span class="va">fit_sfo_sfo</span> <span class="op">&lt;-</span> <span class="fu"><a href="mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">SFO_SFO.3</span>, <span class="va">FOCUS_2006_D</span>, quiet <span class="op">=</span> <span class="cn">TRUE</span>, solution_type <span class="op">=</span> <span class="st">"deSolve"</span><span class="op">)</span></span>
-+<span class="r-in"></span>
-+<span class="r-in"><span class="co"># Show details of creating the C function</span></span>
-+<span class="r-in"><span class="va">SFO_SFO</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span></span>
-+<span class="r-in"> parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span>, <span class="st">"m1"</span><span class="op">)</span>,</span>
-+<span class="r-in"> m1 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>, verbose <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> Program source:</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> 1: #include &lt;R.h&gt;</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> 2: </span>
-@@ -344,10 +297,10 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p>
- <span class="r-out co"><span class="r-pr">#&gt;</span> 18: f[1] = + f_parent_to_m1 * k_parent * y[0] - k_m1 * y[1];</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> 19: }</span>
- <span class="r-msg co"><span class="r-pr">#&gt;</span> Temporary DLL for differentials generated and loaded</span>
--<span class="r-in"><span></span></span>
--<span class="r-in"><span><span class="co"># The symbolic solution which is available in this case is not</span></span></span>
--<span class="r-in"><span><span class="co"># made for human reading but for speed of computation</span></span></span>
--<span class="r-in"><span><span class="va">SFO_SFO</span><span class="op">$</span><span class="va">deg_func</span></span></span>
-+<span class="r-in"></span>
-+<span class="r-in"><span class="co"># The symbolic solution which is available in this case is not</span></span>
-+<span class="r-in"><span class="co"># made for human reading but for speed of computation</span></span>
-+<span class="r-in"><span class="va">SFO_SFO</span><span class="op">$</span><span class="va">deg_func</span></span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> function (observed, odeini, odeparms) </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> {</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> predicted &lt;- numeric(0)</span>
-@@ -363,21 +316,21 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p>
- <span class="r-out co"><span class="r-pr">#&gt;</span> })</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> return(predicted)</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> }</span>
--<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x55555d516c10&gt;</span>
--<span class="r-in"><span></span></span>
--<span class="r-in"><span><span class="co"># If we have several parallel metabolites</span></span></span>
--<span class="r-in"><span><span class="co"># (compare tests/testthat/test_synthetic_data_for_UBA_2014.R)</span></span></span>
--<span class="r-in"><span><span class="va">m_synth_DFOP_par</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span></span></span>
--<span class="r-in"><span> parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"DFOP"</span>, <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"M1"</span>, <span class="st">"M2"</span><span class="op">)</span><span class="op">)</span>,</span></span>
--<span class="r-in"><span> M1 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>,</span></span>
--<span class="r-in"><span> M2 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>,</span></span>
--<span class="r-in"><span> quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
--<span class="r-in"><span></span></span>
--<span class="r-in"><span><span class="va">fit_DFOP_par_c</span> <span class="op">&lt;-</span> <span class="fu"><a href="mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">m_synth_DFOP_par</span>,</span></span>
--<span class="r-in"><span> <span class="va">synthetic_data_for_UBA_2014</span><span class="op">[[</span><span class="fl">12</span><span class="op">]</span><span class="op">]</span><span class="op">$</span><span class="va">data</span>,</span></span>
--<span class="r-in"><span> quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
--<span class="r-in"><span><span class="co"># }</span></span></span>
--<span class="r-in"><span></span></span>
-+<span class="r-out co"><span class="r-pr">#&gt;</span> &lt;environment: 0x55555cd83c70&gt;</span>
-+<span class="r-in"></span>
-+<span class="r-in"><span class="co"># If we have several parallel metabolites</span></span>
-+<span class="r-in"><span class="co"># (compare tests/testthat/test_synthetic_data_for_UBA_2014.R)</span></span>
-+<span class="r-in"><span class="va">m_synth_DFOP_par</span> <span class="op">&lt;-</span> <span class="fu">mkinmod</span><span class="op">(</span></span>
-+<span class="r-in"> parent <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"DFOP"</span>, <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="st">"M1"</span>, <span class="st">"M2"</span><span class="op">)</span><span class="op">)</span>,</span>
-+<span class="r-in"> M1 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>,</span>
-+<span class="r-in"> M2 <span class="op">=</span> <span class="fu">mkinsub</span><span class="op">(</span><span class="st">"SFO"</span><span class="op">)</span>,</span>
-+<span class="r-in"> quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
-+<span class="r-in"></span>
-+<span class="r-in"><span class="va">fit_DFOP_par_c</span> <span class="op">&lt;-</span> <span class="fu"><a href="mkinfit.html">mkinfit</a></span><span class="op">(</span><span class="va">m_synth_DFOP_par</span>,</span>
-+<span class="r-in"> <span class="va">synthetic_data_for_UBA_2014</span><span class="op">[[</span><span class="fl">12</span><span class="op">]</span><span class="op">]</span><span class="op">$</span><span class="va">data</span>,</span>
-+<span class="r-in"> quiet <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span>
-+<span class="r-in"><span class="co"># }</span></span>
-+<span class="r-in"></span>
- </code></pre></div>
- </div>
- </div>
-@@ -392,7 +345,7 @@ Evaluating and Calculating Degradation Kinetics in Environmental Media</p>
- </div>
-
- <div class="pkgdown">
-- <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
-+ <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.2.</p>
- </div>
-
- </footer></div>
-diff --git a/docs/dev/reference/mkinpredict.html b/docs/dev/reference/mkinpredict.html
-index 0e645b5..3793091 100644
---- a/docs/dev/reference/mkinpredict.html
-+++ b/docs/dev/reference/mkinpredict.html
-@@ -377,7 +377,7 @@ as these always return mapped output.</p></dd>
- <span class="r-out co"><span class="r-pr">#&gt;</span> 2 deSolve_compiled 1.0 0.005</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> 1 eigen 4.2 0.021</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> 4 analytical 4.2 0.021</span>
--<span class="r-out co"><span class="r-pr">#&gt;</span> 3 deSolve 41.0 0.205</span>
-+<span class="r-out co"><span class="r-pr">#&gt;</span> 3 deSolve 40.8 0.204</span>
- <span class="r-in"><span></span></span>
- <span class="r-in"><span><span class="co"># \dontrun{</span></span></span>
- <span class="r-in"><span> <span class="co"># Predict from a fitted model</span></span></span>
-diff --git a/docs/dev/reference/read_spreadsheet.html b/docs/dev/reference/read_spreadsheet.html
-index efba012..7082876 100644
---- a/docs/dev/reference/read_spreadsheet.html
-+++ b/docs/dev/reference/read_spreadsheet.html
-@@ -64,10 +64,7 @@ factors can be given in columns named 'Temperature' and 'Moisture'."><meta name=
- <a href="../articles/web_only/NAFTA_examples.html">Example evaluation of NAFTA SOP Attachment examples</a>
- </li>
- <li>
-- <a href="../articles/web_only/benchmarks.html">Benchmark timings for mkin</a>
-- </li>
-- <li>
-- <a href="../articles/web_only/saem_benchmarks.html">Benchmark timings for saem.mmkin</a>
-+ <a href="../articles/web_only/benchmarks.html">Some benchmark timings</a>
- </li>
- </ul></li>
- <li>
-@@ -106,7 +103,7 @@ factors can be given in columns named 'Temperature' and 'Moisture'.</p>
- <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">read_spreadsheet</span><span class="op">(</span></span>
- <span> <span class="va">path</span>,</span>
- <span> valid_datasets <span class="op">=</span> <span class="st">"all"</span>,</span>
--<span> parent_only <span class="op">=</span> <span class="cn">FALSE</span>,</span>
-+<span> parent_only <span class="op">=</span> <span class="cn">TRUE</span>,</span>
- <span> normalize <span class="op">=</span> <span class="cn">TRUE</span></span>
- <span><span class="op">)</span></span></code></pre></div>
- </div>
-diff --git a/docs/dev/reference/saem.html b/docs/dev/reference/saem.html
-index d2e930e..73382cb 100644
---- a/docs/dev/reference/saem.html
-+++ b/docs/dev/reference/saem.html
-@@ -432,8 +432,8 @@ using <a href="mmkin.html">mmkin</a>.</p>
- <span class="r-out co"><span class="r-pr">#&gt;</span> saemix version used for fitting: 3.2 </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> mkin version used for pre-fitting: 1.2.0 </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> R version used for fitting: 4.2.2 </span>
--<span class="r-out co"><span class="r-pr">#&gt;</span> Date of fit: Wed Nov 16 10:49:43 2022 </span>
--<span class="r-out co"><span class="r-pr">#&gt;</span> Date of summary: Wed Nov 16 10:49:43 2022 </span>
-+<span class="r-out co"><span class="r-pr">#&gt;</span> Date of fit: Tue Nov 15 00:45:58 2022 </span>
-+<span class="r-out co"><span class="r-pr">#&gt;</span> Date of summary: Tue Nov 15 00:45:58 2022 </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> Equations:</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> d_parent/dt = - ((k1 * g * exp(-k1 * time) + k2 * (1 - g) * exp(-k2 *</span>
-@@ -448,7 +448,7 @@ using <a href="mmkin.html">mmkin</a>.</p>
- <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> Model predictions using solution type analytical </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
--<span class="r-out co"><span class="r-pr">#&gt;</span> Fitted in 8.935 s</span>
-+<span class="r-out co"><span class="r-pr">#&gt;</span> Fitted in 9.189 s</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> Using 300, 100 iterations and 10 chains</span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> </span>
- <span class="r-out co"><span class="r-pr">#&gt;</span> Variance model: Constant variance </span>
-diff --git a/log/build.log b/log/build.log
-index a56a64d..245bd20 100644
---- a/log/build.log
-+++ b/log/build.log
-@@ -5,4 +5,5 @@
- * creating vignettes ... OK
- * checking for LF line-endings in source and make files and shell scripts
- * checking for empty or unneeded directories
--* building ‘mkin_1.2.0.tar.gz’
-+* building ‘mkin_1.3.0.tar.gz’
-+
-diff --git a/log/check.log b/log/check.log
-index 7aa4610..e7d4d32 100644
---- a/log/check.log
-+++ b/log/check.log
-@@ -5,7 +5,7 @@
- * using options ‘--no-tests --as-cran’
- * checking for file ‘mkin/DESCRIPTION’ ... OK
- * checking extension type ... Package
--* this is package ‘mkin’ version ‘1.2.0’
-+* this is package ‘mkin’ version ‘1.3.0’
- * package encoding: UTF-8
- * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers
- Maintainer: ‘Johannes Ranke <johannes.ranke@jrwb.de>’
-@@ -37,11 +37,18 @@ Maintainer: ‘Johannes Ranke <johannes.ranke@jrwb.de>’
- * checking whether the namespace can be unloaded cleanly ... OK
- * checking loading without being on the library search path ... OK
- * checking use of S3 registration ... OK
--* checking dependencies in R code ... OK
-+* checking dependencies in R code ... NOTE
-+Package in Depends field not imported from: ‘deSolve’
-+ These packages need to be imported from (in the NAMESPACE file)
-+ for when this namespace is loaded but not attached.
- * checking S3 generic/method consistency ... OK
- * checking replacement functions ... OK
--* checking foreign function calls ... OK
--* checking R code for possible problems ... [18s/18s] OK
-+* checking foreign function calls ... NOTE
-+Foreign function call to a different package:
-+ .C("unlock_solver", ..., PACKAGE = "deSolve")
-+See chapter ‘System and foreign language interfaces’ in the ‘Writing R
-+Extensions’ manual.
-+* checking R code for possible problems ... [17s/17s] OK
- * checking Rd files ... OK
- * checking Rd metadata ... OK
- * checking Rd line widths ... OK
-@@ -69,5 +76,9 @@ Maintainer: ‘Johannes Ranke <johannes.ranke@jrwb.de>’
- * checking for detritus in the temp directory ... OK
- * DONE
-
--Status: OK
-+Status: 2 NOTEs
-+See
-+ ‘/home/jranke/git/mkin/mkin.Rcheck/00check.log’
-+for details.
-+
-
-diff --git a/log/test.log b/log/test.log
-index b305bf5..10c0aa7 100644
---- a/log/test.log
-+++ b/log/test.log
-@@ -1,57 +1,57 @@
- ℹ Testing mkin
- ✔ | F W S OK | Context
- ✔ | 5 | AIC calculation
--✔ | 5 | Analytical solutions for coupled models [3.5s]
-+✔ | 5 | Analytical solutions for coupled models [2.9s]
- ✔ | 5 | Calculation of Akaike weights
- ✔ | 3 | Export dataset for reading into CAKE
--✔ | 12 | Confidence intervals and p-values [1.1s]
--✔ | 1 12 | Dimethenamid data from 2018 [34.5s]
-+✔ | 12 | Confidence intervals and p-values [1.0s]
-+✔ | 1 12 | Dimethenamid data from 2018 [29.5s]
- ────────────────────────────────────────────────────────────────────────────────
--Skip ('test_dmta.R:98'): Different backends get consistent results for SFO-SFO3+, dimethenamid data
-+Skip ('test_dmta.R:99'): Different backends get consistent results for SFO-SFO3+, dimethenamid data
- Reason: Fitting this ODE model with saemix takes about 15 minutes on my system
- ────────────────────────────────────────────────────────────────────────────────
--✔ | 14 | Error model fitting [5.3s]
-+✔ | 14 | Error model fitting [4.9s]
- ✔ | 5 | Time step normalisation
- ✔ | 4 | Calculation of FOCUS chi2 error levels [0.6s]
--✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.8s]
--✔ | 4 | Test fitting the decline of metabolites from their maximum [0.4s]
-+✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.7s]
-+✔ | 4 | Test fitting the decline of metabolites from their maximum [0.3s]
- ✔ | 1 | Fitting the logistic model [0.2s]
--✔ | 10 | Batch fitting and diagnosing hierarchical kinetic models [25.6s]
--✔ | 1 12 | Nonlinear mixed-effects models [0.4s]
-+✔ | 10 | Batch fitting and diagnosing hierarchical kinetic models [24.7s]
-+✔ | 1 12 | Nonlinear mixed-effects models [0.3s]
- ────────────────────────────────────────────────────────────────────────────────
- Skip ('test_mixed.R:74'): saemix results are reproducible for biphasic fits
- Reason: Fitting with saemix takes around 10 minutes when using deSolve
- ────────────────────────────────────────────────────────────────────────────────
- ✔ | 3 | Test dataset classes mkinds and mkindsg
--✔ | 10 | Special cases of mkinfit calls [0.6s]
-+✔ | 10 | Special cases of mkinfit calls [0.5s]
- ✔ | 3 | mkinfit features [0.7s]
- ✔ | 8 | mkinmod model generation and printing [0.2s]
--✔ | 3 | Model predictions with mkinpredict [0.3s]
--✔ | 9 | Multistart method for saem.mmkin models [40.2s]
--✔ | 16 | Evaluations according to 2015 NAFTA guidance [2.6s]
--✔ | 9 | Nonlinear mixed-effects models with nlme [9.5s]
--✔ | 16 | Plotting [10.5s]
-+✔ | 3 | Model predictions with mkinpredict [0.4s]
-+✔ | 7 | Multistart method for saem.mmkin models [36.8s]
-+✔ | 16 | Evaluations according to 2015 NAFTA guidance [2.5s]
-+✔ | 9 | Nonlinear mixed-effects models with nlme [8.8s]
-+✔ | 16 | Plotting [10.0s]
- ✔ | 4 | Residuals extracted from mkinfit models
--✔ | 1 36 | saemix parent models [69.8s]
-+✔ | 1 36 | saemix parent models [66.1s]
- ────────────────────────────────────────────────────────────────────────────────
- Skip ('test_saemix_parent.R:143'): We can also use mkin solution methods for saem
- Reason: This still takes almost 2.5 minutes although we do not solve ODEs
- ────────────────────────────────────────────────────────────────────────────────
--✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.6s]
-+✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.1s]
- ✔ | 11 | Processing of residue series
--✔ | 10 | Fitting the SFORB model [3.9s]
-+✔ | 10 | Fitting the SFORB model [3.4s]
- ✔ | 1 | Summaries of old mkinfit objects
- ✔ | 5 | Summary [0.2s]
--✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.3s]
--✔ | 9 | Hypothesis tests [8.5s]
--✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.3s]
-+✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [1.6s]
-+✔ | 9 | Hypothesis tests [6.1s]
-+✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.2s]
-
- ══ Results ═════════════════════════════════════════════════════════════════════
--Duration: 225.9 s
-+Duration: 206.2 s
-
- ── Skipped tests ──────────────────────────────────────────────────────────────
- • Fitting this ODE model with saemix takes about 15 minutes on my system (1)
- • Fitting with saemix takes around 10 minutes when using deSolve (1)
- • This still takes almost 2.5 minutes although we do not solve ODEs (1)
-
--[ FAIL 0 | WARN 0 | SKIP 3 | PASS 269 ]
-+[ FAIL 0 | WARN 0 | SKIP 3 | PASS 267 ]
-diff --git a/man/mkinmod.Rd b/man/mkinmod.Rd
-index 87ce901..612c3c2 100644
---- a/man/mkinmod.Rd
-+++ b/man/mkinmod.Rd
-@@ -58,7 +58,9 @@ applicable to give detailed information about the C function being built.}
- \item{dll_dir}{Directory where an DLL object, if generated internally by
- \code{\link[inline:cfunction]{inline::cfunction()}}, should be saved. The DLL will only be stored in a
- permanent location for use in future sessions, if 'dll_dir' and 'name'
--are specified.}
-+are specified. This is helpful if fit objects are cached e.g. by knitr,
-+as the cache remains functional across sessions if the DLL is stored in
-+a user defined location.}
-
- \item{unload}{If a DLL from the target location in 'dll_dir' is already
- loaded, should that be unloaded first?}
-diff --git a/man/mkinpredict.Rd b/man/mkinpredict.Rd
-index 0797f25..d93c075 100644
---- a/man/mkinpredict.Rd
-+++ b/man/mkinpredict.Rd
-@@ -18,9 +18,10 @@ mkinpredict(x, odeparms, odeini, outtimes, ...)
- method.ode = "lsoda",
- atol = 1e-08,
- rtol = 1e-10,
-- maxsteps = 20000,
-+ maxsteps = 20000L,
- map_output = TRUE,
- na_stop = TRUE,
-+ call_lsoda = NULL,
- ...
- )
-
-@@ -60,23 +61,21 @@ solver is used.}
- \item{solution_type}{The method that should be used for producing the
- predictions. This should generally be "analytical" if there is only one
- observed variable, and usually "deSolve" in the case of several observed
--variables. The third possibility "eigen" is faster but not applicable to
--some models e.g. using FOMC for the parent compound.}
-+variables. The third possibility "eigen" is fast in comparison to uncompiled
-+ODE models, but not applicable to some models, e.g. using FOMC for the
-+parent compound.}
-
- \item{use_compiled}{If set to \code{FALSE}, no compiled version of the
- \link{mkinmod} model is used, even if is present.}
-
- \item{method.ode}{The solution method passed via \link{mkinpredict} to \link{ode}] in
--case the solution type is "deSolve". The default "lsoda" is performant, but
--sometimes fails to converge.}
-+case the solution type is "deSolve" and we are not using compiled code.}
-
--\item{atol}{Absolute error tolerance, passed to \link{ode}. Default is 1e-8,
--lower than in \link{lsoda}.}
-+\item{atol}{Absolute error tolerance, passed to the ode solver.}
-
--\item{rtol}{Absolute error tolerance, passed to \link{ode}. Default is 1e-10,
--much lower than in \link{lsoda}.}
-+\item{rtol}{Absolute error tolerance, passed to the ode solver.}
-
--\item{maxsteps}{Maximum number of steps, passed to \link{ode}.}
-+\item{maxsteps}{Maximum number of steps, passed to the ode solver.}
-
- \item{map_output}{Boolean to specify if the output should list values for
- the observed variables (default) or for all state variables (if set to
-@@ -84,6 +83,8 @@ FALSE). Setting this to FALSE has no effect for analytical solutions,
- as these always return mapped output.}
-
- \item{na_stop}{Should it be an error if \link{ode} returns NaN values}
-+
-+\item{call_lsoda}{The address of the compiled function "call_lsoda"}
- }
- \value{
- A matrix with the numeric solution in wide format
-diff --git a/man/read_spreadsheet.Rd b/man/read_spreadsheet.Rd
-index 41c3210..147d09b 100644
---- a/man/read_spreadsheet.Rd
-+++ b/man/read_spreadsheet.Rd
-@@ -7,7 +7,7 @@
- read_spreadsheet(
- path,
- valid_datasets = "all",
-- parent_only = FALSE,
-+ parent_only = TRUE,
- normalize = TRUE
- )
- }
-diff --git a/man/saem.Rd b/man/saem.Rd
-index 1146335..3a5abad 100644
---- a/man/saem.Rd
-+++ b/man/saem.Rd
-@@ -206,12 +206,12 @@ plot(f_saem_dfop_sfo)
- summary(f_saem_dfop_sfo, data = TRUE)
-
- # The following takes about 6 minutes
--#f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve",
--# control = list(nbiter.saemix = c(200, 80), nbdisplay = 10))
-+f_saem_dfop_sfo_deSolve <- saem(f_mmkin["DFOP-SFO", ], solution_type = "deSolve",
-+ nbiter.saemix = c(200, 80))
-
--#saemix::compare.saemix(list(
--# f_saem_dfop_sfo$so,
--# f_saem_dfop_sfo_deSolve$so))
-+#anova(
-+# f_saem_dfop_sfo,
-+# f_saem_dfop_sfo_deSolve))
-
- # If the model supports it, we can also use eigenvalue based solutions, which
- # take a similar amount of time
-diff --git a/tests/testthat/test_dmta.R b/tests/testthat/test_dmta.R
-index c44cdac..5cfc61d 100644
---- a/tests/testthat/test_dmta.R
-+++ b/tests/testthat/test_dmta.R
-@@ -11,13 +11,13 @@ names(dmta_ds) <- sapply(dimethenamid_2018$ds, function(ds) ds$title)
- dmta_ds[["Elliot"]] <- rbind(dmta_ds[["Elliot 1"]], dmta_ds[["Elliot 2"]])
- dmta_ds[["Elliot 1"]] <- dmta_ds[["Elliot 2"]] <- NULL
-
-+# mkin
-+dmta_dfop <- mmkin("DFOP", dmta_ds, quiet = TRUE, cores = n_cores)
-+dmta_dfop_tc <- mmkin("DFOP", dmta_ds, error_model = "tc", quiet = TRUE, cores = n_cores)
-+
- test_that("Different backends get consistent results for DFOP tc, dimethenamid data", {
-
- skip_on_cran() # Time constraints
-- # mkin
-- dmta_dfop <- mmkin("DFOP", dmta_ds, quiet = TRUE, cores = n_cores)
-- dmta_dfop_tc <- mmkin("DFOP", dmta_ds, error_model = "tc", quiet = TRUE, cores = n_cores)
--
- # nlme
- expect_warning(
- nlme_dfop_tc <- nlme(dmta_dfop_tc),
-@@ -85,7 +85,8 @@ sfo_sfo3p <- mkinmod(
- )
-
- dmta_sfo_sfo3p_tc <- mmkin(list("SFO-SFO3+" = sfo_sfo3p),
-- dmta_ds, error_model = "tc", quiet = TRUE, cores = n_cores)
-+ dmta_ds, error_model = "tc", quiet = TRUE,
-+ cores = n_cores)
-
- test_that("Different backends get consistent results for SFO-SFO3+, dimethenamid data", {
-
-diff --git a/tests/testthat/test_multistart.R b/tests/testthat/test_multistart.R
-index 98d3fb6..c1a10d1 100644
---- a/tests/testthat/test_multistart.R
-+++ b/tests/testthat/test_multistart.R
-@@ -1,7 +1,6 @@
- context("Multistart method for saem.mmkin models")
-
- test_that("multistart works for saem.mmkin models", {
-- skip_on_cran() # Save CRAN time
- set.seed(123456)
- saem_sfo_s_multi <- multistart(sfo_saem_1_reduced, n = 8, cores = n_cores,
- no_random_effect = "parent_0")
-@@ -10,13 +9,9 @@ test_that("multistart works for saem.mmkin models", {
- best(saem_sfo_s_multi),
- test = TRUE
- )
-- # On winbuilder, sfo_saem_1 gives an AIC of 1310.8, while we get 1311.7
-- # locally on Linux and Windows. The other, well-determined fits
-- # both give 1309.7
-- expect_equal(round(anova_sfo, 1)["sfo_saem_1_reduced", "AIC"], 1309.7)
-- expect_equal(round(anova_sfo, 1)["best(saem_sfo_s_multi)", "AIC"], 1309.7)
-- expect_true(anova_sfo[3, "Pr(>Chisq)"] > 0.2) # Local: 1, CRAN: 0.4
-+ expect_true(anova_sfo[3, "Pr(>Chisq)"] > 0.5)
-
-+ skip_on_cran() # Save CRAN time
- set.seed(123456)
- saem_biphasic_m_multi <- multistart(saem_biphasic_m, n = 8,
- cores = n_cores)
-diff --git a/tests/testthat/test_nafta.R b/tests/testthat/test_nafta.R
-index b89ea34..8eb052c 100644
---- a/tests/testthat/test_nafta.R
-+++ b/tests/testthat/test_nafta.R
-@@ -4,7 +4,6 @@ test_that("Data for more than one compound are rejected",
- expect_error(nafta(FOCUS_2006_D, cores = 1)))
-
- test_that("Test data from Appendix B are correctly evaluated", {
-- skip_on_cran()
- expect_message(res <- nafta(NAFTA_SOP_Appendix_B, "aerobic aquatic", cores = 1))
-
- # From Figure D.1
-@@ -26,7 +25,6 @@ test_that("Test data from Appendix B are correctly evaluated", {
- })
-
- test_that("Test data from Appendix D are correctly evaluated", {
-- skip_on_cran()
- # We are not interested in the warnings about non-normal residuals here
- suppressWarnings(
- res <- nafta(NAFTA_SOP_Appendix_D, "MRID 555555",
-diff --git a/vignettes/mkin.html b/vignettes/mkin.html
-index 0d5ed6f..38c44a0 100644
---- a/vignettes/mkin.html
-+++ b/vignettes/mkin.html
-@@ -1599,7 +1599,7 @@ div.tocify {
-
- <h1 class="title toc-ignore">Introduction to mkin</h1>
- <h4 class="author">Johannes Ranke</h4>
--<h4 class="date">Last change 15 February 2021 (rebuilt 2022-07-12)</h4>
-+<h4 class="date">Last change 15 February 2021 (rebuilt 2022-11-15)</h4>
-
- </div>
-
-diff --git a/vignettes/web_only/benchmarks.html b/vignettes/web_only/benchmarks.html
-index 5f81f39..5376c1f 100644
---- a/vignettes/web_only/benchmarks.html
-+++ b/vignettes/web_only/benchmarks.html
-@@ -1599,7 +1599,7 @@ div.tocify {
-
- <h1 class="title toc-ignore">Benchmark timings for mkin</h1>
- <h4 class="author">Johannes Ranke</h4>
--<h4 class="date">Last change 14 July 2022 (rebuilt 2022-07-14)</h4>
-+<h4 class="date">Last change 14 July 2022 (rebuilt 2022-11-15)</h4>
-
- </div>
-
-@@ -1635,7 +1635,7 @@ FOMC_SFO &lt;- mkinmod(
- parent = mkinsub(&quot;FOMC&quot;, &quot;m1&quot;),
- m1 = mkinsub(&quot;SFO&quot;))
- DFOP_SFO &lt;- mkinmod(
-- parent = mkinsub(&quot;FOMC&quot;, &quot;m1&quot;),
-+ parent = mkinsub(&quot;FOMC&quot;, &quot;m1&quot;), # erroneously used FOMC twice, not fixed for consistency
- m1 = mkinsub(&quot;SFO&quot;))
- t3 &lt;- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D)))[[&quot;elapsed&quot;]]
- t4 &lt;- system.time(mmkin_bench(list(SFO_SFO, FOMC_SFO, DFOP_SFO), list(FOCUS_D),
-@@ -1816,6 +1816,30 @@ t11 &lt;- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c),
- <td align="right">1.770</td>
- <td align="right">3.377</td>
- </tr>
-+<tr class="odd">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.1</td>
-+<td align="left">1.1.2</td>
-+<td align="right">1.957</td>
-+<td align="right">3.633</td>
-+</tr>
-+<tr class="even">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.2</td>
-+<td align="left">1.2.0</td>
-+<td align="right">2.129</td>
-+<td align="right">3.784</td>
-+</tr>
-+<tr class="odd">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.2</td>
-+<td align="left">1.3.0</td>
-+<td align="right">2.046</td>
-+<td align="right">3.693</td>
-+</tr>
- </tbody>
- </table>
- </div>
-@@ -1979,6 +2003,33 @@ t11 &lt;- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c),
- <td align="right">5.758</td>
- <td align="right">2.558</td>
- </tr>
-+<tr class="odd">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.1</td>
-+<td align="left">1.1.2</td>
-+<td align="right">1.503</td>
-+<td align="right">6.147</td>
-+<td align="right">2.803</td>
-+</tr>
-+<tr class="even">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.2</td>
-+<td align="left">1.2.0</td>
-+<td align="right">1.559</td>
-+<td align="right">6.097</td>
-+<td align="right">2.841</td>
-+</tr>
-+<tr class="odd">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.2</td>
-+<td align="left">1.3.0</td>
-+<td align="right">1.230</td>
-+<td align="right">4.333</td>
-+<td align="right">2.187</td>
-+</tr>
- </tbody>
- </table>
- </div>
-@@ -2193,6 +2244,42 @@ t11 &lt;- system.time(mmkin_bench(list(m_synth_DFOP_par), list(DFOP_par_c),
- <td align="right">1.744</td>
- <td align="right">2.566</td>
- </tr>
-+<tr class="odd">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.1</td>
-+<td align="left">1.1.2</td>
-+<td align="right">0.861</td>
-+<td align="right">1.295</td>
-+<td align="right">1.507</td>
-+<td align="right">3.102</td>
-+<td align="right">1.961</td>
-+<td align="right">2.852</td>
-+</tr>
-+<tr class="even">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.2</td>
-+<td align="left">1.2.0</td>
-+<td align="right">0.911</td>
-+<td align="right">1.328</td>
-+<td align="right">1.519</td>
-+<td align="right">2.986</td>
-+<td align="right">1.957</td>
-+<td align="right">2.769</td>
-+</tr>
-+<tr class="odd">
-+<td align="left">Linux</td>
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">4.2.2</td>
-+<td align="left">1.3.0</td>
-+<td align="right">0.693</td>
-+<td align="right">0.996</td>
-+<td align="right">1.121</td>
-+<td align="right">2.174</td>
-+<td align="right">1.427</td>
-+<td align="right">2.026</td>
-+</tr>
- </tbody>
- </table>
- </div>
-diff --git a/vignettes/web_only/mkin_benchmarks.rda b/vignettes/web_only/mkin_benchmarks.rda
-index 2d3deb2..c07def6 100644
-Binary files a/vignettes/web_only/mkin_benchmarks.rda and b/vignettes/web_only/mkin_benchmarks.rda differ
-diff --git a/vignettes/web_only/saem_benchmarks.html b/vignettes/web_only/saem_benchmarks.html
-index 4875bb1..714dc1f 100644
---- a/vignettes/web_only/saem_benchmarks.html
-+++ b/vignettes/web_only/saem_benchmarks.html
-@@ -1599,7 +1599,7 @@ div.tocify {
-
- <h1 class="title toc-ignore">Benchmark timings for saem.mmkin</h1>
- <h4 class="author">Johannes Ranke</h4>
--<h4 class="date">Last change 14 November 2022 (rebuilt 2022-11-14)</h4>
-+<h4 class="date">Last change 14 November 2022 (rebuilt 2022-11-15)</h4>
-
- </div>
-
-@@ -1781,10 +1781,20 @@ t11 &lt;- system.time(sforb_sfo3_plus_const &lt;- saem(three_met_sep_tc[&quot;SF
- <td align="left">Linux</td>
- <td align="left">1.2.0</td>
- <td align="left">3.2</td>
--<td align="right">2.996</td>
--<td align="right">5.207</td>
--<td align="right">5.317</td>
--<td align="right">5.171</td>
-+<td align="right">2.110</td>
-+<td align="right">4.632</td>
-+<td align="right">4.264</td>
-+<td align="right">4.930</td>
-+</tr>
-+<tr class="even">
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">Linux</td>
-+<td align="left">1.3.0</td>
-+<td align="left">3.2</td>
-+<td align="right">2.394</td>
-+<td align="right">4.748</td>
-+<td align="right">4.883</td>
-+<td align="right">4.937</td>
- </tr>
- </tbody>
- </table>
-@@ -1808,10 +1818,20 @@ t11 &lt;- system.time(sforb_sfo3_plus_const &lt;- saem(three_met_sep_tc[&quot;SF
- <td align="left">Linux</td>
- <td align="left">1.2.0</td>
- <td align="left">3.2</td>
--<td align="right">5.671</td>
--<td align="right">7.696</td>
--<td align="right">8.166</td>
--<td align="right">8.168</td>
-+<td align="right">5.602</td>
-+<td align="right">7.373</td>
-+<td align="right">7.815</td>
-+<td align="right">7.831</td>
-+</tr>
-+<tr class="even">
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">Linux</td>
-+<td align="left">1.3.0</td>
-+<td align="left">3.2</td>
-+<td align="right">5.622</td>
-+<td align="right">7.445</td>
-+<td align="right">8.297</td>
-+<td align="right">7.740</td>
- </tr>
- </tbody>
- </table>
-@@ -1836,8 +1856,16 @@ t11 &lt;- system.time(sforb_sfo3_plus_const &lt;- saem(three_met_sep_tc[&quot;SF
- <td align="left">Linux</td>
- <td align="left">1.2.0</td>
- <td align="left">3.2</td>
--<td align="right">24.883</td>
--<td align="right">818.157</td>
-+<td align="right">24.014</td>
-+<td align="right">749.699</td>
-+</tr>
-+<tr class="even">
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">Linux</td>
-+<td align="left">1.3.0</td>
-+<td align="left">3.2</td>
-+<td align="right">24.480</td>
-+<td align="right">519.087</td>
- </tr>
- </tbody>
- </table>
-@@ -1861,7 +1889,14 @@ t11 &lt;- system.time(sforb_sfo3_plus_const &lt;- saem(three_met_sep_tc[&quot;SF
- <td align="left">Linux</td>
- <td align="left">1.2.0</td>
- <td align="left">3.2</td>
--<td align="right">1355.036</td>
-+<td align="right">1249.834</td>
-+</tr>
-+<tr class="even">
-+<td align="left">Ryzen 7 1700</td>
-+<td align="left">Linux</td>
-+<td align="left">1.3.0</td>
-+<td align="left">3.2</td>
-+<td align="right">944.471</td>
- </tr>
- </tbody>
- </table>
-diff --git a/vignettes/web_only/saem_benchmarks.rda b/vignettes/web_only/saem_benchmarks.rda
-index 55fabf1..992b58c 100644
-Binary files a/vignettes/web_only/saem_benchmarks.rda and b/vignettes/web_only/saem_benchmarks.rda differ
diff --git a/custom_lsoda_call_edited.patch b/custom_lsoda_call_edited.patch
deleted file mode 100644
index a79cbbcd..00000000
--- a/custom_lsoda_call_edited.patch
+++ /dev/null
@@ -1,116 +0,0 @@
---- a/R/mkinfit.R
-+++ b/R/mkinfit.R
-
-+ # Get native symbol before iterations info for speed
-+ call_lsoda <- getNativeSymbolInfo("call_lsoda", PACKAGE = "deSolve")
-+ if (solution_type == "deSolve" & use_compiled[1] != FALSE) {
-+ mkinmod$diffs_address <- getNativeSymbolInfo("diffs",
-+ PACKAGE = mkinmod$dll_info[["name"]])$address
-+ mkinmod$initpar_address <- getNativeSymbolInfo("initpar",
-+ PACKAGE = mkinmod$dll_info[["name"]])$address
-+ }
-+
-
-@@ -610,7 +619,8 @@ mkinfit <- function(mkinmod, observed,
- solution_type = solution_type,
- use_compiled = use_compiled,
- method.ode = method.ode,
-- atol = atol, rtol = rtol, ...)
-+ atol = atol, rtol = rtol,
-+ call_lsoda = call_lsoda, ...)
-
---- a/R/mkinpredict.R
-+++ b/R/mkinpredict.R
-
-@@ -116,9 +114,10 @@ mkinpredict.mkinmod <- function(x,
- outtimes = seq(0, 120, by = 0.1),
- solution_type = "deSolve",
- use_compiled = "auto",
-- method.ode = "lsoda", atol = 1e-8, rtol = 1e-10, maxsteps = 20000,
-+ method.ode = "lsoda", atol = 1e-8, rtol = 1e-10, maxsteps = 20000L,
- map_output = TRUE,
- na_stop = TRUE,
-+ call_lsoda = NULL,
- ...)
- {
-
-@@ -173,20 +172,80 @@ mkinpredict.mkinmod <- function(x,
- if (solution_type == "deSolve") {
- if (!is.null(x$cf) & use_compiled[1] != FALSE) {
-
-- out <- deSolve::ode(
-- y = odeini,
-- times = outtimes,
-- func = "diffs",
-- initfunc = "initpar",
-- dllname = if (is.null(x$dll_info)) inline::getDynLib(x$cf)[["name"]]
-- else x$dll_info[["name"]],
-- parms = odeparms[x$parms], # Order matters when using compiled models
-- method = method.ode,
-- atol = atol,
-- rtol = rtol,
-- maxsteps = maxsteps,
-- ...
-+ # Prepare call to "call_lsoda"
-+ # Simplified code from deSolve::lsoda() adapted to our use case
-+ if (is.null(call_lsoda)) {
-+ call_lsoda <- getNativeSymbolInfo("call_lsoda", PACKAGE = "deSolve")
-+ }
-+ if (is.null(x$diffs_address)) {
-+ x$diffs_address <- getNativeSymbolInfo("diffs",
-+ PACKAGE = x$dll_info[["name"]])$address
-+ x$initpar_address <- getNativeSymbolInfo("initpar",
-+ PACKAGE = x$dll_info[["name"]])$address
-+ }
-+ rwork <- vector("double", 20)
-+ rwork[] <- 0.
-+ rwork[6] <- max(abs(diff(outtimes)))
-+
-+ iwork <- vector("integer", 20)
-+ iwork[] <- 0
-+ iwork[6] <- maxsteps
-+
-+ n <- length(odeini)
-+ lmat <- n^2 + 2 # from deSolve::lsoda(), for Jacobian type full, internal (2)
-+ # hard-coded default values of lsoda():
-+ maxordn <- 12L
-+ maxords <- 5L
-+ lrn <- 20 + n * (maxordn + 1) + 3 * n # length in case non-stiff method
-+ lrs <- 20 + n * (maxords + 1) + 3 * n + lmat # length in case stiff method
-+ lrw <- max(lrn, lrs) # actual length: max of both
-+ liw <- 20 + n
-+
-+ on.exit(.C("unlock_solver", PACKAGE = "deSolve"))
-+
-+ out_raw <- .Call(call_lsoda,
-+ as.double(odeini), # y
-+ as.double(outtimes), # times
-+ x$diffs_address, # derivfunc
-+ as.double(odeparms[x$parms]), # parms
-+ rtol, atol,
-+ NULL, NULL, # rho, tcrit
-+ NULL, # jacfunc
-+ x$initpar_address, # initfunc
-+ NULL, # eventfunc
-+ 0L, # verbose
-+ 1L, # iTask
-+ as.double(rwork), # rWork
-+ as.integer(iwork), # iWork
-+ 2L, # jT full Jacobian calculated internally
-+ 0L, # nOut
-+ as.integer(lrw), # lRw
-+ as.integer(liw), # lIw
-+ 1L, # Solver
-+ NULL, # rootfunc
-+ 0L, as.double(0), 0L, # nRoot, Rpar, Ipar
-+ 0L, # Type
-+ list(fmat = 0L, tmat = 0L, imat = 0L, ModelForc = NULL), # flist
-+ list(), # elist
-+ list(islag = 0L) # elag
- )
-+
-+ out <- t(out_raw)
-+ colnames(out) <- c("time", mod_vars)
- } else {
- mkindiff <- function(t, state, parms) {
-

Contact - Imprint