aboutsummaryrefslogtreecommitdiff
path: root/docs/articles/FOCUS_Z.R
diff options
context:
space:
mode:
Diffstat (limited to 'docs/articles/FOCUS_Z.R')
-rw-r--r--docs/articles/FOCUS_Z.R32
1 files changed, 27 insertions, 5 deletions
diff --git a/docs/articles/FOCUS_Z.R b/docs/articles/FOCUS_Z.R
index 5fc8f123..5c70b57e 100644
--- a/docs/articles/FOCUS_Z.R
+++ b/docs/articles/FOCUS_Z.R
@@ -1,3 +1,25 @@
+## ----include=FALSE--------------------------------------------------
+require(knitr)
+opts_chunk$set(engine='R', tidy = FALSE, cache = TRUE)
+options(width=70)
+
+## ----FOCUS_2006_Z_data, echo=TRUE, eval=TRUE------------------------
+require(mkin)
+LOD = 0.5
+FOCUS_2006_Z = data.frame(
+ t = c(0, 0.04, 0.125, 0.29, 0.54, 1, 2, 3, 4, 7, 10, 14, 21,
+ 42, 61, 96, 124),
+ Z0 = c(100, 81.7, 70.4, 51.1, 41.2, 6.6, 4.6, 3.9, 4.6, 4.3, 6.8,
+ 2.9, 3.5, 5.3, 4.4, 1.2, 0.7),
+ Z1 = c(0, 18.3, 29.6, 46.3, 55.1, 65.7, 39.1, 36, 15.3, 5.6, 1.1,
+ 1.6, 0.6, 0.5 * LOD, NA, NA, NA),
+ Z2 = c(0, NA, 0.5 * LOD, 2.6, 3.8, 15.3, 37.2, 31.7, 35.6, 14.5,
+ 0.8, 2.1, 1.9, 0.5 * LOD, NA, NA, NA),
+ Z3 = c(0, NA, NA, NA, NA, 0.5 * LOD, 9.2, 13.1, 22.3, 28.4, 32.5,
+ 25.2, 17.2, 4.8, 4.5, 2.8, 4.4))
+
+FOCUS_2006_Z_mkin <- mkin_wide_to_long(FOCUS_2006_Z)
+
## ----FOCUS_2006_Z_fits_1, echo=TRUE, fig.height=6-------------------
Z.2a <- mkinmod(Z0 = mkinsub("SFO", "Z1"),
Z1 = mkinsub("SFO"))
@@ -32,9 +54,9 @@ plot_sep(m.Z.5)
Z.FOCUS <- mkinmod(Z0 = mkinsub("SFO", "Z1", sink = FALSE),
Z1 = mkinsub("SFO", "Z2", sink = FALSE),
Z2 = mkinsub("SFO", "Z3"),
- Z3 = mkinsub("SFO"),
+ Z3 = mkinsub("SFO"),
use_of_ff = "max")
-m.Z.FOCUS <- mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin,
+m.Z.FOCUS <- mkinfit(Z.FOCUS, FOCUS_2006_Z_mkin,
parms.ini = m.Z.5$bparms.ode,
quiet = TRUE)
plot_sep(m.Z.FOCUS)
@@ -62,7 +84,7 @@ Z.mkin.4 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
Z1 = mkinsub("SFO", "Z2", sink = FALSE),
Z2 = mkinsub("SFO", "Z3"),
Z3 = mkinsub("SFO"))
-m.Z.mkin.4 <- mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin,
+m.Z.mkin.4 <- mkinfit(Z.mkin.4, FOCUS_2006_Z_mkin,
parms.ini = m.Z.mkin.3$bparms.ode,
quiet = TRUE)
plot_sep(m.Z.mkin.4)
@@ -72,13 +94,13 @@ Z.mkin.5 <- mkinmod(Z0 = mkinsub("SFORB", "Z1", sink = FALSE),
Z1 = mkinsub("SFO", "Z2", sink = FALSE),
Z2 = mkinsub("SFO", "Z3"),
Z3 = mkinsub("SFORB"))
-m.Z.mkin.5 <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin,
+m.Z.mkin.5 <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin,
parms.ini = m.Z.mkin.4$bparms.ode[1:4],
quiet = TRUE)
plot_sep(m.Z.mkin.5)
## ----FOCUS_2006_Z_fits_11a, echo=TRUE-------------------------------
-m.Z.mkin.5a <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin,
+m.Z.mkin.5a <- mkinfit(Z.mkin.5, FOCUS_2006_Z_mkin,
parms.ini = c(m.Z.mkin.5$bparms.ode[1:7],
k_Z3_bound_free = 0),
fixed_parms = "k_Z3_bound_free",

Contact - Imprint