Variables based on amounts do not update at the first time point
First of all, thank you for this wonderful tool !
Here is my issue :
I wrote the following PD model (two bacterial subpopulations)
new_ode_model( code = " KILLS = pow((KMAXS * CONC),GAMMA) / (pow(KC50S,GAMMA) + pow(CONC,GAMMA)); KILLR = pow((KMAXR * CONC),GAMMA) / (pow(KC50R,GAMMA) + pow(CONC,GAMMA)); PLAT = (A[1]+A[2])/pow(10,POPMAX); CFU_TOT = A[1] + A[2]; dAdt[1] = (KG * (1-PLAT) - KILLS) * A[1]; dAdt[2] = (KG * (1-PLAT) - KILLR) * A[2]; ", dose = list(cmt = 1, bioav = 1), covariates = c("CONC"), state_init="A[1] = INOC * (1 - pow(10,MUTF)); A[2] = INOC * pow(10,MUTF); A[3] = INOC;", obs = list(cmt = c(1, 2, 3), scale = c(1, 1, 1), label = c("S", "R","TOTAL")), declare_variables = c("KILLS","KILLR","PLAT","CFU_TOT"))
First of all, my variables PLAT and CFU_TOT have the same value on time = 0h and time = 1h, which make me think that there is something about how the variables values are updated that I don't understand. Also CFU_TOT should be equal to A[1] + A[2] but it doesn't !
Thanks again
can you send me a complete code example you are trying to run? (So including parameter and covariate definitions)
On Fri, Jun 30, 2017 at 12:26 PM, Vincent ARANZANA-CLIMENT < [email protected]> wrote:
First of all, thank you for this wonderful tool ! Here is my issue : I wrote the following PD model (two bacterial subpopulations) new_ode_model( code = " KILLS = pow((KMAXS * CONC),GAMMA) / (pow(KC50S,GAMMA) + pow(CONC,GAMMA)); KILLR = pow((KMAXR * CONC),GAMMA) / (pow(KC50R,GAMMA) + pow(CONC,GAMMA)); PLAT = (A[1]+A[2])/pow(10,POPMAX); CFU_TOT = A[1] + A[2]; dAdt[1] = (KG * (1-PLAT) - KILLS) * A[1]; dAdt[2] = (KG * (1-PLAT) - KILLR) * A[2]; ", dose = list(cmt = 1, bioav = 1), covariates = c("CONC"), state_init="A[1] = INOC * (1 - pow(10,MUTF)); A[2] = INOC * pow(10,MUTF); A[3] = INOC;", obs = list(cmt = c(1, 2, 3), scale = c(1, 1, 1), label = c("S", "R","TOTAL")), declare_variables = c("KILLS","KILLR","PLAT","CFU_TOT")) First of all, my variables PLAT and CFU_TOT have the same value on time = 0h and time = 1h, which make me think that there is something about how the variables values are updated that I don't understand. Also CFU_TOT should be equal to A[1] + A[2] but it doesn't !
Thanks again
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ronkeizer/PKPDsim/issues/34, or mute the thread https://github.com/notifications/unsubscribe-auth/AAO4UcrS7IDHD8akzp1nApghscoGyfugks5sJM1FgaJpZM4OKafH .
Yes ! Here you go : Simulation_SR_Complete_Code.txt
Can indeed reproduce unexpected behavior. Not sure why this happens, will try to find time in next week to look at.