Introduction

Castellated beams with openings in their webs are extensively utilized in steel structure buildings in Iran. The web openings are regularly and closely spaced along the beams at constant intervals. The main advantage of castellated beams is their cost-saving due to their efficient use. Voids in castellated beams’ web make these beams deeper than solid web beams with the same weight. Since deeper beams have more moment of inertia and section modulus, castellated beams cover a more extended span with less weight than solid web beams. The second advantage of castellated beams is that they can pass utilities and buildings’ mechanical ducts through their openings. Moreover, from the aesthetic point of view, castellated beams give an appealing appearance in exposed steel structures such as the ceiling of parking stories in commercial buildings.

Despite the abovementioned benefits, web openings cause complexities in designing castellated beams. For example, the web openings considerably affect castellated beams’ shear and buckling strength (Soltani et al., 2012). In addition, extra failure modes are observed in castellated beams. Kerdal and Nethercot (1984) experimentally demonstrate these failure modes. These failure modes must be considered in designing castellated beams. Web buckling of castellated beams is studied by Tsavdaridis (Tsavdaridis & D’Mello, 2011).

Although there is no specific regulatory rule to restrict using castellated beams in steel design standards, the lack of sufficient studies related to the seismic behavior of castellated beams brings about an obstacle to using them as main girders. However, castellated beams are mainly used as secondary beams connecting main girder beams. The central role of secondary beams is to support and transfer floor gravity loads to the main girder beams. The secondary beams connections to the main beams are commonly designed as simple connections to not exert further moment on the main supporting beams.

There are several castellated beam types based on web-opening shapes. Two well-known opening shapes are circular and hexagonal. However, castellated beams are not limited to these two types, and there are other opening shapes, such as sinusoidal, elliptical, square, and octagonal. Castellated beams with circular openings are also known as cellular beams. Web openings are not produced by cutting out materials from solid web beams, because waste and construction activities would be considerable. Instead, these openings are created by cutting the solid web beams longitudinally in a specified pattern and connecting two cut parts by an offset. The solid web beam is hereafter called the original beam. The specified cutting pattern for hexagonal castellated beams is the zig-zag pattern. The welding process is used to connect two cut parts.

The design of castellated beams includes specifying the dimensions of web openings and the section of the original beam. As a result, the number of parameters assigned for designing castellated beams is more than the counterpart for solid web beam design because cutting shape parameters must also be determined. Moreover, as previously stated, due to their complex behavior, there are also more design criteria for designing castellated beams than solid web beams. Additional design parameters and design criteria lead to the fact that the design procedure of castellated beams is more complex than the design of conventional solid web beams.

The design of castellated beams is to specify design parameters so that the corresponding beam meets the design criteria. This procedure can be done with a trial-and-error activity, but it could be time-consuming, and the final design could be uneconomic. Suppose it is desired to find the design with minimum cost and improve the efficiency of the design process. In that case, the design problem of castellated beams can be treated as an optimization problem.

In the optimization problems context, the parameters that are desired to be found are called decision variables. In designing castellated beams, the solid web beam’s cutting parameters and cross-section parameters are considered decision variables. Constraint functions handle the design criteria. In each optimization problem, a quantity is desired to be minimum. This quantity must be expressed as functions of decision variables. This function is called the objective function. In castellated beam optimization problems, the aim is to minimize construction costs. The objective function of this problem would be a function that takes decision variables as input and return the total cost as output. It should be mentioned that the total cost includes material costs and construction costs. Optimization problems are called constrained optimization problems, which aim to find a set of decision variables that minimize an objective function while meeting a set of constraint functions. The problem of designing castellated beams is a constrained optimization problem.

Numerous methods are available to solve constrained optimization problems. Some of these methods are classified as classical optimization methods, which have mathematical bases. These methods usually require gradient and Hessian matrix information of objective functions and constraint functions. These methods start from one random point in decision variables space and set that point as a reference point. Afterward, a prespecified algorithm is used to move from a reference point to another point where its objective function values are smaller than a reference point. The next point is considered a new reference point. This process is continued until a stop** criterion is satisfied. The main drawback of classical optimization methods is getting trapped in local optimization points. This drawback hinders finding global optimal points, which is the primary goal of constrained optimization methods.

Meta-heuristic algorithms are introduced to alleviate the drawbacks of classical optimization methods. Meta-heuristic algorithms are based on simulating natural processes rather than solving complicated mathematical formulas. There are several phenomena in nature that optimal solution is found without solving any mathematical formula. The interesting point is that the mathematical formulation of these phenomena in nature could be complicated, and it might be impossible to find optimal solutions by mathematical formulations. Meta-heuristics algorithms provide powerful tools to solve problems that classical optimization methods could not quickly solve. Another advantage of meta-heuristic algorithms is the simplicity of their implementations.

There are many meta-heuristic algorithms developed to solve unconstrained optimization problems. Genetic Algorithm (GA) is the most well-known evolutionary algorithm that simulates natural selection in nature (Holland, 1975). Another example of meta-heuristic algorithms is Particle Swarm Optimization (PSO) which mimics the social behavior of birds flocking (Eberhart & Kennedy, 1995). Grey Wolf Optimizer (GWO) is another evolutionary algorithm that mimics grey wolves’ hunting mechanism and leadership hierarchy in nature (Mirjalili et al., 2014). Charged System Search (CSS) is a meta-heuristic algorithm developed based on governing the Newtonian laws of mechanics and Coulomb law from electrostatics (Kaveh & Talatahari, 2010). Colliding Bodies Optimization (CBO) is another meta-heuristic algorithm that imitates collision between bodies (Kaveh & Mahdavi, 2014). Imperialist Competitive Algorithm (ICA) simulates the competition between imperialists (Atashpaz-Gargari & Lucas, 2007). Shabani et al., (2020) developed a new meta-heuristic algorithm that simulates the exploration behavior of humans during search and rescue operations. Martínez-Álvarez et al., (2020) proposed a bioinspired meta-heuristic simulating how the coronavirus spreads and infects healthy people.

