Yates_2023_tgi_bertalanffy <- function() {
  description <- paste(
    "Theoretical (illustrative; no data fitted). Von Bertalanffy",
    "tumor-growth law (dV/dt = k * V^(2/3) - kd * V) with an Emax drug",
    "effect on the proliferation term, driven by a one-compartment i.v.",
    "bolus PK model. Case study 3 of Yates and Mistry (2023): an explicit",
    "cell-death term lets tumor size plateau, and the resulting",
    "dose-response is log-linear in shape.",
    sep = " "
  )
  reference <- paste(
    "Yates JWT, Mistry HB. Skipping a pillar does not make for strong",
    "foundations: Pharmacokinetic-pharmacodynamic reasoning behind the",
    "shape of dose-response relationships in oncology.",
    "CPT Pharmacometrics Syst Pharmacol. 2023;12:1591-1601.",
    "doi:10.1002/psp4.13020.",
    sep = " "
  )
  vignette <- "Yates_2023_dose_response_shape"
  units <- list(
    time = "day",
    dosing = "arbitrary dose unit",
    concentration = "arbitrary dose unit/L"
  )

  compartmentData <- list(
    central   = list(analyte = "Drug (generic)", units = "arbitrary dose unit", specimen = "plasma", verified = FALSE),
    tumor_vol = list(analyte = "tumour_size", units = "L", specimen = "tumor", verified = FALSE)
  )

  population <- list(
    species = "not applicable (theoretical illustration; no subjects, no data fitted)",
    n_subjects = 0,
    n_studies = 0,
    disease_state = "solid tumor (generic; sub-exponential growth with an explicit cell-death term)",
    dose_range = paste(
      "illustrative single i.v. bolus doses. The published closed-form",
      "series solution converges only for D / (EC50 * Vd) < 1; the ODE",
      "encoded here has no such restriction"
    ),
    notes = paste(
      "Yates and Mistry (2023) is a theoretical / tutorial paper. No",
      "clinical or preclinical data were fitted, so there is no study",
      "population, no inter-individual variability and no residual-error",
      "model. Every parameter below is an illustrative constant chosen by",
      "the authors for the published figures, and is therefore encoded with",
      "fixed(). Full derivations are in Appendix S1 of the source."
    )
  )

  ini({
    # ---- One-compartment i.v. bolus PK ----------------------------------
    # C(t) = (D / Vd) * exp(-a * t) with a = CL / Vd, as for case study 1
    # (p. 1595). Encoded as the equivalent one-compartment ODE.
    lcl <- fixed(log(0.01)); label("Clearance CL (L/day)")           # Figure 7 caption (CL = 0.01)
    lvc <- fixed(log(1))   ; label("Volume of distribution Vd (L)")  # Figure 7 caption (Vd = 1)

    # ---- Von Bertalanffy tumor growth -------------------------------------
    # dV/dt = k * V^(2/3) - kd * V. The untreated tumor plateaus at
    # V = (k / kd)^3 (p. 1599; Appendix S1 "Analytical solution of
    # Bertanlanffy growth law").
    lrbase <- fixed(log(1))    ; label("Initial tumor volume V0 (L)")                              # Figure 7 caption (V0 = 1)
    lp     <- fixed(log(0.005)); label("Von Bertalanffy proliferation constant k (L^(1/3)/day)")   # Figure 7 caption (k = 0.005)
    lkdeath <- fixed(log(0.004)); label("Von Bertalanffy natural cell-death rate kd (1/day)")      # Figure 7 caption (kd = 0.004)

    # ---- Emax drug effect on the proliferation term ----------------------
    # dV/dt = (k - Emax * C / (EC50 + C)) * V^(2/3) - kd * V (p. 1599).
    lemax <- fixed(log(0.01)); label("Maximum proliferation-inhibition rate Emax (L^(1/3)/day)")  # Figure 7 caption (Emax = 0.01)
    lec50 <- fixed(log(1))   ; label("Concentration for 50% of maximal effect EC50 (dose unit/L)")  # Figure 7 caption (EC50 = 1)
  })

  model({
    cl     <- exp(lcl)
    vc     <- exp(lvc)
    rbase  <- exp(lrbase)
    p      <- exp(lp)
    kdeath <- exp(lkdeath)
    emax   <- exp(lemax)
    ec50   <- exp(lec50)

    kel <- cl / vc

    tumor_vol(0) <- rbase

    d/dt(central) <- -kel * central
    Cc <- central / vc

    drugEffect <- emax * Cc / (ec50 + Cc)

    # Paper Eq. dV/dT = (k - Emax * C(t) / (EC50 + C(t))) * V^(2/3) - kd * V,
    # p. 1599.
    d/dt(tumor_vol) <- (p - drugEffect) * tumor_vol^(2 / 3) - kdeath * tumor_vol
  })
}
