aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_analytical.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2020-05-11 15:00:25 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2020-05-11 15:20:53 +0200
commit6308e7d7898d4f064d321d97d162c6752c22b362 (patch)
tree5308c9a024fc4df0d0e9486f787228b8c9de535b /tests/testthat/test_analytical.R
parentb36ae3d710858ee3ff2907eb2d780e0dff48a4f3 (diff)
Add analytical solution for DFOP-SFO
This is about twice as fast as deSolve compiled in the case of FOCUS D
Diffstat (limited to 'tests/testthat/test_analytical.R')
-rw-r--r--tests/testthat/test_analytical.R14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/testthat/test_analytical.R b/tests/testthat/test_analytical.R
index 5972a18a..578258d3 100644
--- a/tests/testthat/test_analytical.R
+++ b/tests/testthat/test_analytical.R
@@ -1,6 +1,6 @@
context("Analytical solutions for coupled models")
-test_that("The analytical solutions of SFO-SFO are correct", {
+test_that("The analytical solutions for SFO-SFO are correct", {
# No sink, no formation fractions
SFO_SFO_nosink <- mkinmod(
parent = mkinsub("SFO", to = "m1", sink = FALSE),
@@ -44,3 +44,15 @@ test_that("The analytical solutions of SFO-SFO are correct", {
)
})
+
+test_that("The analytical solution for DFOP-SFO are correct", {
+ # With formation fraction
+ f_dfop_sfo_analytical <- mkinfit(DFOP_SFO, FOCUS_D,
+ solution_type = "analytical", quiet = TRUE)
+ f_dfop_sfo_desolve <- mkinfit(DFOP_SFO, FOCUS_D,
+ solution_type = "deSolve", quiet = TRUE)
+ expect_equal(
+ parms(f_dfop_sfo_analytical),
+ parms(f_dfop_sfo_desolve)
+ )
+})

Contact - Imprint