Skip to content
New issue

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

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

Already on GitHub? # to your account

difficulty in running model #38

Open
jrwoodworth opened this issue Dec 2, 2018 · 1 comment
Open

difficulty in running model #38

jrwoodworth opened this issue Dec 2, 2018 · 1 comment

Comments

@jrwoodworth
Copy link

Hi Ron,

I am attempting to create a simulation with a simple two-compartment oral model. Although the model compiles, the simulation does not seem to recognize the dose, and my simulation output is nothing but "0"s. Can you help please?

Thanks in advance.

Jim Woodworth

mod2 <-new_ode_model(code="
conc = A[2]/V
dAdt[1] = -KAA[1]
dAdt[2] = KA
A[1] +(Q/V3)*A[3] - (Q/V)*A[2] - (CL/V)*A[2]
dAdt[3] =(CL/V)*A[2] - (Q/V3)*A[3]
",declare_variables= c("F"),
dose = list(cmt=1,bioav="F"),
obs = list(cmt=2,scale="V"))

reg3 <- new_regimen(amt=3800,
n=5,
times=c(0,24,48,72,96),
type="oral")

par2 <-list(KA=1,CL=7.65,V=20,V3=25.7,Q=60.9,F=.9)

data3 <-sim(ode=mod2,
regimen=reg3,
parameters=par2,
n=100,
omega = c(0.1,0.05,0.1),
only_obs=TRUE
)

@roninsightrx
Copy link

sorry, for delay in response. Please note that development of PKPDsim is continued at https://github.com/InsightRX/PKPDsim, code here will not be updated. So please install PKPDsim either from CRAN or using devtools("InsightRX/PKPDsim").

Regarding the above code, please note that parameters cannot be used as vectors (i.e. KAA[1] is not allowed). If you just change that to KA the simulation worked fine for me.

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

No branches or pull requests

2 participants