# Hierarchical Coordinated Predictive Control of Multiagent Systems for Process Industries
## 3 Methodology
### Implementation of Consistent Open-Loop Prediction  
A \"leader-follower\"-like protocol implementation strategy for consistent open-loop prediction is proposed in this section. First, each agent utilizes its own open-loop prediction model to compute its open-loop prediction of the system outputs for the next \(N_{\text{P}}\) time steps and computes the Euclidean distance of the open-loop prediction with respect to the target. Then, each agent utilizes the proposed consistency strategy to achieve consistent open-loop prediction between itself and the adjacent agent that has the minimum Euclidean distance. Figure 1: Flow chart of proposed HCPC. To describe MASs with interaction topologies described by simple noncomplete graphs, the state-space model (3) in Section 2 is rewritten as  
\[\mathbf{x}_{i}(k+1)=\mathbf{M}_{\rm s}\mathbf{x}_{i}(k)+\mathbf{r}_{i}\Delta u_{i}(k)+\sum_{j\
eq i,\bar{\
u}_{j}\in\mathbf{\mathcal{N}}_{i}}\mathbf{r}_{j}\Delta u_{j}(k) \tag{8}\]  
where \(\mathbf{r}_{i}= \begin{bmatrix}r_{i,1,1}&\cdots&r_{i,1,N}&\cdots&r_{i,N_{\rm O},1}& \cdots&r_{i,N_{\rm O},N}\end{bmatrix} ^{\rm T}\) is the vector of the step responses with respect to agent \(v_{i}\). Accordingly, the open-loop prediction model (6) is rewritten as  
\[\mathbf{y}_{\rm Pol,i}(k+1)=\mathbf{G}\mathbf{M}_{\rm s}\mathbf{x}_{i}(k)+\mathbf{h}\mathbf{e}_{i}(k)= \mathbf{G}\mathbf{M}_{\rm s}(\mathbf{M}_{\rm s}\mathbf{x}_{i}(k-1)+\mathbf{r}_{i}\Delta u_{i}(k-1)+ \sum_{j\
eq i,\bar{\
u}_{j}\in\mathbf{\mathcal{N}}_{i}}\mathbf{r}_{j}\Delta u_{j}(k-1) )+\mathbf{h}\mathbf{e}_{i}^{\prime}(k) \tag{9}\]  
where \(\mathbf{e}_{i}^{\prime}(k)\) is the vector of prediction errors of agent \(v_{i}\) at time step \(k\) with finite time-domain averaging filtering, which is denoted as  
\[\bar{\mathbf{e}}_{i}^{\prime}(k)=\left\{ \begin{array}{ll}\frac{1}{N_{\rm L}} \sum_{t=0}^{N_{\rm L}-1}\mathbf{e}_{i}^{\prime}(k-t_{t}),&k\geq N_{\rm L}\\ \frac{1}{k}\sum_{t=0}^{k}\mathbf{e}_{i}^{\prime}(t_{t}),&k<N_{\rm L}\end{array} \right. \tag{10}\]  
where \(N_{\rm L}\) is the time step for averaging filtering and \(\mathbf{e}_{i}^{\prime}(k)\) is the vector of prediction errors of agent \(v_{i}\) at time step \(k\) under a simple noncomplete graph, which is of the same form as \(\mathbf{e}_{i}(k)\) in the open-loop prediction model (6), with the main difference being that \(\mathbf{e}_{i}^{\prime}(k)\) includes the effect on the system of agents that are not in the set \(\mathbf{\mathcal{N}}_{i}\). From the open-loop prediction model (9), the open-loop prediction models of all agents differ because they can only communicate with adjacent agents, which may negatively impact the control performance. Thus, it is necessary to provide a consistent closed-loop prediction basis (i.e., consistent open-loop prediction) for each agent. Let \(\Delta\bar{\mathbf{y}}(k)\) be the weighted average of the increments of deviation between the system outputs and targets at time step \(k\) and \(d_{i}(k)\) be the Euclidean distance of the open-loop prediction of agent \(v_{i}\) with respect to the target at time step \(k\); they are expressed as  
\[\Delta\bar{\mathbf{y}}(k)=\frac{\sum_{m=1}^{N_{\rm O}}q_{n}(|y_{n}(k) -y_{t,n}(k)|-|y_{n}(k-1)-y_{t,n}(k-1)|)}{N_{\rm O}} \tag{11}\] \[d_{i}(k)=\left\|\mathbf{y}_{\rm Pol,i}(k)-\mathbf{y}_{\rm t}(k)\otimes \mathbf{I}_{\rm y}\right\| \tag{12}\]  
where \(q_{n}\) is the weight of the deviation of the \(n\)-th system output from the target, \(\mathbf{y}_{\rm t}(k)= \begin{bmatrix}y_{t,1}(k)&y_{t,2}(k)&\cdots&y_{t,N_{\rm O}} (k)\end{bmatrix} ^{\rm T}\) is the vector of the targets, the Kronecker product \(\otimes\) and vector \(\mathbf{I}_{\rm y}= \begin{bmatrix}1&1&\cdots&1\end{bmatrix} _{1\times N_{\rm P}}^ {\rm T}\) are used to tensor the vectors about system outputs into tensors dimensioned in terms of the prediction horizon, \(\left\|\cdot\right\|\) denotes the Euclidean norm.