-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Trying and failing miserably. :)
Using the premade model pk1_cmt_oral, I get this description:
ODE definition:
dAdt[1] = -KA*A[1];;
dAdt[2] = KA*A[1] - (CL/V)*A[2];;
;
Required parameters: KA, CL, V
Covariates:
Variables:
Number of compartments: 2
Observation compartment: 2
Observation scaling: V
Lag time:
The model has two compartments, with the amount of the chemical, 1 being the gut, 2 the central compartment i.e plasma?
And to get the concentration I need to decide on an observation compartment and scale it?
"Obs" here is compartment 2 (in mg) divided by the selected scaling variable V (L) giving me the concentration in mg / L?
(How does the model know scaling means division, not multiplication..?)
basemodel <- new_ode_model(
code = "
dAdt[1] = -KA * A[1]
dAdt[2] = +KA * A[1] -(CL/V) * A[2]
",obs = list(cmt = 2, scale = "V"))
gives me the same results as pk1_cmt_oral, and adding F1 should be
Bioavailability <- new_ode_model(
code = "
dAdt[1] = -KA * A[1]
dAdt[2] = +KA * A[1] -(CL/V) * A[2]
",obs = list(cmt = 2, scale = "V"),
dose = list(cmt = 1, bioav = "F1")
but this code gives me an error ( error: 'F1' was not declared in this scope)
and declaring it like this:
Bioavailability <- new_ode_model(
code = "
dAdt[1] = -KA * A[1]
dAdt[2] = +KA * A[1] -(CL/V) * A[2]
",obs = list(cmt = 2, scale = "V"),
dose = list(cmt = 1, bioav = "F1") declare_variables = c("F1")
)
gives me zero in all compartments
Hardcoding an F1 value doesn't change my results from not using any bioavailability data.
Bioavailability <- new_ode_model(
code = "
dAdt[1] = -KA * A[1]
dAdt[2] = +KA * A[1] -(CL/V) * A[2]
",obs = list(cmt = 2, scale = "V"),
dose = list(cmt = 1, bioav = 0.000000001)
)
has no effect?
Started looking for it in source code, but thought I'd better ask. :)