Evolutionary algorithms start with a set of solution candidates called the initial population; this contradicts classical optimization methods that begin with a single solution candidate. Initial solution candidates in meta-heuristic algorithms are randomly produced to cover the entire decision variables space. This search space coverage prevents the algorithm from getting trapped in the local optimum solution. This property of meta-heuristic algorithms is the main superior to classical optimization methods. A Vibrating Particle System (VPS) mimics free vibration of a single degree of freedom with viscous dam** (Kaveh & Ghazaan, 2017). Harmony Search (HS) algorithm simulates the improvisation of music players (Geem et al., 2001).

Meta-heuristic algorithms have widespread applications in solving engineering optimization problems. Many studies have employed meta-heuristic algorithms to solve optimization problems. For example, Mashayekhi et al., (2019a) employed a PSO algorithm to generate endurance time excitation functions. Mashayekhi et al., (2019b) utilized the ICA method in simulating Endurance Time Excitation Functions. Shabani et al., (2019) employed a search and rescue optimization algorithm to design truss structures with discrete decision variables. Donyaii and Sarraf, (2020) utilized a coronavirus optimization algorithm to optimize reservoir operation.

Several studies have employed Meta-heuristic algorithms in designing castellated beams. For example, Kaveh and Shokohi, (2014) employed a CSS algorithm to optimize the cost of castellated beams. Kaveh and Shokohi, (2016a) used the War optimization algorithm to solve design castellated beam optimization problems. Kaveh and Shokohi developed a hybrid optimization algorithm based on CBO and PSO algorithms to optimize castellated beams (Kaveh & Mahdavi, 2015; Kaveh & Shokohi, 2015, 2016b). Kaveh et al. employed GWO to design castellated beams (Kaveh & Shokohi, 2016c). Shendge et al. used finite element analysis to optimize castellated beams’ design (Shendge & Shinde, 2015). Pástor et al., (2016) used numerical methods and experiments to optimize the shape and geometry of castellated beams. Budi et al. discussed the size and distance of hexagonal holes in castellated beams (Budi & Partono, 2017). They used finite element analysis for optimizing castellated beams. Kaveh et al. employed a VBS algorithm as a meta-heuristic algorithm to optimize composite steel deck slabs and supporting castellated beams consisting of interior beams, edge beams, and girders (Kaveh & Fakoor, 2021). Erdal et al., (2016) investigated the influence of Random number sequences in the HS algorithm on the optimum design of steel castellated beams. Kaveh applied the Tug of War optimization algorithm for designing castellated beams (Kaveh, 2017). Erdal et al. employed HS and PSO to design cellular beams (Erdal et al., 2011). Kaveh et al. investigated the effect of composite action and semi-rigid connection on the optimum design of castellated beams (Kaveh & Ghafari, 2018). Tsavdaridis and D’Mello optimized castellated beams’ novel elliptically based web-opening shapes for better structural performance (Tsavdaridis & D’Mello, 2012).

Even though the castellated beam designing problem has been solved by several methods, solving this problem can be further investigated by newly developed meta-heuristic algorithms, such as Harris Hawks Optimizer (HHO) (Heidari et al., 2019), or hybridization of current methods. Kaveh et al., (2022) used a hybrid HHO and ICA algorithm for structural optimization problems. The main reason for this further investigation is to reach better results or improve the efficiency of the optimization process. In addition, the optimization formulation of this problem can be improved by including more constraints or changing the objective function.

This study aims to solve the optimum design of castellated beams by using a newly proposed method based on the combination of Harris Hawks Optimization (HHO) and Particle Swarm Optimization (PSO) algorithms. The flowchart of the proposed algorithm is presented. The design problem of castellated beams is formulated. The proposed algorithm is used to design three 4-m, 8-m, and 9-m beams with one fixed-end, simply supported, and two fixed-end support conditions, respectively. The results are then compared with five existing algorithms to explore the efficiency of the proposed method.

Design of castellated beams

In this section, the design requirements of castellated beams are presented. These requirements fall into two general categories: ultimate limit state requirements and serviceability limit state requirements. A Limit state refers to the condition that the structural behavior no longer meets the owner’s desired conditions. These two limit states are discussed in two following sub-sections. In addition to these requirements, there are several limitations regarding the size and shape of openings. These limitations are discussed at the end of this section.

Ultimate limit states

In the ultimate limit states, the demand in structural members exceeds the nominal strength of members, or instability in structural members occurs. These requirements are expressed in terms of the strength of members and members’ demands. Each limit state is defined based on failure modes observed in experimental tests. For castellated beams, web openings and welds bring about some failure modes not observed in solid web beams.

The strength of castellated beams associated with each limit state depends upon the cross-section of the original beam, geometry, and shape of web openings. The basic geometry and notations of castellated beams are illustrated in Fig. 1. In this figure, the construction stages of hexagonal castellated beams are also shown. Net space between two adjacent openings, which is welded to connect two parts, is denoted by e. The center-to-center distance between two adjacent openings is denoted by S. S is called open spacing, and more open spacing leads to lighter castellated beams. d is the total depth of the original I-section. h is the height of the openings, and θ is the cutting angle of the web openings. dg is the total depth of the castellated beam, S is the distance between the center of web openings, and a0 is the total width of web openings.

Fig. 1
figure 1

Basic geometry and construction stages of hexagonal castellated beam: a cutting pattern of root I section, b Separating, shifting, and rotating one part, c generating a castellated beam by rejoining two parts by welding

