## 2 Materials and Methods
### Model Development
#### 2.1.1 Tumor Compartment  
**Tumor Cells:** Within the tumor, our model includes androgen-sensitive (\(N\)) and castration-resistant (\(M\)) cancer cells. In the absence of treatment with ADT, \(N\) and \(M\) cells proliferate at rates \(\alpha_{N}\) and \(\alpha_{M}\), respectively. In the absence of treatment, \(N\) and \(M\) cells undergo death via necrosis (at rates \(\delta_{NN}\) and \(\delta_{MN}\), respectively), and apoptosis (at rates \(\delta_{NA}\) and \(\delta_{MA}\), respectively) [16]. The effect of ADT on cell proliferation and death is accounted for via the dimensionless parameters \(\epsilon_{N}\), \(\epsilon_{M}\), \(\omega_{N}\), and \(\omega_{M}\). Specifically, in the absence of ADT, \(\epsilon_{N}=\epsilon_{M}=\omega_{N}=\omega_{M}=1\), while under ADT, \(0\leq\epsilon_{N},\epsilon_{M}\leq 1\) and \(\omega_{N},\omega_{M}\geq 1\). We remark that ADT induces cell death primarily via apoptosis [17]. Tumor cell death may also occur due to the presence of activated CD8\({}^{+}\) T cells (\(T8_{A}\)), which induce apoptosis via direct contact in cells expressing their cognate antigen [18]. For simplicity, both \(N\) and \(M\) cells are assumed to be equally sensitive to CD8\({}^{+}\) T cells. Their immune-mediated death rate is taken to be an increasing and saturating function of \(T8_{A}\), with a maximum rate, \(\delta_{K}\), and with half-saturation constant, \(k_{T}\). These assumptions yield the following equations governing the dynamics of proliferating tumor cells. Figure 1: Schematic showing interactions between model variables, and their transport between the tumor and lymphoid compartments. \[\frac{dN}{dt} = \epsilon_{N}\alpha_{N}N-\omega_{N}\delta_{NA}N-\delta_{NN}N-\delta_{ K}N\frac{T8_{A}}{k_{T}+T8_{A}}, \tag{1}\] \[\frac{dM}{dt} = \epsilon_{M}\alpha_{M}M-\omega_{M}\delta_{MA}M-\delta_{MN}M- \delta_{K}M\frac{T8_{A}}{k_{T}+T8_{A}}. \tag{2}\]  
Once tumor cells die, they are removed to either an apoptotic (\(D_{A}\)) or a necrotic (\(D_{N}\)) compartment, depending on the type of cell death. Dead cells are cleared by phagocytes, such as macrophages and immature dendritic cells (\(A_{I}\)) [19]. Specifically, \(A_{I}\) cells phagocytose dead tumor cells via direct contact, at an assumed rate \(\lambda_{A}\). For simplicity, we do not explicitly include macrophages in our model. Rather, following [10], dead cell phagocytosis by macrophages is assumed to occur at a constant rate, \(\delta_{D}\). These assumptions lead to the following equations governing the dynamics of dead tumor cells. \[\frac{dD_{A}}{dt} = \omega_{N}\delta_{NA}N+\omega_{M}\delta_{MA}M+\delta_{K}(N+M) \frac{T8_{A}}{k_{T}+T8_{A}}-\lambda_{A}D_{A}A_{I}-\delta_{D}D_{A}, \tag{3}\] \[\frac{dD_{N}}{dt} = \delta_{NN}N+\delta_{MN}M-\lambda_{A}D_{N}A_{I}-\delta_{D}D_{N}. \tag{4}\]  
**Dendritic Cells:** Immuture dendritic cells (\(A_{I}\)) are recruited to the tumor due to the release of antigens and signaling molecules such as LysoPC and S1P, by dying cells [20]. For simplicity we do not explicitly model these chemokines; rather we assume that the rate of \(A_{I}\) cell localization to the tumor is an increasing and saturating function of total dead cell number, with a maximum value of \(\rho\), and half-saturation constant, \(k_{D}\). In our model, we distinguish between cell death via apoptosis and necrosis because when immature dendritic cells phagocytose necrotic tumor cells, they transform into mature, antigen presenting cells or APCs (\(A_{M}\)) [21]. Assuming that this maturation occurs on a faster time-scale than phagocytosis, the rate of dendritic cell-to-APC maturation is taken to be equal to the rate of necrotic cell phagocytosis by \(A_{I}\) cells. mature APCs subsequently migrate to lymphatic organs [22] at an assumed constant per capita rate \(\mu_{A}\). Both immature and mature dendritic cells undergo cell death at rates \(\delta_{AI}\) and \(\delta_{AM}\), respectively. These assumptions yield the following equations governing the dynamics of dendritic cells.