# Adaptive Harmony Search for Tuned Liquid Damper Optimization under Seismic Excitation
## 2 Materials and Methods
### Harmony Search and Adaptive Harmony Search Algorithm  
The harmony search algorithm is a metaheuristic algorithm inspired by the best harmony search process developed by [PERSON] et al. Memory consideration, used in classical HS, was eliminated to adapt the problem optimization, to increase the convergence capacity. In this case, a parameter called pitch adjusting rate (PAR) was not used, and the formulations of HS were simplified. In addition, the adaptive version of HS was used to actively change two parameters of HS. Due to the use of adaptive parameters and the elimination of PAR, the algorithm used in this study is less parameter-dependent than the classical version. In the algorithm operation, design limit values, iteration number, algorithm-specific harmony memory consideration rate (HMCR), fret width (FW), and harmony memory size (HMS) were defined. A random number between 0 and 1 is shown as \(rand\). In AHS, the initial values for the parameters were defined. These initial parameters (\(X_{initial}\)) were defined according to Equation (14) by using the whole solution range. The maximum and minimum ranges of design variables are shown as \(X_{min}\) and \(X_{max}\), respectively.  
\[X_{initial}=X_{min}+rand\ (X_{max}-X_{min})\ \text{for T}_{d},\ \zeta_{d},\ R\ \text{and h} \tag{14}\]  
\(X_{new}\) defines a candidate value of a design variable. Then, a harmony is memorized. A new harmony vector is generated, as shown in Equation (15) or (16), keeping the design within the lower and upper limit values. The results obtained by writing the harmony vector values in the objective function are stored in the memory. This process is repeated for the amount of HMS, and each harmony vector created is stored in a solution matrix.  
\[X_{new}=X_{min}+rand\ (X_{max}-X_{min})\ if\ HMCR>rand \tag{15}\]  
Another way to obtain the harmony vector is calculations based on the FW value, as shown in Equation (15). An existing candidate solution is chosen and is shown as \(X_{nt}\). Which equation will be used to create the harmony vector is decided by the HMCR value. If a randomly selected value between zero and one is less than HMCR, Equation (14) is chosen. If it is larger, Equation (15) is selected to create a new harmony vector.  
\[X_{new}=X_{n}+rand\ \text{FW}\ (X_{max}-X_{min})\ if\ HMCR\leq rand \tag{16}\]  
The design variables of the TLD optimization problem are T\({}_{d}\), \(\zeta_{d}\), R, and h. After assigning candidate values to these variables, the mass, stiffness, and damping coefficient values of the TLD can be calculated via the formulations presented in Section 2.1. Then, the coupled equation of motion, Equation (13), can be solved via dynamic analysis performed with MATLAB and Simulink [35].  
The newly created harmony vectors are compared with the previously stored old harmony vectors. If the new solutions are better than the old solution, the old solutions are updated; otherwise, the old solution remains as it is. These operations are repeated for the amount of iteration by controlling the boundary conditions, and the solution vector takes its final form. The objective function (\(f(X)\)) is the minimization of maximum top story displacement (\(dis(tm)\)) that occurs as maximum for various earthquake records in time (tm) domain analyses. It is formulated as Equation (17).  
\[f(X)=\text{minimize}(\text{max}(|dis(tm)|)) \tag{17}\]  
To obtain the adaptive harmony search algorithm, an initial value is assigned to the classical HS algorithm parameters (HMCR and FW), and these values are written in decreasing order. Thus, the optimum solution is sought for all values, from the initial value to the smallest value. Equations (18) and (19) show the HMCR and FW calculations.  
\[HMCR=HMCR_{in}\bigg{(}1-\frac{t}{mt}\bigg{)} \tag{18}\]  
\[FW=FW_{in}\bigg{(}1-\frac{t}{mt}\bigg{)} \tag{19}\]  
Here, the \(HMCR_{in}\) and \(FW_{in}\) values represent the initial values of the algorithm parameter. In the equations, \(t\) represents the iteration number and \(mt\) represents the maximum number of iterations.