## 3 Optimal Control Problem  
To better understand the interactions between drug therapy and the host immune reaction, we allow the effects of the two drug types (NAs and IFN-\(\alpha\)) to vary with time. We replace the NAs' efficacy parameter \(\eta\) with \(u_{1}(t)\) to represent the time-varying effective drug dosage needed for optimal therapy. Similarly, \(u_{2}(t)\) will replace the parameter \(\epsilon\) to represent the time-varying dosage of IFN-\(\alpha\). As before, \(a_{1}\), \(a_{2}\) and \(a_{3}\) indicate the relative strength of the three effects of IFN-\(\alpha\) under consideration; \(b_{1}\) and \(b_{2}\) represent the relative strengths of the two effects of the NA; and \(f\) and \(1-f\) are the relative contribution of interferon and NAs, respectively, in reducing viral production.  
For computational convenience and consistency of notation, we will relabel the state variables as in Table 2. With these adjustments, our model becomes as follows.  
\begin{table}
\begin{tabular}{l l} \hline \(x_{1}(t)=T(t)\) & \\ \(x_{2}(t)=I(t)\) & \(z_{2}(t)=I(t-\tau)\) \\ \(x_{3}(t)=V(t)\) & \\ \(x_{4}(t)=E(t)\) & \(z_{4}(t)=E(t-\tau)\) \\ \(x_{5}(t)=R(t)\) & \\ \hline \end{tabular}
\end{table}
Table 2: Correspondence between labeling of the state variables in Models (1) and (8).  
\[\frac{dx_{1}}{dt} =rx_{1}\left(1-\frac{x_{1}+x_{2}+x_{5}}{K}\right)-\beta(1-b_{1}u_{1}) x_{1}x_{3}+qx_{5} \tag{8}\] \[\frac{dx_{2}}{dt} =rx_{2}\left(1-\frac{x_{1}+x_{2}+x_{5}}{K}\right)+\beta(1-b_{1}u_{1 })x_{1}x_{3}-((1+a_{1}u_{2})\mu+\rho)x_{2}x_{4}\] \[\frac{dx_{3}}{dt} =(1-fa_{2}u_{2}-(1-f)b_{2}u_{1})\pi x_{2}-cx_{3}\] \[\frac{dx_{4}}{dt} =s+\alpha z_{2}z_{4}-d(1-a_{3}u_{2})x_{4}\] \[\frac{dx_{5}}{dt} =\rho x_{2}x_{4}+rx_{5}\left(1-\frac{x_{1}+x_{2}+x_{5}}{K}\right) -qx_{5}-\
u x_{4}x_{5}\]  
Our goal is to find the regime of drug therapy that minimizes the objective functional:  
\[J(u_{1},u_{2})=\int_{0}^{T}\left(c_{1}x_{3}+c_{2}x_{2}+c_{3}u_{1}+c_{4}u_{2}+ \varepsilon_{1}u_{1}^{2}+\varepsilon_{2}u_{2}^{2}\right)dt+c_{5}x_{3}(T) \tag{9}\]  
subject to the system of delay differential Equation (8) with initial conditions (2). Here, \(T\) represents the duration of therapy. We will study two different scenarios for drug treatment by considering two different sets of initial conditions. For the case of chronic HBV infection, the initial values of the state variables \(x_{i}\) will be constant and equal to their chronic infection equilibrium values for the entire interval \([t_{d}-\tau,t_{d}]\). We will also study the case of drug therapy initiation at the peak of viral load, during acute infection. In this case, the initial functions for the state variables \(x_{i}\) will be set by their trajectories during acute infection in the absence of treatment. This is described in more detail in Section 3.3.  
Given upper bounds \(M_{i}\) on \(u_{i}\) (for \(i=1,2\)), we seek to find an optimal pair in the control set:  
\[U=\{(u_{1},u_{2})\in L^{\infty}(0,T)\,|\,0\leq u_{i}\leq M_{i},\,i=1,2\}\]  
such that  
\[J(u_{1}^{*},u_{2}^{*})=\inf_{(u_{1},u_{2})\in U}J(u_{1},u_{2})\]  
The integral portion of the objective functional encapsulates the goal of minimizing total virus concentration (\(x_{3}\)), infected cell concentration (\(x_{2}\)) and the amount of drug used (\(u_{1}\) and \(u_{2}\) terms) over the entire treatment period. The final term \(c_{5}x_{3}(T)\) represents the goal of minimizing the final viral concentrations at time \(T\), which ideally would be below clearance levels. The parameters \(c_{i}>0\) and \(\varepsilon_{j}>0\) give the relative weight of each of these factors.