From fd9ea462ba438c023e33902449429eae6d2dc28f Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 9 Nov 2022 10:08:37 +0100 Subject: Version 3.5, from a fresh installation --- CakeSolutions.R | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 CakeSolutions.R (limited to 'CakeSolutions.R') diff --git a/CakeSolutions.R b/CakeSolutions.R old mode 100644 new mode 100755 index c9e5b88..ecbfa59 --- a/CakeSolutions.R +++ b/CakeSolutions.R @@ -1,6 +1,7 @@ # $Id$ # Some of the CAKE R modules are based on mkin, -# Developed by Tessella Ltd for Syngenta: Copyright (C) 2011-2020 Syngenta +# Modifications developed by Hybrid Intelligence (formerly Tessella), part of +# Capgemini Engineering, for Syngenta, Copyright (C) 2011-2022 Syngenta # Tessella Project Reference: 6245, 7247, 8361, 7414, 10091 # The CAKE R modules are free software: you can redistribute it and/or modify @@ -38,5 +39,12 @@ HS.solution <- function (t, parent.0, k1, k2, tb) { # Produces solutions to the IORE equation given times t and parameters M_0, k and N. IORE.solution <- function(t, parent.0, k, N) { - parent = (parent.0^(1 - N) - (1 - N) * k * t)^(1/(1-N)) + if (N == 1) { + parent = parent.0 * exp(-k * t) + } + else { + parent = (parent.0 ^ (1 - N) - (1 - N) * k * t) ^ (1 / (1 - N)) + } + + return(parent) } \ No newline at end of file -- cgit v1.2.1