Assume that we have a plasma concentration-time dataset for a drug after intravenous injection of 10 mg. As shown below, this dataset follows a typically 2-compartment kinetic profile. The objective of this assignment is to fit a 2-compartment model to this dataset. Assume that from the literature we found that the appropriate values of the parameters are as below: V1 = 0.6 (L), K12 = 0.4 (/h), K21 = 0.4 (/h), and K10 = 0.4 (/h). Please write appropriate code of a 2-compartment model to simulate the time-course of this dataset. Please estimate these four parameter values using the curving fitting module in Berkeley Madonna. Please make sure that the left y axis represents C1 (i.e., concentration in the central compartment). Once done, save your figure as .jpg file and upload it. In the comments, enter the estimated optimal values of V1, K12, K21, and K10 that you think best describes this dataset. Requirement for the figure: (1) change the X axis label from “TIME” to “TIME (hour)”; (2) change the left Y axis label to “C1 (ug/mL)”.

1 Two-compartment PK model in Berkeley Madonna.

The Berkeley Madonna model code is as follows:

METHOD RK4

STARTTIME = 0
STOPTIME=24
DT = 0.02

IVDOSE = 10; mg
k12 = 0.4; /h
k21 = 0.4; /h
k10 = 0.4; /h
V1 = 0.6; L
init A1 = IVDOSE;


d / dt(A1) = - K12 * A1 + K21 * A2 - K10 * A1
d / dt(A2) = K12 * A1 - K21 * A2

init A1 = IVDOSE;
init A2 = 0 

C1 = A1 / V1

2 Two-compartment PK model in R.

library(deSolve) #load and attach add-on packages.
pkmodel <- function(time, state, parmeters) {
  with(as.list(c(state, parmeters)), {
    dA1 <- - K12 * A1 + K21 * A2 - K10 * A1
    dA2 <- K12 * A1 - K21 * A2
    list(c(dA1, dA2))
  })
}
state <- c(A1 = 10, A2 = 0) # initial dose is 10 mg in A1, and 0 mg in A2
parmeters <- c(K12 = 0.4,
               K21 = 0.4,
               K10 = 0.4) 
times <- seq(0, 24, 0.02) # start points to end points
# calcuate differential equation with parameters
# and initialized state values
out <- ode(y = state, 
           times = times, 
           func = pkmodel, 
           parms = parmeters) 
out <- as.data.frame(out)
V1 = 0.6
plot(out$time, 
     out$A1/V1, 
     main = "Concentration", 
     xlab = "Time (hour)", 
     ylab= "Concentration (ug/mL)", 
     type = 'l')