## 2 Motion Equation of a Nonlinear Building System  
The AMD installed on the roof of a three-story nonlinear building is used to control the dynamic response of the structure (see Figure 1). The AMD control system consists of sensors, a controller, and a hydraulic actuator. The structural response is measured by the sensors and fed back to the controller. Then the controller computes at real-time the active control force \(f\) according to a control algorithm and turns it into control voltage to be exerted to drive the hydraulic actuator. The hydraulic actuator is operated by the control signal generated by the neuro-controller. Lastly, the AMD attached to the actuator applies a reaction force, caused by the inertial force of the AMD, to the structure. Therefore, actuator-structure interaction is included in the system. Figure 1: Idealized schematic diagram of a three-story building structure with an active mass damper (AMD). The differential equation of the three-story nonlinear structure with an AMD is  
\[\mathbf{M}\ddot{\mathbf{x}}+\mathbf{C}\dot{\mathbf{x}}+\mathbf{K}\Big{(}\mathbf{x },\dot{\mathbf{x}}\Big{)}=\mathbf{L}f-\mathbf{M}[\mathbf{1}]\ddot{x}_{g} \tag{1}\]  
where \(\mathbf{M}\) and \(\mathbf{C}\) are the mass and damping matrices; \(\mathbf{x}=[x_{1}\,x_{2}\,x_{3}\,x_{a}]^{\mathrm{T}}\), where \(x_{i}\) and \(x_{a}\) are the displacement of the \(i\)th story and the AMD; \(\mathbf{x}\), \(\dot{\mathbf{x}}\), and \(\ddot{\mathbf{x}}\) are the displacement, velocity, and acceleration vectors relative to the ground, respectively; \(\mathbf{K}\Big{(}\mathbf{x},\dot{\mathbf{x}}\Big{)}\) is the restoring force vector; \(f\) is the control force of the actuator; \(\mathbf{L}\) is the location vector of the actuator; \(\ddot{x}_{g}\) is the ground acceleration; and \(\mathbf{[1]}\) is the location vector of the ground acceleration. In order to make it easy to use the nonlinear model, Equation (1) was transformed into an inter-story coordinate system by introducing  
\[\mathbf{x}_{s}=\mathbf{T}\mathbf{x} \tag{2}\]  
where  
\[\mathbf{x}_{s}=[x_{s1}\,x_{s2}\,x_{s3}\,x_{s\mathrm{i}}]^{\mathrm{T}} \tag{3}\]  
and  
\[\mathbf{T}=\left[ \begin{array}{rrrr}1&0&0&0\\ -1&1&0&0\\ 0&-1&1&0\\ 0&0&-1&1\end{array} \right] \tag{4}\]  
where \(x_{si}\) is the inter-story displacement of the \(i\)th story and \(x_{sa}\) is the relative displacement of the AMD and the top of the structure. Substituting Equation (2) into Equation (1), Equation (1) can be rewritten as  
\[\mathbf{M}_{s}\ddot{\mathbf{x}}_{s}+\mathbf{C}_{s}\dot{\mathbf{x}}_{s}+ \mathbf{K}_{s}\Big{(}\mathbf{x}_{s},\ \dot{\mathbf{x}}_{s}\Big{)}=\mathbf{L}f-\mathbf{M}[\mathbf{1}]\ddot{x}_{g} \tag{5}\]  
Therefore, the transformed mass and damping matrices can be denoted as  
\[\mathbf{M}_{s} =\mathbf{M}\mathbf{T}^{-1} \tag{6}\] \[\mathbf{C}_{s} =\mathbf{C}\mathbf{T}^{-1} \tag{7}\]  
The restoring force can be obtained from the nonlinear model proposed by [PERSON] and [PERSON] [27] and is composed of a linear \((\alpha k_{0}x_{s})\) and a nonlinear \(((1-\alpha)k_{0}dy)\) term  
\[\mathbf{K}_{s}\Big{(}\mathbf{x}_{s},\dot{\mathbf{x}}_{s}\Big{)}=\alpha k_{0}x _{s}+(1-\alpha)k_{0}dy \tag{8}\]  
where \(k_{0}\), \(x_{s}\), \(\alpha\), and \(d\) are the linear stiffness, the inter-story displacement at each level, its contribution to the restoring force, and a constant, respectively. If \(\alpha\) is 1, the nonlinear term becomes zero and Equation (8) means linear stiffness. The term \(y\) is the displacement of the nonlinear part, satisfying the equation [27]  
\[\dot{y}=\frac{1}{d}\Big{(}\rho\dot{x}_{s}-\mu\big{|}\dot{x}_{s}\big{|}y\big{|}^ {p-1}y-\sigma\dot{x}_{s}\big{|}y\big{|}^{p}\Big{)} \tag{9}\]  
where \(\rho\), \(\mu\), \(p\), and \(\sigma\) are the constants that affect the hysteretic behavior, and \(\dot{x}_{s}\) is the inter-story velocity at each level. The parameters \(\rho\), \(\mu\), \(p\), and \(\sigma\) play the role of governing and controlling the scale and general shape of the hysteresis loop.