From f39815aa87272849f8e0c808099c4cee780c2a81 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Thu, 3 Nov 2016 14:33:05 +0100 Subject: Static documentation rebuilt by pkgdown::build_site() Using pkgdown with PR hadley/pkgdown#212 --- docs/reference/mkinpredict.html | 64 ++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 39 deletions(-) (limited to 'docs/reference/mkinpredict.html') diff --git a/docs/reference/mkinpredict.html b/docs/reference/mkinpredict.html index 31556527..57bb747c 100644 --- a/docs/reference/mkinpredict.html +++ b/docs/reference/mkinpredict.html @@ -61,7 +61,12 @@ @@ -154,10 +159,7 @@

A matrix in the same format as the output of ode.

-

- - Examples -

+

Examples

SFO <- mkinmod(degradinol = list(type = "SFO")) # Compare solution types mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, @@ -182,8 +184,7 @@ #> 18 17 0.6096747 #> 19 18 0.4516581 #> 20 19 0.3345965 -#> 21 20 0.2478752 -#>
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, solution_type = "deSolve")
#> time degradinol #> 1 0 100.0000000 #> 2 1 74.0818221 @@ -205,8 +206,7 @@ #> 18 17 0.6096747 #> 19 18 0.4516581 #> 20 19 0.3345965 -#> 21 20 0.2478752 -#>
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, solution_type = "deSolve", use_compiled = FALSE)
#> time degradinol #> 1 0 100.0000000 #> 2 1 74.0818221 @@ -228,8 +228,7 @@ #> 18 17 0.6096747 #> 19 18 0.4516581 #> 20 19 0.3345965 -#> 21 20 0.2478752 -#>
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, solution_type = "eigen")
#> time degradinol #> 1 0 100.0000000 #> 2 1 74.0818221 @@ -251,57 +250,44 @@ #> 18 17 0.6096747 #> 19 18 0.4516581 #> 20 19 0.3345965 -#> 21 20 0.2478752 -#>
+#> 21 20 0.2478752
# Compare integration methods to analytical solution mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, solution_type = "analytical")[21,]
#> time degradinol -#> 21 20 0.2478752 -#>
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, method = "lsoda")[21,]
#> time degradinol -#> 21 20 0.2478752 -#>
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, method = "ode45")[21,]
#> time degradinol -#> 21 20 0.2478752 -#>
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, +#> 21 20 0.2478752
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), 0:20, method = "rk4")[21,]
#> time degradinol -#> 21 20 0.2480043 -#>
# rk4 is not as precise here +#> 21 20 0.2480043
# rk4 is not as precise here # The number of output times used to make a lot of difference until the # default for atol was adjusted mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), seq(0, 20, by = 0.1))[201,]
#> time degradinol -#> 201 20 0.2478752 -#>
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), +#> 201 20 0.2478752
mkinpredict(SFO, c(k_degradinol_sink = 0.3), c(degradinol = 100), seq(0, 20, by = 0.01))[2001,]
#> time degradinol -#> 2001 20 0.2478752 -#>
+#> 2001 20 0.2478752
# Check compiled model versions - they are faster than the eigenvalue based solutions! SFO_SFO = mkinmod(parent = list(type = "SFO", to = "m1"), - m1 = list(type = "SFO"))
Successfully compiled differential equation model from auto-generated C code.
system.time( + m1 = list(type = "SFO"))
#> Successfully compiled differential equation model from auto-generated C code.
system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "eigen")[201,]))
#> time parent m1 -#> 201 20 4.978707 27.46227 -#>
#> user system elapsed -#> 0.028 0.004 0.004 -#>
system.time( +#> 201 20 4.978707 27.46227
#> user system elapsed +#> 0.004 0.024 0.004
system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve")[201,]))
#> time parent m1 -#> 201 20 4.978707 27.46227 -#>
#> user system elapsed -#> 0.016 0.004 0.002 -#>
system.time( +#> 201 20 4.978707 27.46227
#> user system elapsed +#> 0.004 0.016 0.003
system.time( print(mkinpredict(SFO_SFO, c(k_parent_m1 = 0.05, k_parent_sink = 0.1, k_m1_sink = 0.01), c(parent = 100, m1 = 0), seq(0, 20, by = 0.1), solution_type = "deSolve", use_compiled = FALSE)[201,]))
#> time parent m1 -#> 201 20 4.978707 27.46227 -#>
#> user system elapsed -#> 0.052 0.000 0.052 -#>
+#> 201 20 4.978707 27.46227
#> user system elapsed +#> 0.036 0.000 0.033