# Optimal Control Algorithms and Their Analysis for Short-Term Scheduling in Manufacturing Systems
## 2 Optimal Control Applications to Scheduling in Manufacturing Systems
In the first phase, the MS OPC problem is considered without strict end conditions at the time \(t=T_{f}\). The solution of the problem with a free right end is some approximation \(\widetilde{\psi}_{(r)}(T_{0})\) (\(r=1,2,\dots\) ). Then, in the second phase, the received vector is used as the initial approximation \(\widetilde{\psi}_{(0)}(T_{0})=\widetilde{\psi}_{(r)}(T_{0})\) for [PERSON]'s method, the penalty functional method, or the gradient method. Thus, in the second phase, the problem of MS OPC construction can be solved over a finite number of iterations. Let us now consider one of the most effective methods, namely [PERSON] and [PERSON]'s method for OPC problem with a free right end [39]. Step 1. An initial solution (an allowable program control) \(\mathbf{u}_{d}(t)\), \(\forall\)\(t\in(T_{0},T_{f})\), \(\mathbf{u}_{d}(t)\in M\) is selected. Step 2. The main system of Equation (1) is integrated under the end conditions \(\mathbf{h}_{0}(\mathbf{x}(T_{0}))\leq 0\). This results in the trajectory \(\mathbf{x}_{d}(t)\)\(\forall\)\(t\in(T_{0},T_{f})\). Step 3. The adjoint system (2) is integrated over the time interval from \(t=T_{f}\) to \(t=T_{0}\) under the end conditions:  
\[\psi_{<i,d>}(T_{f})=\frac{1}{2}\frac{\partial\Big{(}a_{i}-x_{<i,d>}(T_{f}) \Big{)}^{2}}{\partial x_{<i,d>}},\,i=1,\dots,\widetilde{n} \tag{18}\]  
where the constraints (18) are transversality conditions for the optimal control problem with a free end. The integration results in functions \(\psi_{<i,d>}\) of time and particularly in \(\psi_{<i,d>}(T_{0})\). Step 4. The control \(\mathbf{u}_{(r)}(t)\) is searched for subject to:  
\[H\Big{(}\mathbf{x}_{(r)}(t),\mathbf{u}_{(r+1)}(t),\Psi_{(r)}(t)\Big{)}=\max_{ \widetilde{u}_{(r)}\in M}H\Big{(}\mathbf{x}_{(r)}(t),\Psi_{(r)}(t),\mathbf{u}_ {(r)}(t)\Big{)} \tag{19}\]where \(r=1,2,\,\dots\) is an iteration number. An initial solution belongs to the iteration \(r=0\). Apart from the maximization of the Hamiltonian (19), the main and the adjoint systems of Equations (1) and (2) are integrated from \(t=T_{0}\) to \(t=T_{f}\). Notably, several problems of mathematical programming are solved for each time point (the maximal number of the problems is equal to the number of MS OPC models). These problems define components of [PERSON]'s function. This is the end of the first iteration (\(r=1\)). If the conditions  
\[\left|I_{ob}^{(r)}-J_{ob}^{(r-1)}\right|\leq\varepsilon_{1} \tag{20}\]  
\[\left\|\mathbf{u}_{(r)}(t)-\mathbf{u}_{(r-1)}(t)\right\|\leq\varepsilon_{2} \tag{21}\]  
are satisfied, where constants \(\varepsilon_{1}\) and \(\varepsilon_{2}\) define the degree of accuracy, then the optimal control \(\mathbf{u}_{(r)}^{*}(t)=\mathbf{u}_{(r)}(t)\) and the vector \(\widetilde{\psi}_{(r)}(T_{0})\) are received at the first iteration. If not, we repeat **Step 3** and so on. In a general case (when the model \(M\) is used), the integration step for differential Equations (1) and (2) is selected according to the feasible accuracy of approximation (substitution of initial equations for finite difference ones) and according to the restrictions related with the correctness of the maximum principle. If we linearize the MS motion model (\(M_{<\Theta,\Theta>}\)), then all the components of the model \(M\) (\(M_{<\alpha,\Theta>}\), \(M_{<\alpha,\Theta>}\), \(M_{<\alpha,\Theta>}\), \(M_{<\alpha,\Theta>}\), \(M_{<\alpha,\Theta>}\), \(M_{<\alpha,\Theta>}\)) will be finite-dimensional, non-stationary, linear dynamical systems or bi-linear \(M_{<k,\Theta>}\) dynamic systems. In this case, the simplest of [PERSON]'s formulas can be used for integration. The advantage of the method is its simple programming. [PERSON]'s method is less dependent on the initial allowable control, as compared with the above-mentioned methods. In addition, control inputs may be discontinuous functions. This is noteworthy as most MS resources are allocated in a relay mode. However, the simple successive approximations method (SSAM) can diverge.