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

Problems creating new_ode model #79

Open
lostinpkpd opened this issue Nov 12, 2023 · 0 comments
Open

Problems creating new_ode model #79

lostinpkpd opened this issue Nov 12, 2023 · 0 comments

Comments

@lostinpkpd
Copy link

Hi guys,

I want to create a one compartment model with first order absorption and elimination (drug administered orally). I want the model to contain bioavailabilty and half life time and to be able to show concentrations and to predict time to reach steady state.

I first tried to model it like this (without halflife time):

par_mod_BA<-list(KA=1, KEL=0.6, F=0.98)
reg_mod_BA<-new_regimen(
amt=400,
interval=24,
n=5
)
mod_BA<-new_ode_model(
code="
dAdt[1]=-KAA[1];
dAdt[2]=KA
A[1]-KEL*A[2]",
dose=list(cmt=1, bioav="F"),
obs=list(cmt=2),
parameters=c("F","KEL", "KA")
)

My questions is:
I want to include half life time "HLT", that can be described by the term HLT=ln(2)/KEL, KEL=ln(2)/HLT respectively. I tried it by making HLT a covariate.

cov1<-list("HLT"=new_covariate(value=17))

par_mod_BA<-list(KA=1, KEL=0.6, F=0.98)

reg_mod_BA<-new_regimen(
amt=400,
interval=24,
n=5
)

mod_BA_HLT<-new_ode_model(
code="
dAdt[1]=-KAA[1];
dAdt[2]=KA
A[1]-KEL*A[2];
KEL=log(2)/HLT",
declare_variables=c("KEL","KA"),
covariates=cov1
)

data_mod_BA_HLT<-sim_ode(ode=mod_BA_HLT,
regimen=reg_mod_BA,
parameters=par_mod_BA)

But when I try to run the simulation is says:
Error in sim(...) :
Not all covariates for this model have been specified. Missing:
HLT

but I don't understand because I specified it in my opinion. I tried to fix it but I can't figure out what I am doing wrong...

Thank you so much for any help!:)

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

1 participant