Different failure modes of castellated beams are discussed here. It must be noted that, in this study, it is assumed that the compression flange of castellated beams is restrained in the floor concrete so that lateral-torsional buckling cannot happen. This assumption in composite floor systems is rational. Consequently, this limit state is not considered in the designing procedure.

The first failure mode considered in this study is overall beam flexural capacity. According to this limit state, a castellated beam must have enough flexural strength to resist external loading. The formula to check this limit state is given in Eq. (1). The required parameters of a cross-section of the castellated beam are shown in Fig. 2.

$$M_{u} \le F_{y} \left( {\left( {b_{f} - t_{w} } \right)t_{f} + d_{T} \times t_{w} } \right) \times d_{u} ,$$
(1)

where Fy is the material’s yield strength, and du is the distance between the centroid of the top and bottom tee sections. bftf, and tw are the original I section’s flange width, flange thickness, and web thickness. h is the height of the web opening, as shown in Fig. 1Mu is the maximum internal moment of the castellated beam due to external factored loads. Mu is calculated from the structural analysis of castellated beams under external loads. dT is the depth of the top and bottom tee sections.

Fig. 2
figure 2

Cross-section of the castellated beam

The second failure mode considered in this study is a shear failure. Two shear mode failures could occur in castellated beams: vertical shear failure and horizontal shear failure. Vertical shear force is resisted by top and bottom tees. Vertical shear capacity (Vnt) is calculated according to Eq. (2).

$$V_{nt} = 0.6\alpha_{v} F_{y} d_{T} t_{w} ,$$
(2)

where αv is computed according to Eq. (3); but is not taken greater than one.

$$\alpha_{v} = \frac{{\sqrt 6 d_{T} }}{{a_{0} + \sqrt 3 d_{T} }} \le 1.$$
(3)

The top tee resisted half of the vertical shear force, and the bottom tee resisted the other half. This matter is illustrated in Fig. 3. As a result, the following condition (Eq. 4) must be satisfied in the design of castellated beams.

$$\frac{{V_{u} }}{2} \le \phi_{v} V_{nt} ,$$
(4)

where ϕv is the shear reduction factor which is taken to 0.9.

Fig. 3
figure 3

Horizontal shear in the castellated beams

The difference between the axial forces of two tees around a web opening causes horizontal shear in a web post. This mechanism is shown in Fig. 3. Horizontal shear is calculated by Eq. (5).

$$V_{h} = \frac{{\left( {V_{1} + V_{2} } \right)s}}{2g}.$$
(5)

Horizontal shear capacity (Vnh) is computed by Eq. (6).

$$V_{nh} = 0.6F_{y} et_{w} .$$
(6)

The criterion presented in Eq. (7) must be satisfied in designing castellated beams.

$$V_{h} \le \phi_{v} V_{nh} .$$
(7)

Another failure mode considered in this study is web-post buckling. This mode arises from horizontal shear force and bending moment at the mid-height of the web post. This failure mode can be treated by using column analogies or beam analogies (Aglan & Redwood, 1974). In the design method given by Ward, Eq. (8) is utilized to check web-post buckling resistance in bending (Ward, 1990).

$$\frac{{M_{sd} }}{{M_{el.rd} }} \le \min \left\{ {C_{1} \alpha - C_{2} \alpha^{2} - C_{3} ,0.6} \right\},$$
(8)

where Msd is the elastic bending moment at the critical web-post section, which is Vh × h/2. Mel, rd is the elastic bending resistance of the critical web-post section, which is tw × Fy × (S-2e)2/6. α is S/h; C1, C2, and C3 are geometric parameter constants. They are calculated as follows according to Eq. (9):

$$\begin{gathered} C_{1} = 5.097 + 0.1464\beta - 0.00174\beta^{2} \hfill \\ C_{2} = 1.441 + 0.0625\beta - 0.000683\beta^{2} \hfill \\ C_{3} = 3.645 + 0.0853\beta - 0.00108\beta^{2} , \hfill \\ \end{gathered}$$
(9)

where \(\beta =h/{t}_{w}\).

Another failure mode considered in this study is the Vierendeel mechanism. Four plastic hinges are formed around a single opening in this failure mode, as shown in Fig. 4a.

Fig. 4
figure 4

a Vierendeel mechanism, b Free body diagram of opening length

The top and bottom tee sections must individually carry half of the total shear force that produces a secondary moment. This secondary moment is also known as the Vierendeel moment. This secondary moment is added to the conventional moment, called the primary moment. Tee sections must resist both primary and secondary moments. To evade this failure mode, the following condition must be satisfied according to Eq. (10):

$$\left| {\frac{{m_{u} }}{{\phi_{b} m_{n} }}} \right| + \left| {\frac{{M_{u} }}{{\phi_{b} M_{n} }}} \right| \le 1,$$
(10)

where ϕb is the resistance factor for flexure, taken to 0.9, mu and Mu are secondary and primary moments, respectively. \({m}_{n}\) is the nominal flexure strength of the tee sections, which is calculated by Eq. (11):

$$m_{n} = Z_{T} F_{y} \le 1.6S_{i} F_{y} ,$$
(11)

where ZT is the plastic section modulus of tee sections, Mn is the nominal flexure strength of the castellated beam section at the mid-length opening, which is calculated by Eq. (12):

$$M_{n} = Z_{x} F_{y} ,$$
(12)

where Zx is the plastic section modulus of the castellated beam section.

The last failure mode considered in this study is the compressive strength of webs. The compressive force acting on the web of castellated beams is schematically shown in Fig. 5. From the free body diagram of the web-post, the compressive force acting on the web-post (P) is WS/2. The web-post area (AW) at the critical section is e × tw. The radius of gyration of the web-post section is 0.3tw. The nominal compressive strength of the web-post, Fcr, is calculated based on Euler buckling stress Fe, which is calculated based on the column slenderness. Column slenderness; KL/r is h/(0.3tw) and must be less than 200. Elastic buckling Euler stress is computed according to Eq. (13):

