# Distributed Passive Actuation Schemes for Seismic Protection of Multibuilding Systems
## 3 Optimization Procedure
### Optimization Variables and Associated Multibuilding Model
For \(j\) values with \(\tilde{\eta}_{j}>0\), we consider the cumulative numbers \(\hat{\theta}_{0}=0\), \(\tilde{\theta}_{j}=\hat{\eta}_{1}+\cdots+\tilde{\eta}_{j}\), \(j\geq 1\), extract the sublist  
\[\tilde{\alpha}^{(j)}=[\tilde{\alpha}_{1}^{(j)},\ldots,\tilde{\alpha}_{\hat{ \eta}_{j}}^{(j)}]=\overline{\alpha}(\hat{\eta}+\tilde{\theta}_{j-1}+1:\hat{ \eta}+\tilde{\theta}_{j}) \tag{51}\]  
and compute the number of interbuilding dampers \(\tilde{\eta}_{j}=sum(\tilde{\alpha}^{(j)})\) allocated between \(\mathcal{B}^{(j)}\) and \(\mathcal{B}^{(j+1)}\). For \(j\) values with \(\hat{\eta}_{j}=0\), there are no dampers allocated between \(\mathcal{B}^{(j)}\) and \(\mathcal{B}^{(j+1)}\), and we set \(\widehat{\mathbf{C}}^{(j)}=[\mathbf{0}]_{n\times n}\); for \(j\) values with \(\tilde{\eta}_{j}>0\), we compute the list of indexes \(\widetilde{\pi}^{(j)}=\pi(\tilde{\alpha}^{(j)})\), which contains the positions of the \(\tilde{\eta}_{j}\) nonzero elements in \(\tilde{\alpha}^{(j)}\), and obtain the list of interbuilding positions \(\tilde{p}^{(j)}=\hat{\sigma}^{(j)}\big{(}\hat{\pi}^{(j)}\big{)}\) where the dampers are allocated. To compute the corresponding list of damping coefficients, we define the cumulative numbers \(\widetilde{N}_{0}=0\), \(\widetilde{N}_{j}=\hat{n}_{1}+\cdots+\hat{n}_{j}\), for \(j\geq 1\), and extract the sublist \(\hat{\epsilon}^{(j)}=d(\hat{n}+\widetilde{N}_{j-1}+1:\hat{n}+\widetilde{N}_{j})\). From the interbuilding damping scheme \(\widehat{\mathcal{C}}^{(j)}=[\tilde{p}^{(j)},\hat{\epsilon}^{(j)}]\), the associated damping matrix \(\tilde{\mathbf{C}}^{(j)}\) can be computed as indicated in Equation (12). To illustrate the described procedure, let us consider the scheme of allowed damper positions in Equation (45), the overall list of allocated dampers in Equation (49) and the list of damping coefficients \(d=[d_{1},\ldots,d_{7}]\). First, we observe that \(\hat{\eta}_{2}=0\) and set \(\hat{n}_{2}=0\) and \(\widehat{\mathbf{C}}^{(2)}=[\mathbf{0}]_{5\times 5}\). Next, we compute the cumulative numbers  
\[\hat{\theta}_{0}=0,\ \hat{\theta}_{1}=3,\ \hat{\theta}_{2}=3,\ \hat{\theta}_{3}=6. \tag{52}\]For \(j=1\), we have \(\hat{\eta}_{1}=3\) and extract the sublist  
\[\hat{\alpha}^{(1)}=\pi(\hat{\theta}_{0}+1:\hat{\theta}_{1})=\pi(1:3)=[1,1,0], \tag{53}\]  
which indicates that there are \(\hat{n}_{1}=sum(\hat{\alpha}^{(1)})=sum([1,1,0])=2\) interstory dampers allocated in building \(\mathcal{B}^{(1)}\). The list of positions of the nonzero elements in \(\hat{\alpha}^{(1)}\) is \(\hat{\pi}^{(1)}=\pi([1,1,0])=[1,2]\) and the list of interstory positions where the dampers are allocated is \(\hat{p}^{(1)}=\hat{\sigma}^{(1)}(\hat{\pi}^{(1)})=\hat{\sigma}^{(1)}([1,2])=[1,2]\). To obtain the list of damping coefficients, we compute the cumulative numbers \(\widehat{N}_{0}=0\), \(\widehat{N}_{1}=2\), and extract the coefficient sublist \(\hat{c}^{(1)}=d(\widehat{N}_{0}+1:\widehat{N}_{1})=d(1:2)=[d_{1},d_{2}]\). After computing the interstory actuation scheme \(\widehat{\mathcal{C}}^{(1)}=[\hat{p}^{(1)},\hat{c}^{(1)}]\), we apply Equation (9) and obtain  
\[\widehat{\mathbf{C}}^{(1)}=\left[ \begin{array}{ccccc}d_{1}+d_{2}&-d_{2}&0&0& 0\\ -d_{2}&d_{2}&0&0&0\\ 0&0&0&0&0\\ 0&0&0&0&0\\ 0&0&0&0&0\end{array} \right]. \tag{54}\]  
For \(j=3\), we have \(\hat{\eta}_{3}=3\) and obtain the sublist \(\hat{\alpha}^{(3)}=\pi(\hat{\theta}_{2}+1:\hat{\theta}_{3})=\pi(4:6)=[1,0,1]\) and the number of dampers \(\hat{n}_{3}=sum(\hat{\alpha}^{(3)})=2\). The nonzero elements in \(\hat{\alpha}^{(3)}\) are placed at positions \(\hat{\pi}^{(3)}=\pi([1,0,1])=[1,3]\), which produces the list of interstory damper positions \(\hat{p}^{(3)}=\hat{\sigma}^{(3)}(\hat{\pi}^{(3)})=\hat{\sigma}^{(3)}([1,3])=[1,3]\). With the values \(\hat{n}_{2}=0\) and \(\hat{n}_{3}=2\), we can complete the cumulative numbers \(\widehat{N}_{2}=2\), \(\widehat{N}_{3}=4\), and extract the coefficient sublist \(\hat{c}^{(3)}=d(\widehat{N}_{2}+1:\widehat{N}_{3})=d(3:4)=[d_{3},d_{4}]\).