From 8452daa2015aa645dcc1eca3ec2bba5726603e4e Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Sat, 22 Sep 2018 09:54:59 +0200 Subject: Add test and update docs --- tests/testthat/test_PEC_soil.R | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests') diff --git a/tests/testthat/test_PEC_soil.R b/tests/testthat/test_PEC_soil.R index 34b4749..6e4e30b 100644 --- a/tests/testthat/test_PEC_soil.R +++ b/tests/testthat/test_PEC_soil.R @@ -127,3 +127,23 @@ test_that("Tier 1 PEC soil example for Pesticide F in EFSA guidance from 2015 ca expect_equivalent(round(results_pfm, 2), results_guidance) expect_equivalent(round(results_pfm_pw, 2), results_guidance_pw) }) + +test_that("Long term FOMC PEC soil from ESCAPE can be reproduced", { + # Application of 100 g/ha with 25% interception and FOMC degradation type a + fomc_50_a <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 1, beta = 10), + interval = 365, tillage_depth = 20, n_periods = 50) + fomc_long_a <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 1, beta = 10), + interval = 365, tillage_depth = 20) + + # Application of 100 g/ha with 25% interception and FOMC degradation type b + # The long term PEC is much lower than when adding FOMC curves for 50 years + fomc_50_b <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 0.5, beta = 20), + interval = 365, tillage_depth = 20, n_periods = 50) + fomc_long_b <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 0.5, beta = 20), + interval = 365, tillage_depth = 20) + + expect_true(fomc_50_b > fomc_long_b) + + # The benchmark results were obtained with ESCAPE + expect_equivalent(round(fomc_long_b, 4), 0.1424) +}) -- cgit v1.2.1