Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables based on amounts do not update at the first time point #34

Open
Vincent-AC opened this issue Jun 30, 2017 · 3 comments
Open

Comments

@Vincent-AC
Copy link

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

@Vincent-AC Vincent-AC changed the title Variables based on amounts do not update on time. Variables based on amounts do not update at the first time point Jun 30, 2017
@ronkeizer
Copy link
Owner

ronkeizer commented Jul 2, 2017 via email

@Vincent-AC
Copy link
Author

Yes ! Here you go :
Simulation_SR_Complete_Code.txt

@ronkeizer
Copy link
Owner

Can indeed reproduce unexpected behavior. Not sure why this happens, will try to find time in next week to look at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants