## 2 Materials and Methods
### The Optimal Control
For this purpose, we define the Hamiltonian as  
\[\mathcal{H} = A_{1}E_{i}+A_{2}E_{i}^{q}+A_{3}I_{i}^{q}+\frac{1}{2}\left(\tau_{ 1}u_{i}^{2}+\tau_{2}v_{i}^{2}+\tau_{3}T_{i}^{2}\right)\] \[+ \zeta_{1,i+1}\left[\Gamma_{i}+S_{i}+\rho_{1}E_{i}^{q}+\rho_{2}R_{ i}+\rho_{3}I_{i}-\beta_{1}(1-u_{i})\frac{S_{i}I_{i}}{N_{i}}-\beta_{2}(1-v_{i}) \frac{S_{i}E_{i}}{N_{i}}-\right.\] \[\left.\alpha\sum_{r=0}^{9}\frac{\beta_{1}S_{i-r}(\gamma_{2}E_{i}) }{N_{i-r}}-dS_{i}\right]\] \[+ \zeta_{2,i+1}\left[E_{i}+\beta_{1}(1-u_{i})\frac{S_{i}I_{i}}{N_{i }}+\beta_{2}(1-v_{i})\frac{S_{i}E_{i}}{N_{i}}-(\gamma_{1}+\gamma_{2}+d)E_{i}\right]\] \[+ \zeta_{3,i+1}\left[I_{i}+\gamma_{1}E_{i}-(\mu_{1}+\rho_{3}+d)I_{i}\right]\] \[+ \zeta_{4,i+1}\left[R_{i}+TI_{i}^{q}-(\rho_{2}+d)R_{i}\right]\] \[+ \zeta_{5,i+1}\left[E_{i}^{q}+\alpha\sum_{r=0}^{9}\frac{\beta_{1}S _{i-r}(\gamma_{2}E_{i})}{N_{i-r}}-(\rho_{1}+\gamma_{3}+d)E_{i}^{q}\right]\] Figure 5:0 Figure 5:1  
**Theorem 2** (Necessary Conditions). : _Given the optimal controls \(u_{i}^{*}\), \(v_{i}^{*}\), \(T^{*}\) and solutions \(S^{*}\), \(E^{*}\), \(I^{*}\), \(R^{*}\), \(E^{*}\), \(I^{*}\) and \(D^{*}\), there exists \(\zeta_{k,i}\), \(i=1...N\), \(k=1,\ldots,7\), with the adjoint variables satisfying the following equations_  
Figure 5:2 Figure 5:3 Figure 5:4 Figure 5:5 Figure 5:6 Figure 5:7 Figure 5:8  
Figure 5:9 \[J_{j}(u_{i}{}^{*},v_{i}{}^{*},T_{i}{}^{*})=min\{J(u,v,T)/(u,v,T)\in\mathcal{U}_{ ad}\};\]0 \[J_{j}(u_{i}{}^{*},v_{i}{}^{*},T_{i}{}^{*})=min\{J(u,v,T)/(u,v,T)\in\mathcal{U}_{ ad}\};\]1  
\[J_{j}(u_{i}{}^{*},v_{i}{}^{*},T_{i}{}^{*})=min\{J(u,v,T)/(u,v,T)\in\mathcal{U}_{ ad}\};\]2  
\(\zeta_{1,N}=0\), \(\zeta_{2,N}=A_{1}\), \(\zeta_{3,N}=0\) and \(\zeta_{4,N}=\zeta_{5,N}=A_{2}\), \(\zeta_{6,N}=A_{3}\), \(\zeta_{7,N}=0\). _Furthermore, the optimal controls \(u_{i}^{*}\), \(v_{i}^{*}\) and \(T_{i}^{*}\) are given by_  
\[J_{j}(u_{i}{}^{*},v_{i}{}^{*},T_{i}{}^{*})=min\{J(u,v,T)/(u,v,T)\in\mathcal{U}_{ ad}\};\]3 \[J_{j}(u_{i}{}^{*},v_{i}{}^{*},T_{i}{}^{*})=min\{J(u,v,T)/(u,v,T)\in\mathcal{U}_{ ad}\};\]4 \[J_{j}(u_{i}{}^{*},v_{i}{}^{*},T_{i}{}^{*})=min\{J(u,v,T)/(u,v,T)\in\mathcal{U}_{ ad}\};\]5  
Proof. : Using Pontryagin's Maximum Principle [14], and setting \(S_{i}=S_{i}^{*}\), \(E_{i}=E_{i}^{*}\), \(I_{i}=I_{i}^{*}\), \(R_{i}=R_{i}^{*}\), \(E_{i}^{q}=E_{i}^{q*}\), \(I_{i}^{q}=I_{i}^{q*}\), \(D_{i}=D_{i}^{*}\) and \(u_{i}=u_{i}^{*},v_{i}=v_{i}^{*}\), \(T=T^{*}\) we obtain the following adjoint equations  
\[\Delta\zeta_{1,i} = -\frac{\partial H}{\  
\[ \begin{array}{rcl}\Delta\zeta_{2,i}&=&-\frac{\partial H}{\partial E_{i}}=- \left[A_{1}+\zeta_{1,i+1}\left(-\beta_{2}(1-v_{i})\frac{S_{i}}{N_{i}}-\alpha \sum\limits_{r=0}^{9}\beta_{1}\gamma_{2}\frac{S_{i-r}}{N_{i-r}}\right)+\zeta_{ 3,i+1}\gamma_{1}+\zeta_{6,i+1}\gamma_{2}+\right.\\ &&\left.\zeta_{2,i+1}\left(2+\beta_{2}(1-v_{i})\frac{S_{i}}{N_{i}}-\gamma_{1}- \gamma_{2}-d\right)+\zeta_{5,i+1}\alpha\sum\limits_{r=0}^{9}\beta_{1}\gamma_{ 2}\frac{S_{i-r}}{N_{i-r}}\right.\\ &&\left.\zeta_{3,i}\right.&=&-\frac{\partial H}{\partial I_{i}}=-\left[\zeta_ {1,i+1}\left(\rho_{3}-\beta_{1}(1-u_{i})\frac{S_{i}}{N_{i}}\right)+\zeta_{2,i+ 1}\beta_{1}(1-u_{i})\frac{S_{i}}{N_{i}}+\right.\\ &&\left.\zeta_{3,i+1}\left(1-\mu_{1}-\rho_{3}-d\right)+\zeta_{7,i+1}\mu_{1} \right]\end{array} \]  
then  
\[ \begin{array}{rcl}\zeta_{3,i}&=&\zeta_{1,i+1}\left(\rho_{3}-\beta_{1}(1-u_{i })\frac{S_{i}}{N_{i}}\right)+\zeta_{2,i+1}\beta_{1}(1-u_{i})\frac{S_{i}}{N_{i }}+\\ &&\zeta_{3,i+1}\left(2-\mu_{1}-\rho_{3}-d\right)+\zeta_{7,i+1}\mu_{1}\end{array} \]  
\[ \begin{array}{rcl}\Delta\zeta_{4,i}=-\frac{\partial H}{\partial R_{i}}=- \left[\zeta_{1,i+1}\rho_{2}+\zeta_{4,i+1}\left(1-\rho_{2}-d\right)\right]\end{array} \]  
then  
\[ \begin{array}{rcl}\zeta_{4,i}=\zeta_{1,i+1}\rho_{2}+\zeta_{4,i+1}\left(2- \rho_{2}-d\right)\\ &&\left.\zeta_{5,i}=-\frac{\partial H}{\partial E_{i}^{d}}=-\left(A_{2}+\zeta _{1,i+1}\rho_{1}+\zeta_{5,i+1}\left(1-\rho_{1}-\gamma_{3}-d\right)+\zeta_{6,i+ 1}\gamma_{3}\right)\end{array} \]  
then  
\[