From 0bd507131a9bb180afe6e843681330956086be9b Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Mon, 9 Nov 2015 09:35:15 +0100 Subject: Vignettes rebuilt by staticdocs::build_site() for static documentation on r-forge --- vignettes/compiled_models.html | 47 +++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 26 deletions(-) (limited to 'vignettes/compiled_models.html') diff --git a/vignettes/compiled_models.html b/vignettes/compiled_models.html index 3d92a7b8..92919da9 100644 --- a/vignettes/compiled_models.html +++ b/vignettes/compiled_models.html @@ -82,13 +82,8 @@ img {
##            gcc 
 ## "/usr/bin/gcc"

First, we build a simple degradation model for a parent compound with one metabolite.

-
library("mkin")
-
## Loading required package: minpack.lm
-## Loading required package: rootSolve
-## Loading required package: inline
-## Loading required package: methods
-## Loading required package: parallel
-
SFO_SFO <- mkinmod(
+
library("mkin")
+SFO_SFO <- mkinmod(
   parent = mkinsub("SFO", "m1"),
   m1 = mkinsub("SFO"))
## Successfully compiled differential equation model from auto-generated C code.
@@ -104,19 +99,19 @@ smb.1 <- summary(mb.1)[-1] rownames(smb.1) <- c("deSolve, not compiled", "Eigenvalue based", "deSolve, compiled") print(smb.1)
##                             min        lq      mean    median        uq
-## deSolve, not compiled 4920.5498 4957.8305 5073.8005 4995.1112 5150.4259
-## Eigenvalue based       792.7603  820.6244  849.2773  848.4885  877.5358
-## deSolve, compiled      663.5431  673.4949  678.4844  683.4468  685.9551
+## deSolve, not compiled 9307.3194 9319.9546 9332.8171 9332.5899 9345.5659
+## Eigenvalue based       855.3608  855.8081  869.4725  856.2555  876.5283
+## deSolve, compiled      686.6143  687.9256  698.0279  689.2369  703.7346
 ##                             max neval cld
-## deSolve, not compiled 5305.7406     3   b
-## Eigenvalue based       906.5832     3  a 
-## deSolve, compiled      688.4634     3  a
-

We see that using the compiled model is by a factor of 7.3 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs:

+## deSolve, not compiled 9358.5420 3 c +## Eigenvalue based 896.8012 3 b +## deSolve, compiled 718.2324 3 a +

We see that using the compiled model is by a factor of 13.5 faster than using the R version with the default ode solver, and it is even faster than the Eigenvalue based solution implemented in R which does not need iterative solution of the ODEs:

smb.1["median"]/smb.1["deSolve, compiled", "median"]
-
##                         median
-## deSolve, not compiled 7.308706
-## Eigenvalue based      1.241484
-## deSolve, compiled     1.000000
+
##                          median
+## deSolve, not compiled 13.540468
+## Eigenvalue based       1.242324
+## deSolve, compiled      1.000000

Benchmark for a model that can not be solved with Eigenvalues

@@ -133,17 +128,17 @@ smb.2 <- summary(mb.2)[-1] rownames(smb.2) <- c("deSolve, not compiled", "deSolve, compiled") print(smb.2)
##                             min        lq      mean    median        uq
-## deSolve, not compiled 10.710141 10.757988 10.810178 10.805835 10.860196
-## deSolve, compiled      1.200581  1.203966  1.211877  1.207351  1.217525
+## deSolve, not compiled 20.130709 20.147223 20.180429 20.163737 20.205289
+## deSolve, compiled      1.235864  1.255748  1.267458  1.275632  1.283255
 ##                             max neval cld
-## deSolve, not compiled 10.914558     3   b
-## deSolve, compiled      1.227699     3  a
+## deSolve, not compiled 20.246841 3 b +## deSolve, compiled 1.290878 3 a
smb.2["median"]/smb.2["deSolve, compiled", "median"]
##                         median
-## deSolve, not compiled 8.950036
-## deSolve, compiled     1.000000
-

Here we get a performance benefit of a factor of 9 using the version of the differential equation model compiled from C code using the inline package!

-

This vignette was built with mkin 0.9.40.900 on

+## deSolve, not compiled 15.80686 +## deSolve, compiled 1.00000 +

Here we get a performance benefit of a factor of 15.8 using the version of the differential equation model compiled from C code using the inline package!

+

This vignette was built with mkin 0.9.41 on

## R version 3.2.2 (2015-08-14)
 ## Platform: x86_64-pc-linux-gnu (64-bit)
 ## Running under: Debian GNU/Linux 8 (jessie)
-- cgit v1.2.1