# Leveraging Blockchain and Consignment Contracts to Optimize Food Supply Chains Under Uncertainty
## 5 Mathematical Model and Methods
### Traditional System Without Blockchain  
The retailer's total profit for the traditional system in model BC is  
\[\phi_{TS}^{r}=\left\{\begin{array}{ll}(p_{\textit{WBC}}D_{\textit{WBC}}-wq)-h _{TS}^{r}(q-D_{\textit{WBC}});&D_{\textit{WBC}}\leq q\\ (p_{\textit{WBC}}-w)q-s^{r}(D_{\textit{WBC}}-q);&D_{\textit{WBC}}>q\end{array}\right.\]  
The retailer keeps ownership of the product, purchases the entire lot at wholesale from the manufacturer, and sells it to the customer at a selling price. If \(x\leq q\), then the retailer incurs a carrying cost of \(h_{TS}^{r}\) for each unsold unit. Conversely, if \(x>q\), the retailer suffers a loss of goodwill quantified at \(s^{r}\) for each unit of stockout. The anticipated profit of the retailer can be articulated as  
\[E(\phi_{TS}^{r}) = \int_{0}^{q}p_{\textit{WBC}}(D_{0}^{\textit{WBC}}-\eta_{1}p_{ \textit{WBC}}-\alpha-\beta h_{c})x-h_{TS}^{r}(q-(D_{0}^{\textit{WBC}}-\eta_{1} p_{\textit{WBC}}-\alpha-\beta h_{c})x)\] \[- W(q)f(x)dx+\int_{q}^{\infty}[p_{\textit{WBC}}q-S^{r}((D_{0}^{ \textit{WBC}}-\eta_{1}p_{\textit{WBC}}-\alpha-\beta h_{c})x)-q)-Wq]f(x)dx\]  
The retailer procures \(q\) from the supplier. The initial integral represents the anticipated profit of the retailer, predicated on the scenario where the available stock exceeds consumer demand. The retailer meets the demand and incurs a holding cost, \(h_{TS}^{r}\), for each unsold unit. The following integral demonstrates that the retailer faces a stock-out cost, represented as \(s^{r}\), for each unit that cannot be satisfied when depleting their existing inventory. Within the traditional system, a retailer ascertains customer demand and subsequently conveys the  
Figure 2: Model and methodology.  
order quantity to the manufacturer in an indirect manner. The retailer determines the order quantity based on customer demand.  
\[X\sim U\Big{[}\mu-\frac{\sigma}{2},\mu+\frac{\sigma}{2}\Big{]}\]  
See Appendix A for details of the calculation.  
\[Q^{*}=(\mu-\frac{\sigma}{2})+\Bigg{[}\frac{p_{WBC}-w+s^{r}(D_{0}^{WBC}-\eta_{1 }p_{WBC}-\alpha-\beta h_{c})}{(p_{WBC}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h _{c})+h_{TS}^{r}+S^{r})}\Bigg{]}\sigma \tag{3}\]  
Owing to the order quantity \((Q^{*})\), the manufacturer maximizes his estimated revenue for a set wholesale price per unit. The profit of the producer can be explained as  
\[\phi_{TS}^{m}=(w-c)Q^{*} \tag{4}\]  
The estimated profit of the producer and the seller in the TS without blockchain is given below. The proof can be found in the Appendix A.  
\[E(\phi_{TS}^{r}) = (p_{WBC}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c})+h_{TS}^{r }(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c}))\mu \tag{5}\] \[- (p_{WBC}+h_{TS}^{r}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{ c})+s^{r})\frac{1}{2}((\mu+\frac{\sigma^{2}}{2}-((\mu-\frac{\sigma}{2})\] \[+ \frac{p_{WBC}-A+s^{r}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h _{c})}{(p_{WBC}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c})+h_{TS}^{r}+S^{ r})}\sigma))\]  
\[E(\phi_{TS}^{m}) = \Bigg{[}\frac{(p_{WBC}(\sigma^{2}-2\mu\sigma+2c)-2s^{r})D_{0}^{ WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c})+(\sigma-2\mu\sigma+2c)(h_{TS}^{r}-s^{r})-2 \sigma(p_{WBC}-1)}{2(p_{WBC}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c})+h _{TS}^{r}-s^{r}-1)}-c\Bigg{]} \tag{6}\] \[\times \Bigg{[}(\mu-\frac{\sigma}{2})+\frac{p_{WBC}-A+s^{r}(D_{0}^{WBC}- \eta_{1}p_{WBC}-\alpha-\beta h_{c})}{(p_{WBC}(D_{0}^{WBC}-\eta_{1}p_{WBC}- \alpha-\beta h_{c})+h_{TS}^{r}+S^{r})}\sigma\Bigg{]}\] where, \[A=\frac{(p_{WBC}(\sigma^{2}-2\mu\sigma+2c)-2s^{r})D_{0}^{WBC}-\eta_{1}p_{WBC }-\alpha-\beta h_{c})+(\sigma-2\mu\sigma+2c)(h_{TS}^{r}-s^{r})-2\sigma(p_{ WBC}-1)}{2(p_{WBC}(D_{0}^{WBC}-\eta_{1}p_{WBC}-\alpha-\beta h_{c})+h_{TS}^{r}-s^{r}-1)} \tag{7}\]