Wang_2024_evorpacept_qsp <- function() {
  description <- paste(
    "QSP. Quantitative systems pharmacology platform for immuno-oncology in",
    "advanced non-small cell lung cancer (NSCLC), extended with a",
    "pharmacokinetic and pharmacodynamic module for the anti-CD47 antibody",
    "evorpacept (ALX-148) in combination with the anti-PD-L1 antibody",
    "durvalumab. Four physiological compartments (central, peripheral, tumour,",
    "tumour-draining lymph node) plus an endothelial endosomal compartment for",
    "FcRn recycling, APC endosomal / surface compartments and three",
    "immunological-synapse compartments (T-cell:cancer-cell, T-cell:APC and",
    "macrophage:cancer-cell). The evorpacept module adds target-mediated drug",
    "disposition through CD47 on red blood cells with cross-arm (bivalent)",
    "binding, FcRn-mediated recycling, and CD47-SIRP-alpha plus PD-1/PD-L1",
    "control of macrophage phagocytosis. The surrounding platform covers naive",
    "and activated CD4+/CD8+ T cell trafficking and proliferation, logistic",
    "tumour growth, antigen release, uptake, endosomal processing and MHC-I",
    "presentation for a self-antigen and a neo-antigen, TCR kinetic",
    "proofreading, PD-1/PD-L1/PD-L2/CTLA-4/CD28/CD80/CD86 checkpoint binding,",
    "M1/M2 macrophage recruitment and polarisation, MDSC recruitment with",
    "arginase-I and nitric-oxide suppression, Th-to-Treg transdifferentiation,",
    "and TGF-beta / IFN-gamma / IL-2 / IL-10 / IL-12 / CCL2 dynamics. 153 ODE",
    "states, 6 algebraic species, 40 repeated-assignment rules and 276",
    "parameters, translated from the SimBiology export in Supplementary Tables",
    "S2-S6 and cross-checked against the authors' MATLAB source (Zenodo",
    "doi:10.5281/zenodo.11093921). Deterministic mechanism model: the authors",
    "generated virtual patients by sampling the parameter distributions in",
    "Supplementary Table S1 rather than by fitting IIV or residual error, so no",
    "etas and no error model are encoded.",
    sep = " "
  )
  reference <- paste(
    "Wang H, Arulraj T, Anbari S, Popel AS. Quantitative systems pharmacology",
    "modeling of macrophage-targeted therapy combined with PD-L1 inhibition in",
    "advanced NSCLC. Clin Transl Sci. 2024;17(6):e13811. doi:10.1111/cts.13811.",
    "Model source code: Zenodo doi:10.5281/zenodo.11093921 (QSPIO-TNBC v4.0).",
    sep = " "
  )
  vignette <- "Wang_2024_evorpacept_qsp"

  units <- list(
    time          = "day",
    dosing        = "nmol",
    concentration = "nmol/L"
  )

  covariateData <- list()

  population <- list(
    species       = "human (in silico virtual cohort)",
    n_subjects    = 629L,
    disease_state = "advanced / metastatic non-small cell lung cancer",
    dose_range    = paste(
      "Evorpacept (ALX-148) 1, 3, 10 and 30 mg/kg as a 1-h intravenous infusion,",
      "dosed weekly; durvalumab 10 mg/kg every 2 weeks. The combination",
      "scenario is 10 mg/kg evorpacept weekly with 10 mg/kg durvalumab.",
      sep = " "
    ),
    notes = paste(
      "Virtual cohort of 629 patients drawn from the authors' earlier anti-PD-L1",
      "NSCLC analysis, generated by randomly sampling the 30 parameter",
      "distributions in Supplementary Table S1 and selecting plausible patients",
      "on the model-predicted CD8/CD4, CD8/Treg and M1/M2 ratios against NSCLC",
      "immunogenomic data. The evorpacept PK parameters were fitted to the mean",
      "concentration and CD47 occupancy from the phase I trial of ALX-148;",
      "durvalumab PK was inherited from the authors' earlier work. Body weight",
      "is 80 kg in the dosing schedule; pre-treatment tumour diameter is 3.7 cm.",
      sep = " "
    )
  )

  ini({
    # ---- compartment capacities (Supplementary Table S6) ----
    vol_V_C <- fixed(5.0); label("Capacity of compartment V_C [L]")  # Table S6 (V_C = 5 liter)
    vol_V_P <- fixed(60.0); label("Capacity of compartment V_P [L]")  # Table S6 (V_P = 60 liter)
    vol_V_LN <- fixed(0.0013744467859455347); label("Capacity of compartment V_LN [L]")  # Table S6 (V_LN = 1374.4467859455344 millimeter^3)
    vol_V_e <- fixed(4.0000000000000004e-16); label("Capacity of compartment V_e [L]")  # Table S6 (V_e = 4.0000000000000004e-16 litre)
    vol_A_e <- fixed(1.5000000000000002e-09); label("Capacity of compartment A_e [dm^2]")  # Table S6 (A_e = 15 micrometer^2)
    vol_A_s <- fixed(9.000000000000001e-08); label("Capacity of compartment A_s [dm^2]")  # Table S6 (A_s = 900 micrometer^2)
    vol_syn_T_C1 <- fixed(3.780000000000001e-09); label("Capacity of compartment syn_T_C1 [dm^2]")  # Table S6 (syn_T_C1 = 37.8 micrometer^2)
    vol_syn_T_APC <- fixed(3.780000000000001e-09); label("Capacity of compartment syn_T_APC [dm^2]")  # Table S6 (syn_T_APC = 37.8 micrometer^2)
    vol_syn_M_C <- fixed(3.780000000000001e-09); label("Capacity of compartment syn_M_C [dm^2]")  # Table S6 (syn_M_C = 37.8 micrometer^2)
    vol_V_endo <- fixed(0.34); label("Capacity of compartment V_endo [L]")  # Table S6 (V_endo = 340 milliliter)

    # ---- model parameters (Supplementary Table S2) ----
    k_cell_clear <- fixed(0.1); label("Rate of dead cell clearance from tumour compartment (estimated) [1/day]")  # Table S2 (k_cell_clear = 0.1 1/day)
    cell <- fixed(1.6605390671738466e-15); label("unit parameter for calculation [cell]")  # Table S2 (cell = 1 cell)
    day <- fixed(1.0); label("unit parameter for calculation [day]")  # Table S2 (day = 1 day)
    vol_cell <- fixed(1521.9824287231045); label("Average volume of cancer cell Volume of a cancer cell calculated based on cancer ... [micrometer^3/cell]")  # Table S2 (vol_cell = 2527.3112824468485 micrometer^3/cell)
    vol_Tcell <- fixed(105.3969239624137); label("Average volume of T cells Volume of a T cell calculated based on the average T ce... [micrometer^3/cell]")  # Table S2 (vol_Tcell = 175.01570979953922 micrometer^3/cell)
    Ve_T <- fixed(0.75); label("Void fraction of the tumor (Zhang 2010, PMID: 20713014) [dimensionless]")  # Table S2 (Ve_T = 0.75 dimensionless)
    k_C1_growth <- fixed(0.007); label("Cancer cell growth rate (Usuda 1994, PMID: 7922975) [1/day]")  # Table S2 (k_C1_growth = 0.007 1/day)
    C_max <- fixed(0.000249080860076077); label("Cancer cell capacity estimated [cell]")  # Table S2 (C_max = 150000000000 cell)
    k_C1_death <- fixed(0.0001); label("Cancer cell death rate from innate immune cells (Palsson 2013, PMID: 24074340) [1/day]")  # Table S2 (k_C1_death = 0.0001 1/day)
    div_T0 <- fixed(1160000.0); label("T Cell Diversity (Robins 2009, PMID: 19706884) [dimensionless]")  # Table S2 (div_T0 = 1160000 dimensionless)
    n_T0_clones <- fixed(100.0); label("Number of T cell clones (Jafarnejad 2019 PMID: 31236847) [dimensionless]")  # Table S2 (n_T0_clones = 100 dimensionless)
    q_nT0_LN_in <- fixed(0.1); label("Rate of naive T cell transport into the LN  calculated based on the steady-state ... [1/day]")  # Table S2 (q_nT0_LN_in = 0.1 1/day)
    q_T0_LN_out <- fixed(24.0); label("Rate of activated T cell transport out of the LN (De Boer and Perelson 1995, PMID... [1/day]")  # Table S2 (q_T0_LN_out = 24 1/day)
    q_nT0_LN_out <- fixed(2.88); label("Rate of naive T cell transport out of the LN (Mandl 2012, PMID: 23071319) [1/day]")  # Table S2 (q_nT0_LN_out = 2.88 1/day)
    k_T0_act <- fixed(5.0); label("T0 activation rate (De Boer and Perelson 1995, PMID: 7475092; Robertson-Tessi 201... [1/day]")  # Table S2 (k_T0_act = 5 1/day)
    k_T0_pro <- fixed(1.0); label("T0 proliferation rate (Marchingo 2014, PMID: 25430770) [1/day]")  # Table S2 (k_T0_pro = 1 1/day)
    k_T0_death <- fixed(0.01); label("T0 death rate (De Boer and Perelson 1995, PMID: 7475092) [1/day]")  # Table S2 (k_T0_death = 0.01 1/day)
    q_T0_P_in <- fixed(3507.84); label("rate of T0 transport into the peripheral compartment calculated based on T cell t... [1/minute]")  # Table S2 (q_T0_P_in = 2.436 1/minute)
    q_T0_P_out <- fixed(24.0); label("rate of T0 transport out of the peripheral compartment (De Boer and Perelson 1995... [1/day]")  # Table S2 (q_T0_P_out = 24 1/day)
    q_T0_T_in <- fixed(208.79999999999995); label("rate of T0 transport into the tumor compartment calculated based on T cell transm... [1/(centimeter^3*minute)]")  # Table S2 (q_T0_T_in = 0.000145 1/(centimeter^3*minute))
    q_nT0_P_in <- fixed(254.016); label("rate of nT0 transport into the peripheral compartment calculated based on T cell ... [1/minute]")  # Table S2 (q_nT0_P_in = 0.1764 1/minute)
    q_nT0_P_out <- fixed(5.1); label("rate of nT0 transport out of the peripheral compartment  calculated based on stea... [1/day]")  # Table S2 (q_nT0_P_out = 5.1 1/day)
    Q_nT0_thym <- fixed(1.1623773470216926e-07); label("Thymic output of nT0 (Bains 2009, PMID: 19179300; Yeh 2017, PMID: 28912973) [cell/day]")  # Table S2 (Q_nT0_thym = 70000000 cell/day)
    k_nT0_pro <- fixed(5.313725014956309e-07); label("rate of nT0 proliferation (Braber 2012, PMID: 22365666) [cell/day]")  # Table S2 (k_nT0_pro = 320000000 cell/day)
    K_nT0_pro <- fixed(1.6605390671738465e-06); label("half-maximal peripheral proliferation of of nT0 (Braber 2012, PMID: 22365666) [cell]")  # Table S2 (K_nT0_pro = 1000000000 cell)
    k_nT0_death <- fixed(0.002); label("rate of nT0 death (Braber 2012, PMID: 22365666) [1/day]")  # Table S2 (k_nT0_death = 0.002 1/day)
    k_IL2_deg <- fixed(288.0); label("rate of IL2 degradation (Lotze 1985, PMID: 3871099) [1/minute]")  # Table S2 (k_IL2_deg = 0.2 1/minute)
    k_IL2_cons <- fixed(86718826944.0); label("rate of IL2 consumption by T cells (Lotze 1985, PMID: 3871099) [nanomole/cell/h]")  # Table S2 (k_IL2_cons = 6e-06 nanomole/cell/h)
    k_IL2_sec <- fixed(433594134720.0); label("rate of IL2 secretion from T cells (Han 2012, PMID: 22160692; Thurley 2015, PMID:... [nanomole/cell/h]")  # Table S2 (k_IL2_sec = 3e-05 nanomole/cell/h)
    IL2_50 <- fixed(0.32); label("T cell activation half-maximal IL2 concentration (Marchingo 2014, PMID: 25430770) [nanomolarity]")  # Table S2 (IL2_50 = 0.32 nanomolarity)
    IL2_50_Treg <- fixed(0.32); label("Treg activation half-maximal IL2 concentration (Wang and Smith 1987, PMID: 3116143) [nanomolarity]")  # Table S2 (IL2_50_Treg = 0.32 nanomolarity)
    N0 <- fixed(2.0); label("numer of activated T cell generation by TCR signaling only(Marchingo 2014, PMID: ... [dimensionless]")  # Table S2 (N0 = 2 dimensionless)
    N_costim <- fixed(3.0); label("numer of activated T cell generation by co-stimulatory signaling only (Marchingo ... [dimensionless]")  # Table S2 (N_costim = 3 dimensionless)
    N_IL2_CD8 <- fixed(11.0); label("maximum number of activated T cell generations due to IL2 (Marchingo 2014, PMID: ... [dimensionless]")  # Table S2 (N_IL2_CD8 = 11 dimensionless)
    N_IL2_CD4 <- fixed(8.0); label("maximum number of activated T cell generations due to IL2 (Marchingo 2014, PMID: ... [dimensionless]")  # Table S2 (N_IL2_CD4 = 8 dimensionless)
    k_Treg <- fixed(0.1); label("Rate of T cell death by Tregs (estimated) [1/day]")  # Table S2 (k_Treg = 0.1 1/day)
    div_T1 <- fixed(1110000.0); label("T Cell Diversity (Robins 2009, PMID: 19706884) [dimensionless]")  # Table S2 (div_T1 = 1110000 dimensionless)
    n_T1_clones <- fixed(92.0); label("Number of T cell clones (Jafarnejad 2019 PMID: 31236847, Forde 2018, PMID: 30157404) [dimensionless]")  # Table S2 (n_T1_clones = 92 dimensionless)
    q_nT1_LN_in <- fixed(0.076); label("Rate of naive T cell transport into the LN  calculated based on the steady-state ... [1/day]")  # Table S2 (q_nT1_LN_in = 0.076 1/day)
    q_T1_LN_out <- fixed(24.0); label("Rate of activated T cell transport out of the LN (De Boer and Perelson 1995, PMID... [1/day]")  # Table S2 (q_T1_LN_out = 24 1/day)
    q_nT1_LN_out <- fixed(1.8); label("Rate of naive T cell transport out of the LN (Mandl 2012, PMID: 23071319) [1/day]")  # Table S2 (q_nT1_LN_out = 1.8 1/day)
    k_T1_act <- fixed(23.0); label("T1 activation rate (De Boer and Perelson 1995, PMID: 7475092; Robertson-Tessi 201... [1/day]")  # Table S2 (k_T1_act = 23 1/day)
    k_T1_pro <- fixed(1.0); label("T1 proliferation rate (Marchingo 2014, PMID: 25430770) [1/day]")  # Table S2 (k_T1_pro = 1 1/day)
    k_T1_death <- fixed(0.01); label("T1 death rate (De Boer and Perelson 1995, PMID: 7475092) [1/day]")  # Table S2 (k_T1_death = 0.01 1/day)
    q_T1_P_in <- fixed(3507.84); label("rate of T1 transport into the peripheral compartment calculated based on T cell t... [1/minute]")  # Table S2 (q_T1_P_in = 2.436 1/minute)
    q_T1_P_out <- fixed(24.0); label("rate of T1 transport out of the peripheral compartment (De Boer and Perelson 1995... [1/day]")  # Table S2 (q_T1_P_out = 24 1/day)
    q_T1_T_in <- fixed(208.79999999999995); label("rate of T1 transport into the tumor compartment calculated based on T cell transm... [1/(centimeter^3*minute)]")  # Table S2 (q_T1_T_in = 0.000145 1/(centimeter^3*minute))
    q_nT1_P_in <- fixed(254.016); label("rate of nT1 transport into the peripheral compartment calculated based on T cell ... [1/minute]")  # Table S2 (q_nT1_P_in = 0.1764 1/minute)
    q_nT1_P_out <- fixed(5.1); label("rate of nT1 transport out of the peripheral compartment  calculated based on stea... [1/day]")  # Table S2 (q_nT1_P_out = 5.1 1/day)
    Q_nT1_thym <- fixed(5.811886735108463e-08); label("Thymic output of nT1 (Bains 2009, PMID: 19179300; Ye 2002, PMID: 11994448) [cell/day]")  # Table S2 (Q_nT1_thym = 35000000 cell/day)
    k_nT1_pro <- fixed(5.313725014956309e-07); label("rate of nT1 proliferation (Braber 2012, PMID: 22365666) [cell/day]")  # Table S2 (k_nT1_pro = 320000000 cell/day)
    K_nT1_pro <- fixed(1.6605390671738465e-06); label("half-maximal peripheral proliferation of of nT1 (Braber 2012, PMID: 22365666) [cell]")  # Table S2 (K_nT1_pro = 1000000000 cell)
    k_nT1_death <- fixed(0.002); label("rate of nT1 death (Braber 2012, PMID: 22365666) [1/day]")  # Table S2 (k_nT1_death = 0.002 1/day)
    k_T1 <- fixed(0.1); label("Rate of T cell exhaustion by cancer cells (estimated) [1/day]")  # Table S2 (k_T1 = 0.1 1/day)
    k_C_T1 <- fixed(0.9); label("Rate of cancer cell death by T cells (Robertson-Tessi 2012, PMID: 22051568) [1/day]")  # Table S2 (k_C_T1 = 0.9 1/day)
    k_IFNg_Tsec <- fixed(240.8856304); label("rate of IFNg secretion from CD8 T cells (Autenshlyus 2021, PMID: 34059727; Borj 2... [nanomole/cell/day]")  # Table S2 (k_IFNg_Tsec = 4e-13 nanomole/cell/day)
    K_T_C <- fixed(1.2); label("Dependence of Teff killing rate on Teff/C ratio (Robertson-Tessi 2012, PMID: 2205... [dimensionless]")  # Table S2 (K_T_C = 1.2 dimensionless)
    K_T_Treg <- fixed(11.0); label("Dependence of Teff killing rate on Teff/Treg ratio (Robertson-Tessi 2012, PMID: 2... [dimensionless]")  # Table S2 (K_T_Treg = 11 dimensionless)
    k_APC_mat <- fixed(1.5); label("Maximum rate of APC maturation (Chen 2014, PMID: 25184733) [1/day]")  # Table S2 (k_APC_mat = 1.5 1/day)
    k_APC_mig <- fixed(4.0); label("Rate of APC migration (Russo Halin 2016, PMID: 26876174) [1/day]")  # Table S2 (k_APC_mig = 4 1/day)
    k_APC_death <- fixed(0.01); label("Rate of APC death (Marino and Kirschner 2004, PMID: 15038983) [1/day]")  # Table S2 (k_APC_death = 0.01 1/day)
    k_mAPC_death <- fixed(0.02); label("Rate of mAPC death(Marino and Kirschner 2004, PMID: 15038983) [1/day]")  # Table S2 (k_mAPC_death = 0.02 1/day)
    APC0_T <- fixed(6.642156268695386e-07); label("Steady state density of CD103+ APCs in the tumor, calculated to fit basal APC equ... [cell/milliliter]")  # Table S2 (APC0_T = 400000 cell/milliliter)
    APC0_LN <- fixed(1.9926468806086156e-06); label("Steady state density of all APC subtypes in the LN (Catron 2004, PMID: 15357945)-... [cell/milliliter]")  # Table S2 (APC0_LN = 1200000 cell/milliliter)
    n_sites_APC <- fixed(10.0); label("Maxium number of T Cells an APC can interact with (De Boer and Perelson 1995, PMI... [dimensionless]")  # Table S2 (n_sites_APC = 10 dimensionless)
    kin <- fixed(14.4); label("Rate of MHC internalization (Chen 2014, PMID: 25184733) [1/day]")  # Table S2 (kin = 14.4 1/day)
    kout <- fixed(28.8); label("Rate of MHC externalization (Chen 2014, PMID: 25184733) [1/day]")  # Table S2 (kout = 28.8 1/day)
    k_P0_up <- fixed(8671882694400000.0); label("Rate of antigen uptake by APCs (Chen 2014, PMID: 25184733) [1/day/cell]")  # Table S2 (k_P0_up = 14.4 1/day/cell)
    k_xP0_deg <- fixed(2.0); label("Rate of extracellular antigen degradation (Palsson 2013, PMID: 24074340) [1/day]")  # Table S2 (k_xP0_deg = 2 1/day)
    k_P0_deg <- fixed(17.28); label("Rate of endosomal antigen degradation (Chen 2014, PMID: 25184733) [1/day]")  # Table S2 (k_P0_deg = 17.28 1/day)
    k_p0_deg <- fixed(144.0); label("Rate of endosomal epitope degradation (Chen 2014, PMID: 25184733) [1/day]")  # Table S2 (k_p0_deg = 144 1/day)
    k_P0_on <- fixed(0.000144); label("Rate of antigen-MHC binding (Agrawal and Linderman 1996, PMID: 8944895) [1/day/molarity]")  # Table S2 (k_P0_on = 144000 1/day/molarity)
    k_P0_d1 <- fixed(100.0); label("Antigen-MHC kd (Stone 2015, PMID: 25618219) [molarity]")  # Table S2 (k_P0_d1 = 1e-07 molarity)
    p0_50 <- fixed(4.392960495168906e-10); label("calculated based on the number of molecules for half-maximal T cell activation (K... [molecule/micrometer^2]")  # Table S2 (p0_50 = 2.6455026455026456e-05 molecule/micrometer^2)
    P0_C1 <- fixed(325195601040.00006); label("Concentration of P0 in C1 (estimated by 2.7e6 proteins/um^3 in a cancer cell (Mil... [mole/cell]")  # Table S2 (P0_C1 = 5.4e-13 mole/cell)
    A_syn <- fixed(3.780000000000001e-09); label("Surface area of the synapse (Jansson 2005, PMID: 16034096) [micrometer^2]")  # Table S2 (A_syn = 37.8 micrometer^2)
    A_Tcell <- fixed(1.513104119304374e-08); label("Surface area of the T cell calculated based on the average T cell diameter (Chapm... [micrometer^2]")  # Table S2 (A_Tcell = 151.31041193043737 micrometer^2)
    A_cell <- fixed(8.97270277791781e-08); label("Surface area of the Cancer cell calculated based on the average cancer cell diame... [micrometer^2]")  # Table S2 (A_cell = 897.2702777917808 micrometer^2)
    A_APC <- fixed(9.000000000000001e-08); label("Surface area of the APC (Agrawal and Linderman 1996, PMID: 8944895) [micrometer^2]")  # Table S2 (A_APC = 900 micrometer^2)
    d_syn <- fixed(3.0000000000000004e-08); label("The synapse gap distance (kd2D = kd3D*d_syn) (Jansson 2005, PMID: 16034096) [nanometer]")  # Table S2 (d_syn = 3 nanometer)
    k_M1p0_TCR_on <- fixed(5203129616.640002); label("Rate of TCR binding to MHC-peptide complex (Lever 2014, PMID: 25145757) [1/(second*molecule/micrometer^2)]")  # Table S2 (k_M1p0_TCR_on = 1 1/(second*molecule/micrometer^2))
    k_M1p0_TCR_off <- fixed(86400.0); label("Rate of TCR unbinding from MHC-peptide complex (Lever 2014, PMID: 25145757) [1/second]")  # Table S2 (k_M1p0_TCR_off = 1 1/second)
    k_M1p0_TCR_p <- fixed(86400.0); label("Rate of MHC-peptide-TCR complex modification (Lever 2014, PMID: 25145757) [1/second]")  # Table S2 (k_M1p0_TCR_p = 1 1/second)
    phi_M1p0_TCR <- fixed(7776.0); label("Rate of MHC-peptide-TCR complex with maximal modification that leads to non-signa... [1/second]")  # Table S2 (phi_M1p0_TCR = 0.09 1/second)
    N_M1p0_TCR <- fixed(10.0); label("Number of modifcation steps for MHC-peptide-TCR complex (Lever 2014, PMID: 25145757) [dimensionless]")  # Table S2 (N_M1p0_TCR = 10 dimensionless)
    TCR_p0_tot <- fixed(0.0017238567613680398); label("Total number of TCR molecules per naive T cell calculated based on the number of ... [molecule/micrometer^2]")  # Table S2 (TCR_p0_tot = 103.81308067036068 molecule/micrometer^2)
    k_P1_up <- fixed(8671882694400000.0); label("Rate of antigen uptake by APCs (Chen 2014, PMID: 25184733) [1/day/cell]")  # Table S2 (k_P1_up = 14.4 1/day/cell)
    k_xP1_deg <- fixed(2.0); label("Rate of extracellular antigen degradation (Palsson 2013, PMID: 24074340) [1/day]")  # Table S2 (k_xP1_deg = 2 1/day)
    k_P1_deg <- fixed(17.28); label("Rate of endosomal antigen degradation (Chen 2014, PMID: 25184733) [1/day]")  # Table S2 (k_P1_deg = 17.28 1/day)
    k_p1_deg <- fixed(144.0); label("Rate of endosomal epitope degradation (Chen 2014, PMID: 25184733) [1/day]")  # Table S2 (k_p1_deg = 144 1/day)
    k_P1_on <- fixed(0.000144); label("Rate of antigen-MHC binding (Agrawal and Linderman 1996, PMID: 8944895) [1/day/molarity]")  # Table S2 (k_P1_on = 144000 1/day/molarity)
    k_P1_d1 <- fixed(10.0); label("Antigen-MHC kd (Stone 2015, PMID: 25618219) [molarity]")  # Table S2 (k_P1_d1 = 1e-08 molarity)
    p1_50 <- fixed(4.392960495168906e-10); label("calculated based on the number of molecules for half-maximal T cell activation (K... [molecule/micrometer^2]")  # Table S2 (p1_50 = 2.6455026455026456e-05 molecule/micrometer^2)
    P1_C1 <- fixed(325195601040.00006); label("Concentration of P1 in C1 (estimated by 2.7e6 proteins/um^3 in a cancer cell (Mil... [mole/cell]")  # Table S2 (P1_C1 = 5.4e-13 mole/cell)
    k_M1p1_TCR_on <- fixed(5203129616.640002); label("Rate of TCR binding to MHC-peptide complex (Lever 2014, PMID: 25145757) [1/(second*molecule/micrometer^2)]")  # Table S2 (k_M1p1_TCR_on = 1 1/(second*molecule/micrometer^2))
    k_M1p1_TCR_off <- fixed(86400.0); label("Rate of TCR unbinding from MHC-peptide complex (Lever 2014, PMID: 25145757) [1/second]")  # Table S2 (k_M1p1_TCR_off = 1 1/second)
    k_M1p1_TCR_p <- fixed(86400.0); label("Rate of MHC-peptide-TCR complex modification (Lever 2014, PMID: 25145757) [1/second]")  # Table S2 (k_M1p1_TCR_p = 1 1/second)
    phi_M1p1_TCR <- fixed(7776.0); label("Rate of MHC-peptide-TCR complex with maximal modification that leads to non-signa... [1/second]")  # Table S2 (phi_M1p1_TCR = 0.09 1/second)
    N_M1p1_TCR <- fixed(10.0); label("Number of modifcation steps for MHC-peptide-TCR complex (Lever 2014, PMID: 25145757) [dimensionless]")  # Table S2 (N_M1p1_TCR = 10 dimensionless)
    TCR_p1_tot <- fixed(0.0017238567613680398); label("Total number of TCR molecules per naive T cell calculated based on the number of ... [molecule/micrometer^2]")  # Table S2 (TCR_p1_tot = 103.81308067036068 molecule/micrometer^2)
    q_P_aPD1 <- fixed(0.791424); label("Capillary filtration rate of aPD1 between central and peripheral compartment(Aham... [liter/second]")  # Table S2 (q_P_aPD1 = 9.16e-06 liter/second)
    q_T_aPD1 <- fixed(0.00736128); label("Capillary filtration rate of aPD1 between central and tumor compartment(Wang 2019... [milliliter/second]")  # Table S2 (q_T_aPD1 = 8.52e-05 milliliter/second)
    q_LN_aPD1 <- fixed(0.0002808); label("Capillary filtration rate of aPD1 between central and TDLN compartment(Meijer 201... [milliliter/second]")  # Table S2 (q_LN_aPD1 = 3.25e-06 milliliter/second)
    q_LD_aPD1 <- fixed(2.16); label("Rate of lymphatic drainage of aPD1 from TDLN to central compartment(Zhu 1996, PMI... [1/minute]")  # Table S2 (q_LD_aPD1 = 0.0015 1/minute)
    k_cl_aPD1 <- fixed(0.315); label("Clearance rate of aPD1 from central compartment(Ahamadi 2016, PMID: 27863186) [liter/day]")  # Table S2 (k_cl_aPD1 = 0.315 liter/day)
    gamma_C_aPD1 <- fixed(0.698); label("Volume fraction of interstitial space available to aPD1 in central compartment(Ah... [dimensionless]")  # Table S2 (gamma_C_aPD1 = 0.698 dimensionless)
    gamma_P_aPD1 <- fixed(0.0789); label("Volume fraction of interstitial space available to aPD1 in peripheral compartment... [dimensionless]")  # Table S2 (gamma_P_aPD1 = 0.0789 dimensionless)
    gamma_T_aPD1 <- fixed(0.522); label("Volume fraction of interstitial space available to aPD1 in tumor compartment(Coug... [dimensionless]")  # Table S2 (gamma_T_aPD1 = 0.522 dimensionless)
    gamma_LN_aPD1 <- fixed(0.2); label("Volume fraction of interstitial space available to aPD1 in TDLN compartment(Wang ... [dimensionless]")  # Table S2 (gamma_LN_aPD1 = 0.2 dimensionless)
    q_P_aPDL1 <- fixed(0.48038400000000003); label("Capillary filtration rate of aPDL1 between central and peripheral compartment(Bav... [liter/second]")  # Table S2 (q_P_aPDL1 = 5.56e-06 liter/second)
    q_T_aPDL1 <- fixed(0.00736128); label("Capillary filtration rate of aPDL1 between central and tumor compartment(Wang 201... [milliliter/second]")  # Table S2 (q_T_aPDL1 = 8.52e-05 milliliter/second)
    q_LN_aPDL1 <- fixed(0.0002808); label("Capillary filtration rate of aPDL1 between central and TDLN compartment(Meijer 20... [milliliter/second]")  # Table S2 (q_LN_aPDL1 = 3.25e-06 milliliter/second)
    q_LD_aPDL1 <- fixed(2.16); label("Rate of lymphatic drainage of aPDL1 from TDLN to central compartment(Zhu 1996, PM... [1/minute]")  # Table S2 (q_LD_aPDL1 = 0.0015 1/minute)
    k_cl_aPDL1 <- fixed(0.33); label("Clearance rate of aPDL1 from central compartment(Baverel 2018, PMID: 29243223) [liter/day]")  # Table S2 (k_cl_aPDL1 = 0.33 liter/day)
    gamma_C_aPDL1 <- fixed(0.7); label("Volume fraction of interstitial space available to aPDL1 in central compartment(B... [dimensionless]")  # Table S2 (gamma_C_aPDL1 = 0.7 dimensionless)
    gamma_P_aPDL1 <- fixed(0.057); label("Volume fraction of interstitial space available to aPDL1 in peripheral compartmen... [dimensionless]")  # Table S2 (gamma_P_aPDL1 = 0.057 dimensionless)
    gamma_T_aPDL1 <- fixed(0.522); label("Volume fraction of interstitial space available to aPDL1 in tumor compartment(Cou... [dimensionless]")  # Table S2 (gamma_T_aPDL1 = 0.522 dimensionless)
    gamma_LN_aPDL1 <- fixed(0.2); label("Volume fraction of interstitial space available to aPDL1 in TDLN compartment(Wang... [dimensionless]")  # Table S2 (gamma_LN_aPDL1 = 0.2 dimensionless)
    k_cln_aPDL1 <- fixed(5.6); label("Non-linear clearance rate of aPDL1 from central compartment(fitted) [nanomole/day]")  # Table S2 (k_cln_aPDL1 = 5.6 nanomole/day)
    Kc_aPDL1 <- fixed(1.69); label("Half-maximal concentration of aPDL1 in central compartment for nonlinear clearanc... [nanomole/liter]")  # Table S2 (Kc_aPDL1 = 1.69 nanomole/liter)
    q_P_aCTLA4 <- fixed(0.4605984); label("Capillary filtration rate of aCTLA4 between central and peripheral compartment(Wa... [liter/second]")  # Table S2 (q_P_aCTLA4 = 5.331e-06 liter/second)
    q_T_aCTLA4 <- fixed(0.00736128); label("Capillary filtration rate of aCTLA4 between central and tumor compartment(Wang 20... [milliliter/second]")  # Table S2 (q_T_aCTLA4 = 8.52e-05 milliliter/second)
    q_LN_aCTLA4 <- fixed(0.0002808); label("Capillary filtration rate of aCTLA4 between central and TDLN compartment(Meijer 2... [milliliter/second]")  # Table S2 (q_LN_aCTLA4 = 3.25e-06 milliliter/second)
    q_LD_aCTLA4 <- fixed(2.16); label("Rate of lymphatic drainage of aCTLA4 from TDLN to central compartment(Zhu 1996, P... [1/minute]")  # Table S2 (q_LD_aCTLA4 = 0.0015 1/minute)
    k_cl_aCTLA4 <- fixed(0.3276); label("Clearance rate of aCTLA4 from central compartment(Wang 2014, PMID: 24737343) [liter/day]")  # Table S2 (k_cl_aCTLA4 = 0.3276 liter/day)
    gamma_C_aCTLA4 <- fixed(0.794); label("Volume fraction of interstitial space available to aCTLA4 in central compartment(... [dimensionless]")  # Table S2 (gamma_C_aCTLA4 = 0.794 dimensionless)
    gamma_P_aCTLA4 <- fixed(0.062); label("Volume fraction of interstitial space available to aCTLA4 in peripheral compartme... [dimensionless]")  # Table S2 (gamma_P_aCTLA4 = 0.062 dimensionless)
    gamma_T_aCTLA4 <- fixed(0.522); label("Volume fraction of interstitial space available to aCTLA4 in tumor compartment(Co... [dimensionless]")  # Table S2 (gamma_T_aCTLA4 = 0.522 dimensionless)
    gamma_LN_aCTLA4 <- fixed(0.2); label("Volume fraction of interstitial space available to aCTLA4 in TDLN compartment(Wan... [dimensionless]")  # Table S2 (gamma_LN_aCTLA4 = 0.2 dimensionless)
    kon_PD1_PDL1 <- fixed(518400000.0); label("kon of PD1-PDL1 binding kon for PD1-PDL1 (Cheng 2013, PMID: 23417675) [1/(micromolarity*nanometer*second)]")  # Table S2 (kon_PD1_PDL1 = 0.06 1/(micromolarity*nanometer*second))
    k_out_PDL1 <- fixed(8.302695335869233e-11); label("Expression rate of PDL1 on tumor cells (Mimura 2018, PMID: 29034543) [molecule/day]")  # Table S2 (k_out_PDL1 = 50000 molecule/day)
    k_in_PDL1 <- fixed(1.0); label("Degradation rate of PDL1 on tumor cells (Hsu 2018, PMID: 30442814) [1/day]")  # Table S2 (k_in_PDL1 = 1 1/day)
    r_PDL1_IFNg <- fixed(6.0); label("Number of folds increase of PDL1 expression by IFNg (Shin 2017, PMID: 27903500) [dimensionless]")  # Table S2 (r_PDL1_IFNg = 6 dimensionless)
    kon_PD1_PDL2 <- fixed(691200000.0); label("kon of PD1-PDL2 binding (Cheng 2013, PMID: 23417675) [1/(micromolarity*nanometer*second)]")  # Table S2 (kon_PD1_PDL2 = 0.08 1/(micromolarity*nanometer*second))
    kon_PD1_aPD1 <- fixed(57.888000000000005); label("kon of PD1-aPD1 binding (Wang 2014, PMID: 24872026; Brown 2020, PMID: 32134960) [1/(molarity*second)]")  # Table S2 (kon_PD1_aPD1 = 670000 1/(molarity*second))
    kon_PDL1_aPDL1 <- fixed(37.15200000000001); label("kon of PDL1-aPDL1 binding (Wang 2014, PMID: 24872026) [1/(molarity*second)]")  # Table S2 (kon_PDL1_aPDL1 = 430000 1/(molarity*second))
    kon_CD28_CD80 <- fixed(1152000000.0); label("kon of CD28-CD80 binding (van der Merwe 1997, PMID: 9053440) [1/(micromolarity*nanometer*second)]")  # Table S2 (kon_CD28_CD80 = 0.13333333333333333 1/(micromolarity*nanometer*second))
    kon_CD28_CD86 <- fixed(4032000000.0); label("kon of CD28-CD86 binding (Collins 2002, PMID: 12196291) [1/(micromolarity*nanometer*second)]")  # Table S2 (kon_CD28_CD86 = 0.4666666666666667 1/(micromolarity*nanometer*second))
    kon_CTLA4_CD80 <- fixed(2880000000.0); label("kon of CTLA4-CD80 binding (van der Merwe 1997, PMID: 9053440) [1/(micromolarity*nanometer*second)]")  # Table S2 (kon_CTLA4_CD80 = 0.3333333333333333 1/(micromolarity*nanometer*second))
    kon_CTLA4_CD86 <- fixed(5760000000.0); label("kon of CTLA4-CD86 binding (Jansson 2005, PMID: 16034096; Collins 2002, PMID: 1219... [1/(micromolarity*nanometer*second)]")  # Table S2 (kon_CTLA4_CD86 = 0.6666666666666666 1/(micromolarity*nanometer*second))
    kon_CD80_PDL1 <- fixed(921600000.0); label("kon of CD80-PDL1 binding (Cheng 2014, PMID: 23417675) [1/(micromolarity*nanometer*second)]")  # Table S2 (kon_CD80_PDL1 = 0.10666666666666667 1/(micromolarity*nanometer*second))
    kon_CTLA4_aCTLA4 <- fixed(33.09120000000001); label("kon of CTLA4-aCTLA4 binding (Wang 2014, PMID: 24872026) [1/(molarity*second)]")  # Table S2 (kon_CTLA4_aCTLA4 = 383000 1/(molarity*second))
    kon_CD80_CD80 <- fixed(1699200.0000000002); label("kon of CD80 self-association (Ikemizu 2000, PMID: 10661405) [1/(micromolarity*nanometer*second)]")  # Table S2 (kon_CD80_CD80 = 0.00019666666666666669 1/(micromolarity*nanometer*second))
    koff_PD1_PDL1 <- fixed(127526.4); label("koff of PD1-PDL1 binding calculated based on the measured kd and kon (Cheng 2013,... [1/second]")  # Table S2 (koff_PD1_PDL1 = 1.476 1/second)
    koff_PD1_PDL2 <- fixed(47692.8); label("koff of PD1-PDL2 binding calculated based on the measured kd and kon (Cheng 2013,... [1/second]")  # Table S2 (koff_PD1_PDL2 = 0.552 1/second)
    koff_PD1_aPD1 <- fixed(231.55200000000002); label("koff of PD1-aPD1 binding calculated based on the measured kd and kon (Wang 2014, ... [1/second]")  # Table S2 (koff_PD1_aPD1 = 0.00268 1/second)
    koff_PDL1_aPDL1 <- fixed(14.860800000000001); label("koff of PDL1-aPDL1 binding calculated based on the measured kd and kon (Wang 2014... [1/second]")  # Table S2 (koff_PDL1_aPDL1 = 0.000172 1/second)
    koff_CD28_CD80 <- fixed(138240.0); label("koff of CD28-CD80 binding calculated based on the measured kd and kon (van der Me... [1/second]")  # Table S2 (koff_CD28_CD80 = 1.6 1/second)
    koff_CD28_CD86 <- fixed(2419200.0); label("koff of CD28-CD86 binding calculated based on the measured kd and kon (Collins 20... [1/second]")  # Table S2 (koff_CD28_CD86 = 28 1/second)
    koff_CTLA4_CD80 <- fixed(36288.0); label("koff of CTLA4-CD80 binding calculated based on the measured kd and kon (van der M... [1/second]")  # Table S2 (koff_CTLA4_CD80 = 0.42 1/second)
    koff_CTLA4_CD86 <- fixed(449280.0); label("koff of CTLA4-CD86 binding calculated based on the measured kd and kon (Jansson 2... [1/second]")  # Table S2 (koff_CTLA4_CD86 = 5.2 1/second)
    koff_CD80_PDL1 <- fixed(519782.4); label("koff of CD80-PDL1 binding calculated based on the measured kd and kon (Cheng 2014... [1/second]")  # Table S2 (koff_CD80_PDL1 = 6.016 1/second)
    koff_CTLA4_aCTLA4 <- fixed(602.25984); label("koff of CTLA4-aCTLA4 binding calculated based on the measured kd and kon (Wang 20... [1/second]")  # Table S2 (koff_CTLA4_aCTLA4 = 0.0069706 1/second)
    koff_CD80_CD80 <- fixed(866.5920000000001); label("koff of CD80 self-association calculated based on the measured kd and kon (Ikemiz... [1/second]")  # Table S2 (koff_CD80_CD80 = 0.01003 1/second)
    Chi_PD1_aPD1 <- fixed(3333333309.5322742); label("Antibody cross-arm binding efficiency that also includes the conversion of kon fr... [1/nanometer]")  # Table S2 (Chi_PD1_aPD1 = 33.33333309532274 1/nanometer)
    Chi_PDL1_aPDL1 <- fixed(3333333309.5322742); label("Antibody cross-arm binding efficiency that also includes the conversion of kon fr... [1/nanometer]")  # Table S2 (Chi_PDL1_aPDL1 = 33.33333309532274 1/nanometer)
    Chi_CTLA4_aCTLA4 <- fixed(3333333309.5322742); label("Antibody cross-arm binding efficiency that also includes the conversion of kon fr... [1/nanometer]")  # Table S2 (Chi_CTLA4_aCTLA4 = 33.33333309532274 1/nanometer)
    PD1_50 <- fixed(9.963234403043078e-05); label("PD1/PDL1 concentration for half-maximal T cell inactivation (Jafarnejad 2019, PMI... [molecule/micrometer^2]")  # Table S2 (PD1_50 = 6 molecule/micrometer^2)
    n_PD1 <- fixed(2.0); label("Hill coefficient for PD1/PDL1 half-maximal T cell inactivation (estimated) [dimensionless]")  # Table S2 (n_PD1 = 2 dimensionless)
    CD28_CD8X_50 <- fixed(0.0033210781343476926); label("CD28-CD80/CD28-CD86 concentration for half-maximal T cell co-estimulation estimat... [molecule/micrometer^2]")  # Table S2 (CD28_CD8X_50 = 200 molecule/micrometer^2)
    n_CD28_CD8X <- fixed(2.0); label("Hill coefficient for CD28-CD80/CD28-CD86 half-maximal T cell co-estimulation (est... [dimensionless]")  # Table S2 (n_CD28_CD8X = 2 dimensionless)
    T_PD1_total <- fixed(4.426997153085475e-11); label("concentration of PD1 on T cells (Cheng 2014, PMID: 23417675; Mkrtichyan 2012, PMI... [molecule]")  # Table S2 (T_PD1_total = 26660 molecule)
    T_CD28_total <- fixed(3.0553918835998774e-10); label("concentration of CD28 on T cells (Jansson 2005, PMID: 16034096) [molecule]")  # Table S2 (T_CD28_total = 184000 molecule)
    T_CTLA4_syn <- fixed(1.3284312537390772e-11); label("concentration of CTLA4 on T cells (Jansson 2005, PMID: 16034096) [molecule]")  # Table S2 (T_CTLA4_syn = 8000 molecule)
    T_PDL1_total <- fixed(1.3280991459256424e-10); label("concentration of PDL1 on T cells (Cheng 2014, PMID: 23417675; Mkrtichyan 2012, PM... [molecule]")  # Table S2 (T_PDL1_total = 79980 molecule)
    C1_PDL1_base <- fixed(3.7196075104694167e-10); label("baseline number of PDL1 molecules per C1 cell (Cheng 2014, PMID: 23417675; Mkrtic... [molecule]")  # Table S2 (C1_PDL1_base = 224000.00000000003 molecule)
    r_PDL2C1 <- fixed(0.07); label("PDL2/PDL1 molecule ratio on C1 cell (Cheng 2014, PMID: 23417675) [dimensionless]")  # Table S2 (r_PDL2C1 = 0.07 dimensionless)
    C1_CD80_total <- fixed(1.3284312537390773e-10); label("number of CD80 molecules per C1 cell (Jansson 2005, PMID: 16034096) [molecule]")  # Table S2 (C1_CD80_total = 80000 molecule)
    C1_CD86_total <- fixed(1.4280635977695081e-09); label("number of CD86 molecules per C1 cell (Jansson 2005, PMID: 16034096) [molecule]")  # Table S2 (C1_CD86_total = 860000 molecule)
    APC_PDL1_base <- fixed(3.7196075104694167e-10); label("baseline number of PDL1 molecules per APC cell (Cheng 2014, PMID: 23417675; Mkrti... [molecule]")  # Table S2 (APC_PDL1_base = 224000.00000000003 molecule)
    r_PDL2APC <- fixed(0.07); label("PDL2/PDL1 molecule ratio on APC cell (Cheng 2014, PMID: 23417675) [dimensionless]")  # Table S2 (r_PDL2APC = 0.07 dimensionless)
    APC_CD80_total <- fixed(1.3284312537390773e-10); label("number of CD80 molecules per APC cell (Jansson 2005, PMID: 16034096) [molecule]")  # Table S2 (APC_CD80_total = 80000 molecule)
    APC_CD86_total <- fixed(1.4280635977695081e-09); label("number of CD86 molecules per APC cell (Jansson 2005, PMID: 16034096) [molecule]")  # Table S2 (APC_CD86_total = 860000 molecule)
    k_Th_act <- fixed(10.0); label("Rate of T helper cell activation (Robertson-Tessi 2012, PMID: 22051568) [1/day]")  # Table S2 (k_Th_act = 10 1/day)
    k_Th_Treg <- fixed(0.022); label("Th differentiation rate to Treg (Robertson-Tessi 2012, PMID: 22051568) [1/day]")  # Table S2 (k_Th_Treg = 0.022 1/day)
    k_TGFb_Tsec <- fixed(72265.68912); label("TGF secretion rate by Treg (Liyanage 2002, PMID: 12193750) [nanomole/cell/day]")  # Table S2 (k_TGFb_Tsec = 1.2e-10 nanomole/cell/day)
    k_TGFb_deg <- fixed(14.3); label("TGF degradtion rate (Robertson-Tessi 2012, PMID: 22051568) [1/day]")  # Table S2 (k_TGFb_deg = 14.3 1/day)
    TGFb_50 <- fixed(0.07); label("Half-Maximal TGFb level for Th-to-Treg differentiation / chemoresistance developm... [nanomolarity]")  # Table S2 (TGFb_50 = 0.07 nanomolarity)
    TGFb_50_Teff <- fixed(0.14); label("Half-Maximal TGFb level for CD8 T cell inhibition (Robertson-Tessi 2012, PMID: 22... [nanomolarity]")  # Table S2 (TGFb_50_Teff = 0.14 nanomolarity)
    Kc_rec <- fixed(5.569927787093388e-23); label("Half-Maximal cancer cell number for T cell recruitment (Phillis 2006, PMID: 16153... [cell^2]")  # Table S2 (Kc_rec = 20200000 cell^2)
    TGFbase <- fixed(0.016); label("Baseline TGFb level in breast tumor (Ivanovic 2003, PMID: 12751375; Manuyakorn 20... [nanomolarity]")  # Table S2 (TGFbase = 0.016 nanomolarity)
    k_IFNg_Thsec <- fixed(80.29521142666667); label("IFNg secretion rate by T helper cell estimated assuming IFNg secretion is 3 times... [1/day]")  # Table S2 (k_IFNg_Thsec = 80.29521142666667 1/day)
    k_IFNg_deg <- fixed(7.68); label("IFNg degradation rate (Hofstra 1998, PMID: 9806748) [1/day]")  # Table S2 (k_IFNg_deg = 7.68 1/day)
    IFNg_50_ind <- fixed(0.00296); label("Half-Maximal IFNg level for PD-L1 induction (Shin 2017, PMID: 27903500) [picomolarity]")  # Table S2 (IFNg_50_ind = 2.96 picomolarity)
    k_CCL2_sec <- fixed(1023.7639292); label("rate of CCL2 secretion (Huang 2007, PMID: 17257744; Dutta 2018, PMID: 29594759) [nanomole/cell/day]")  # Table S2 (k_CCL2_sec = 1.7e-12 nanomole/cell/day)
    k_CCL2_deg <- fixed(1.44); label("rate of CCL2 degradation (Tanimoto 2007, PMID: 18089573) [1/h]")  # Table S2 (k_CCL2_deg = 0.06 1/h)
    CCL2_50 <- fixed(0.23); label("Half-maximal CCL2 level of MDSC recruitment (Opalek 2007, PMID: 17888174; Ernst 1... [nanomolarity]")  # Table S2 (CCL2_50 = 0.23 nanomolarity)
    k_MDSC_rec <- fixed(3.321078134347693e-09); label("Rate of MDSC recruitment into the tumor (Parra 2021, PMID: 33875760) [cell/(milliliter*day)]")  # Table S2 (k_MDSC_rec = 2000 cell/(milliliter*day))
    k_MDSC_death <- fixed(0.015); label("Rate of MDSC death (Lai 2018, PMID: 29735668) [1/day]")  # Table S2 (k_MDSC_death = 0.015 1/day)
    k_NO_deg <- fixed(135.0); label("rate of NO degradation (Hakim 1996, PMID: 8953625) [1/day]")  # Table S2 (k_NO_deg = 135 1/day)
    k_ArgI_deg <- fixed(0.173); label("rate of ArgI degradation (Schimke 1964, PMID: 14257612) [1/day]")  # Table S2 (k_ArgI_deg = 0.173 1/day)
    k_NO_sec <- fixed(289062756.47999996); label("rate of NO secretion from MDSCs (Serafini 2008, PMID: 18593947) [nanomole/cell/day]")  # Table S2 (k_NO_sec = 4.8e-07 nanomole/cell/day)
    k_ArgI_sec <- fixed(8430997064000000.0); label("rate of ArgI secretion (Serafini 2008, PMID: 18593947) [(mU*microliter)/cell/day]")  # Table S2 (k_ArgI_sec = 0.014 (mU*microliter)/cell/day)
    ArgI_50_Teff <- fixed(61700000000.0); label("rate of ArgI-induced T cell death (Serafini 2008, PMID: 18593947) [mU]")  # Table S2 (ArgI_50_Teff = 61.7 mU)
    NO_50_Teff <- fixed(0.75); label("rate of NO-induced T cell death (Serafini 2008, PMID: 18593947) [nanomolarity]")  # Table S2 (NO_50_Teff = 0.75 nanomolarity)
    ArgI_50_Treg <- fixed(22100000000.0); label("Half-maximal ArgI level of Treg expansion (estimated based on Serafini 2008, PMID... [mU]")  # Table S2 (ArgI_50_Treg = 22.1 mU)
    k_Mac_rec <- fixed(3.321078134347693e-07); label("Recruitment rate of macrophage into tumor compartment (Welsh 2005, PMID: 16219934) [cell/(milliliter*day)]")  # Table S2 (k_Mac_rec = 200000 cell/(milliliter*day))
    k_Mac_death <- fixed(0.02); label("Death rate of macrophages into tumor compartment (Ginhoux 2016, PMID: 26982352) [1/day]")  # Table S2 (k_Mac_death = 0.02 1/day)
    k_TGFb_Msec <- fixed(12044.281519999999); label("Secretion rate of TGFb by macrophage in tumor compartment (Matsuo 2000, PMID: 106... [nanomole/cell/day]")  # Table S2 (k_TGFb_Msec = 2e-11 nanomole/cell/day)
    k_IL12_sec <- fixed(5118.819646); label("Secretion rate of IL-12 by mAPC in tumor compartment (Heufler 1996, PMID: 8605935) [nanomole/cell/day]")  # Table S2 (k_IL12_sec = 8.5e-12 nanomole/cell/day)
    k_IL12_Msec <- fixed(301.107038); label("Secretion rate of IL-12 by macrophage in tumor compartment (Clough 2007, PMID: 17... [nanomole/cell/day]")  # Table S2 (k_IL12_Msec = 5e-13 nanomole/cell/day)
    k_IL12_deg <- fixed(0.5544); label("Degradation rate of IL-12 in tumor compartment (Carreno 2000, PMID: 10707873) [1/h]")  # Table S2 (k_IL12_deg = 0.0231 1/h)
    k_IL10_sec <- fixed(1806.6422280000002); label("Secretion rate of IL-10 by macrophage in tumor compartment (Autenshlyus 2021, PMI... [nanomole/cell/day]")  # Table S2 (k_IL10_sec = 3e-12 nanomole/cell/day)
    k_IL10_deg <- fixed(4.0); label("Degradation rate of IL-10 in tumor compartment (Saxena 2015, PMID: 25481648) [1/day]")  # Table S2 (k_IL10_deg = 4 1/day)
    k_M2_pol <- fixed(0.25); label("Rate of M1 to M2 macrophage polarization (estimated assuming that polarization ta... [1/day]")  # Table S2 (k_M2_pol = 0.25 1/day)
    k_M1_pol <- fixed(0.02); label("Rate of M2 to M1 macrophage polarization (estimated based on the M1/M2 ratio) [1/day]")  # Table S2 (k_M1_pol = 0.02 1/day)
    IL10_50 <- fixed(0.008); label("Half-maximal IL10 level for M1 to M2 polarization / maintaining Treg function / m... [picomolarity]")  # Table S2 (IL10_50 = 8 picomolarity)
    IL12_50 <- fixed(0.00014000000000000001); label("Half-maximal IL-12 level for M2 to M1 macrophage polarization (Altan-Bonnet 2019,... [picomolarity]")  # Table S2 (IL12_50 = 0.14 picomolarity)
    IFNg_50 <- fixed(0.0029); label("Half-maximal IFNg level for M2 to M1 macrophage polarization (Altan-Bonnet 2019, ... [picomolarity]")  # Table S2 (IFNg_50 = 2.9 picomolarity)
    k_M1_phago <- fixed(0.33); label("Rate of M1 macrophage-mediated killing of cancer cell (Pan 2020, PMID: 33365025) [1/day]")  # Table S2 (k_M1_phago = 0.33 1/day)
    vol_Mcell <- fixed(2920.1651178666225); label("Volume of a single macrophage cell Volume of a macrophage calculated based on the... [micrometer^3/cell]")  # Table S2 (vol_Mcell = 4849.048260815845 micrometer^3/cell)
    q_P_aCD47 <- fixed(2.03904); label("Capillary filtration rate of aCD47 between central and peripheral compartment(fit... [liter/second]")  # Table S2 (q_P_aCD47 = 2.36e-05 liter/second)
    q_T_aCD47 <- fixed(0.013046400000000001); label("Capillary filtration rate of aCD47 between central and tumor compartment(fitted) [milliliter/second]")  # Table S2 (q_T_aCD47 = 0.000151 milliliter/second)
    q_LN_aCD47 <- fixed(0.0002808); label("Capillary filtration rate of aCD47 between central and TDLN compartment(Meijer 20... [milliliter/second]")  # Table S2 (q_LN_aCD47 = 3.25e-06 milliliter/second)
    q_LD_aCD47 <- fixed(2.16); label("Rate of lymphatic drainage of aCD47 from TDLN to central compartment(Zhu 1996, PM... [1/minute]")  # Table S2 (q_LD_aCD47 = 0.0015 1/minute)
    k_cl_aCD47 <- fixed(0.679); label("Clearance rate of aCD47 from central compartment(fitted) [liter/day]")  # Table S2 (k_cl_aCD47 = 0.679 liter/day)
    gamma_C_aCD47 <- fixed(0.58); label("Volume fraction of interstitial space available to aCD47 in central compartment(f... [dimensionless]")  # Table S2 (gamma_C_aCD47 = 0.58 dimensionless)
    gamma_P_aCD47 <- fixed(0.074); label("Volume fraction of interstitial space available to aCD47 in peripheral compartmen... [dimensionless]")  # Table S2 (gamma_P_aCD47 = 0.074 dimensionless)
    gamma_T_aCD47 <- fixed(0.2); label("Volume fraction of interstitial space available to aCD47 in tumor compartment(Wan... [dimensionless]")  # Table S2 (gamma_T_aCD47 = 0.2 dimensionless)
    gamma_LN_aCD47 <- fixed(0.2); label("Volume fraction of interstitial space available to aCD47 in TDLN compartment(Wang... [dimensionless]")  # Table S2 (gamma_LN_aCD47 = 0.2 dimensionless)
    RBC_CD47 <- fixed(1474.0); label("CD47 expression on RBCs (fitted) [micromole]")  # Table S2 (RBC_CD47 = 1.474 micromole)
    kdeg_CD47 <- fixed(0.125); label("Degradation rate of free CD47 on RBCs (fitted) [1/day]")  # Table S2 (kdeg_CD47 = 0.125 1/day)
    kint_CD47 <- fixed(9.9); label("Internalization rate of bound CD47 on RBCs (fitted) [1/day]")  # Table S2 (kint_CD47 = 9.9 1/day)
    kint_aCD47 <- fixed(0.18); label("Internalization rate of anti-CD47 antibody by endothelial cells (Kendrick 2017, P... [1/day]")  # Table S2 (kint_aCD47 = 0.18 1/day)
    krec_aCD47 <- fixed(5.0); label("Recycling rate of anti-CD47 antibody from endothelial cell back into plasma (Kend... [1/day]")  # Table S2 (krec_aCD47 = 5 1/day)
    koff_FcRn_aCD47 <- fixed(43.199999999999996); label("Dissociation rate of aCD47-FcRn complex(Vaughn 1997, PMID: 9235980) [1/minute]")  # Table S2 (koff_FcRn_aCD47 = 0.03 1/minute)
    kd_FcRn_aCD47 <- fixed(1000.0); label("Binding affinity of anti-CD47 antibody to FcRn (Abdiche 2015, PMID: 25658443; Kau... [nanomolarity]")  # Table S2 (kd_FcRn_aCD47 = 1000 nanomolarity)
    kdeg_aCD47 <- fixed(3.0); label("Degradation rate of anti-CD47 antibody in the endosomal compartment (Kendrick 201... [1/day]")  # Table S2 (kdeg_aCD47 = 3 1/day)
    kon_CD47_aCD47 <- fixed(0.792); label("Association rate of anti-CD47 antibody and CD47 [1/minute/nanomolarity]")  # Table S2 (kon_CD47_aCD47 = 0.00055 1/minute/nanomolarity)
    koff_CD47_aCD47 <- fixed(1.584); label("Dissociation rate of anti-CD47 antibody and CD47 (fitted) [1/minute]")  # Table S2 (koff_CD47_aCD47 = 0.0011 1/minute)
    Chi_CD47_aCD47_3D <- fixed(100.0); label("aCD47 antibody cross-arm binding strength [dimensionless]")  # Table S2 (Chi_CD47_aCD47_3D = 100 dimensionless)
    kon_CD47_SIRPa <- fixed(9000000.0); label("kon of CD47-SIRPa binding (Hayes 2020, PMID: 31964705) [1/(micromolarity*minute*nanometer)]")  # Table S2 (kon_CD47_SIRPa = 0.0625 1/(micromolarity*minute*nanometer))
    koff_CD47_SIRPa <- fixed(432.0); label("koff of CD47-SIRPa binding (Hayes 2020, PMID: 31964705) [1/minute]")  # Table S2 (koff_CD47_SIRPa = 0.3 1/minute)
    SIRPa_50 <- fixed(0.0006143994548543231); label("SIRPa occupancy for half-maximal CD47/SIRPa inhibition on phagocytosis of cancer ... [molecule/micrometer^2]")  # Table S2 (SIRPa_50 = 37 molecule/micrometer^2)
    n_SIRPa <- fixed(2.0); label("Hill coefficient for CD47/SIRPa inhibition on phagocytosis of cancer cells by mac... [dimensionless]")  # Table S2 (n_SIRPa = 2 dimensionless)
    C_CD47 <- fixed(0.0016605390671738463); label("CD47 expression on cancer cells (Morrissey 2020, PMID: 32768386; Zhang 2019, PMID... [molecule/micrometer^2]")  # Table S2 (C_CD47 = 100 molecule/micrometer^2)
    M_PD1_total <- fixed(2.0756738339673084e-11); label("PD-1 expression on macrophages estimated based on PD-1 expression on T cell (Chen... [molecule]")  # Table S2 (M_PD1_total = 12500 molecule)
    M_SIRPa <- fixed(0.0016605390671738463); label("SIRPa expression on macrophages (Subramanian 2006, PMID: 16291597) [molecule/micrometer^2]")  # Table S2 (M_SIRPa = 100 molecule/micrometer^2)
    A_Mcell <- fixed(1.385442360233099e-07); label("Surface area of the macrophage calculated based on the average macrophage diamete... [micrometer^2]")  # Table S2 (A_Mcell = 1385.4423602330987 micrometer^2)
    IL10_50_phago <- fixed(0.27); label("Half-maximal IL-10 level for phagocytosis by macrophage (Bian 2016, PMID: 27578867) [picomolarity]")  # Table S2 (IL10_50_phago = 270 picomolarity)
    K_Mac_C <- fixed(2.0); label("Association coefficient for macrophage and cancer cell (estimated) [dimensionless]")  # Table S2 (K_Mac_C = 2 dimensionless)

    # The remaining Supplementary Table S2 entries are recorded here for
    # provenance but are not ini() parameters, because nothing in the ODE
    # system reads them: each is either recomputed on every step by a
    # Table S5 repeated-assignment rule (its Table S2 value is only a
    # placeholder), or is used by the authors' driver script rather than
    # by the model itself.  rxode2 rejects an ini() entry that the model
    # block never reads.
    #   C_total = 0 cell  (recomputed by a Table S5 rule)
    #   T_total = 0 cell  (recomputed by a Table S5 rule)
    #   T_total_LN = 0 cell  (recomputed by a Table S5 rule)
    #   R_Tcell = 1 cell/day  (recomputed by a Table S5 rule)
    #   Tregs_ = 0 cell  (recomputed by a Table S5 rule)
    #   H_APC = 0.5 dimensionless  (recomputed by a Table S5 rule)
    #   H_mAPC = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_APCh = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_PD1_C1 = 0.9 dimensionless  (recomputed by a Table S5 rule)
    #   H_PD1_APC = 0.9 dimensionless  (recomputed by a Table S5 rule)
    #   H_CD28_C1 = 0.1 dimensionless  (recomputed by a Table S5 rule)
    #   H_CD28_APC = 0.1 dimensionless  (recomputed by a Table S5 rule)
    #   k_C1_therapy = 0 1/day  (recomputed by a Table S5 rule)
    #   initial_tumour_diameter = 3.7 centimeter  (not referenced by any rate law)
    #   H_P0 = 1 dimensionless  (recomputed by a Table S5 rule)
    #   N_aT = 1 dimensionless  (recomputed by a Table S5 rule)
    #   N_aT0 = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_P1 = 1 dimensionless  (recomputed by a Table S5 rule)
    #   pTCR_p0_MHC_tot = 0 molecule/micrometer^2  (recomputed by a Table S5 rule)
    #   pTCR_p1_MHC_tot = 0 molecule/micrometer^2  (recomputed by a Table S5 rule)
    #   H_TGFb = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_TGFb_Teff = 1 dimensionless  (recomputed by a Table S5 rule)
    #   N_aTh = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_NO = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_ArgI_Teff = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_ArgI_Treg = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_MDSC = 1 dimensionless  (recomputed by a Table S5 rule)
    #   kd_CD47_aCD47 = 1 nanomolarity  (not referenced by any rate law)
    #   H_Mac_C = 0 dimensionless  (recomputed by a Table S5 rule)
    #   H_PD1_M = 0 dimensionless  (recomputed by a Table S5 rule)
    #   H_SIRPa = 0 dimensionless  (recomputed by a Table S5 rule)
    #   M_total = 0 cell  (recomputed by a Table S5 rule)
    #   H_IL10 = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_IL10_phago = 1 dimensionless  (recomputed by a Table S5 rule)
    #   H_IL12 = 1 dimensionless  (recomputed by a Table S5 rule)
    #   N_avg = 6.02214076e14 molecule/nmol  (user-defined unit cell = molecule,
    #     immune_oncology_model_NSCLC.m:10; folded into the converted values)
  })

  model({
    # ---- parameter aliases (rxode2 reads a bare theta+theta sum as a
    # mu-reference block; these mechanistic rate laws legitimately add two
    # fixed constants, so each such parameter is copied to a local first) ----
    a_ArgI_50_Teff <- ArgI_50_Teff
    a_ArgI_50_Treg <- ArgI_50_Treg
    a_CCL2_50 <- CCL2_50
    a_IFNg_50 <- IFNg_50
    a_IFNg_50_ind <- IFNg_50_ind
    a_IL10_50 <- IL10_50
    a_IL10_50_phago <- IL10_50_phago
    a_IL12_50 <- IL12_50
    a_IL2_50 <- IL2_50
    a_IL2_50_Treg <- IL2_50_Treg
    a_Kc_aPDL1 <- Kc_aPDL1
    a_Kc_rec <- Kc_rec
    a_N0 <- N0
    a_NO_50_Teff <- NO_50_Teff
    a_TCR_p0_tot <- TCR_p0_tot
    a_TCR_p1_tot <- TCR_p1_tot
    a_TGFb_50 <- TGFb_50
    a_TGFb_50_Teff <- TGFb_50_Teff
    a_TGFbase <- TGFbase
    a_cell <- cell
    a_k_C1_death <- k_C1_death
    a_k_M1p0_TCR_off <- k_M1p0_TCR_off
    a_k_M1p0_TCR_p <- k_M1p0_TCR_p
    a_k_M1p1_TCR_off <- k_M1p1_TCR_off
    a_k_M1p1_TCR_p <- k_M1p1_TCR_p
    a_p0_50 <- p0_50
    a_p1_50 <- p1_50
    a_phi_M1p0_TCR <- phi_M1p0_TCR
    a_phi_M1p1_TCR <- phi_M1p1_TCR

    # ---- compartment capacities ----
    m_V_C <- vol_V_C
    m_V_P <- vol_V_P
    m_V_LN <- vol_V_LN
    m_V_e <- vol_V_e
    m_A_e <- vol_A_e
    m_A_s <- vol_A_s
    m_syn_T_C1 <- vol_syn_T_C1
    m_syn_T_APC <- vol_syn_T_APC
    m_syn_M_C <- vol_syn_M_C
    m_V_endo <- vol_V_endo

    # ---- species quantities (states are AMOUNTS; x_* are SimBiology values) ----
    x_V_C_nT0 <- q_V_C_nT0
    x_V_C_T0 <- q_V_C_T0
    x_V_C_nT1 <- q_V_C_nT1
    x_V_C_T1 <- q_V_C_T1
    x_V_C_aPD1 <- q_V_C_aPD1/m_V_C
    x_V_C_aPDL1 <- q_V_C_aPDL1/m_V_C
    x_V_C_aCTLA4 <- q_V_C_aCTLA4/m_V_C
    x_V_C_Th <- q_V_C_Th
    x_V_C_aCD47 <- q_V_C_aCD47/m_V_C
    x_V_C_CD47 <- q_V_C_CD47/m_V_C
    x_V_C_CD47_aCD47 <- q_V_C_CD47_aCD47/m_V_C
    x_V_C_CD47_aCD47_CD47 <- q_V_C_CD47_aCD47_CD47/m_V_C
    x_V_P_nT0 <- q_V_P_nT0
    x_V_P_T0 <- q_V_P_T0
    x_V_P_nT1 <- q_V_P_nT1
    x_V_P_T1 <- q_V_P_T1
    x_V_P_aPD1 <- q_V_P_aPD1/m_V_P
    x_V_P_aPDL1 <- q_V_P_aPDL1/m_V_P
    x_V_P_aCTLA4 <- q_V_P_aCTLA4/m_V_P
    x_V_P_Th <- q_V_P_Th
    x_V_P_aCD47 <- q_V_P_aCD47/m_V_P
    x_V_LN_nT0 <- q_V_LN_nT0
    x_V_LN_aT0 <- q_V_LN_aT0
    x_V_LN_T0 <- q_V_LN_T0
    x_V_LN_IL2 <- q_V_LN_IL2/m_V_LN
    x_V_LN_nT1 <- q_V_LN_nT1
    x_V_LN_aT1 <- q_V_LN_aT1
    x_V_LN_T1 <- q_V_LN_T1
    x_V_LN_APC <- q_V_LN_APC
    x_V_LN_mAPC <- q_V_LN_mAPC
    x_V_LN_aPD1 <- q_V_LN_aPD1/m_V_LN
    x_V_LN_aPDL1 <- q_V_LN_aPDL1/m_V_LN
    x_V_LN_aCTLA4 <- q_V_LN_aCTLA4/m_V_LN
    x_V_LN_aTh <- q_V_LN_aTh
    x_V_LN_Th <- q_V_LN_Th
    x_V_LN_aCD47 <- q_V_LN_aCD47/m_V_LN
    x_V_e_P0 <- q_V_e_P0/m_V_e
    x_V_e_p0 <- q_V_e_p0/m_V_e
    x_V_e_P1 <- q_V_e_P1/m_V_e
    x_V_e_p1 <- q_V_e_p1/m_V_e
    x_A_e_M1 <- q_A_e_M1/m_A_e
    x_A_e_M1p0 <- q_A_e_M1p0/m_A_e
    x_A_e_M1p1 <- q_A_e_M1p1/m_A_e
    x_A_s_M1 <- q_A_s_M1/m_A_s
    x_A_s_M1p0 <- q_A_s_M1p0/m_A_s
    x_A_s_M1p1 <- q_A_s_M1p1/m_A_s
    x_syn_T_C1_PD1_PDL1 <- q_syn_T_C1_PD1_PDL1/m_syn_T_C1
    x_syn_T_C1_PD1_PDL2 <- q_syn_T_C1_PD1_PDL2/m_syn_T_C1
    x_syn_T_C1_PD1 <- q_syn_T_C1_PD1/m_syn_T_C1
    x_syn_T_C1_PDL1 <- q_syn_T_C1_PDL1/m_syn_T_C1
    x_syn_T_C1_PDL2 <- q_syn_T_C1_PDL2/m_syn_T_C1
    x_syn_T_C1_PD1_aPD1 <- q_syn_T_C1_PD1_aPD1/m_syn_T_C1
    x_syn_T_C1_PD1_aPD1_PD1 <- q_syn_T_C1_PD1_aPD1_PD1/m_syn_T_C1
    x_syn_T_C1_PDL1_aPDL1 <- q_syn_T_C1_PDL1_aPDL1/m_syn_T_C1
    x_syn_T_C1_PDL1_aPDL1_PDL1 <- q_syn_T_C1_PDL1_aPDL1_PDL1/m_syn_T_C1
    x_syn_T_C1_TPDL1 <- q_syn_T_C1_TPDL1/m_syn_T_C1
    x_syn_T_C1_TPDL1_aPDL1 <- q_syn_T_C1_TPDL1_aPDL1/m_syn_T_C1
    x_syn_T_C1_TPDL1_aPDL1_TPDL1 <- q_syn_T_C1_TPDL1_aPDL1_TPDL1/m_syn_T_C1
    x_syn_T_C1_CD28_CD80 <- q_syn_T_C1_CD28_CD80/m_syn_T_C1
    x_syn_T_C1_CD28_CD80_CD28 <- q_syn_T_C1_CD28_CD80_CD28/m_syn_T_C1
    x_syn_T_C1_CD28_CD86 <- q_syn_T_C1_CD28_CD86/m_syn_T_C1
    x_syn_T_C1_CD80_CTLA4 <- q_syn_T_C1_CD80_CTLA4/m_syn_T_C1
    x_syn_T_C1_CD80_CTLA4_CD80 <- q_syn_T_C1_CD80_CTLA4_CD80/m_syn_T_C1
    x_syn_T_C1_CTLA4_CD80_CTLA4 <- q_syn_T_C1_CTLA4_CD80_CTLA4/m_syn_T_C1
    x_syn_T_C1_CD80_CTLA4_CD80_CTLA4 <- q_syn_T_C1_CD80_CTLA4_CD80_CTLA4/m_syn_T_C1
    x_syn_T_C1_CD86_CTLA4 <- q_syn_T_C1_CD86_CTLA4/m_syn_T_C1
    x_syn_T_C1_CD86_CTLA4_CD86 <- q_syn_T_C1_CD86_CTLA4_CD86/m_syn_T_C1
    x_syn_T_C1_PDL1_CD80 <- q_syn_T_C1_PDL1_CD80/m_syn_T_C1
    x_syn_T_C1_PDL1_CD80_CD28 <- q_syn_T_C1_PDL1_CD80_CD28/m_syn_T_C1
    x_syn_T_C1_PDL1_CD80_CTLA4 <- q_syn_T_C1_PDL1_CD80_CTLA4/m_syn_T_C1
    x_syn_T_C1_CD28 <- q_syn_T_C1_CD28/m_syn_T_C1
    x_syn_T_C1_CTLA4 <- q_syn_T_C1_CTLA4/m_syn_T_C1
    x_syn_T_C1_CD80 <- q_syn_T_C1_CD80/m_syn_T_C1
    x_syn_T_C1_CD80m <- q_syn_T_C1_CD80m/m_syn_T_C1
    x_syn_T_C1_CD86 <- q_syn_T_C1_CD86/m_syn_T_C1
    x_syn_T_C1_CTLA4_aCTLA4 <- q_syn_T_C1_CTLA4_aCTLA4/m_syn_T_C1
    x_syn_T_C1_CTLA4_aCTLA4_CTLA4 <- q_syn_T_C1_CTLA4_aCTLA4_CTLA4/m_syn_T_C1
    x_syn_T_APC_PD1_PDL1 <- q_syn_T_APC_PD1_PDL1/m_syn_T_APC
    x_syn_T_APC_PD1_PDL2 <- q_syn_T_APC_PD1_PDL2/m_syn_T_APC
    x_syn_T_APC_PD1 <- q_syn_T_APC_PD1/m_syn_T_APC
    x_syn_T_APC_PDL1 <- q_syn_T_APC_PDL1/m_syn_T_APC
    x_syn_T_APC_PDL2 <- q_syn_T_APC_PDL2/m_syn_T_APC
    x_syn_T_APC_PD1_aPD1 <- q_syn_T_APC_PD1_aPD1/m_syn_T_APC
    x_syn_T_APC_PD1_aPD1_PD1 <- q_syn_T_APC_PD1_aPD1_PD1/m_syn_T_APC
    x_syn_T_APC_PDL1_aPDL1 <- q_syn_T_APC_PDL1_aPDL1/m_syn_T_APC
    x_syn_T_APC_PDL1_aPDL1_PDL1 <- q_syn_T_APC_PDL1_aPDL1_PDL1/m_syn_T_APC
    x_syn_T_APC_TPDL1 <- q_syn_T_APC_TPDL1/m_syn_T_APC
    x_syn_T_APC_TPDL1_aPDL1 <- q_syn_T_APC_TPDL1_aPDL1/m_syn_T_APC
    x_syn_T_APC_TPDL1_aPDL1_TPDL1 <- q_syn_T_APC_TPDL1_aPDL1_TPDL1/m_syn_T_APC
    x_syn_T_APC_CD28_CD80 <- q_syn_T_APC_CD28_CD80/m_syn_T_APC
    x_syn_T_APC_CD28_CD80_CD28 <- q_syn_T_APC_CD28_CD80_CD28/m_syn_T_APC
    x_syn_T_APC_CD28_CD86 <- q_syn_T_APC_CD28_CD86/m_syn_T_APC
    x_syn_T_APC_CD80_CTLA4 <- q_syn_T_APC_CD80_CTLA4/m_syn_T_APC
    x_syn_T_APC_CD80_CTLA4_CD80 <- q_syn_T_APC_CD80_CTLA4_CD80/m_syn_T_APC
    x_syn_T_APC_CTLA4_CD80_CTLA4 <- q_syn_T_APC_CTLA4_CD80_CTLA4/m_syn_T_APC
    x_syn_T_APC_CD80_CTLA4_CD80_CTLA4 <- q_syn_T_APC_CD80_CTLA4_CD80_CTLA4/m_syn_T_APC
    x_syn_T_APC_CD86_CTLA4 <- q_syn_T_APC_CD86_CTLA4/m_syn_T_APC
    x_syn_T_APC_CD86_CTLA4_CD86 <- q_syn_T_APC_CD86_CTLA4_CD86/m_syn_T_APC
    x_syn_T_APC_PDL1_CD80 <- q_syn_T_APC_PDL1_CD80/m_syn_T_APC
    x_syn_T_APC_PDL1_CD80_CD28 <- q_syn_T_APC_PDL1_CD80_CD28/m_syn_T_APC
    x_syn_T_APC_PDL1_CD80_CTLA4 <- q_syn_T_APC_PDL1_CD80_CTLA4/m_syn_T_APC
    x_syn_T_APC_CD28 <- q_syn_T_APC_CD28/m_syn_T_APC
    x_syn_T_APC_CTLA4 <- q_syn_T_APC_CTLA4/m_syn_T_APC
    x_syn_T_APC_CD80 <- q_syn_T_APC_CD80/m_syn_T_APC
    x_syn_T_APC_CD80m <- q_syn_T_APC_CD80m/m_syn_T_APC
    x_syn_T_APC_CD86 <- q_syn_T_APC_CD86/m_syn_T_APC
    x_syn_T_APC_CTLA4_aCTLA4 <- q_syn_T_APC_CTLA4_aCTLA4/m_syn_T_APC
    x_syn_T_APC_CTLA4_aCTLA4_CTLA4 <- q_syn_T_APC_CTLA4_aCTLA4_CTLA4/m_syn_T_APC
    x_syn_M_C_CD47_aCD47 <- q_syn_M_C_CD47_aCD47/m_syn_M_C
    x_syn_M_C_CD47_aCD47_CD47 <- q_syn_M_C_CD47_aCD47_CD47/m_syn_M_C
    x_syn_M_C_CD47 <- q_syn_M_C_CD47/m_syn_M_C
    x_syn_M_C_SIRPa <- q_syn_M_C_SIRPa/m_syn_M_C
    x_syn_M_C_CD47_SIRPa <- q_syn_M_C_CD47_SIRPa/m_syn_M_C
    x_syn_M_C_PD1_PDL1 <- q_syn_M_C_PD1_PDL1/m_syn_M_C
    x_syn_M_C_PD1_PDL2 <- q_syn_M_C_PD1_PDL2/m_syn_M_C
    x_syn_M_C_PD1 <- q_syn_M_C_PD1/m_syn_M_C
    x_syn_M_C_PDL1 <- q_syn_M_C_PDL1/m_syn_M_C
    x_syn_M_C_PDL2 <- q_syn_M_C_PDL2/m_syn_M_C
    x_syn_M_C_PD1_aPD1 <- q_syn_M_C_PD1_aPD1/m_syn_M_C
    x_syn_M_C_PD1_aPD1_PD1 <- q_syn_M_C_PD1_aPD1_PD1/m_syn_M_C
    x_syn_M_C_PDL1_aPDL1 <- q_syn_M_C_PDL1_aPDL1/m_syn_M_C
    x_syn_M_C_PDL1_aPDL1_PDL1 <- q_syn_M_C_PDL1_aPDL1_PDL1/m_syn_M_C
    x_syn_M_C_PDL1_CD80 <- q_syn_M_C_PDL1_CD80/m_syn_M_C
    x_syn_M_C_CD80 <- q_syn_M_C_CD80/m_syn_M_C
    x_syn_M_C_CD80m <- q_syn_M_C_CD80m/m_syn_M_C
    x_V_endo_aCD47 <- q_V_endo_aCD47/m_V_endo
    x_V_endo_FcRn <- q_V_endo_FcRn/m_V_endo
    x_V_endo_FcRn_aCD47 <- q_V_endo_FcRn_aCD47/m_V_endo

    # ---- tumour volume: state-dependent repeated assignment (Table S5 rule 1) ----
    x_V_T_C_x <- q_V_T_C_x
    x_V_T_T1_exh <- q_V_T_T1_exh
    x_V_T_Th_exh <- q_V_T_Th_exh
    x_V_T_C1 <- q_V_T_C1
    x_V_T_T0 <- q_V_T_T0
    x_V_T_T1 <- q_V_T_T1
    x_V_T_APC <- q_V_T_APC
    x_V_T_mAPC <- q_V_T_mAPC
    x_V_T_Th <- q_V_T_Th
    x_V_T_MDSC <- q_V_T_MDSC
    x_V_T_Mac_M1 <- q_V_T_Mac_M1
    x_V_T_Mac_M2 <- q_V_T_Mac_M2
    C_total <- 0*a_cell+x_V_T_C1   # Table S5 (C_total)
    T_total <- 0*a_cell+x_V_T_T0+x_V_T_T1+x_V_T_Th   # Table S5 (T_total)
    M_total <- x_V_T_Mac_M1+x_V_T_Mac_M2   # Table S5 (M_total)
    vol_V_T <- ((x_V_T_C_x+C_total)*vol_cell+(x_V_T_T1_exh+x_V_T_Th_exh+T_total)*vol_Tcell)/Ve_T+M_total*vol_Mcell/Ve_T   # Table S5 rule 1
    x_V_T_IFNg <- q_V_T_IFNg/vol_V_T
    x_V_T_P0 <- q_V_T_P0/vol_V_T
    x_V_T_P1 <- q_V_T_P1/vol_V_T
    x_V_T_aPD1 <- q_V_T_aPD1/vol_V_T
    x_V_T_aPDL1 <- q_V_T_aPDL1/vol_V_T
    x_V_T_aCTLA4 <- q_V_T_aCTLA4/vol_V_T
    x_V_T_TGFb <- q_V_T_TGFb/vol_V_T
    x_V_T_NO <- q_V_T_NO/vol_V_T
    x_V_T_ArgI <- q_V_T_ArgI/vol_V_T
    x_V_T_CCL2 <- q_V_T_CCL2/vol_V_T
    x_V_T_IL12 <- q_V_T_IL12/vol_V_T
    x_V_T_IL10 <- q_V_T_IL10/vol_V_T
    x_V_T_aCD47 <- q_V_T_aCD47/vol_V_T

    # ---- algebraic / repeated-assignment rules (Table S5) ----
    T_total_LN <- 0*a_cell+x_V_LN_T0+x_V_LN_T1+x_V_LN_Th   # Table S5 (T_total_LN)
    k_C1_therapy <- 0/day   # Table S5 (k_C1_therapy)
    Tregs_ <- x_V_T_T0   # Table S5 (Tregs_)
    H_APC <- n_sites_APC*x_V_LN_mAPC/(n_sites_APC*x_V_LN_mAPC+x_V_LN_nT0*n_T0_clones+a_cell)   # Table S5 (H_APC)
    H_mAPC <- n_sites_APC*x_V_LN_mAPC/(n_sites_APC*x_V_LN_mAPC+x_V_LN_nT1*n_T1_clones+a_cell)   # Table S5 (H_mAPC)
    H_APCh <- n_sites_APC*x_V_LN_mAPC/(n_sites_APC*x_V_LN_mAPC+x_V_LN_nT0*n_T1_clones+a_cell)   # Table S5 (H_APCh)
    pTCR_p0_MHC_tot <- a_k_M1p0_TCR_off/(a_k_M1p0_TCR_off+a_phi_M1p0_TCR)*(a_k_M1p0_TCR_p/(a_k_M1p0_TCR_off+a_k_M1p0_TCR_p))^N_M1p0_TCR*(0.5*(x_A_s_M1p0/n_T0_clones+a_TCR_p0_tot+a_k_M1p0_TCR_off/k_M1p0_TCR_on-a_TCR_p0_tot*sqrt(((x_A_s_M1p0/n_T0_clones+a_TCR_p0_tot+a_k_M1p0_TCR_off/k_M1p0_TCR_on)/a_TCR_p0_tot)^2-4*x_A_s_M1p0/n_T0_clones/a_TCR_p0_tot)))   # Table S5 (pTCR_p0_MHC_tot)
    H_P0 <- pTCR_p0_MHC_tot/(pTCR_p0_MHC_tot+a_p0_50)   # Table S5 (H_P0)
    pTCR_p1_MHC_tot <- a_k_M1p1_TCR_off/(a_k_M1p1_TCR_off+a_phi_M1p1_TCR)*(a_k_M1p1_TCR_p/(a_k_M1p1_TCR_off+a_k_M1p1_TCR_p))^N_M1p1_TCR*(0.5*(x_A_s_M1p1/n_T1_clones+a_TCR_p1_tot+a_k_M1p1_TCR_off/k_M1p1_TCR_on-a_TCR_p1_tot*sqrt(((x_A_s_M1p1/n_T1_clones+a_TCR_p1_tot+a_k_M1p1_TCR_off/k_M1p1_TCR_on)/a_TCR_p1_tot)^2-4*x_A_s_M1p1/n_T1_clones/a_TCR_p1_tot)))   # Table S5 (pTCR_p1_MHC_tot)
    H_P1 <- pTCR_p1_MHC_tot/(pTCR_p1_MHC_tot+a_p1_50)   # Table S5 (H_P1)
    x_syn_T_C1_PDL1_total <- x_syn_T_C1_PDL1+x_syn_T_C1_PD1_PDL1+x_syn_T_C1_PDL1_aPDL1+2*x_syn_T_C1_PDL1_aPDL1_PDL1+x_syn_T_C1_PDL1_CD80+x_syn_T_C1_PDL1_CD80_CD28+x_syn_T_C1_PDL1_CD80_CTLA4   # Table S5 (syn_T_C1.PDL1_total)
    x_syn_T_C1_PDL2_total <- x_syn_T_C1_PD1_PDL2+x_syn_T_C1_PDL2   # Table S5 (syn_T_C1.PDL2_total)
    H_PD1_C1 <- ((x_syn_T_C1_PD1_PDL1+x_syn_T_C1_PD1_PDL2)/PD1_50)^n_PD1/(((x_syn_T_C1_PD1_PDL1+x_syn_T_C1_PD1_PDL2)/PD1_50)^n_PD1+1)   # Table S5 (H_PD1_C1)
    H_CD28_C1 <- ((x_syn_T_C1_CD28_CD80+x_syn_T_C1_CD28_CD86+2*x_syn_T_C1_CD28_CD80_CD28+x_syn_T_C1_PDL1_CD80_CD28)/CD28_CD8X_50)^n_CD28_CD8X/(((x_syn_T_C1_CD28_CD80+x_syn_T_C1_CD28_CD86+2*x_syn_T_C1_CD28_CD80_CD28+x_syn_T_C1_PDL1_CD80_CD28)/CD28_CD8X_50)^n_CD28_CD8X+1)   # Table S5 (H_CD28_C1)
    x_syn_T_APC_PDL1_total <- x_syn_T_APC_PDL1+x_syn_T_APC_PD1_PDL1+x_syn_T_APC_PDL1_aPDL1+2*x_syn_T_APC_PDL1_aPDL1_PDL1+x_syn_T_APC_PDL1_CD80+x_syn_T_APC_PDL1_CD80_CD28+x_syn_T_APC_PDL1_CD80_CTLA4   # Table S5 (syn_T_APC.PDL1_total)
    x_syn_T_APC_PDL2_total <- x_syn_T_APC_PD1_PDL2+x_syn_T_APC_PDL2   # Table S5 (syn_T_APC.PDL2_total)
    H_PD1_APC <- ((x_syn_T_APC_PD1_PDL1+x_syn_T_APC_PD1_PDL2)/PD1_50)^n_PD1/(((x_syn_T_APC_PD1_PDL1+x_syn_T_APC_PD1_PDL2)/PD1_50)^n_PD1+1)   # Table S5 (H_PD1_APC)
    H_CD28_APC <- ((x_syn_T_APC_CD28_CD80+x_syn_T_APC_CD28_CD86+2*x_syn_T_APC_CD28_CD80_CD28+x_syn_T_APC_PDL1_CD80_CD28)/CD28_CD8X_50)^n_CD28_CD8X/(((x_syn_T_APC_CD28_CD80+x_syn_T_APC_CD28_CD86+2*x_syn_T_APC_CD28_CD80_CD28+x_syn_T_APC_PDL1_CD80_CD28)/CD28_CD8X_50)^n_CD28_CD8X+1)   # Table S5 (H_CD28_APC)
    H_TGFb <- x_V_T_TGFb/(x_V_T_TGFb+a_TGFb_50)   # Table S5 (H_TGFb)
    H_TGFb_Teff <- x_V_T_TGFb/(x_V_T_TGFb+a_TGFb_50_Teff)   # Table S5 (H_TGFb_Teff)
    N_aTh <- a_N0+N_costim*H_CD28_APC+N_IL2_CD4*x_V_LN_IL2/(a_IL2_50+x_V_LN_IL2)   # Table S5 (N_aTh)
    H_NO <- x_V_T_NO/(a_NO_50_Teff+x_V_T_NO)   # Table S5 (H_NO)
    H_ArgI_Teff <- x_V_T_ArgI/(a_ArgI_50_Teff+x_V_T_ArgI)   # Table S5 (H_ArgI_Teff)
    H_ArgI_Treg <- x_V_T_ArgI/(a_ArgI_50_Treg+x_V_T_ArgI)   # Table S5 (H_ArgI_Treg)
    H_MDSC <- 1-(1-H_NO)*(1-H_ArgI_Teff)   # Table S5 (H_MDSC)
    x_syn_M_C_PDL1_total <- x_syn_M_C_PDL1+x_syn_M_C_PD1_PDL1+x_syn_M_C_PDL1_aPDL1+2*x_syn_M_C_PDL1_aPDL1_PDL1+x_syn_M_C_PDL1_CD80   # Table S5 (syn_M_C.PDL1_total)
    x_syn_M_C_PDL2_total <- x_syn_M_C_PD1_PDL2+x_syn_M_C_PDL2   # Table S5 (syn_M_C.PDL2_total)
    H_SIRPa <- (x_syn_M_C_CD47_SIRPa/SIRPa_50)^n_SIRPa/((x_syn_M_C_CD47_SIRPa/SIRPa_50)^n_SIRPa+1)   # Table S5 (H_SIRPa)
    H_PD1_M <- ((x_syn_M_C_PD1_PDL1+x_syn_M_C_PD1_PDL2)/PD1_50)^n_PD1/(((x_syn_M_C_PD1_PDL1+x_syn_M_C_PD1_PDL2)/PD1_50)^n_PD1+1)   # Table S5 (H_PD1_M)
    H_Mac_C <- 1-(1-H_SIRPa)*(1-H_PD1_M)   # Table S5 (H_Mac_C)
    H_IL10 <- x_V_T_IL10/(a_IL10_50+x_V_T_IL10)   # Table S5 (H_IL10)
    H_IL10_phago <- x_V_T_IL10/(a_IL10_50_phago+x_V_T_IL10)   # Table S5 (H_IL10_phago)
    H_IL12 <- x_V_T_IL12/(a_IL12_50+x_V_T_IL12)   # Table S5 (H_IL12)
    R_Tcell <- 0*a_cell/day+(a_k_C1_death+k_C1_therapy)*x_V_T_C1+k_C_T1*x_V_T_C1*x_V_T_T1/(K_T_C*x_V_T_C1+x_V_T_T1+a_cell)*x_V_T_T1/(x_V_T_T1+K_T_Treg*Tregs_+a_cell)*(1-H_TGFb_Teff)*(1-H_PD1_C1)*(1-H_MDSC)+k_M1_phago*x_V_T_C1*x_V_T_Mac_M1/(x_V_T_Mac_M1+K_Mac_C*x_V_T_C1+a_cell)*(1-H_Mac_C)*(1-H_IL10_phago)   # Table S5 (R_Tcell)
    N_aT <- a_N0+N_costim*H_CD28_APC+N_IL2_CD8*x_V_LN_IL2/(a_IL2_50+x_V_LN_IL2)   # Table S5 (N_aT)
    N_aT0 <- a_N0+N_costim*H_CD28_APC+N_IL2_CD4*x_V_LN_IL2/(a_IL2_50+x_V_LN_IL2)   # Table S5 (N_aT0)

    # ---- reaction rates (Supplementary Table S4) ----
    v1 <- k_cell_clear*x_V_T_C_x   # R1 Clearance of dead cancer cells from tumor
    v2 <- k_cell_clear*x_V_T_T1_exh   # R2 Clearance of exhausted CD8 T cells from tumor
    v3 <- k_cell_clear*x_V_T_Th_exh   # R3 Clearance of exhausted CD4 T cells from tumor
    v4 <- k_C1_growth*x_V_T_C1*(1-C_total/C_max)   # R4 Cancer cell growth
    v5 <- a_k_C1_death*x_V_T_C1   # R5 Cancer cell death
    v6 <- Q_nT0_thym/div_T0   # R6 Thymic output of naive T cell to blood
    v7 <- k_nT0_pro/div_T0*x_V_P_nT0/(K_nT0_pro/div_T0+x_V_P_nT0)   # R7 Naive T cell proliferation in the peripheral compartment
    v8 <- k_nT0_pro/div_T0*x_V_LN_nT0/(K_nT0_pro/div_T0+x_V_LN_nT0)   # R8 Naive T cell proliferation in the TDLN compartment
    v9 <- k_nT0_death*x_V_P_nT0   # R9 Naive T cell death in the peripheral compartment
    v10 <- k_nT0_death*x_V_C_nT0   # R10 Naive T cell death in the central compartment
    v11 <- k_nT0_death*x_V_LN_nT0   # R11 Naive T cell death in the TDLN compartment
    v12 <- q_nT0_P_in*x_V_C_nT0   # R12 Naive T cell entry into the peripheral compartment
    v13 <- q_nT0_P_out*x_V_P_nT0   # R13 Naive T cell exit from the peripheral compartment
    v14 <- q_nT0_LN_in*x_V_C_nT0   # R14 Naive T cell entry into the lymph node
    v15 <- q_nT0_LN_out*x_V_LN_nT0   # R15 Naive T cell exit from the lymph node
    v16 <- k_T0_act*H_APC*H_P0*x_V_LN_nT0   # R16 Naive T cell activation
    v17 <- k_T0_act*H_APC*H_P0*x_V_LN_nT0*n_T0_clones   # R17 Naive T cell activation
    v18 <- k_T0_pro/N_aT0*x_V_LN_aT0   # R18 aT0 cell proliferation
    v19 <- k_T0_pro/N_aT0*2^N_aT0*x_V_LN_aT0   # R19 aT0 cell proliferation
    v20 <- k_T0_death*x_V_C_T0   # R20 T cell death in the central compartment
    v21 <- k_T0_death*x_V_P_T0   # R21 T cell death in the peripheral compartment
    v22 <- k_T0_death*x_V_LN_T0   # R22 T cell death in the lymph node compartment
    v23 <- k_T0_death*x_V_T_T0   # R23 T cell death in the tumor compartment
    v24 <- k_cell_clear*x_V_T_T0*(a_Kc_rec/(C_total^2+a_Kc_rec))   # R24 T cell clearance upon antigen clearance
    v25 <- q_T0_P_in*x_V_C_T0   # R25 T cell transport into the peripheral compartment
    v26 <- q_T0_P_out*x_V_P_T0   # R26 T cell transport out of the peripheral compartment
    v27 <- q_T0_T_in*vol_V_T*x_V_C_T0*(C_total^2/(C_total^2+a_Kc_rec))   # R27 T cell transport into the tumor compartment
    v28 <- q_T0_LN_out*x_V_LN_T0   # R28 T cell transport out of the lymph node compartment
    v29 <- k_IL2_deg*x_V_LN_IL2*m_V_LN   # R29 IL2 degradation
    v30 <- k_IL2_cons*x_V_LN_T1*x_V_LN_IL2/(a_IL2_50+x_V_LN_IL2)   # R30 IL2 consumption by T cells
    v31 <- k_IL2_cons*x_V_LN_T0*x_V_LN_IL2/(a_IL2_50_Treg+x_V_LN_IL2)   # R31 IL2 consumption by Tregs
    v32 <- Q_nT1_thym/div_T1   # R32 Thymic output of naive T cell to blood
    v33 <- k_nT1_pro/div_T1*x_V_P_nT1/(K_nT1_pro/div_T1+x_V_P_nT1)   # R33 Naive T cell proliferation in the peripheral compartment
    v34 <- k_nT1_pro/div_T1*x_V_LN_nT1/(K_nT1_pro/div_T1+x_V_LN_nT1)   # R34 Naive T cell proliferation in the TDLN compartment
    v35 <- k_nT1_death*x_V_P_nT1   # R35 Naive T cell death in the peripheral compartment
    v36 <- k_nT1_death*x_V_C_nT1   # R36 Naive T cell death in the central compartment
    v37 <- k_nT1_death*x_V_LN_nT1   # R37 Naive T cell death in the TDLN compartment
    v38 <- q_nT1_P_in*x_V_C_nT1   # R38 Naive T cell entry into the peripheral compartment
    v39 <- q_nT1_P_out*x_V_P_nT1   # R39 Naive T cell exit from the peripheral compartment
    v40 <- q_nT1_LN_in*x_V_C_nT1   # R40 Naive T cell entry into the lymph node
    v41 <- q_nT1_LN_out*x_V_LN_nT1   # R41 Naive T cell exit from the lymph node
    v42 <- k_T1_act*H_mAPC*H_P1*x_V_LN_nT1   # R42 Naive T cell activation
    v43 <- k_T1_act*H_mAPC*H_P1*x_V_LN_nT1*n_T1_clones   # R43 Naive T cell activation
    v44 <- k_T1_pro/N_aT*x_V_LN_aT1   # R44 aT1 cell proliferation
    v45 <- k_T1_pro/N_aT*2^N_aT*x_V_LN_aT1   # R45 aT1 cell proliferation
    v46 <- k_T1_death*x_V_C_T1   # R46 T cell death in the central compartment
    v47 <- k_T1_death*x_V_P_T1   # R47 T cell death in the peripheral compartment
    v48 <- k_T1_death*x_V_LN_T1   # R48 T cell death in the lymph node compartment
    v49 <- k_T1_death*x_V_T_T1   # R49 T cell death in the tumor compartment
    v50 <- k_cell_clear*x_V_T_T1*(a_Kc_rec/(C_total^2+a_Kc_rec))   # R50 T cell clearance upon antigen clearance
    v51 <- k_Treg*x_V_T_T1*Tregs_/(x_V_T_T1+Tregs_+a_cell)*H_IL10   # R51 T cell death from Tregs
    v52 <- k_T1*x_V_T_T1*C_total/(C_total+x_V_T_T1+a_cell)*H_PD1_C1   # R52 T cell death from cancer
    v53 <- q_T1_P_in*x_V_C_T1   # R53 T cell transport into the peripheral compartment
    v54 <- q_T1_P_out*x_V_P_T1   # R54 T cell transport out of the peripheral compartment
    v55 <- q_T1_T_in*vol_V_T*x_V_C_T1*(C_total^2/(C_total^2+a_Kc_rec))   # R55 T cell transport into the tumor compartment
    v56 <- q_T1_LN_out*x_V_LN_T1   # R56 T cell transport out of the lymph node compartment
    v57 <- k_IL2_sec*x_V_LN_aT1   # R57 IL2 secretion from activated T cells
    v58 <- k_IFNg_Tsec*x_V_T_T1   # R58 IFNg secretion from CD8 T cells in tumor
    v59 <- k_C_T1*x_V_T_C1*x_V_T_T1/(K_T_C*x_V_T_C1+x_V_T_T1+a_cell)*x_V_T_T1/(x_V_T_T1+K_T_Treg*Tregs_+a_cell)*(1-H_TGFb_Teff)*(1-H_PD1_C1)*(1-H_MDSC)   # R59 Cancer cell killing by T cells
    v60 <- k_APC_death*(APC0_T*vol_V_T-x_V_T_APC)   # R60 APC recruitment/death in the tumour
    v61 <- k_APC_death*(APC0_LN*m_V_LN-x_V_LN_APC)   # R61 APC recruitment/death in LN
    v62 <- k_APC_mat*x_V_T_APC*H_IL12*(1-H_IL10)   # R62 APC maturation in the tumour
    v63 <- k_APC_mig*x_V_T_mAPC   # R63 APC migration to the lymph node
    v64 <- k_mAPC_death*x_V_T_mAPC   # R64 mAPC death in the tumour
    v65 <- k_mAPC_death*x_V_LN_mAPC   # R65 mAPC death in the lymph node
    v66 <- kout*x_A_e_M1*m_A_e-kin*x_A_s_M1*m_A_s   # R66 MHC translocation
    v67 <- n_T0_clones*(P0_C1*(a_k_C1_death+k_C1_therapy)*x_V_T_C1+P0_C1*k_C_T1*x_V_T_C1*x_V_T_T1/(K_T_C*x_V_T_C1+x_V_T_T1+a_cell)*x_V_T_T1/(x_V_T_T1+K_T_Treg*Tregs_+a_cell)*(1-H_TGFb_Teff)*(1-H_PD1_C1)*(1-H_MDSC))   # R67 Antigen deposition from dying cancer cells
    v68 <- k_xP0_deg*x_V_T_P0*vol_V_T   # R68 Free antigen degradation
    v69 <- k_P0_up*x_V_T_APC*x_V_T_P0*vol_V_T   # R69 Antigen uptake by mature antigen presenting cells
    v70 <- k_P0_up*a_cell*x_V_T_P0*m_V_e   # R70 Antigen uptake by mature antigen presenting cells
    v71 <- k_P0_deg*x_V_e_P0*m_V_e   # R71 Antigen degradation in APC endosomes
    v72 <- k_p0_deg*x_V_e_p0*m_V_e   # R72 Epitope degradation in APC endosomes
    v73 <- k_P0_on*x_V_e_p0*x_A_e_M1*m_A_e   # R73 Antigen-MHC binding in endosome
    v74 <- k_P0_d1*k_P0_on*x_A_e_M1p0*m_A_e   # R74 Antigen-MHC unbinding in endosome
    v75 <- k_P0_d1*k_P0_on*x_A_s_M1p0*m_A_s   # R75 Antigen-MHC unbinding on APC surface
    v76 <- kout*x_A_e_M1p0*m_A_e   # R76 Antigen-MHC translocation
    v77 <- n_T1_clones*(P1_C1*(a_k_C1_death+k_C1_therapy)*x_V_T_C1+P1_C1*k_C_T1*x_V_T_C1*x_V_T_T1/(K_T_C*x_V_T_C1+x_V_T_T1+a_cell)*x_V_T_T1/(x_V_T_T1+K_T_Treg*Tregs_+a_cell)*(1-H_TGFb_Teff)*(1-H_PD1_C1)*(1-H_MDSC))   # R77 Antigen deposition from dying cancer cells
    v78 <- k_xP1_deg*x_V_T_P1*vol_V_T   # R78 Free antigen degradation
    v79 <- k_P1_up*x_V_T_APC*x_V_T_P1*vol_V_T   # R79 Antigen uptake by mature antigen presenting cells
    v80 <- k_P1_up*a_cell*x_V_T_P1*m_V_e   # R80 Antigen uptake by mature antigen presenting cells
    v81 <- k_P1_deg*x_V_e_P1*m_V_e   # R81 Antigen degradation in APC endosomes
    v82 <- k_p1_deg*x_V_e_p1*m_V_e   # R82 Epitope degradation in APC endosomes
    v83 <- k_P1_on*x_V_e_p1*x_A_e_M1*m_A_e   # R83 Antigen-MHC binding in endosome
    v84 <- k_P1_d1*k_P1_on*x_A_e_M1p1*m_A_e   # R84 Antigen-MHC unbinding in endosome
    v85 <- k_P1_d1*k_P1_on*x_A_s_M1p1*m_A_s   # R85 Antigen-MHC unbinding on APC surface
    v86 <- kout*x_A_e_M1p1*m_A_e   # R86 Antigen-MHC translocation
    v87 <- q_P_aPD1*(x_V_C_aPD1/gamma_C_aPD1-x_V_P_aPD1/gamma_P_aPD1)   # R87 aPD1 diffusive transport to peripheral compartment
    v88 <- q_T_aPD1*(x_V_C_aPD1/gamma_C_aPD1-x_V_T_aPD1/gamma_T_aPD1)   # R88 aPD1 diffusive transport to tumor compartment
    v89 <- q_LN_aPD1*(x_V_C_aPD1/gamma_C_aPD1-x_V_LN_aPD1/gamma_LN_aPD1)   # R89 aPD1 diffusive transport to lymph node compartment
    v90 <- q_LD_aPD1*vol_V_T*x_V_T_aPD1/gamma_T_aPD1   # R90 aPD1 convective transport from tumor to lymph node
    v91 <- q_LD_aPD1*vol_V_T*x_V_LN_aPD1/gamma_LN_aPD1   # R91 aPD1 convective transport from lymph node to central
    v92 <- k_cl_aPD1*x_V_C_aPD1   # R92 Drug clearance from central compartment
    v93 <- q_P_aPDL1*(x_V_C_aPDL1/gamma_C_aPDL1-x_V_P_aPDL1/gamma_P_aPDL1)   # R93 aPDL1 diffusive transport to peripheral compartment
    v94 <- q_T_aPDL1*(x_V_C_aPDL1/gamma_C_aPDL1-x_V_T_aPDL1/gamma_T_aPDL1)   # R94 aPDL1 diffusive transport to tumor compartment
    v95 <- q_LN_aPDL1*(x_V_C_aPDL1/gamma_C_aPDL1-x_V_LN_aPDL1/gamma_LN_aPDL1)   # R95 aPDL1 diffusive transport to lymph node compartment
    v96 <- q_LD_aPDL1*vol_V_T*x_V_T_aPDL1/gamma_T_aPDL1   # R96 aPDL1 convective transport from tumor to lymph node
    v97 <- q_LD_aPDL1*vol_V_T*x_V_LN_aPDL1/gamma_LN_aPDL1   # R97 aPDL1 convective transport from lymph node to central
    v98 <- k_cl_aPDL1*x_V_C_aPDL1   # R98 Drug clearance from central compartment
    v99 <- k_cln_aPDL1*x_V_C_aPDL1/(x_V_C_aPDL1+a_Kc_aPDL1)   # R99 Nonlinear clearance of aPDL1 from central compartment
    v100 <- q_P_aCTLA4*(x_V_C_aCTLA4/gamma_C_aCTLA4-x_V_P_aCTLA4/gamma_P_aCTLA4)   # R100 aCTLA4 diffusive transport to peripheral compartment
    v101 <- q_T_aCTLA4*(x_V_C_aCTLA4/gamma_C_aCTLA4-x_V_T_aCTLA4/gamma_T_aCTLA4)   # R101 aCTLA4 diffusive transport to tumor compartment
    v102 <- q_LN_aCTLA4*(x_V_C_aCTLA4/gamma_C_aCTLA4-x_V_LN_aCTLA4/gamma_LN_aCTLA4)   # R102 aCTLA4 diffusive transport to lymph node compartment
    v103 <- q_LD_aCTLA4*vol_V_T*x_V_T_aCTLA4/gamma_T_aCTLA4   # R103 aCTLA4 convective transport from tumor to lymph node
    v104 <- q_LD_aCTLA4*vol_V_T*x_V_LN_aCTLA4/gamma_LN_aCTLA4   # R104 aCTLA4 convective transport from lymph node to central
    v105 <- k_cl_aCTLA4*x_V_C_aCTLA4   # R105 Drug clearance from central compartment
    v106 <- k_out_PDL1*x_V_T_IFNg/(x_V_T_IFNg+a_IFNg_50_ind)*(1-x_syn_T_C1_PDL1_total/(C1_PDL1_base*r_PDL1_IFNg/A_cell))   # R106 Translocation of PDL1 between cell surface and cytoplasm
    v107 <- k_out_PDL1*r_PDL2C1*x_V_T_IFNg/(x_V_T_IFNg+a_IFNg_50_ind)*(1-x_syn_T_C1_PDL2_total/(C1_PDL1_base*r_PDL1_IFNg/A_cell*r_PDL2C1))   # R107 Translocation of PDL2 between cell surface and cytoplasm
    v108 <- k_in_PDL1*(C1_PDL1_base/A_cell-x_syn_T_C1_PDL1_total)   # R108 Translocation of PDL1 between cell surface and cytoplasm
    v109 <- k_in_PDL1*(C1_PDL1_base/A_cell*r_PDL2C1-x_syn_T_C1_PDL2_total)   # R109 Translocation of PDL2 between cell surface and cytoplasm
    v110 <- kon_PD1_PDL1*x_syn_T_C1_PD1*x_syn_T_C1_PDL1-koff_PD1_PDL1*x_syn_T_C1_PD1_PDL1   # R110 binding and unbinding of PD1 PDL1 in synapse
    v111 <- kon_PD1_PDL2*x_syn_T_C1_PD1*x_syn_T_C1_PDL2-koff_PD1_PDL2*x_syn_T_C1_PD1_PDL2   # R111 binding and unbinding of PD1 PDL2 in synapse
    v112 <- 2*kon_PD1_aPD1*(x_syn_T_C1_PD1*x_V_T_aPD1/gamma_T_aPD1)-koff_PD1_aPD1*x_syn_T_C1_PD1_aPD1   # R112 binding and unbinding of PD1 to aPD1 on T surface in synapse
    v113 <- Chi_PD1_aPD1*kon_PD1_aPD1*(x_syn_T_C1_PD1*x_syn_T_C1_PD1_aPD1)-2*koff_PD1_aPD1*x_syn_T_C1_PD1_aPD1_PD1   # R113 binding and unbinding of PD1 to PD1-aPD1 on T surface in synapse
    v114 <- 2*kon_PDL1_aPDL1*(x_syn_T_C1_PDL1*x_V_T_aPDL1/gamma_T_aPDL1)-koff_PDL1_aPDL1*x_syn_T_C1_PDL1_aPDL1   # R114 binding and unbinding of PDL1 to aPDL1 on C1 surface in synapse
    v115 <- Chi_PDL1_aPDL1*kon_PDL1_aPDL1*(x_syn_T_C1_PDL1*x_syn_T_C1_PDL1_aPDL1)-2*koff_PDL1_aPDL1*x_syn_T_C1_PDL1_aPDL1_PDL1   # R115 binding and unbinding of PDL1 to PDL1-aPDL1 on C1 surface in synapse
    v116 <- 2*kon_CD28_CD80*x_syn_T_C1_CD28*x_syn_T_C1_CD80-koff_CD28_CD80*x_syn_T_C1_CD28_CD80   # R116 binding and unbinding of CD28 and CD80 in synapse
    v117 <- kon_CD28_CD80*x_syn_T_C1_CD28*x_syn_T_C1_CD28_CD80-2*koff_CD28_CD80*x_syn_T_C1_CD28_CD80_CD28   # R117 binding and unbinding of CD28-CD80 and CD28 in synapse
    v118 <- kon_CD28_CD86*x_syn_T_C1_CD28*x_syn_T_C1_CD86-koff_CD28_CD86*x_syn_T_C1_CD28_CD86   # R118 binding and unbinding of CD28 and CD86 in synapse
    v119 <- 4*kon_CTLA4_CD80*x_syn_T_C1_CTLA4*x_syn_T_C1_CD80-koff_CTLA4_CD80*x_syn_T_C1_CD80_CTLA4   # R119 binding and unbinding of CTLA4 and CD80 in synapse
    v120 <- 2*kon_CTLA4_CD80*x_syn_T_C1_CTLA4*x_syn_T_C1_CD80_CTLA4-2*koff_CTLA4_CD80*x_syn_T_C1_CTLA4_CD80_CTLA4   # R120 binding and unbinding of CTLA4 and CD80-CTLA4 in synapse
    v121 <- 4*kon_CTLA4_CD80*x_syn_T_C1_CD80*x_syn_T_C1_CTLA4_CD80_CTLA4-koff_CTLA4_CD80*x_syn_T_C1_CD80_CTLA4_CD80_CTLA4   # R121 binding and unbinding of CD80 and CTLA4-CD80-CTLA4 in synapse
    v122 <- 2*kon_CTLA4_CD80*x_syn_T_C1_CD80_CTLA4*x_syn_T_C1_CD80-2*koff_CTLA4_CD80*x_syn_T_C1_CD80_CTLA4_CD80   # R122 binding and unbinding of CD80-CTLA4 and CD80 in synapse
    v123 <- 4*kon_CTLA4_CD80*x_syn_T_C1_CTLA4*x_syn_T_C1_CD80_CTLA4_CD80-koff_CTLA4_CD80*x_syn_T_C1_CD80_CTLA4_CD80_CTLA4   # R123 binding and unbinding of CTLA4 and CD80-CTLA4-CD80 in synapse
    v124 <- 2*kon_CTLA4_CD86*x_syn_T_C1_CTLA4*x_syn_T_C1_CD86-koff_CTLA4_CD86*x_syn_T_C1_CD86_CTLA4   # R124 binding and unbinding of CTLA4 and CD86 in synapse
    v125 <- kon_CTLA4_CD86*x_syn_T_C1_CD86_CTLA4*x_syn_T_C1_CD86-2*koff_CTLA4_CD86*x_syn_T_C1_CD86_CTLA4_CD86   # R125 binding and unbinding of CD86-CTLA4 and CD86 in synapse
    v126 <- 4*kon_CTLA4_aCTLA4*(x_syn_T_C1_CTLA4*x_V_T_aCTLA4/gamma_T_aCTLA4)-koff_CTLA4_aCTLA4*x_syn_T_C1_CTLA4_aCTLA4   # R126 binding and unbinding of CTLA4 to aCTLA4 on T surface in synapse
    v127 <- 2*Chi_CTLA4_aCTLA4*kon_CTLA4_aCTLA4*(x_syn_T_C1_CTLA4*x_syn_T_C1_CTLA4_aCTLA4)-2*koff_CTLA4_aCTLA4*x_syn_T_C1_CTLA4_aCTLA4_CTLA4   # R127 binding and unbinding of CTLA4 to aCTLA4 on T surface in synapse
    v128 <- kon_CD80_CD80*x_syn_T_C1_CD80m*x_syn_T_C1_CD80m-koff_CD80_CD80*x_syn_T_C1_CD80   # R128 self-association and dissociation of CD80 monomers in synapse
    v129 <- kon_CD80_PDL1*x_syn_T_C1_CD80m*x_syn_T_C1_PDL1-koff_CD80_PDL1*x_syn_T_C1_PDL1_CD80   # R129 binding and unbinding of CD80 and PDL1 in synapse
    v130 <- kon_CD28_CD80*x_syn_T_C1_PDL1_CD80*x_syn_T_C1_CD28-koff_CD28_CD80*x_syn_T_C1_PDL1_CD80_CD28   # R130 binding and unbinding of PDL1-CD80 and CD28 in synapse
    v131 <- 2*kon_CTLA4_CD80*x_syn_T_C1_PDL1_CD80*x_syn_T_C1_CTLA4-koff_CTLA4_CD80*x_syn_T_C1_PDL1_CD80_CTLA4   # R131 binding and unbinding of PDL1-CD80 and CTLA4 in synapse
    v132 <- 2*kon_PDL1_aPDL1*(x_syn_T_C1_TPDL1*x_V_T_aPDL1/gamma_T_aPDL1)-koff_PDL1_aPDL1*x_syn_T_C1_TPDL1_aPDL1   # R132 binding and unbinding of PDL1 to aPDL1 on C1 surface in synapse
    v133 <- Chi_PDL1_aPDL1*kon_PDL1_aPDL1*(x_syn_T_C1_TPDL1*x_syn_T_C1_TPDL1_aPDL1)-2*koff_PDL1_aPDL1*x_syn_T_C1_TPDL1_aPDL1_TPDL1   # R133 binding and unbinding of PDL1 to PDL1-aPDL1 on C1 surface in synapse
    v134 <- k_out_PDL1*x_V_T_IFNg/(x_V_T_IFNg+a_IFNg_50_ind)*(1-x_syn_T_APC_PDL1_total/(APC_PDL1_base*r_PDL1_IFNg/A_cell))   # R134 Translocation of PDL1 between cell surface and cytoplasm
    v135 <- k_out_PDL1*r_PDL2APC*x_V_T_IFNg/(x_V_T_IFNg+a_IFNg_50_ind)*(1-x_syn_T_APC_PDL2_total/(APC_PDL1_base*r_PDL1_IFNg/A_cell*r_PDL2APC))   # R135 Translocation of PDL2 between cell surface and cytoplasm
    v136 <- k_in_PDL1*(APC_PDL1_base/A_cell-x_syn_T_APC_PDL1_total)   # R136 Translocation of PDL1 between cell surface and cytoplasm
    v137 <- k_in_PDL1*(APC_PDL1_base/A_cell*r_PDL2APC-x_syn_T_APC_PDL2_total)   # R137 Translocation of PDL2 between cell surface and cytoplasm
    v138 <- kon_PD1_PDL1*x_syn_T_APC_PD1*x_syn_T_APC_PDL1-koff_PD1_PDL1*x_syn_T_APC_PD1_PDL1   # R138 binding and unbinding of PD1 PDL1 in synapse
    v139 <- kon_PD1_PDL2*x_syn_T_APC_PD1*x_syn_T_APC_PDL2-koff_PD1_PDL2*x_syn_T_APC_PD1_PDL2   # R139 binding and unbinding of PD1 PDL2 in synapse
    v140 <- 2*kon_PD1_aPD1*(x_syn_T_APC_PD1*x_V_LN_aPD1/gamma_LN_aPD1)-koff_PD1_aPD1*x_syn_T_APC_PD1_aPD1   # R140 binding and unbinding of PD1 to aPD1 on T surface in synapse
    v141 <- Chi_PD1_aPD1*kon_PD1_aPD1*(x_syn_T_APC_PD1*x_syn_T_APC_PD1_aPD1)-2*koff_PD1_aPD1*x_syn_T_APC_PD1_aPD1_PD1   # R141 binding and unbinding of PD1 to PD1-aPD1 on T surface in synapse
    v142 <- 2*kon_PDL1_aPDL1*(x_syn_T_APC_PDL1*x_V_LN_aPDL1/gamma_LN_aPDL1)-koff_PDL1_aPDL1*x_syn_T_APC_PDL1_aPDL1   # R142 binding and unbinding of PDL1 to aPDL1 on APC surface in synapse
    v143 <- Chi_PDL1_aPDL1*kon_PDL1_aPDL1*(x_syn_T_APC_PDL1*x_syn_T_APC_PDL1_aPDL1)-2*koff_PDL1_aPDL1*x_syn_T_APC_PDL1_aPDL1_PDL1   # R143 binding and unbinding of PDL1 to PDL1-aPDL1 on APC surface in synapse
    v144 <- 2*kon_CD28_CD80*x_syn_T_APC_CD28*x_syn_T_APC_CD80-koff_CD28_CD80*x_syn_T_APC_CD28_CD80   # R144 binding and unbinding of CD28 and CD80 in synapse
    v145 <- kon_CD28_CD80*x_syn_T_APC_CD28*x_syn_T_APC_CD28_CD80-2*koff_CD28_CD80*x_syn_T_APC_CD28_CD80_CD28   # R145 binding and unbinding of CD28-CD80 and CD28 in synapse
    v146 <- kon_CD28_CD86*x_syn_T_APC_CD28*x_syn_T_APC_CD86-koff_CD28_CD86*x_syn_T_APC_CD28_CD86   # R146 binding and unbinding of CD28 and CD86 in synapse
    v147 <- 4*kon_CTLA4_CD80*x_syn_T_APC_CTLA4*x_syn_T_APC_CD80-koff_CTLA4_CD80*x_syn_T_APC_CD80_CTLA4   # R147 binding and unbinding of CTLA4 and CD80 in synapse
    v148 <- 2*kon_CTLA4_CD80*x_syn_T_APC_CTLA4*x_syn_T_APC_CD80_CTLA4-2*koff_CTLA4_CD80*x_syn_T_APC_CTLA4_CD80_CTLA4   # R148 binding and unbinding of CTLA4 and CD80-CTLA4 in synapse
    v149 <- 4*kon_CTLA4_CD80*x_syn_T_APC_CD80*x_syn_T_APC_CTLA4_CD80_CTLA4-koff_CTLA4_CD80*x_syn_T_APC_CD80_CTLA4_CD80_CTLA4   # R149 binding and unbinding of CD80 and CTLA4-CD80-CTLA4 in synapse
    v150 <- 2*kon_CTLA4_CD80*x_syn_T_APC_CD80_CTLA4*x_syn_T_APC_CD80-2*koff_CTLA4_CD80*x_syn_T_APC_CD80_CTLA4_CD80   # R150 binding and unbinding of CD80-CTLA4 and CD80 in synapse
    v151 <- 4*kon_CTLA4_CD80*x_syn_T_APC_CTLA4*x_syn_T_APC_CD80_CTLA4_CD80-koff_CTLA4_CD80*x_syn_T_APC_CD80_CTLA4_CD80_CTLA4   # R151 binding and unbinding of CTLA4 and CD80-CTLA4-CD80 in synapse
    v152 <- 2*kon_CTLA4_CD86*x_syn_T_APC_CTLA4*x_syn_T_APC_CD86-koff_CTLA4_CD86*x_syn_T_APC_CD86_CTLA4   # R152 binding and unbinding of CTLA4 and CD86 in synapse
    v153 <- kon_CTLA4_CD86*x_syn_T_APC_CD86_CTLA4*x_syn_T_APC_CD86-2*koff_CTLA4_CD86*x_syn_T_APC_CD86_CTLA4_CD86   # R153 binding and unbinding of CD86-CTLA4 and CD86 in synapse
    v154 <- 4*kon_CTLA4_aCTLA4*(x_syn_T_APC_CTLA4*x_V_LN_aCTLA4/gamma_LN_aCTLA4)-koff_CTLA4_aCTLA4*x_syn_T_APC_CTLA4_aCTLA4   # R154 binding and unbinding of CTLA4 to aCTLA4 on T surface in synapse
    v155 <- 2*Chi_CTLA4_aCTLA4*kon_CTLA4_aCTLA4*(x_syn_T_APC_CTLA4*x_syn_T_APC_CTLA4_aCTLA4)-2*koff_CTLA4_aCTLA4*x_syn_T_APC_CTLA4_aCTLA4_CTLA4   # R155 binding and unbinding of CTLA4 to aCTLA4 on T surface in synapse
    v156 <- kon_CD80_CD80*x_syn_T_APC_CD80m*x_syn_T_APC_CD80m-koff_CD80_CD80*x_syn_T_APC_CD80   # R156 self-association and dissociation of CD80 monomers in synapse
    v157 <- kon_CD80_PDL1*x_syn_T_APC_CD80m*x_syn_T_APC_PDL1-koff_CD80_PDL1*x_syn_T_APC_PDL1_CD80   # R157 binding and unbinding of CD80 and PDL1 in synapse
    v158 <- kon_CD28_CD80*x_syn_T_APC_PDL1_CD80*x_syn_T_APC_CD28-koff_CD28_CD80*x_syn_T_APC_PDL1_CD80_CD28   # R158 binding and unbinding of PDL1-CD80 and CD28 in synapse
    v159 <- 2*kon_CTLA4_CD80*x_syn_T_APC_PDL1_CD80*x_syn_T_APC_CTLA4-koff_CTLA4_CD80*x_syn_T_APC_PDL1_CD80_CTLA4   # R159 binding and unbinding of PDL1-CD80 and CTLA4 in synapse
    v160 <- 2*kon_PDL1_aPDL1*(x_syn_T_APC_TPDL1*x_V_LN_aPDL1/gamma_LN_aPDL1)-koff_PDL1_aPDL1*x_syn_T_APC_TPDL1_aPDL1   # R160 binding and unbinding of PDL1 to aPDL1 on APC surface in synapse
    v161 <- Chi_PDL1_aPDL1*kon_PDL1_aPDL1*(x_syn_T_APC_TPDL1*x_syn_T_APC_TPDL1_aPDL1)-2*koff_PDL1_aPDL1*x_syn_T_APC_TPDL1_aPDL1_TPDL1   # R161 binding and unbinding of PDL1 to PDL1-aPDL1 on APC surface in synapse
    v162 <- k_Th_act*H_APCh*H_P1*x_V_LN_nT0   # R162 Naive T cell activation
    v163 <- k_Th_act*H_APCh*H_P1*x_V_LN_nT0*n_T1_clones   # R163 Naive T cell activation
    v164 <- k_T0_pro/N_aTh*x_V_LN_aTh   # R164 aTh cell proliferation
    v165 <- k_T0_pro/N_aTh*2^N_aTh*x_V_LN_aTh   # R165 aTh cell proliferation
    v166 <- k_Th_Treg*x_V_T_Th*H_TGFb*H_ArgI_Treg   # R166 Differentiation between Treg and Th Cells
    v167 <- k_T0_death*x_V_C_Th   # R167 T cell death in the central compartment
    v168 <- k_T0_death*x_V_P_Th   # R168 T cell death in the peripheral compartment
    v169 <- k_T0_death*x_V_LN_Th   # R169 T cell death in the lymph node compartment
    v170 <- k_T0_death*x_V_T_Th   # R170 T cell death in the tumor compartment
    v171 <- k_cell_clear*x_V_T_Th*(a_Kc_rec/(C_total^2+a_Kc_rec))   # R171 T cell clearance upon antigen clearance
    v172 <- q_T0_P_in*x_V_C_Th   # R172 T cell transport into the peripheral compartment
    v173 <- q_T0_P_out*x_V_P_Th   # R173 T cell transport out of the peripheral compartment
    v174 <- q_T0_T_in*vol_V_T*x_V_C_Th*(C_total^2/(C_total^2+a_Kc_rec))   # R174 T cell transport into the tumor compartment
    v175 <- q_T0_LN_out*x_V_LN_Th   # R175 T cell transport out of the lymph node compartment
    v176 <- k_IL2_sec*x_V_LN_aTh   # R176 IL2 secretion from activated T cells
    v177 <- k_TGFb_deg*(a_TGFbase-x_V_T_TGFb)*vol_V_T   # R177 TGFb secretion by triple-negative breast cancer cells
    v178 <- k_TGFb_Tsec*x_V_T_T0   # R178 TGFb secretion from activated T cells in tumor
    v179 <- k_IFNg_Thsec*x_V_T_Th   # R179 IFNg secretion from CD4 T cells in tumor
    v180 <- k_IFNg_deg*x_V_T_IFNg   # R180 IFNg degradtion in tumor
    v181 <- k_CCL2_sec*C_total   # R181 CCL2 secretion by MDSCs and cancer cells
    v182 <- k_CCL2_deg*x_V_T_CCL2   # R182 CCL2 degradation
    v183 <- k_MDSC_rec*vol_V_T*(x_V_T_CCL2/(x_V_T_CCL2+a_CCL2_50))   # R183 Recruitment of macrophage to tumor
    v184 <- k_MDSC_death*x_V_T_MDSC   # R184 MDSC death in the tumor compartment
    v185 <- k_cell_clear*x_V_T_MDSC*(a_Kc_rec/(C_total^2+a_Kc_rec))   # R185 MDSC death upon tumor eradication
    v186 <- k_NO_deg*x_V_T_NO   # R186 NO degradation
    v187 <- k_ArgI_deg*x_V_T_ArgI   # R187 ArgI degradation
    v188 <- k_NO_sec*x_V_T_MDSC   # R188 NO secretion from MDSC
    v189 <- k_ArgI_sec*x_V_T_MDSC   # R189 ArgI secretion from MDSC
    v190 <- k_Mac_rec*vol_V_T*(x_V_T_CCL2/(x_V_T_CCL2+a_CCL2_50))   # R190 Recruitment of pro-inflammatory M1 macrophage to tumor
    v191 <- k_cell_clear*x_V_T_Mac_M1*(a_Kc_rec/(C_total^2+a_Kc_rec))   # R191 Macrophage death upon tumor eradication
    v192 <- k_cell_clear*x_V_T_Mac_M2*(a_Kc_rec/(C_total^2+a_Kc_rec))   # R192 Macrophage death upon tumor eradication
    v193 <- k_Mac_death*x_V_T_Mac_M1   # R193 Death of macrophage in tumor
    v194 <- k_Mac_death*x_V_T_Mac_M2   # R194 Death of macrophage in tumor
    v195 <- k_IL12_sec*x_V_T_mAPC   # R195 Secretion of IL-12 by APC in the tumor
    v196 <- k_IL12_Msec*x_V_T_Mac_M1   # R196 Secretion of IL-12 by macrophage in tumor
    v197 <- k_IL12_deg*x_V_T_IL12   # R197 Degradation of IL-12 in tumor
    v198 <- k_TGFb_Msec*x_V_T_Mac_M2   # R198 Secretion of TGFb by macrophage in tumor
    v199 <- k_IL10_sec*x_V_T_Mac_M2   # R199 Secretion of IL-10 by macrophage in tumor
    v200 <- k_IL10_deg*x_V_T_IL10   # R200 Degradation of IL-10 in tumor
    v201 <- k_M2_pol*x_V_T_Mac_M1*(x_V_T_TGFb/(x_V_T_TGFb+a_TGFb_50)+x_V_T_IL10/(x_V_T_IL10+a_IL10_50))   # R201 M1 to M2 macrophage polarization in tumor
    v202 <- k_M1_pol*x_V_T_Mac_M2*(x_V_T_IL12/(x_V_T_IL12+a_IL12_50)+x_V_T_IFNg/(x_V_T_IFNg+a_IFNg_50))   # R202 M2 to M1 macrophage polarization in tumor
    v203 <- q_P_aCD47*(x_V_C_aCD47/gamma_C_aCD47-x_V_P_aCD47/gamma_P_aCD47)   # R203 aCD47 diffusive transport to peripheral compartment
    v204 <- q_T_aCD47*(x_V_C_aCD47/gamma_C_aCD47-x_V_T_aCD47/gamma_T_aCD47)   # R204 aCD47 diffusive transport to tumor compartment
    v205 <- q_LN_aCD47*(x_V_C_aCD47/gamma_C_aCD47-x_V_LN_aCD47/gamma_LN_aCD47)   # R205 aCD47 diffusive transport to lymph node compartment
    v206 <- q_LD_aCD47*vol_V_T*x_V_T_aCD47/gamma_T_aCD47   # R206 aCD47 convective transport from tumor to lymph node
    v207 <- q_LD_aCD47*vol_V_T*x_V_LN_aCD47/gamma_LN_aCD47   # R207 aCD47 convective transport from lymph node to central
    v208 <- k_cl_aCD47*x_V_C_aCD47   # R208 Drug clearance from central compartment
    v209 <- kdeg_CD47*RBC_CD47/gamma_C_aCD47   # R209 Production of CD47 on red blood cell
    v210 <- kdeg_CD47*x_V_C_CD47/gamma_C_aCD47   # R210 Internalization of CD47 on red blood cell
    v211 <- kint_CD47*x_V_C_CD47_aCD47/gamma_C_aCD47   # R211 Internalization of CD47-aCD47 on red blood cell
    v212 <- kint_CD47*x_V_C_CD47_aCD47_CD47/gamma_C_aCD47   # R212 Internalization of CD47-aCD47-CD47 on red blood cell
    v213 <- 2*kon_CD47_aCD47*x_V_C_aCD47/gamma_C_aCD47*x_V_C_CD47/gamma_C_aCD47-koff_CD47_aCD47*x_V_C_CD47_aCD47/gamma_C_aCD47   # R213 Binding and unbinding of anti-CD47 antibody to CD47 on red blood cell
    v214 <- Chi_CD47_aCD47_3D*kon_CD47_aCD47*x_V_C_CD47_aCD47/gamma_C_aCD47*x_V_C_CD47/gamma_C_aCD47-2*koff_CD47_aCD47*x_V_C_CD47_aCD47_CD47/gamma_C_aCD47   # R214 Binding and unbinding of CD47-aCD47 complex to CD47 on red blood cell
    v215 <- kint_aCD47*x_V_C_aCD47/gamma_C_aCD47   # R215 Internalization of anti-CD47 antibody by endothelial cells
    v216 <- koff_FcRn_aCD47/kd_FcRn_aCD47*x_V_endo_aCD47*x_V_endo_FcRn-koff_FcRn_aCD47*x_V_endo_FcRn_aCD47   # R216 Binding and unbinding of anti-CD47 antibody to neonatal Fc receptor in the endosomal compartment
    v217 <- krec_aCD47*x_V_endo_FcRn_aCD47   # R217 Recycling of anti-CD47 antibody from endothelial cell back into plasma
    v218 <- kdeg_aCD47*x_V_endo_aCD47   # R218 Degradation of anti-CD47 antibody in the endosomal compartment
    v219 <- k_out_PDL1*x_V_T_IFNg/(x_V_T_IFNg+a_IFNg_50_ind)*(1-x_syn_M_C_PDL1_total/(C1_PDL1_base*r_PDL1_IFNg/A_cell))   # R219 Translocation of PDL1 between cell surface and cytoplasm
    v220 <- k_out_PDL1*r_PDL2C1*x_V_T_IFNg/(x_V_T_IFNg+a_IFNg_50_ind)*(1-x_syn_M_C_PDL2_total/(C1_PDL1_base*r_PDL1_IFNg/A_cell*r_PDL2C1))   # R220 Translocation of PDL2 between cell surface and cytoplasm
    v221 <- k_in_PDL1*(C1_PDL1_base/A_cell-x_syn_M_C_PDL1_total)   # R221 Translocation of PDL1 between cell surface and cytoplasm
    v222 <- k_in_PDL1*(C1_PDL1_base/A_cell*r_PDL2C1-x_syn_M_C_PDL2_total)   # R222 Translocation of PDL2 between cell surface and cytoplasm
    v223 <- kdeg_CD47*A_syn*C_CD47   # R223 Translocation of CD47 between cell surface and cytoplasm
    v224 <- kdeg_CD47*x_syn_M_C_CD47   # R224 Internalization of CD47 on cancer cell
    v225 <- kon_CD47_SIRPa*x_syn_M_C_CD47*x_syn_M_C_SIRPa-koff_CD47_SIRPa*x_syn_M_C_CD47_SIRPa   # R225 binding and unbinding of CD47-SIRPa in synapse
    v226 <- kon_PD1_PDL1*x_syn_M_C_PD1*x_syn_M_C_PDL1-koff_PD1_PDL1*x_syn_M_C_PD1_PDL1   # R226 binding and unbinding of PD1 PDL1 in synapse
    v227 <- kon_PD1_PDL2*x_syn_M_C_PD1*x_syn_M_C_PDL2-koff_PD1_PDL2*x_syn_M_C_PD1_PDL2   # R227 binding and unbinding of PD1 PDL2 in synapse
    v228 <- 2*kon_PD1_aPD1*(x_syn_M_C_PD1*x_V_T_aPD1/gamma_T_aPD1)-koff_PD1_aPD1*x_syn_M_C_PD1_aPD1   # R228 binding and unbinding of PD1 to aPD1 on macrophage surface in synapse
    v229 <- Chi_PD1_aPD1*kon_PD1_aPD1*(x_syn_M_C_PD1*x_syn_M_C_PD1_aPD1)-2*koff_PD1_aPD1*x_syn_M_C_PD1_aPD1_PD1   # R229 binding and unbinding of PD1 to PD1-aPD1 on macrophage surface in synapse
    v230 <- 2*kon_PDL1_aPDL1*(x_syn_M_C_PDL1*x_V_T_aPDL1/gamma_T_aPDL1)-koff_PDL1_aPDL1*x_syn_M_C_PDL1_aPDL1   # R230 binding and unbinding of PDL1 to aPDL1 on C1 surface in synapse
    v231 <- Chi_PDL1_aPDL1*kon_PDL1_aPDL1*(x_syn_M_C_PDL1*x_syn_M_C_PDL1_aPDL1)-2*koff_PDL1_aPDL1*x_syn_M_C_PDL1_aPDL1_PDL1   # R231 binding and unbinding of PDL1 to PDL1-aPDL1 on cancer cell surface in synapse
    v232 <- kon_CD80_CD80*x_syn_M_C_CD80m*x_syn_M_C_CD80m-koff_CD80_CD80*x_syn_M_C_CD80   # R232 self-association and dissociation of CD80 monomers in synapse
    v233 <- kon_CD80_PDL1*x_syn_M_C_CD80m*x_syn_M_C_PDL1-koff_CD80_PDL1*x_syn_M_C_PDL1_CD80   # R233 binding and unbinding of CD80 and PDL1 in synapse
    v234 <- 2*kon_CD47_aCD47*(x_syn_M_C_CD47*x_V_T_aCD47/gamma_T_aCD47)-koff_CD47_aCD47*x_syn_M_C_CD47_aCD47   # R234 binding and unbinding of CD47 to aCD47 on cancer cell surface in synapse
    v235 <- Chi_CD47_aCD47_3D*kon_CD47_aCD47/d_syn*(x_syn_M_C_CD47*x_syn_M_C_CD47_aCD47)-2*koff_CD47_aCD47*x_syn_M_C_CD47_aCD47_CD47   # R235 binding and unbinding of CD47 to CD47-aCD47 on cancer cell surface in synapse
    v236 <- kint_CD47*x_syn_M_C_CD47_aCD47   # R236 Internalization of CD47-aCD47 on cancer cell
    v237 <- kint_CD47*x_syn_M_C_CD47_aCD47_CD47   # R237 Internalization of CD47-aCD47-CD47 on cancer cell
    v238 <- k_M1_phago*x_V_T_C1*x_V_T_Mac_M1/(x_V_T_Mac_M1+K_Mac_C*x_V_T_C1+a_cell)*(1-H_Mac_C)*(1-H_IL10_phago)   # R238 M1 macrophage-mediated killing of cancer cell

    # ---- initial conditions (Table S3 + initialAssignment rules of Table S5) ----
    q_V_C_nT0(0) <- 6.155446542109949e-12   # Table S3 (3706.896551724138 cell)
    q_V_C_nT1(0) <- 3.777352382535101e-12   # Table S3 (2274.774774774775 cell)
    q_V_C_CD47(0) <- (RBC_CD47/m_V_C)*m_V_C   # Table S5 initialAssignment
    q_V_P_nT0(0) <- 3.0777232710549745e-10   # Table S3 (185344.8275862069 cell)
    q_V_P_nT1(0) <- 1.8886761912675508e-10   # Table S3 (113738.73873873874 cell)
    q_V_T_C1(0) <- 1.6605390671738466e-15   # Table S3 (1 cell)
    q_V_T_P0(0) <- 1e-18   # Table S3 (1e-18 molarity)
    q_V_T_P1(0) <- 1e-18   # Table S3 (1e-18 molarity)
    q_V_LN_nT0(0) <- 2.585287547686178e-13   # Table S3 (155.68965517241378 cell)
    q_V_LN_IL2(0) <- 2.611448893296516e-07   # Table S3 (0.00019 nanomolarity)
    q_V_LN_nT1(0) <- 1.8886761912675507e-13   # Table S3 (113.73873873873873 cell)
    q_V_e_P0(0) <- 4.0000000000000006e-25   # Table S3 (1e-18 molarity)
    q_V_e_p0(0) <- 4.0000000000000006e-25   # Table S3 (1e-18 molarity)
    q_V_e_P1(0) <- 4.0000000000000006e-25   # Table S3 (1e-18 molarity)
    q_V_e_p1(0) <- 4.0000000000000006e-25   # Table S3 (1e-18 molarity)
    q_A_e_M1(0) <- 5.4443903841765467e-11   # Table S3 (2185.792349726776 molecule/micrometer^2)
    q_A_e_M1p0(0) <- 2.49080860076077e-20   # Table S3 (1e-06 molecule/micrometer^2)
    q_A_e_M1p1(0) <- 2.49080860076077e-20   # Table S3 (1e-06 molecule/micrometer^2)
    q_A_s_M1(0) <- 1.494485160456462e-18   # Table S3 (1e-06 molecule/micrometer^2)
    q_A_s_M1p0(0) <- 1.494485160456462e-18   # Table S3 (1e-06 molecule/micrometer^2)
    q_A_s_M1p1(0) <- 1.494485160456462e-18   # Table S3 (1e-06 molecule/micrometer^2)
    q_syn_T_C1_PD1(0) <- (T_PD1_total/A_Tcell)*m_syn_T_C1   # Table S5 initialAssignment
    q_syn_T_C1_PDL1(0) <- (C1_PDL1_base/A_cell)*m_syn_T_C1   # Table S5 initialAssignment
    q_syn_T_C1_PDL2(0) <- (C1_PDL1_base*r_PDL2C1/A_cell)*m_syn_T_C1   # Table S5 initialAssignment
    q_syn_T_C1_TPDL1(0) <- (T_PDL1_total/A_Tcell)*m_syn_T_C1   # Table S5 initialAssignment
    q_syn_T_C1_CD28(0) <- (T_CD28_total/A_Tcell)*m_syn_T_C1   # Table S5 initialAssignment
    q_syn_T_C1_CTLA4(0) <- (T_CTLA4_syn/A_Tcell)*m_syn_T_C1   # Table S5 initialAssignment
    q_syn_T_C1_CD80(0) <- (C1_CD80_total/A_cell)*m_syn_T_C1   # Table S5 initialAssignment
    q_syn_T_C1_CD86(0) <- (C1_CD86_total/A_cell)*m_syn_T_C1   # Table S5 initialAssignment
    q_syn_T_APC_PD1(0) <- (T_PD1_total/A_Tcell)*m_syn_T_APC   # Table S5 initialAssignment
    q_syn_T_APC_PDL1(0) <- (APC_PDL1_base/A_APC)*m_syn_T_APC   # Table S5 initialAssignment
    q_syn_T_APC_PDL2(0) <- (APC_PDL1_base*r_PDL2APC/A_APC)*m_syn_T_APC   # Table S5 initialAssignment
    q_syn_T_APC_TPDL1(0) <- (T_PDL1_total/A_Tcell)*m_syn_T_APC   # Table S5 initialAssignment
    q_syn_T_APC_CD28(0) <- (T_CD28_total/A_Tcell)*m_syn_T_APC   # Table S5 initialAssignment
    q_syn_T_APC_CTLA4(0) <- (T_CTLA4_syn/A_Tcell)*m_syn_T_APC   # Table S5 initialAssignment
    q_syn_T_APC_CD80(0) <- (APC_CD80_total/A_APC)*m_syn_T_APC   # Table S5 initialAssignment
    q_syn_T_APC_CD86(0) <- (APC_CD86_total/A_APC)*m_syn_T_APC   # Table S5 initialAssignment
    q_syn_M_C_CD47(0) <- (C_CD47)*m_syn_M_C   # Table S5 initialAssignment
    q_syn_M_C_SIRPa(0) <- (M_SIRPa)*m_syn_M_C   # Table S5 initialAssignment
    q_syn_M_C_PD1(0) <- (M_PD1_total/A_Mcell)*m_syn_M_C   # Table S5 initialAssignment
    q_syn_M_C_PDL1(0) <- (C1_PDL1_base/A_cell)*m_syn_M_C   # Table S5 initialAssignment
    q_syn_M_C_PDL2(0) <- (C1_PDL1_base*r_PDL2C1/A_cell)*m_syn_M_C   # Table S5 initialAssignment
    q_syn_M_C_CD80(0) <- (C1_CD80_total/A_cell)*m_syn_M_C   # Table S5 initialAssignment
    q_V_endo_FcRn(0) <- 14008.000000000002   # Table S3 (41.2 micromolarity)

    # ---- ODEs (amounts) ----
    d/dt(q_V_C_nT0) <- v6-v10-v12+v13-v14+v15
    d/dt(q_V_C_T0) <- -v20-v25+v26-v27+v28
    d/dt(q_V_C_nT1) <- v32-v36-v38+v39-v40+v41
    d/dt(q_V_C_T1) <- -v46-v53+v54-v55+v56
    d/dt(q_V_C_aPD1) <- -v87-v88-v89+v91-v92
    d/dt(q_V_C_aPDL1) <- -v93-v94-v95+v97-v98-v99
    d/dt(q_V_C_aCTLA4) <- -v100-v101-v102+v104-v105
    d/dt(q_V_C_Th) <- -v167-v172+v173-v174+v175
    d/dt(q_V_C_aCD47) <- -v203-v204-v205+v207-v208-v213*m_V_C-v215*m_V_C+v217*m_V_endo
    d/dt(q_V_C_CD47) <- v209-v210*m_V_C-v213*m_V_C-v214*m_V_C
    d/dt(q_V_C_CD47_aCD47) <- -v211*m_V_C+v213*m_V_C-v214*m_V_C
    d/dt(q_V_C_CD47_aCD47_CD47) <- -v212*m_V_C+v214*m_V_C
    d/dt(q_V_P_nT0) <- v7-v9+v12-v13
    d/dt(q_V_P_T0) <- -v21+v25-v26
    d/dt(q_V_P_nT1) <- v33-v35+v38-v39
    d/dt(q_V_P_T1) <- -v47+v53-v54
    d/dt(q_V_P_aPD1) <- v87
    d/dt(q_V_P_aPDL1) <- v93
    d/dt(q_V_P_aCTLA4) <- v100
    d/dt(q_V_P_Th) <- -v168+v172-v173
    d/dt(q_V_P_aCD47) <- v203
    d/dt(q_V_T_C_x) <- -v1+v5+v59+v238
    d/dt(q_V_T_T1_exh) <- -v2+v49+v50+v51+v52
    d/dt(q_V_T_Th_exh) <- -v3+v170+v171
    d/dt(q_V_T_C1) <- v4-v5-v59-v238
    d/dt(q_V_T_T0) <- -v23-v24+v27+v166
    d/dt(q_V_T_T1) <- -v49-v50-v51-v52+v55
    d/dt(q_V_T_IFNg) <- v58+v179-v180*vol_V_T
    d/dt(q_V_T_APC) <- v60-v62
    d/dt(q_V_T_mAPC) <- v62-v63-v64
    d/dt(q_V_T_P0) <- v67-v68-v69
    d/dt(q_V_T_P1) <- v77-v78-v79
    d/dt(q_V_T_aPD1) <- v88-v90
    d/dt(q_V_T_aPDL1) <- v94-v96
    d/dt(q_V_T_aCTLA4) <- v101-v103
    d/dt(q_V_T_Th) <- -v166-v170-v171+v174
    d/dt(q_V_T_TGFb) <- v177+v178+v198
    d/dt(q_V_T_MDSC) <- v183-v184-v185
    d/dt(q_V_T_NO) <- -v186*vol_V_T+v188
    d/dt(q_V_T_ArgI) <- -v187*vol_V_T+v189
    d/dt(q_V_T_CCL2) <- v181-v182*vol_V_T
    d/dt(q_V_T_Mac_M1) <- v190-v191-v193-v201+v202
    d/dt(q_V_T_Mac_M2) <- -v192-v194+v201-v202
    d/dt(q_V_T_IL12) <- v195+v196-v197*vol_V_T
    d/dt(q_V_T_IL10) <- v199-v200*vol_V_T
    d/dt(q_V_T_aCD47) <- v204-v206
    d/dt(q_V_LN_nT0) <- v8-v11+v14-v15-v16-v162
    d/dt(q_V_LN_aT0) <- v17-v18
    d/dt(q_V_LN_T0) <- v19-v22-v28
    d/dt(q_V_LN_IL2) <- -v29-v30-v31+v57+v176
    d/dt(q_V_LN_nT1) <- v34-v37+v40-v41-v42
    d/dt(q_V_LN_aT1) <- v43-v44
    d/dt(q_V_LN_T1) <- v45-v48-v56
    d/dt(q_V_LN_APC) <- v61
    d/dt(q_V_LN_mAPC) <- v63-v65
    d/dt(q_V_LN_aPD1) <- v89+v90-v91
    d/dt(q_V_LN_aPDL1) <- v95+v96-v97
    d/dt(q_V_LN_aCTLA4) <- v102+v103-v104
    d/dt(q_V_LN_aTh) <- v163-v164
    d/dt(q_V_LN_Th) <- v165-v169-v175
    d/dt(q_V_LN_aCD47) <- v205+v206-v207
    d/dt(q_V_e_P0) <- v70-v71
    d/dt(q_V_e_p0) <- v71-v72-v73+v74
    d/dt(q_V_e_P1) <- v80-v81
    d/dt(q_V_e_p1) <- v81-v82-v83+v84
    d/dt(q_A_e_M1) <- -v66-v73+v74-v83+v84
    d/dt(q_A_e_M1p0) <- v73-v74-v76
    d/dt(q_A_e_M1p1) <- v83-v84-v86
    d/dt(q_A_s_M1) <- v66+v75+v85
    d/dt(q_A_s_M1p0) <- -v75+v76
    d/dt(q_A_s_M1p1) <- -v85+v86
    d/dt(q_syn_T_C1_PD1_PDL1) <- v110*m_syn_T_C1
    d/dt(q_syn_T_C1_PD1_PDL2) <- v111*m_syn_T_C1
    d/dt(q_syn_T_C1_PD1) <- -v110*m_syn_T_C1-v111*m_syn_T_C1-v112*m_syn_T_C1-v113*m_syn_T_C1
    d/dt(q_syn_T_C1_PDL1) <- v106+v108*m_syn_T_C1-v110*m_syn_T_C1-v114*m_syn_T_C1-v115*m_syn_T_C1-v129*m_syn_T_C1
    d/dt(q_syn_T_C1_PDL2) <- v107+v109*m_syn_T_C1-v111*m_syn_T_C1
    d/dt(q_syn_T_C1_PD1_aPD1) <- v112*m_syn_T_C1-v113*m_syn_T_C1
    d/dt(q_syn_T_C1_PD1_aPD1_PD1) <- v113*m_syn_T_C1
    d/dt(q_syn_T_C1_PDL1_aPDL1) <- v114*m_syn_T_C1-v115*m_syn_T_C1
    d/dt(q_syn_T_C1_PDL1_aPDL1_PDL1) <- v115*m_syn_T_C1
    d/dt(q_syn_T_C1_TPDL1) <- -v132*m_syn_T_C1-v133*m_syn_T_C1
    d/dt(q_syn_T_C1_TPDL1_aPDL1) <- v132*m_syn_T_C1-v133*m_syn_T_C1
    d/dt(q_syn_T_C1_TPDL1_aPDL1_TPDL1) <- v133*m_syn_T_C1
    d/dt(q_syn_T_C1_CD28_CD80) <- v116*m_syn_T_C1-v117*m_syn_T_C1
    d/dt(q_syn_T_C1_CD28_CD80_CD28) <- v117*m_syn_T_C1
    d/dt(q_syn_T_C1_CD28_CD86) <- v118*m_syn_T_C1
    d/dt(q_syn_T_C1_CD80_CTLA4) <- v119*m_syn_T_C1-v120*m_syn_T_C1-v122*m_syn_T_C1
    d/dt(q_syn_T_C1_CD80_CTLA4_CD80) <- v122*m_syn_T_C1-v123*m_syn_T_C1
    d/dt(q_syn_T_C1_CTLA4_CD80_CTLA4) <- v120*m_syn_T_C1-v121*m_syn_T_C1
    d/dt(q_syn_T_C1_CD80_CTLA4_CD80_CTLA4) <- v121*m_syn_T_C1+v123*m_syn_T_C1
    d/dt(q_syn_T_C1_CD86_CTLA4) <- v124*m_syn_T_C1-v125*m_syn_T_C1
    d/dt(q_syn_T_C1_CD86_CTLA4_CD86) <- v125*m_syn_T_C1
    d/dt(q_syn_T_C1_PDL1_CD80) <- v129*m_syn_T_C1-v130*m_syn_T_C1-v131*m_syn_T_C1
    d/dt(q_syn_T_C1_PDL1_CD80_CD28) <- v130*m_syn_T_C1
    d/dt(q_syn_T_C1_PDL1_CD80_CTLA4) <- v131*m_syn_T_C1
    d/dt(q_syn_T_C1_CD28) <- -v116*m_syn_T_C1-v117*m_syn_T_C1-v118*m_syn_T_C1-v130*m_syn_T_C1
    d/dt(q_syn_T_C1_CTLA4) <- -v119*m_syn_T_C1-v120*m_syn_T_C1-v123*m_syn_T_C1-v124*m_syn_T_C1-v126*m_syn_T_C1-v127*m_syn_T_C1-v131*m_syn_T_C1
    d/dt(q_syn_T_C1_CD80) <- -v116*m_syn_T_C1-v119*m_syn_T_C1-v121*m_syn_T_C1-v122*m_syn_T_C1+v128*m_syn_T_C1
    d/dt(q_syn_T_C1_CD80m) <- -2*v128*m_syn_T_C1-v129*m_syn_T_C1
    d/dt(q_syn_T_C1_CD86) <- -v118*m_syn_T_C1-v124*m_syn_T_C1-v125*m_syn_T_C1
    d/dt(q_syn_T_C1_CTLA4_aCTLA4) <- v126*m_syn_T_C1-v127*m_syn_T_C1
    d/dt(q_syn_T_C1_CTLA4_aCTLA4_CTLA4) <- v127*m_syn_T_C1
    d/dt(q_syn_T_APC_PD1_PDL1) <- v138*m_syn_T_APC
    d/dt(q_syn_T_APC_PD1_PDL2) <- v139*m_syn_T_APC
    d/dt(q_syn_T_APC_PD1) <- -v138*m_syn_T_APC-v139*m_syn_T_APC-v140*m_syn_T_APC-v141*m_syn_T_APC
    d/dt(q_syn_T_APC_PDL1) <- v134+v136*m_syn_T_APC-v138*m_syn_T_APC-v142*m_syn_T_APC-v143*m_syn_T_APC-v157*m_syn_T_APC
    d/dt(q_syn_T_APC_PDL2) <- v135+v137*m_syn_T_APC-v139*m_syn_T_APC
    d/dt(q_syn_T_APC_PD1_aPD1) <- v140*m_syn_T_APC-v141*m_syn_T_APC
    d/dt(q_syn_T_APC_PD1_aPD1_PD1) <- v141*m_syn_T_APC
    d/dt(q_syn_T_APC_PDL1_aPDL1) <- v142*m_syn_T_APC-v143*m_syn_T_APC
    d/dt(q_syn_T_APC_PDL1_aPDL1_PDL1) <- v143*m_syn_T_APC
    d/dt(q_syn_T_APC_TPDL1) <- -v160*m_syn_T_APC-v161*m_syn_T_APC
    d/dt(q_syn_T_APC_TPDL1_aPDL1) <- v160*m_syn_T_APC-v161*m_syn_T_APC
    d/dt(q_syn_T_APC_TPDL1_aPDL1_TPDL1) <- v161*m_syn_T_APC
    d/dt(q_syn_T_APC_CD28_CD80) <- v144*m_syn_T_APC-v145*m_syn_T_APC
    d/dt(q_syn_T_APC_CD28_CD80_CD28) <- v145*m_syn_T_APC
    d/dt(q_syn_T_APC_CD28_CD86) <- v146*m_syn_T_APC
    d/dt(q_syn_T_APC_CD80_CTLA4) <- v147*m_syn_T_APC-v148*m_syn_T_APC-v150*m_syn_T_APC
    d/dt(q_syn_T_APC_CD80_CTLA4_CD80) <- v150*m_syn_T_APC-v151*m_syn_T_APC
    d/dt(q_syn_T_APC_CTLA4_CD80_CTLA4) <- v148*m_syn_T_APC-v149*m_syn_T_APC
    d/dt(q_syn_T_APC_CD80_CTLA4_CD80_CTLA4) <- v149*m_syn_T_APC+v151*m_syn_T_APC
    d/dt(q_syn_T_APC_CD86_CTLA4) <- v152*m_syn_T_APC-v153*m_syn_T_APC
    d/dt(q_syn_T_APC_CD86_CTLA4_CD86) <- v153*m_syn_T_APC
    d/dt(q_syn_T_APC_PDL1_CD80) <- v157*m_syn_T_APC-v158*m_syn_T_APC-v159*m_syn_T_APC
    d/dt(q_syn_T_APC_PDL1_CD80_CD28) <- v158*m_syn_T_APC
    d/dt(q_syn_T_APC_PDL1_CD80_CTLA4) <- v159*m_syn_T_APC
    d/dt(q_syn_T_APC_CD28) <- -v144*m_syn_T_APC-v145*m_syn_T_APC-v146*m_syn_T_APC-v158*m_syn_T_APC
    d/dt(q_syn_T_APC_CTLA4) <- -v147*m_syn_T_APC-v148*m_syn_T_APC-v151*m_syn_T_APC-v152*m_syn_T_APC-v154*m_syn_T_APC-v155*m_syn_T_APC-v159*m_syn_T_APC
    d/dt(q_syn_T_APC_CD80) <- -v144*m_syn_T_APC-v147*m_syn_T_APC-v149*m_syn_T_APC-v150*m_syn_T_APC+v156*m_syn_T_APC
    d/dt(q_syn_T_APC_CD80m) <- -2*v156*m_syn_T_APC-v157*m_syn_T_APC
    d/dt(q_syn_T_APC_CD86) <- -v146*m_syn_T_APC-v152*m_syn_T_APC-v153*m_syn_T_APC
    d/dt(q_syn_T_APC_CTLA4_aCTLA4) <- v154*m_syn_T_APC-v155*m_syn_T_APC
    d/dt(q_syn_T_APC_CTLA4_aCTLA4_CTLA4) <- v155*m_syn_T_APC
    d/dt(q_syn_M_C_CD47_aCD47) <- v234*m_syn_M_C-v235*m_syn_M_C-v236*m_syn_M_C
    d/dt(q_syn_M_C_CD47_aCD47_CD47) <- v235*m_syn_M_C-v237*m_syn_M_C
    d/dt(q_syn_M_C_CD47) <- v223-v224*m_syn_M_C-v225*m_syn_M_C-v234*m_syn_M_C-v235*m_syn_M_C
    d/dt(q_syn_M_C_SIRPa) <- -v225*m_syn_M_C
    d/dt(q_syn_M_C_CD47_SIRPa) <- v225*m_syn_M_C
    d/dt(q_syn_M_C_PD1_PDL1) <- v226*m_syn_M_C
    d/dt(q_syn_M_C_PD1_PDL2) <- v227*m_syn_M_C
    d/dt(q_syn_M_C_PD1) <- -v226*m_syn_M_C-v227*m_syn_M_C-v228*m_syn_M_C-v229*m_syn_M_C
    d/dt(q_syn_M_C_PDL1) <- v219+v221*m_syn_M_C-v226*m_syn_M_C-v230*m_syn_M_C-v231*m_syn_M_C-v233*m_syn_M_C
    d/dt(q_syn_M_C_PDL2) <- v220+v222*m_syn_M_C-v227*m_syn_M_C
    d/dt(q_syn_M_C_PD1_aPD1) <- v228*m_syn_M_C-v229*m_syn_M_C
    d/dt(q_syn_M_C_PD1_aPD1_PD1) <- v229*m_syn_M_C
    d/dt(q_syn_M_C_PDL1_aPDL1) <- v230*m_syn_M_C-v231*m_syn_M_C
    d/dt(q_syn_M_C_PDL1_aPDL1_PDL1) <- v231*m_syn_M_C
    d/dt(q_syn_M_C_PDL1_CD80) <- v233*m_syn_M_C
    d/dt(q_syn_M_C_CD80) <- v232*m_syn_M_C
    d/dt(q_syn_M_C_CD80m) <- -2*v232*m_syn_M_C-v233*m_syn_M_C
    d/dt(q_V_endo_aCD47) <- v215*m_V_C-v216*m_V_endo-v218*m_V_endo
    d/dt(q_V_endo_FcRn) <- -v216*m_V_endo+v217*m_V_endo
    d/dt(q_V_endo_FcRn_aCD47) <- v216*m_V_endo-v217*m_V_endo
  })
}
