# Distributed Passive Actuation Schemes for Seismic Protection of Multibuilding Systems
## 3 Optimization Procedure
### Optimization Variables and Associated Multibuilding Model  
The optimization variables are organized in a list \(v=[\overline{\alpha},d]\), where \(\overline{\alpha}=[\overline{\alpha}_{1},\ldots,\overline{\alpha}_{\overline{ \gamma}}]\) is the list of dampers allocation and \(d=[d_{1},\ldots,d_{n_{d}}]\) is the list of damping coefficients. To carry out the optimization process, for a given list of optimization variables \(v=[\overline{\alpha},d]\), we have to compute the damping schemes \(\widehat{\mathcal{C}}^{(1)},\ldots,\widehat{\mathcal{C}}^{(m)}\), \(\widehat{\mathcal{C}}^{(1)},\ldots,\widehat{\mathcal{C}}^{(m-1)}\) and the associated damping matrices \(\widehat{\mathbf{C}}^{(1)},\ldots,\widehat{\mathbf{C}}^{(m)}\), \(\widehat{\mathbf{C}}^{(1)},\ldots,\widehat{\mathbf{C}}^{(m-1)}\). To simplify that task, we will denote by \(\pi(L)\) the list of positions of the nonzero elements in the list \(L=[l_{1},\ldots,l_{p}]\). We will also use the shorthands \(sum(L)=\sum_{i=1}^{p}l_{i}\); \(L(i_{1}:i_{2})=[l_{i_{1}},\ldots,l_{i_{2}}]\) for \(i_{1}\leq i_{2}\); and \(L(\pi)=[l_{\pi_{1}},\ldots,l_{\pi_{k}}]\) for a list of positions \(\pi=[\pi_{1},\ldots,\pi_{k}]\). To obtain the matrices of interstory damping \(\widehat{\mathbf{C}}^{(j)}\), \(j=1,\ldots,m\), we consider the lists of allowed interstory damper positions \(\hat{\sigma}^{(j)}=[\hat{\sigma}_{1}^{j},\ldots,\hat{\sigma}_{\hat{\eta}_{j}} ^{j}]\), \(j=1,\ldots,m\). For \(j\) values with \(\hat{\eta}_{j}=0\), there can not be any interstory damper implemented in building \(\mathcal{B}^{(j)}\) and we directly set \(\hat{\eta}_{j}=0\) and \(\widehat{\mathbf{C}}^{(j)}=[\mathbf{0}]_{n\times n}\). Next, we define the cumulative numbers \(\hat{\theta}_{0}=0\), \(\hat{\theta}_{j}=\hat{\eta}_{1}+\cdots+\hat{\eta}_{j}\), \(j\geq 1\) and, for \(j\) values with \(\hat{\eta}_{j}>0\), we extract the list  
\[\hat{\alpha}^{(j)}=[\hat{\alpha}_{1}^{j},\ldots,\hat{\alpha}_{\hat{\eta}_{j}} ^{j}]=\overline{\alpha}(\hat{\theta}_{j-1}+1:\hat{\theta}_{j}) \tag{50}\]  
and compute the number of interstory dampers \(\hat{\eta}_{j}=sum(\hat{\alpha}^{(j)})\) allocated in \(\mathcal{B}^{(j)}\). For \(j\) values with \(\hat{\eta}_{j}=0\), there are no dampers allocated in \(\mathcal{B}^{(j)}\) and we set \(\widehat{\mathbf{C}}^{(j)}=[\mathbf{0}]_{n\times n}\); for \(j\) values with \(\hat{\eta}_{j}>0\), we compute the list of indexes \(\hat{\pi}^{(j)}=\pi(\hat{\alpha}^{(j)})\) that contains the positions of the \(\hat{\eta}_{j}\) nonzero elements in \(\hat{\alpha}^{(j)}\) and obtain the list of interstory positions \(\hat{p}^{(j)}=\hat{\sigma}^{(j)}\big{(}\hat{\pi}^{(j)}\big{)}\) where the \(\hat{\eta}_{j}\) dampers are allocated. To compute the corresponding list of damping coefficients, we define the cumulative numbers \(\widehat{N}_{0}=0\), \(\widehat{N}_{j}=\hat{n}_{1}+\cdots+\hat{n}_{j}\), for \(j\geq 1\), and extract the coefficient sublist \(\hat{\epsilon}^{(j)}=d(\widehat{N}_{j-1}+1:\widehat{N}_{j})\). After obtaining the actuation scheme \(\widehat{\mathcal{C}}^{(j)}=[\hat{p}^{(j)},\hat{\epsilon}^{(j)}]\), the associated damping matrix \(\widehat{\mathbf{C}}^{(j)}\) can be computed as indicated in Equation (9). Analogously, to obtain the interbuilding damping matrices \(\widehat{\mathbf{C}}^{(j)}\), \(j=1,\ldots,m-1\), we consider the lists of allowed interbuilding damper positions \(\hat{\sigma}^{(j)}=[\hat{\sigma}_{1}^{j},\ldots,\hat{\sigma}_{\hat{\eta}_{j}} ^{j}]\), \(j=1,\ldots,m-1\). For \(j\) values with \(\tilde{\eta}_{j}=0\), there can not be any interbuilding damper implemented between buildings \(\mathcal{B}^{(j)}\) and \(\mathcal{B}^{(j+1)}\), and we set \(\widehat{\mathbf{C}}^{(j)}=[\mathbf{0}]_{n\times n}\).