$$F_{e} = \frac{{\pi^{2} E}}{{\left( \frac{KL}{r} \right)^{2} }}.$$
(13)
Fig. 5
figure 5

Web-post buckling

Critical buckling stress is calculated by Eq. (14):

$$\begin{gathered} {\text{if}}\,F_{e} \ge 0.44F_{y} \Rightarrow F_{cr} = \left[ {0.658^{{\frac{{F_{y} }}{{F_{e} }}}} } \right]F_{y} \hfill \\ {\text{if}}\,F_{e} < 0.44F_{y} \Rightarrow F_{cr} = 0.877F_{y} . \hfill \\ \end{gathered}$$
(14)

Then, Eq. (15) is used to check web compressive buckling. Nominal compressive strength, Pn, is calculated by Fcr × (etw).

$$\frac{{P_{u} }}{{\phi_{C} P_{n} }} \le 1,$$
(15)

where ϕc is the compression reduction factor which is taken to 0.9.

Serviceability limit state

In the serviceability limit state, the structure’s comfortability and usability are of concern. In this study, deflection control is performed. It should be mentioned that shear deformation in castellated beams is considerable and cannot be ignored. The maximum allowable deflection of the beam, Δmax, is set to L/360, where L is the span length of the beam. More information regarding the calculation of the deflection of castellated beams is provided by Raftoyiannis and Ioannidis (2006).

Hole dimension limitations

This sub-section discusses limitations regarding the dimensions of holes in castellated beams. The first rule is that the hole height ratio over the castellated beam’s web depth must be less than 0.7, according to Eq. (16).

$$\frac{{h_{0} }}{{d_{g} - 2t_{f} }} \le 0.7 \to h_{0} - 0.7\left( {d_{g} - 2t_{f} } \right) \le 0.$$
(16)

The second rule is that the ratio of e over the hole width, a0, must lie between 1/4 and 1/2. This rule can be re-written as Eq. (17):

$$\frac{1}{4} \le \frac{e}{{a_{0} }} \le \frac{1}{2}.$$
(17)

Since a0 is equal to h0cotθ + e, the second rule leads to Eq. (18):

$$\begin{gathered} e - h_{0} \cot \theta \le 0 \hfill \\ h_{0} \cot \theta - 3e \le 0. \hfill \\ \end{gathered}$$
(18)

The third rule is that the ratio of the hole width to the hole height must be less than 2, according to Eq. (19)

$$\frac{{a_{0} }}{{h_{0} }} \le 2.$$
(19)

By substituting a0 by h0cotθ + e, the third rule becomes as Eq. (20):

$$h_{0} \cot \theta + e - 3h_{0} \le 0.$$
(20)

The fourth rule is that the ratio of the total web height of the castellated beam over the overall height of tee sections must be less than 5, according to Eq. (21). Factor 2 in the denominator is based on the fact that both top and bottom tee sections are considered.

$$\frac{{d_{g} - 2t_{f} }}{{2\left( {d_{T} - t_{f} } \right)}} \le 5.$$
(21)

By expanding the fourth rule, Eq. (22) is deduced.

$$\left( {d_{g} - 2t_{f} } \right) - 10\left( {d_{T} - t_{f} } \right) \le 0.$$
(22)

The fifth cutting rule is that the cutting angle must be between 45 and 64 degrees as Eq. (23):

$$45 \le \theta \le 64.$$
(23)

Optimization of the castellated beams

In this section, the design of castellated beams is formulated as an optimization problem. In each optimization problem, the main objective is finding a set of variables to minimize or maximize the desired quantity. The variables are called decision variables. The function representing the desired quantity as a function of the decision variables is known as the objective function.

Decision variables

The decision variables must be specified in the first step of defining each optimization problem. In this study, seven decision variables are considered. The first to fourth decision variables are the width, height, flange thickness, and web thickness of the original I-section beam, respectively. The fifth decision variable must be determined is the cutting depth, h (x5). The sixth variable; x6, is the hole spacing, S. The seventh decision variable; x7, is the cutting angle, θ. The first to fourth decision variables are shown schematically on the I cross-section of the main beam in Fig. 6.

Fig. 6
figure 6

The first to fourth decision variables; related to the optimization problem of castellated beam design

Objective function

The objective function is specified in the second step in defining an optimization problem. In the design of castellated beams, the quantity that is desired to be minimized is the total cost. In this study, it is assumed that the total cost is comprised of three parts: the original beam, cutting, and welding price. The two latter parts are associated with construction costs. The objective function is defined in Eq. (24):

$$F = W_{{{\text{OB}}}} \times P_{1} + L_{{{\text{cut}}}} \times P_{2} + L_{{{\text{weld}}}} \times P_{3} ,$$
(24)

where P1P2, and P3 are the prices of material per unit weight, the cutting price, and the welding price, respectively. The welding price contains the weld’s material price and the workers’ price. WOB is the weight of the original I-section beam that is determined as Eq. (25):

$$W_{{{\text{OB}}}} = \gamma \left( {2x_{1} x_{3} + x_{2} x_{4} } \right)L,$$
(25)

where γ is the density of steel, AOB is the area of the original beam section, and L is the beam span.

Lcut is the cutting length which is determined as Eq. (26):

$$L_{{{\text{cut}}}} = \frac{L}{{x_{6} }}\left( {\frac{{x_{5} }}{{\sin \left( {x_{8} } \right)}} + x_{6} - \frac{{x_{5} }}{{\tan \left( {x_{7} } \right)}}} \right).$$
(26)

Lweld is the welding length and is determined as Eq. (27):

$$L_{{{\text{weld}}}} = \frac{L}{{x_{6} }}\left( {x_{6} - \frac{{x_{5} }}{{\tan \left( {x_{7} } \right)}}} \right).$$
(27)

