metrumresearchgroup / Torsten

library of C++ functions that support applications of Stan in Pharmacometrics
BSD 3-Clause "New" or "Revised" License
52 stars 11 forks source link

[FEATURE] Allow tolerance and max_step controls for steady states solver's algebraic solver #14

Closed yizhang-yiz closed 4 years ago

yizhang-yiz commented 5 years ago

Description

Referenced in https://github.com/metrumresearchgroup/math/issues/29

Example

Description:

PredSS_general has f_tol hard-coded as

    double rel_tol = 1e-10;  // default
    double f_tol = 1e-4;  // empirical
    long int max_num_steps = 1e3;  // default // NOLINT

We need to avoid the above hard-coded solver parameters. In particular, when ODE coefficients are not normalized, f_tol may cause solver failure due to large abs error.

Expected Output:

Allow user to specify tolerance or provide a normalization in the ODE solver.

Current Version:

v0.87.1

yizhang-yiz commented 4 years ago

Resolved in