This PR adds a coefficient of absorption to the PK function and varies it according to the most recent dose_method. The overall effect is that a dose of pills takes around ~5 time steps to peak and peaks at a lower concentration. All other methods peak at the following time step. See pk-absorb-eliminate.ipynb for details.
The model's dose increase logic is based on the effect_record, which used to rely on each dose's peak concentration occurring at the same time step in which the dose was taken. Since this is no longer the case, we also add an indicator after each dose is taken to check if the concentration is lower than the previous time step. If so, the previous time step was that dose's peak, and we record its effect in the effect_record as we used to do at the time the dose was taken.
This PR adds a coefficient of absorption to the PK function and varies it according to the most recent
dose_method
. The overall effect is that a dose of pills takes around ~5 time steps to peak and peaks at a lower concentration. All other methods peak at the following time step. Seepk-absorb-eliminate.ipynb
for details.The model's dose increase logic is based on the
effect_record
, which used to rely on each dose's peak concentration occurring at the same time step in which the dose was taken. Since this is no longer the case, we also add an indicator after each dose is taken to check if the concentration is lower than the previous time step. If so, the previous time step was that dose's peak, and we record its effect in theeffect_record
as we used to do at the time the dose was taken.