Constraint functions

The constraint functions must be specified after determining the objective function and the decision variables. The constraint functions are the criteria that the castellated beam must satisfy. These functions are taken directly from the castellated design section of this paper. The constraints associated with dimension limitations are presented before the requirements associated with ultimate limit state and serviceability limit states. These constraint functions are presented in Eqs. (28) to (41).

$$g_{1} = h_{0} - 0.7\left( {d_{g} - 2t_{f} } \right) \le 0$$
(28)
$$g_{2} = e - h_{0} \cot \theta \le 0$$
(29)
$$g_{3} = h_{0} \cot \theta - 3e \le 0$$
(30)
$$g_{4} = h_{0} \cot \theta + e - 3h_{0} \le 0$$
(31)
$$g_{5} = \left( {d_{g} - 2t_{f} } \right) - 10\left( {d_{T} - t_{f} } \right) \le 0$$
(32)
$$g_{6} = 45 - \theta \le 0$$
(33)
$$g_{7} = \theta - 64 \le 0$$
(34)
$$g_{8} = M_{u} - F_{y} \left( {\left( {b_{f} - t_{w} } \right)t_{f} + d_{T} \times t_{w} } \right) \times d_{u} \le 0$$
(35)
$$g_{9} = \frac{{M_{sd} }}{{M_{el.rd} }} - \min \left\{ {C_{1} \alpha - C_{2} \alpha^{2} - C_{3} ,0.6} \right\} \le 0$$
(36)
$$g_{10} = V_{h} - \phi_{v} V_{nh} \le 0$$
(37)
$$g_{11} = \frac{{V_{u} }}{2} - \phi_{v} V_{nt} \le 0$$
(38)
$$g_{12} = \left| {\frac{{m_{u} }}{{\phi_{b} m_{n} }}} \right| + \left| {\frac{{M_{u} }}{{\phi_{b} M_{n} }}} \right| - 1 \le 0$$
(39)
$$g_{13} = \frac{{P_{u} }}{{\phi_{C} P_{n} }} - 1 \le 0$$
(40)
$$g_{14} = \left| {\delta_{\max } } \right| - \frac{{L_{0} }}{360} \le 0.$$
(41)

Penalty function

The design of castellated beams is a constrained optimization problem. The penalty function method is a technique for solving constrained problems using methods developed for unconstrained problems. In the penalty function method, a term is added to the objective function called the penalty term. In the penalty term, the effect of violating the constraints is taken into account. An immense value is added to the objective function if any constraint is violated. As a result, the minimization algorithms will search for the optimal solution at points where the constraints are satisfied. The penalty term added to the objective function is presented in Eq. (42).

$$PT = \lambda * {\text{sum}}\left( {g_{i} > 0} \right),$$
(42)

where λ is a very large number whose value depends on the range of the objective function values of the optimization problem. In this study, 109 is considered. This equation calculates the sum of unsatisfied conditions, which is a natural number. If all the constraints are satisfied, the penalty amount will be zero.

Evaluation metrics

This section presents criteria for evaluating different optimization methods to solve the current optimization problem. These criteria are expressed based on fobji, which is the value of the objective function of the optimal point in run i.

  1. 1-

    Mean

The Mean index is obtained from arithmetic averaging of the objective function values at the optimal points obtained using M times of running the desired algorithm. The Equation for obtaining this index is given in Eq. (43).

$$Mean = \frac{{\sum\nolimits_{i = 1}^{M} {fobj_{i} } }}{M}.$$
(43)
  1. 2-

    Best

The Best index is obtained based on the best optimal solution obtained from running the algorithm M times. The equation for obtaining this index is given in Eq. (44).

$$Best = {\text{min}}_{i = 1}^{M} \left( {{\text{fobj}}_{i} } \right).$$
(44)
  1. 3-

    Worst

The Worst index is obtained based on the best optimal solution from running the algorithm M times. The Equation for obtaining this index is given in Eq. (45).

$$Worst = {\text{max}}_{i = 1}^{M} \left( {{\text{fobj}}_{i} } \right).$$
(45)
  1. 4-

    Standard deviation

The standard deviation index is obtained based on calculating the standard deviation of the objective function values at the optimal points obtained using M times of running the desired algorithm. The Equation for obtaining this index is given in Eq. (46).

$$std = \sqrt {\frac{{\sum\nolimits_{i = 1}^{M} {\left( {fobj_{i} - mean} \right)^{2} } }}{M - 1}} .$$
(46)

Harris Hawks Optimizer (HHO)

Recently, many meta-heuristic optimization algorithms have been developed and used to solve many problems in different fields. Meta-heuristic optimization algorithms are inspired by nature and typically related to animal behavior, physical phenomenon, or evolutionary concepts.

Harris Hawks Optimizer (HHO) is one of the most recent meta-heuristic algorithms developed by Heidari et al. in 2019 (Donyaii & Sarraf, 2020). The HHO algorithm is inspired by the Harris hawk hunting pattern, known as the surprise pounce. This hunting pattern is a cooperative behavior of Harris hawks that attack the prey from different directions to surprise it. Harris hawks use different chasing patterns in hunting, each of which depends on the scenario’s dynamic nature and the prey’s escape pattern. HHO, as a stochastic meta-heuristic algorithm, can solve complex engineering problems. HHO has an exploration and exploitation phase. The stages of HHO depend on the amount of prey energy, shown in Fig. 7. A summary of this method is described in the following sub-sections:

Fig. 7
figure 7

Different stages of HHO (Heidari et al., 2019)

Exploration phase

