From 108955dfe9f328605844b5bfa6ed10190cb739e3 Mon Sep 17 00:00:00 2001 From: jranke Date: Mon, 4 Nov 2013 09:16:12 +0000 Subject: Complete the fix for fixing initial values for state variables git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/mkin@133 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- R/mkinpredict.R | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'R/mkinpredict.R') diff --git a/R/mkinpredict.R b/R/mkinpredict.R index 5170dc6b..7ce26caf 100644 --- a/R/mkinpredict.R +++ b/R/mkinpredict.R @@ -23,6 +23,11 @@ mkinpredict <- function(mkinmod, odeparms, odeini, outtimes, solution_type = "de # Get the names of the state variables in the model mod_vars <- names(mkinmod$diffs) + # Order the inital values for state variables if they are named + if (!is.null(names(odeini))) { + odeini <- odeini[mod_vars] + } + # Create function for evaluation of expressions with ode parameters and initial values evalparse <- function(string) { -- cgit v1.2.1