## 2 The Analysis of Structures with ATMD  
To investigate the structural responses to seismic excitation, a dynamic analysis of the structure must be performed. To conduct a dynamic analysis, the structure models' equations of motion must be solved. This study considers a shear building model with an ATMD positioned on the top story (Figure 3). The analysis of the structure models was performed using Matlab with Simulink [30]. This process is repeated for every iteration of the optimization process and for different earthquake excitations to find robust solutions that are not sensitive to the change in excitation. The generated Matlab Simulink diagrams of the equations of motion of the structure use a 4 th-order Rung--Kutta method for the time history responses. Figure 3: A structural model with ATMD on the top. As shown in Figure 3, the properties of the story are denoted by m\({}_{\rm i}\), k\({}_{\rm i}\), and c\({}_{\rm i}\) for the mass, stiffness, and damping coefficient of the ith story of the structure, respectively. The properties of the ATMD are shown as m\({}_{\rm d}\), k\({}_{\rm d}\), and c\({}_{\rm d}\) for the mass, stiffness, and damping, respectively. The ATMD is attached to an actuator to provide a control force. This force is applied to the ATMD and the top story (N\({}^{\rm th}\)) as a reaction. As classically known, the equation of structure is written as Equation (1). \[\rm{M\ddot{x}(t)+C\dot{x}(t)+Kx(t)=-M[1]\ddot{x}_{g}(t)+F(t)} \tag{1}\]  
M, K, and C are the mass, stiffness, and damping matrixes, respectively, as follows. \[\rm{M=diag[m_{1}\;m_{2}\dots\;m_{N}\;m_{d}]} \tag{2}\]  
\[\rm{C=}\left[ \begin{array}{cccccc}(c_{1}+c_{2})&-c_{2}&&&&\\ -c_{2}&(c_{2}+c_{3})&-c_{3}&&&\\ &\cdot&\cdot&&&\\ &\cdot&\cdot&\cdot&&\\ &&&-c_{N}&(c_{N}+c_{d})&-c_{d}\\ &&&&-c_{d}&c_{d}\end{array} \right] \tag{3}\]  
\[\rm{K=}\left[ \begin{array}{cccccc}(k_{1}+k_{2})&-k_{2}&&&&\\ -k_{2}&(k_{2}+k_{3})&-k_{3}&&&\\ &\cdot&\cdot&&&\\ &\cdot&\cdot&\cdot&&&\\ &&&\cdot&\cdot&\cdot&&\\ &&&-k_{N}&(k_{N}+k_{d})&-k_{d}\\ &&&&-k_{d}&k_{d}\end{array} \right] \tag{4}\]  
These three matrices are multiplied with the response and its derivative respect to time, as seen in Equation (1). The response of the structure x(t) is the vector of story and ATMD displacements, as shown as Equation (5). The control force vector (F(t)) is as seen Equation (6), and Fu represents the control force produced by the actuator. \[\rm{x(t)=\left\{ \begin{array}{c}x_{1}\\ x_{2}\\ \vdots\\ x_{N}\\ x_{d}\end{array} \right\}} \tag{5}\]  
\[\rm{F(t)=\left\{ \begin{array}{c}0\\ 0\\ \vdots\\ F_{u}\\ -F_{u}\end{array} \right\}} \tag{6}\]  
As seen in Equation (7), the control force is produced by the multiplication of trust constant (K\({}_{\rm f}\)) and current of armature coil (i\({}_{\rm ATMD}\)). \[\rm{F_{u}=k\dot{\rm{a}}_{\rm ATMD}} \tag{7}\]The current of armature coil can be found according to Equation (8), where R, K\({}_{\rm e}\) and u represent the resistance value, the induced voltage constant of armature coil and the control signal produced according to control algorithm, respectively. The velocity values of ATMD (\(\dot{x}_{\rm d}\)) and top story (\(\dot{x}_{\rm N}\)) are also used in Equation (8). \[\rm{Ri}_{ATMD}+k_{\rm e}(\dot{x}_{\rm d}-\dot{x}_{\rm N})=u \tag{8}\]  
In the present study, the control signal is found according to PID controllers. The formulation of PID controllers is shown as Equation (9). \[u=k_{\rm p}\bigg{[}e(t)+T_{\rm d}\frac{de(t)}{dt}+\frac{1}{T_{\rm i}}\int e(t) dt\bigg{]} \tag{9}\]  
As seen in Equation (9), the PID controller parameters are the proportional gain (K\({}_{\rm p}\)), derivative time (T\({}_{\rm d}\)) and integral time (T\({}_{\rm i}\)). These linear controllers transform the error signal e(t) to control signal (u). The error signal is the chosen response of the system, which aims to reduce with control.