## 4 Model Formulation
### Model Formulation  
From the notation and assumptions illustrated above, the graph of production system during the time period from 0 to T [0,T] will be demonstrated in the two-stage production system (reference in Figure A1 of Appendix A). The total profit function will be established; the model of research is a perfect cyclic process. The demands of customers with amounts of dairy products in a cycle will be met by the right number of goods from manufacturers (i.e., \(p_{i}t_{i}=p_{n}t_{n}=DT\)). Therefore, \(t_{i}\) and \(T\) can be presented in turn as follows:  
\[t_{i}=\frac{p_{n}t_{n}}{p_{i}}, \tag{1}\]  
with \(i=1\), \(2\),..., \(n\) and  
\[T=\frac{p_{n}t_{n}}{D}, \tag{2}\]  
Hence, the maximum level of inventory for raw material \(i\) at retailer stage is  
\[Z_{i}=(p_{i}-p_{e})t_{i}, \tag{3}\]  
with \(i=1,2\),..., \(n\). Therefore, the period when the inventory of raw material \(i\) depletes can be determined as:  
\[t_{id}=\frac{Z_{i}}{p_{e}}=\frac{(p_{i}-p_{e})t_{i}}{p_{e}}=\bigg{(}\frac{p_{ i}}{p_{e}}-1\bigg{)}t_{i}, \tag{4}\]  
with \(i=1,2,\)..., \(n\). \begin{table}
\begin{tabular}{c l} \hline \(s\) & Social charity (SC) amount for per unit selling. \\ \(t_{i}\) & Production run time for the raw material of resource \(i\), where \(i=1\), \(2\),..., \(n\). \\ \(r\) & The return rate of used goods from the customer. \\ \hline \end{tabular}
\end{table} 
Table 2: Decision variables. \[H_{e}=(p_{e}-D)(t_{n}+t_{nd})\] \[=(p_{e}-D)\Big{[}t_{n}+\Big{(}\frac{p_{n}}{p_{e}}-1\Big{)}t_{n}\Big{]} \tag{5}\] \[=(p_{e}-D)\frac{p_{n}}{p_{e}}t_{n}.\]  
However, the maximum inventory level of return used product as  
\[Z_{re}=rt_{rdi} \tag{6}\]  
where \(i=1,2,\,\ldots,\,m\). Based on six Equations (1)-(6), with the influence of these components, the total profit function will be established as follows:  
(1) Sales revenue (\(SR\))  
\[SR=(p_{w}-s)\]  
(2) Setup cost  
\[C_{s}=k\]  
(3) Holding the cost of the end product (\(HC_{e}\))  
\[HC_{e}=\frac{h_{e}Z_{e}T}{2}=\frac{h_{e}(p_{e}-D)}{2 Dp_{e}}{p_{n}}^{2}{t_{n}}^{2}\]  
(4) Holding the cost of all materials (\(HC_{c}\))  
\[HC_{c}=\frac{{p_{n}}^{2}{t_{n}}^{2}}{2}\left[\sum_{i=1}^{n}h_{i}\bigg{(}\frac{ 1}{p_{e}}-\frac{1}{p_{i}}\bigg{)}\right]\]  
(5) Disposal costs of the defective end product/all raw materials per cycle (\(DC\))  
\[DC=\bigg{(}d_{e}\theta_{e}+\sum_{i=1}^{n}d_{i}\theta_{i}\bigg{)}DT+\bigg{(}T- \sum_{i=1}^{m}t_{rdi}\bigg{)}rd_{re}\]  
(6) Return costs for used products at retailer stage (\(RC\)). \[H_{e}=(p_{e}-D)(t_{n}+t_{nd})\]0  
(7) Based on [PERSON]'s proposed model in 2005 [61], the production cost (\(PC\)) as:  
\[H_{e}=(p_{e}-D)(t_{n}+t_{nd})\]1  
In the integrated supply chain system, all upstream manufacturers are willing to conglomerate resources. In an organizational decision-making process involving the manufacturer and the retailer, a product is manufactured in a single batch. Thus, making capital investment decisions on CSR activities is given by \(I_{s}\) and collecting the used products for recycling is given by \(I_{t}\). Based on [PERSON] et al. (2004), both investment costs are \(I_{s}=\beta s^{2}\) and \(I_{r}=\alpha r^{2}\), where \(\alpha\) and \(\beta\) are scaling parameters, respectively [62]. Therefore, the objective function of the proposed model consisting of seven parts to maximize the total profit per unit of time is given by optimizing \(s,\,\,t_{n},\,\) and \(r\). Thus, the total profit per unit time (denoted by \(TP(s,\ t_{n},\ r)\)) is given by  
\[