In the exploration phase of the HHO, the algorithm mimics the situation in which the Harris hawks cannot correctly track the prey. They just perch and wait to detect new prey. In the HHO, Harris hawks represent candidate solutions, and the prey is the best solution found so far. The Harris hawks perch randomly in some locations and wait to detect prey based on two operations selected based on the probability of q, based on Eq. (47). If q < 0.5, hawks choose their position based on the position of the population and the prey, while q ≥ 0.5, hawks sit on a tree randomly.

$$X\left(t+1\right)= \left\{\begin{array}{c}{X}_{rand}\left(t\right)-{r}_{1} \left|{X}_{rand}\left(t\right)-2{r}_{2}X\left(t\right)\right| :q\ge 0.5\\ {(X}_{rabbit}\left(t\right)- {X}_{m}\left(t\right)) -{r}_{3} (LB+{r}_{4}(UB-LB)) :q<0.5,\end{array}\right.$$
(47)

where \(X\left(t+1\right)\) is the position vector of hawks in the next iteration \(t\), \({X}_{rabbit}\left(t\right)\) is the position of rabbit, \(X\left(t\right)\) is the current position vector of hawks,\({r}_{1}\),\({r}_{2}\),\({r}_{3}\),\({r}_{4}\), and \(q\) are random numbers inside (0,1), which are updated in each iteration, \(LB\) and \(UB\) show the upper and lower bounds of variables, \({X}_{rand}\left(t\right)\) is a randomly selected hawk from the current population, and \({X}_{m}\left(t\right)\) is the average position of the current population of hawks. The average position of hawks is attained using Eq. (48):

$$X_{m} \left( t \right) = \frac{1}{N} \mathop \sum \limits_{i = 1}^{N} X_{i} \left( t \right),$$
(48)

where \({X}_{i}\left(t\right)\) indicates the location of each hawk in iteration t, and N denotes the total number of hawks.

Transition from exploration to exploitation

A rabbit’s energy is modeled as Eq. (49) for this step’s simulation.

$$E=2{E}_{0} \left(1-\frac{t}{T}\right),$$
(49)

where E indicates the esca** energy of the prey, T is the maximum number of iterations, and E0 is the initial state of its energy. The time-dependent behavior of E is also demonstrated in Fig. 8.

Fig. 8
figure 8

The variation of E for three different runs in 500 iterations

Exploitation phase

In the exploitation phase, Harris hawks perform a surprise pounce operation toward the prey they found in the previous phase. The HHO algorithm performs the exploitation phase with four strategies that depend on the amount of \(|E|\) and r. E is the amount of rabbit’s energy, and r is the chance of the successful escape of the prey, so r < 0.5 is a successful escape, and r ≥ 0.5 is an unsuccessful escape. In any case, at this stage, Harris hawks encircle the prey. Depending on the energy level of the prey, they do either hard besiege or soft besiege. When |E|≥ 0.5 soft besiege occurs, and when |E|< 0.5 hard besiege happens.

Soft besiege

As said in the previous section, a soft besiege occurs when r ≥ 0.5 and |E|≥ 0.5. The formulation of soft besiege is presented in Eqs. (50) and (51).

$$X\left(t+1\right)= \Delta X\left(t\right)-E\left| J{X}_{rabbit}\left(t\right)-X\left(t\right)\right|$$
(50)
$$\Delta X\left(t\right)= {X}_{rabbit}\left(t\right)-X\left(t\right),$$
(51)

where \(\Delta X\left(t\right)\) is the difference between the position vector of the rabbit and the current location in iteration \(t\), \({r}_{5}\) is a random number inside (0,1), and J = 2(1 − \({r}_{5}\)) represents the random jump strength of the rabbit throughout the esca** procedure. The J value changes randomly in each iteration to simulate the nature of rabbit motions.

Hard besiege

Hard besiege occurs when r ≥ 0.5 and |E|< 0.5. The current positions are updated using Eq. (52) in this situation.

$$X\left(t+1\right)= {X}_{rabbit}\left(t\right)-E\left| \Delta X\left(t\right)\right|.$$
(52)

Soft besiege with progressive rapid dives

Soft besiege with progressive rapid dives occurs when r < 0.5 and |E|≥ 0.5. To perform a soft besiege with progressive rapid dives, it is supposed that the hawks can evaluate (decide) their next move based on the following rule in Eq. (53).

$${Y=X}_{rabbit}\left(t\right)-E \left| J{X}_{rabbit}\left(t\right)-X\left(t\right)\right|.$$
(53)

It is supposed that they will dive based on the LF-based patterns using Eq. (54):

$$Z=Y+S\times LF\left(D\right),$$
(54)

where D is the dimension of the problem and S is a random vector by size 1⨯D, and LF is the levy flight function, which is calculated using Equation (55).

$$LF\left( x \right) = 0.01 \times \frac{u \times \sigma }{{\left| \nu \right|^{{\frac{1}{\beta }}} }} , \sigma = \left( {\frac{{\tau \left( {1 + \beta } \right) \times \sin \left( {\frac{\pi \beta }{2}} \right)}}{{\tau \left( {\frac{1 + \beta }{2}} \right) \times \beta \times 2^{{\frac{\beta - 1}{2}}} }} } \right)^{{\frac{1}{\beta }}} ,$$
(55)

where u and v are random values inside (0,1), β is a default constant set to 1.5. Hence, the final strategy for updating the positions of hawks in the soft besiege phase can be performed by Equation (56):

$$X\left(t+1\right)= \left\{\begin{array}{c}Y\quad if \quad F\left(Y\right)<F\left(X\left(t\right)\right)\\ Z \quad if \quad F\left(Z\right)<F\left(X\left(t\right)\right)\end{array}\right.,$$
(56)

where Y and Z are obtained using Eqs. (53) and (54).

Hard besiege with progressive rapid dives

Hard besiege with progressive dives occurs when r < 0.5 and |E|< 0.5. Equation (57) is performed in hard besiege conditions:

$$X\left(t+1\right)= \left\{\begin{array}{c}Y if F\left(Y\right)<F\left(X\left(t\right)\right)\\ Z if F\left(Z\right)<F\left(X\left(t\right)\right)\end{array},\right.$$
(57)

where Y and Z are obtained using new rules in Eqs. (58) and (59).

$$Y={X}_{rabbit}\left(t\right)-E \left| J{X}_{rabbit}\left(t\right)-{X}_{m}\left(t\right)\right|$$
(58)
$$Z=Y+S\times LF\left(D\right),$$
(59)

where \({X}_{m}\left(t\right)\) is obtained using Eq. (48).

The proposed hybrid HHOPSO algorithm

Although several meta-heuristic algorithms have been developed, no single algorithm is suitable for all engineering problems. In other words, a method may be suitable for a particular problem, but it may not perform well for another problem. This fact shows the importance of develo** new methods for the present problem. The new method can be a new algorithm or developed based on combining two existing algorithms. In this study, the proposed method is based on the second approach.

The proposed method is a hybridization of two algorithms, PSO and HHO, which will be hereafter denoted as HHOPSO. Both of these algorithms are population-based. The HHO algorithm was explained in detail in the previous section. One of the main features of the HHO algorithm is that the Harris hawks update their position based on the prey position (the best Harris hawks) but do not consider the best position they experience. On the contrary, in the PSO algorithm, both the best position of the particles and the best position experienced by each particle separately are considered in the update of the particle position. The PSO algorithm does not perform well in establishing a balance between exploration and exploitation, because it does not use other agents in the search process. It should be noted that PSO has a premature convergence problem (Kaveh & Shokohi, 2016b). For this reason, these two algorithms are found to be suitable for combination. Due to these different characteristics, it seems that these two algorithms can overcome each other’s weaknesses. In this regard, the HHO algorithm is considered the main algorithm, and the PSO algorithm is added to it. The best global and local points are used to improve the search process in the proposed hybrid algorithm. It is expected that the use of global and local best points in the PSO algorithm will increase the efficiency of the HHO algorithm in solving the optimization problem. In the hybrid algorithm, each point is considered a Harris hawk in one part of the algorithm and a particle in another. The velocity parameter must be defined in the HHO part of the combined algorithm. As it is known, in the PSO algorithm, velocity is needed to get new points, and to calculate the velocity itself, it is necessary to have the previous velocity. In the proposed algorithm, the previous velocity should be taken from the HHO part, so the velocity in the HHO part should be defined. The velocity is defined as Eq. (60):

$$V\left( {t + 1} \right) = X\left( {t + 1} \right) - X\left( t \right).$$
(60)

It should be noted that the best point of each particle and the best point of all particles should be updated in each iteration after the HHO process is completed. After the completion of HHO, all Harris hawks are considered particles in the PSO algorithm. After PSO completion, the particles are considered Harris hawks, and the rabbit’s position is selected as the best particle. This process continues until the termination conditions are satisfied. The flowchart of the implementation of the proposed algorithm is shown in the figure. In this flowchart, two binary variables named HHO and PSO are defined; at a time, only one of them can be one, which means that the algorithm whose corresponding value is equal to one is running (Fig. 9).

Fig. 9
figure 9

Flowchart of the proposed HHOPSO algorithm

Design examples

This section uses the proposed algorithm in the previous section to design three castellated beams. As mentioned in previous sections, rolled sections are used to make castellated beams in reality. In other words, the obtained solution for the problem must be turned into one of the existing sections, which causes the solution to no longer be optimal. Because the purpose of this article is only to compare different algorithms, this transformation process is no longer done, and the optimal solution; itself is used for comparison. In all the design problems, the modulus of elasticity is taken to 2.1 × 106 kg/cm2, and Grade ST37 is selected for the steel of the beam with a design strength of 2400 kg/cm2.

Castellated beam with a 4 m span

A Cantilever beam with a 4 m span, shown in Fig. 10, is selected as the first design example. The beam is subjected to a 5 kN/m dead load, including its weight. A concentrated live load of 50 KN also acts at the end of the beam, and the allowable displacement of the beam is limited to 11.1 mm. The population size is taken as 1000, and the maximum number of iterations is taken as 1000. The initial inertia coefficient, personal acceleration coefficient, social acceleration coefficient, and the reduction rate of the inertia coefficient are taken as equal to 1, 1.14, 1.14, and 0.89, respectively.

Fig. 10
figure 10

Cantilever beam with a 4 m span

Beams with hexagonal openings are designed using the HHOPSO algorithm and five other existing meta-heuristic algorithms. The problem has been solved five times for each algorithm. It has been observed that each run’s optimal solution may differ from the other. In other words, the value of M in this evaluation is considered equal to 5. The evaluation metrics are presented in Table 1. The box plot of solutions obtained by different algorithms is depicted in Fig. 11. Figure 11 shows the convergence of the six algorithms for the design of a 4 m castellated beam with hexagonal openings. The convergence history of different algorithms for the design of castellated beams is shown in Fig. 12. It can be seen that convergence in the HHOPSO, the PSO, and the GWO algorithms, has happened very quickly. On the other hand, in the HHO method, complete convergence did not occur until 600 repetitions. Also, the optimum shape of the 4 m castellated beam is illustrated as shown in Fig. 13.

Table 1 The evaluation metrics for the design of a castellated beam with a 4 m span using six different algorithms
Fig. 11
figure 11

Comparison of the box plot of the different algorithms for the design of a castellated beam with a 4 m span

Fig. 12
figure 12

Convergence history of the design of the 43 castellated beams using: a the GA, b the HS, c the PSO, d the HHO, e the GWO, and f the HHOPSO

Fig. 13
figure 13

Optimal profile of the castellated beam with a 4 m span

Castellated beam with an 8 m span

The second example is a simply supported castellated beam with a span of 8 m. The beam carries a uniform dead load of 0.40 kN/m, which includes its weight. In addition, it is subjected to a concentrated live load of 280 kN at its mid-span, as shown in Fig. 14. The allowable displacement of the beam is limited to 22.2 mm. The population size is taken as 1000, and the maximum number of iterations is taken as 1000. The initial inertia coefficient, personal acceleration coefficient, social acceleration coefficient, and the reduction rate of the inertia coefficient are taken as equal to 1, 1.14, 1.14, and 0.89, respectively.

Fig. 14
figure 14

Simply supported beam with an 8 m span

In this example, the castellated beam is designed with six methods, and the evaluation metrics are presented in Table 2. For each method, the optimization algorithm was run five times. The box plot diagram of the designed beams is shown in Fig. 15. Convergence history related to these six methods is shown in Fig. 16. Similar to the 4-m beam, it can be seen that the convergence speed was high in the HHOPSO, the GWO, and the PSO methods, and the optimal solution was reached in less than 100 iterations. In the GA, the HS, and the HHO methods, the convergence speed is not high, and it can be seen that in HHO, even in 500 iteration numbers, results have been improved. Also, the optimum shape of the 8 m castellated beam is illustrated as shown in Fig. 17.

Table 2 The evaluation metrics for the design of a castellated beam with an 8 m span using six different algorithms
Fig. 15
figure 15

Comparison of the box plot of different algorithms for the design of castellated beam with an 8 m span

Fig. 16
figure 16

Convergence history of the design of the 8 m span castellated beams using: a the GA, b the HS, c the PSO, d the HHO, e the GWO, and f the HHOPSO

Fig. 17
figure 17

Optimal profile of the castellated beam with a 8 m span

Castellated beam with a 9 m span

The two-fixed-end beam with a 9 m span is considered the last example of this study to compare the minimum cost of the castellated beams. The beam carries a uniform dead load of 40 kN/m, including its weight and concentrated live load of 100 kN at its mid-span, as shown in Fig. 18. The allowable displacement of the beam is limited to 25 mm. Similar to the two previous examples, the population size is taken as 1000, and the maximum number of iterations is taken as 1000. The initial inertia coefficient, personal acceleration coefficient, social acceleration coefficient, and the reduction rate of the inertia coefficient are taken as equal to 1, 1.14, 1.14, and 0.89, respectively.

Fig. 18
figure 18

Two-fixed-end beam with a 9 m span

In this example, the castellated beam is designed with six methods, and the evaluation metrics are presented in Table 3. For each method, the optimization algorithm was run five times. The box plot diagram of the designed beams is shown in Fig. 19. Convergence history related to these six methods is shown in Fig. 20. Similar to the two previous examples, it can be seen that the convergence speed was high in the HHOPSO, the GWO, and the PSO methods, and the optimal solution was reached in less than 100 iterations. In the GA, the HS, and the HHO methods, the convergence speed is not high, and it can be seen that in HHO, even in 500 iteration numbers, results have been improved. Also, the optimum shape of the 9 m castellated beam is illustrated as shown in Fig. 21.

Table 3 The evaluation metrics for the design of a castellated beam with a 9 m span using six different algorithms
Fig. 19
figure 19

Comparison of the box plot of different algorithms for the design of castellated beam with a 9 m span

Fig. 20
figure 20

Convergence history of the design of the 9 m span castellated beams using: a the GA, b the HS, c the PSO, d the HHO, e the GWO, and f the HHOPSO

Fig. 21
figure 21

Optimal profile of the castellated beam with a 9 m span

Concluding remarks

In this study, a hybrid meta-heuristic algorithm based on Harris Hawk Optimization (HHO) and Particle Swarm Optimization (PSO) is developed and used to design castellated beams. Three castellated beams with different dimensions and loadings are selected to design by this method. Hexagonal openings are considered as web-opening of castellated beams. Furthermore, the cost of the beam construction is considered the objective function. In this study, it is assumed that the total cost includes three parts: the price of the main beam, the cost of cutting, and the cost of welding. Constraints for the design of castellated beams, including strength limit states, serviceability limit states, and beam construction limitations, are formulated in the optimization problem. The penalty function method is used to handle the constraints. Four evaluation metrics are introduced to compare different optimization methods. The proposed hybrid optimization algorithms are used to design three castellated beams. The results of the proposed method are compared with five other existing optimization methods, including GA, HS, PSO, HHO, and GWO. Each method is performed five times to check the variability and dispersion of the results. The results of the study are as follows:

  1. 1-

    The mean index of the proposed method in the three beams is lower than all other methods, which shows the method’s efficiency. After the proposed method, the GWO algorithm has the lowest mean index in all three designed beams. It is important to note that the difference between these two methods is not considerable.

  2. 2-

    Regarding the Best index, the proposed method is better than all methods in three problems. In the 4- and 9-m problems, the HHO method takes second place, and in the 8-m problem, the PSO method takes second place.

  3. 3-

    Regarding the Worst index, the HHO method in the 4- and 9-m beams and the GA method in the 8-m beam have the highest error. It can be seen that there is no specific method that has the highest error in all examples.

  4. 4-

    Regarding the standard deviation index, HHOPSO, GWO, and PSO methods have a much lower value than other methods. In the example of 4- and 9-m beams, the proposed method has the lowest standard deviation, followed by the GWO beam. In the 8-m beam, the GWO method has the lowest index, followed by PSO and the proposed method.

  5. 5-

    By observing the convergence history of the examined methods, it was seen that the HHOPSO, PSO, and GWO methods have a much higher convergence speed than other methods, which indicates that they will reach the optimal solution with fewer iterations. The proposed method has a higher convergence speed than the three mentioned methods.