R/custom-tol.R
use_custom_tol.RdCall use_custom_tol() to use custom relative and absolute tolerances in
a model; call use_scalar_tol() to revert to the traditional configuration
where a single rtol and atol are applied to all compartments.
use_custom_tol(x)
use_scalar_tol(x)An updated model object.
If customized tolerances have not been initialized yet, they will be,
assigning the current rtol or atol for every compartment. These default
values can be updated using custom_rtol(), custom_atol(), or
custom_tol().
mod <- house()
mod <- use_custom_tol(mod)
mod
#>
#>
#> -------------- source: housemodel.cpp --------------
#>
#> project: /tmp/Rtmp8QAYrr/...solve/project
#> shared object: mrgsolve
#>
#> time: start: 0 end: 120 delta: 0.25
#> add: <none>
#> compartments: GUT CENT RESP [3]
#> parameters: CL VC KA F1 D1 WTCL WTVC SEXCL SEXVC
#> KIN KOUT IC50 WT SEX [14]
#> captures: DV CP [2]
#> omega: 4x4
#> sigma: 1x1
#>
#> solver: rtol: -- atol: -- itol: 4 (custom)
#> ------------------------------------------------------
mod <- use_scalar_tol(mod)
mod
#>
#>
#> -------------- source: housemodel.cpp --------------
#>
#> project: /tmp/Rtmp8QAYrr/...solve/project
#> shared object: mrgsolve
#>
#> time: start: 0 end: 120 delta: 0.25
#> add: <none>
#> compartments: GUT CENT RESP [3]
#> parameters: CL VC KA F1 D1 WTCL WTVC SEXCL SEXVC
#> KIN KOUT IC50 WT SEX [14]
#> captures: DV CP [2]
#> omega: 4x4
#> sigma: 1x1
#>
#> solver: rtol: 1e-08 atol: 1e-08 itol: 1 (scalar)
#> ------------------------------------------------------