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

[BUG] CMT doesn't accept negative value #10

Closed yizhang-yiz closed 4 years ago

yizhang-yiz commented 5 years ago

Description

in pmx_solve_xxx functions cmt is not allowed to be negative.

Example

Negative compartment id gives

Exception: xxxx_model_namespace::xxxx_model: cmt[i_0__] is -1, but must be greater than or equal to 1

Expected Output

Follow NONMEM behavior:

When CMT specifies the output compartment, it is allowed to have a negative sign (e.g., with the One-compartment model, CMT may be -2). This signals that after the prediction is computed the out- put compartment is to be turned off, i.e. the amount in the compartment is to be set to zero. The amount remains zero until the compartment is subsequently turned on. This is quite useful with urine observations

Current Version:

v0.87.1

yizhang-yiz commented 4 years ago

Resolved when EVID=2 + negative CMT was implemented to indicate resetting given compartment.