CompTox-ExpoCast-httk
CompTox-ExpoCast-httk copied to clipboard
More precise time output in solve_model()
When running one of the solve_model()
functions for more than 100 days, the "time" column of the output matrix does not have sufficient numerical precision to distinguish the different time points of the output. Seems like the precision is fixed at 4 sig figs, which isn't enough for longer simulations.
Precision for time output needs to be determined based on the length of the simulation and the number of time steps.
Reproducible example:
When you run for 100 days or less, the time points are distinguishable:
tmp <- solve_pbtk(
chem.name='Bisphenol-A',
daily.dose=1, doses.per.day = 1,
days=100)
tail(tmp[, "time"], 10)
tail(diff(tmp[,"time"]), 10)
When you run for more than 100 days, the time points are not distinguishable:
tmp <- solve_pbtk(
chem.name='Bisphenol-A',
daily.dose=1, doses.per.day = 1,
days=101)
tail(tmp[, "time"], 10)
tail(diff(tmp[,"time"]), 10)