From 651b27080fd20c8079f2f2744b93b7d866cc8b75 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 4 Dec 2013 05:15:38 +0100 Subject: Remove mkinmod warning based on a misconception --- R/mkinmod.R | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'R') diff --git a/R/mkinmod.R b/R/mkinmod.R index c743777..2bc6ae3 100644 --- a/R/mkinmod.R +++ b/R/mkinmod.R @@ -1,6 +1,4 @@ -# $Id$ - -# Copyright (C) 2010-2012 Johannes Ranke {{{ +# Copyright (C) 2010-2013 Johannes Ranke {{{ # Contact: jranke@uni-bremen.de # This file is part of the R package mkin @@ -46,19 +44,10 @@ mkinmod <- function(..., use_of_ff = "min", speclist = NULL) # fractions if(spec[[1]]$type %in% c("FOMC", "DFOP", "HS")) { mat = FALSE - if(!is.null(spec[[1]]$to)) { - message <- paste( - "Only constant formation fractions over time are implemented.", - "Depending on the reason for the time dependence of degradation", - "this may be unrealistic. You may want to consider using the", - "SFORB model", - sep="\n") - warning(message) - } else message <- "ok" } else mat = TRUE #}}} - # Establish list of differential equations as well as map from observed {{{ + # Establish a list of differential equations as well as a map from observed {{{ # compartments to differential equations for (varname in obs_vars) { -- cgit v1.2.1 From 8b94131388071980e62c17190eb4229e89975a0c Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 4 Dec 2013 10:25:14 +0100 Subject: Make it possible to use different ode solvers --- R/mkinfit.R | 8 +++++--- R/mkinpredict.R | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'R') diff --git a/R/mkinfit.R b/R/mkinfit.R index 3e47479..749d748 100644 --- a/R/mkinfit.R +++ b/R/mkinfit.R @@ -1,5 +1,3 @@ -# $Id$ - # Copyright (C) 2010-2013 Johannes Ranke # Contact: jranke@uni-bremen.de # The summary function is an adapted and extended version of summary.modFit @@ -28,6 +26,7 @@ mkinfit <- function(mkinmod, observed, fixed_parms = NULL, fixed_initials = names(mkinmod$diffs)[-1], solution_type = "auto", + method.ode = "lsoda", method.modFit = "Marq", control.modFit = list(), plot = FALSE, quiet = FALSE, @@ -161,6 +160,7 @@ mkinfit <- function(mkinmod, observed, # Solve the system with current transformed parameter values out <- mkinpredict(mkinmod, parms, odeini, outtimes, solution_type = solution_type, + method.ode = method.ode, atol = atol, rtol = rtol, ...) assign("out_predicted", out, inherits=TRUE) @@ -177,7 +177,9 @@ mkinfit <- function(mkinmod, observed, outtimes_plot = seq(min(observed$time), max(observed$time), length.out=100) out_plot <- mkinpredict(mkinmod, parms, odeini, outtimes_plot, - solution_type = solution_type, atol = atol, rtol = rtol, ...) + solution_type = solution_type, + method.ode = method.ode, + atol = atol, rtol = rtol, ...) plot(0, type="n", xlim = range(observed$time), ylim = range(observed$value, na.rm=TRUE), diff --git a/R/mkinpredict.R b/R/mkinpredict.R index 7ce26ca..07c1a81 100644 --- a/R/mkinpredict.R +++ b/R/mkinpredict.R @@ -1,6 +1,4 @@ -# $Id$ - -# Copyright (C) 2010-2012 Johannes Ranke +# Copyright (C) 2010-2013 Johannes Ranke # Contact: jranke@uni-bremen.de # This file is part of the R package mkin @@ -18,7 +16,10 @@ # You should have received a copy of the GNU General Public License along with # this program. If not, see -mkinpredict <- function(mkinmod, odeparms, odeini, outtimes, solution_type = "deSolve", map_output = TRUE, atol = 1e-8, rtol = 1e-10, ...) { +mkinpredict <- function(mkinmod, odeparms, odeini, + outtimes, solution_type = "deSolve", + method.ode = "lsoda", atol = 1e-8, rtol = 1e-10, + map_output = TRUE, ...) { # Get the names of the state variables in the model mod_vars <- names(mkinmod$diffs) @@ -96,6 +97,7 @@ mkinpredict <- function(mkinmod, odeparms, odeini, outtimes, solution_type = "de times = outtimes, func = mkindiff, parms = odeparms, + method = method.ode, atol = atol, rtol = rtol, ... -- cgit v1.2.1