Genetic Algorithm Optimization of Beams in Terms of Maximizing Gaps between Adjacent Frequencies

The aim of this paper is to optimize the thickness variation function of simply supported and cantilever beams, in terms of maximizing gaps between chosen neighboring frequencies, and to analyze the obtained results. The optimization results are examined in terms of achieving the objective function (related to eigenvalue problems), but also in terms of their dynamic stiffness (forced vibrations excited by a point harmonic load). In the optimization process, a genetic algorithm was used. Problems related to structural dynamics were solved by FEM implementation into the algorithm. Sample results were presented, and the developed algorithm was analyzed in terms of the results convergence by examining several variable parameters. The authors demonstrated the validity of applying the described optimization tool to the presented problems. Conclusions were drawn regarding the correlation between stiffness and mass distribution in the optimized beams and the natural frequency modes in terms of which they were optimized.


Introduction
This paper presents an optimization of the thickness variation function of simply supported and cantilever beams, in terms of maximizing gaps between their chosen neighboring frequencies. The method of optimization-sizing optimization-is a method of modifying dimensions or sizes of components in order to obtain the best structural performance. The beams are made of a homogeneous material. Analyzed elements are considered in the framework of the Euler-Bernoulli theory.
There are a number of studies on the band-gap behavior of structural elements. This phenomenon is of significant importance in various engineering applications. By controlling band-gap characteristics, it is possible to alter the mechanical and vibrational properties of a structure, leading to improved performance and functionality. For example, in the field of materials engineering, the design of band gaps has become an essential tool in developing materials with specific properties, such as phononic crystals (PnCs) and metamaterials [1][2][3]. In the field of civil engineering, the band-gap characteristics of structural elements such as beams or plates are related to their dynamic response. Controlling their occurrence can affect the acoustic and vibrational insulation of the structure, which is crucial for the comfort and safety of occupants. It becomes particularly significant in industrial buildings equipped with vibrating devices and machinery. By managing their dynamic properties, resonance risk can be minimized and structural fatigue can be reduced. For similar reasons, it is essential in bridge construction, where vibrations can be generated by human activities and vehicular traffic. Therefore, the design and analysis of structural elements require a deep understanding of their band-gap behavior, so it can lead to the development of lightweight, high-strength, and energy-efficient structures.
So far, many researchers have addressed the issue of optimization and analysis of structures with gaps between frequencies. Some of the first publications in this area were sectional properties of multi-span bridges using a hybrid GA. Similar tools were also used to optimize structures of roofs like domes [31] or steel trusses [32,33].
The goal of this work is to find the optimal thickness distribution of a linearly elastic beam. The design variable is the height of its cross-section, keeping its length and width constant. Natural frequencies of the beams are computed using the finite element method. An optimizer based on a genetic algorithm is used to determine the optimal material distribution in terms of maximizing the relative gap between two neighboring frequencies.
The paper is outlined as follows. The theoretical background and fundamental equations as well as the methodology (finite element method and genetic algorithms) are presented in Section 2. Section 3 is a description of the research problem and studied cases. Discussion of the optimization process using genetic algorithms is briefly presented in Section 4. In Section 5, results analysis and discussion are provided. The paper ends with general conclusions.

Euler-Bernoulli Beam Theory
The analyzed element is a beam made of isotropic linear-elastic material of Young's modulus E, Poisson number ν, and density ρ. The geometry of the beam of length L is described in an orthogonal Cartesian coordinate system Oxyz. The Ox axis coincides with the axis of the beam ( Figure 1). The cross-section of the beam is a rectangle with dimensions b × h(x), which are parallel respective to the Oy and Oz axes. The beam is represented by a model according to the Euler-Bernoulli beam theory, which assumes that the segment which is straight and perpendicular to the beam's Ox axis before deformation remains straight and perpendicular after deformation. In this chapter variational formulation of the fundamental equations for this problem is briefly introduced. be the damping coefficient. Therefore, strain and kinetic densities per unit of the beam are defined as follows: The overdot stands for the derivative with respect to time In the presented problem, the strain and kinetic energies are integral forms of values defined in (1), and the strain energy refers to beam bending energy.
The action functional is given by: where V is the volume, and the Langragian is of the form: Let EJ = E(x)J(x) be flexural stiffness, µ = ρ(x)A(x) be mass per unit, w = w(x, t) be transverse deflection, q = q(x, t) be the transverse load, and c = c(x) be the damping coefficient. Therefore, strain and kinetic densities per unit of the beam are defined as follows: The overdot stands for the derivative with respect to time t = t 0 , t 1 . In the presented problem, the strain and kinetic energies are integral forms of values defined in (1), and the strain energy refers to beam bending energy.
The action functional is given by: where V is the volume, and the Langragian is of the form: The dissipative force is assumed to be as follows: The equations of motion can be obtained from the extended (cf. [34]) principle of stationary action, formulated as: After applying Equations (2) and (3) to (5) and performing integration by parts, the following formula was obtained: Formula (6) can also be rewritten and presented as (7). It constitutes the governing equation of the Euler-Bernoulli beam model: Omitting the terms involving external load and damping, we arrive at an equation describing the natural bending vibrations of a beam: from which natural frequencies and mode shapes can be calculated, depending on the boundary conditions.

Dynamics in the Finite Element Method Approach
In problems of dynamics and free vibrations described by differential equations, the finite element method (FEM) is used. The generalized equation of motion is given as: where M is mass matrix, K is stiffness matrix, C is damping matrix, F is the external force vector, and q(t), .. q(t) are displacement, velocity, and acceleration vectors, respectively. The matrices of mass, stiffness, and damping for the entire structure can be defined as follows (the superscript e denotes single finite element e): B (e) stands for linear strain matrix of elasticity of element e, D (e) is the elasticity matrix of element e, N (e) is the shape function vector of element e, and µ (e) is the damping parameter of element e. Here, the damping matrix was defined according to the Rayleigh damping model, commonly used in numerous studies [28,35]: Rayleigh coefficients α and β were assumed to be 2 × 10 −6 and 3 × 10 −5 , respectively. In the case of forced harmonic vibrations, the external force can be expressed as: Application of the multimodal approach for forced vibration analysis leads to the following solution: q = a C cos(ωt) + a S sin(ωt), where parameter ω is angular frequency and coefficients a C and a S are defined as: In this particular optimization problem, since we consider free vibrations, the damping matrix is equal to zero and no external forces are involved. Thus, Equation (8) The solution and its second time derivative can be expressed as: where q a stands for eigenvector. It can be expressed as follows, where m is number of degrees of freedom: q a = q a,1 , q a,2 , . . . , q a,m .
Assuming that eigenvalue λ is equal to ω 2 , Equation (13) can be written as: Only the result where q a = 0 is considered, so in order to determine eigenvalues and eigenvectors, the following condition has to be met:

Genetic Algorithms
Genetic algorithms are optimization techniques inspired by the principles of Darwin's theory of natural selection and genetics. They are probabilistic algorithms that maintain a population of potential solutions. The solutions are subjected to genetic operations such as selection, crossover, and mutation that mimic the process of biological evolution. In this section genetic operators and strategies are explained according to the following works [36][37][38][39]. The algorithms used in this work have been adapted to suit the requirements of the investigated problem. They were created using the Python programming language supported mainly by the following libraries: NumPy, SciPy, and Matplotlib.
The beam was divided into n e elements, each of which is of height h i and width b, where i = 1, 2, . . . , n e . Each beam element is a single gene-the basic parameter (a variable). The genes are represented by values corresponding to the height of elements h i and are joined into a string to form a chromosome. In the presented work, the chromosomes correspond to the individual input beams that constitute a population. Figure 2 illustrates the basic concepts behind optimization using the presented GA. Materials 2023, 16, x FOR PEER REVIEW 6 of 20 Evolution starts with an initial population (population '0'). In this study it consists of np individuals (chromosomes). Population '0' is randomly generated from a beta distribution and it is represented by matrix H with dimensions ne × np. The values of H are samples from the beta distribution limited by the minimum and maximum sizes of single element heights hmin = 0.5 hi and hmax = 2 hi, where hi = 10 −2 m. The resulting values in H represent a random population of individual solutions for the optimization problem. Each column represents an individual, and each row represents an element with a given position. The next step is the evaluation of a created population. Population evaluation is performed in terms of the objective function which calculates relative difference between two adjacent frequencies. In this study, the objective function is defined as follows: where ω is natural frequency of optimized beams, and index k represents the number of natural vibration frequency. The function describes the absolute width of the band gap.
Adapting dimensionless values with a maximum value of 1 is advantageous and convenient in terms of numerical calculations.
To evaluate the created population, it is necessary to determine the natural vibration frequencies of each individual. Calculations were performed using our own FEM procedure (described in the previous subsection) built into the algorithm. The individuals of the initial population were assessed in terms of meeting the condition of the objective function maximalization and the best were then subjected to the genetic operators.
One of the used operators is mutation. It is applied to all individuals except the best one among the remaining individuals. The mutation used in the presented algorithm involves randomly selecting one gene (element) from the chromosome (beam) and modifying its value based on the chosen mutation type-addition or subtraction of the specified value to the initial gene.
Then, the algorithm selects parents using the roulette wheel selection mechanism. It selects parents until their number reaches the desired value (npar). The parent selection algorithm ensures that a certain number of parents npar is selected for crossover by sampling from the cumulative probabilities. The first half of the selected parents is chosen based on their probabilities, while the second half is randomly chosen from the entire population, to avoid premature convergence. This can happen when similar chromosomes become dominant in a population. The algorithm then generates all possible pairs of selected parents for crossover using permutations. Value npar is determined using a mathematical equation based on the population size, the number of remaining individuals, and the number of obtained offspring, to ensure a constant population size.
Offspring are created through crossover operations. The algorithm randomly chooses between one-point crossover (OPCX), blend crossover (BLXa), or two-point crossover (TPCX) based on predefined probabilities. OPCX operates on two parents A and B, and Evolution starts with an initial population (population '0'). In this study it consists of n p individuals (chromosomes). Population '0' is randomly generated from a beta distribution and it is represented by matrix H with dimensions n e × n p . The values of H are samples from the beta distribution limited by the minimum and maximum sizes of single element heights h min = 0.5 h i and h max = 2 h i , where h i = 10 −2 m. The resulting values in H represent a random population of individual solutions for the optimization problem. Each column represents an individual, and each row represents an element with a given position.
The next step is the evaluation of a created population. Population evaluation is performed in terms of the objective function which calculates relative difference between two adjacent frequencies. In this study, the objective function is defined as follows: where ω is natural frequency of optimized beams, and index k represents the number of natural vibration frequency. The function describes the absolute width of the band gap. Adapting dimensionless values with a maximum value of 1 is advantageous and convenient in terms of numerical calculations.
To evaluate the created population, it is necessary to determine the natural vibration frequencies of each individual. Calculations were performed using our own FEM procedure (described in the previous subsection) built into the algorithm. The individuals of the initial population were assessed in terms of meeting the condition of the objective function maximalization and the best were then subjected to the genetic operators.
One of the used operators is mutation. It is applied to all individuals except the best one among the remaining individuals. The mutation used in the presented algorithm involves randomly selecting one gene (element) from the chromosome (beam) and modifying its value based on the chosen mutation type-addition or subtraction of the specified value to the initial gene.
Then, the algorithm selects parents using the roulette wheel selection mechanism. It selects parents until their number reaches the desired value (n par ). The parent selection algorithm ensures that a certain number of parents n par is selected for crossover by sampling from the cumulative probabilities. The first half of the selected parents is chosen based on their probabilities, while the second half is randomly chosen from the entire population, to avoid premature convergence. This can happen when similar chromosomes become dominant in a population. The algorithm then generates all possible pairs of selected parents for crossover using permutations. Value n par is determined using a mathematical equation based on the population size, the number of remaining individuals, and the number of obtained offspring, to ensure a constant population size.
Offspring are created through crossover operations. The algorithm randomly chooses between one-point crossover (OPCX), blend crossover (BLXa), or two-point crossover (TPCX) based on predefined probabilities. OPCX operates on two parents A and B, and selects a random point, where the chromosome separates. The first child is created by concatenating the first part of parent A with the second part of parent B. Similarly, the second child is created by concatenating the first part of B with the second part of A. BLXa also combines two parents A and B. It randomly generates new individuals by blending the genes within a specified range based on a defined blending factor. The last one, TPCX, performs a two-point crossover between two parents. It selects two random crossover points and creates two children by combining the values before the first crossover point, between the two points, and after the second crossover point.
The resulting offspring are added to population H. Population size is adjusted to a selected value by removing any extra individuals created during crossover operations. Finally, the updated population H is returned by the algorithm, and the described procedure is repeated.
In general, genetic algorithms are not classified as "global optimizers" [40] and it can be observed in many optimization problems that GAs show a tendency to converge towards local optima. The likelihood of occurrence of this feature depends on the definition of the fitness function. There are methods to reduce this problem, e.g., by using different fitness functions, increasing the rate of mutation, or by using selection techniques that maintain diversity in the population. However, there are no general solutions to this problem. In this paper several techniques were employed to maintain population diversity (the aforementioned mutations and crossovers), but there is no guarantee that they always provide solutions in the form of global extremes.

Problem Statement
We consider a beam of Young's modulus E = 205 GPa, Poisson number ν = 0.3, and density ρ = 7850 kg/m 3 . It is assumed that the length of the beam is L = 1 m.
Two types of beam boundary conditions were considered ( Figure 3): simply supported at both ends (SS) and clamped-free (CF). Individuals were divided into n e elements-32 or 64. The number of individuals in each population was assumed to be 320. The number of created populations (n pop ) corresponds with the number of elements-200 for n e = 32 and 300 for n e = 64. Gaps between adjacent vibration frequencies were investigated in the range of k from 1 to 8. Moreover, all cases were performed three times, and they differed only in automatically generated (random variable) parameters, to compare the influence on GA solutions. As a result, the total number of cases subjected to the optimization procedure, and then analyzed, is 96. selects a random point, where the chromosome separates. The first child is created by concatenating the first part of parent A with the second part of parent B. Similarly, the second child is created by concatenating the first part of B with the second part of A. BLXa also combines two parents A and B. It randomly generates new individuals by blending the genes within a specified range based on a defined blending factor. The last one, TPCX, performs a two-point crossover between two parents. It selects two random crossover points and creates two children by combining the values before the first crossover point, between the two points, and after the second crossover point. The resulting offspring are added to population H. Population size is adjusted to a selected value by removing any extra individuals created during crossover operations. Finally, the updated population H is returned by the algorithm, and the described procedure is repeated.
In general, genetic algorithms are not classified as "global optimizers" [40] and it can be observed in many optimization problems that GAs show a tendency to converge towards local optima. The likelihood of occurrence of this feature depends on the definition of the fitness function. There are methods to reduce this problem, e.g., by using different fitness functions, increasing the rate of mutation, or by using selection techniques that maintain diversity in the population. However, there are no general solutions to this problem. In this paper several techniques were employed to maintain population diversity (the aforementioned mutations and crossovers), but there is no guarantee that they always provide solutions in the form of global extremes.

Problem Statement
We consider a beam of Young's modulus E = 205 GPa, Poisson number ν = 0.3, and density ρ = 7850 kg/m 3 . It is assumed that the length of the beam is L = 1 m.
Two types of beam boundary conditions were considered ( Figure 3): simply supported at both ends (SS) and clamped-free (CF). Individuals were divided into ne elements-32 or 64. The number of individuals in each population was assumed to be 320. The number of created populations (npop) corresponds with the number of elements-200 for ne = 32 and 300 for ne = 64. Gaps between adjacent vibration frequencies were investigated in the range of k from 1 to 8. Moreover, all cases were performed three times, and they differed only in automatically generated (random variable) parameters, to compare the influence on GA solutions. As a result, the total number of cases subjected to the optimization procedure, and then analyzed, is 96. First, the presented genetic algorithm with an integrated FEM procedure for eigenvalue problems was used. The number of finite elements in the FEM procedure was equal to the number of genes for each individual n. Depending on the boundary conditions (BC or SS), a number of dynamic degrees of freedom (DOF) was defined, assuming that for each node it could be up to three.
In addition, forced vibration analysis was performed for optimized individuals. The maximum displacement wmax was analyzed for both boundary condition cases. The excitation force F(t) = F0(t) cos(ωt) is located at the node closest to the support. Deflection was investigated at the mid-span (for an SS beam) or at the end of the cantilever (for a CF beam). The described dynamic problem is presented in Figure 4. First, the presented genetic algorithm with an integrated FEM procedure for eigenvalue problems was used. The number of finite elements in the FEM procedure was equal to the number of genes for each individual n. Depending on the boundary conditions (BC or SS), a number of dynamic degrees of freedom (DOF) was defined, assuming that for each node it could be up to three.
In addition, forced vibration analysis was performed for optimized individuals. The maximum displacement w max was analyzed for both boundary condition cases. The excitation force F(t) = F 0 (t) cos(ωt) is located at the node closest to the support. Deflection was investigated at the mid-span (for an SS beam) or at the end of the cantilever (for a CF beam). The described dynamic problem is presented in Figure 4.  The obtained results (optimized individuals) were compared with reference individuals. The reference individual is a prismatic beam of rectangular cross-section b × href, where href was calculated as the average height of the optimized individuals. As a result, both individuals-reference and optimized-have the same volume, but different material distribution.

Optimization Process Discussion
Here, examples of the optimization process in terms of eigenvalue problems are pre- Population "0" in each case consists of individuals with completely random genes, arranged without any specific order. Initial signs of individuals' fitness to the defined objective function in this problem start to appear as early as the 3rd or 4th population (for a division into ne = 32 elements) or the 6th or 7th population (for a division into ne = 64 elements). By the 10th population, specific areas can be observed where each individual experiences a decrease or increase in thickness. With each subsequent population, these areas are more and more clearly marked. The evolution process for example cases is selectively presented in Figures 5-7, where elements of each beam are marked on the vertical axis, and the number of each individual (beam) in the population is presented on the horizontal axis.
From the populations numbering about 150 (for ne = 32) and 200 (for ne = 64), the changes between individuals within a particular population as well as changes between neighboring populations are very slight. As a result, the best individuals selected from successive populations no longer differ significantly in terms of matching the fitness function. However, it can be noted that convergence is slowest for elements near the ends of the beam.

Optimization Process Discussion
Here, examples of the optimization process in terms of eigenvalue problems are rial distribution.

Optimization Process Discussion
Here, examples of the optimization process in terms of eigenvalue problems are pre- Population "0" in each case consists of individuals with completely random genes, arranged without any specific order. Initial signs of individuals' fitness to the defined objective function in this problem start to appear as early as the 3rd or 4th population (for a division into ne = 32 elements) or the 6th or 7th population (for a division into ne = 64 elements). By the 10th population, specific areas can be observed where each individual experiences a decrease or increase in thickness. With each subsequent population, these areas are more and more clearly marked. The evolution process for example cases is selectively presented in Figures 5-7, where elements of each beam are marked on the vertical axis, and the number of each individual (beam) in the population is presented on the horizontal axis.
From the populations numbering about 150 (for ne = 32) and 200 (for ne = 64), the changes between individuals within a particular population as well as changes between neighboring populations are very slight. As a result, the best individuals selected from successive populations no longer differ significantly in terms of matching the fitness function. However, it can be noted that convergence is slowest for elements near the ends of the beam.   To investigate the influence of the number of elements n on the evolution and final optimization result, additional plots, presented in Figures 8-10, were created. The largest Population "0" in each case consists of individuals with completely random genes, arranged without any specific order. Initial signs of individuals' fitness to the defined objective function in this problem start to appear as early as the 3rd or 4th population (for a division into n e = 32 elements) or the 6th or 7th population (for a division into n e = 64 elements). By the 10th population, specific areas can be observed where each individual experiences a decrease or increase in thickness. With each subsequent population, these areas are more and more clearly marked. The evolution process for example cases is selectively presented in Figures 5-7, where elements of each beam are marked on the vertical axis, and the number of each individual (beam) in the population is presented on the horizontal axis.  To investigate the influence of the number of elements n on the evolution and final optimization result, additional plots, presented in Figures 8-10, were created. The largest differences are observed in the initial populations, reaching up to approximately 10% in the maximum objective function values achieved by the best individual. In the final populations, these differences decrease below 5%. This trend persists when the optimization is focused on values Δω1 to Δω6, corresponding to lower natural frequencies. However, for frequencies Δω7 and Δω8, these differences are higher-up to several percent.   To investigate the influence of the number of elements n on the evolution and final optimization result, additional plots, presented in Figures 8-10, were created. The largest differences are observed in the initial populations, reaching up to approximately 10% in the maximum objective function values achieved by the best individual. In the final populations, these differences decrease below 5%. This trend persists when the optimization is focused on values Δω1 to Δω6, corresponding to lower natural frequencies. However, for frequencies Δω7 and Δω8, these differences are higher-up to several percent.    Furthermore, individuals divided into ne = 32 elements achieve slightly better results in the optimization process for differences in frequencies Δω1 and Δω2. On the other hand, for optimization targeting the highest frequencies Δω7 and Δω8, a division into ne = 64 elements appears to be more advantageous. These observations apply to both SS and CF beams ( Figure 11). From the populations numbering about 150 (for n e = 32) and 200 (for n e = 64), the changes between individuals within a particular population as well as changes between neighboring populations are very slight. As a result, the best individuals selected from successive populations no longer differ significantly in terms of matching the fitness function. However, it can be noted that convergence is slowest for elements near the ends of the beam.
To investigate the influence of the number of elements n on the evolution and final optimization result, additional plots, presented in Figures 8-10, were created. The largest differences are observed in the initial populations, reaching up to approximately 10% in the maximum objective function values achieved by the best individual. In the final populations, these differences decrease below 5%. This trend persists when the optimization is focused on values ∆ω 1 to ∆ω 6 , corresponding to lower natural frequencies. However, for frequencies ∆ω 7 and ∆ω 8 , these differences are higher-up to several percent. Furthermore, individuals divided into n e = 32 elements achieve slightly better results in the optimization process for differences in frequencies ∆ω 1 and ∆ω 2 . On the other hand, for optimization targeting the highest frequencies ∆ω 7 and ∆ω 8 , a division into n e = 64 elements appears to be more advantageous. These observations apply to both SS and CF beams ( Figure 11). For each optimization case, three attempts were performed-marked as 'take 0', 'take 1', and 'take 2'-to compare random variable parameters' influence on optimization algorithm results. In most cases the results do not differ significantly, up to 5% between the different approaches (Figure 12a,b). In individual cases, the final optimization result is slightly different (around 7-8%, Figure 11c), but the results still exhibit extremely strong convergence. For each optimization case, three attempts were performed-marked as 'take 0', 'take 1', and 'take 2'-to compare random variable parameters' influence on optimization algorithm results. In most cases the results do not differ significantly, up to 5% between the different approaches (Figure 12a,b). In individual cases, the final optimization result is slightly different (around 7-8%, Figure 11c), but the results still exhibit extremely strong convergence.
(a) (b) (c) Figure 11. Values of the fitness function for the best individuals depending on the population number for ne = 32 and 64 elements; optimization in terms of (a) Δω1 for SS beam; (b) Δω3 for CF beam; (c) Δω6 for SS beam.
For each optimization case, three attempts were performed-marked as 'take 0', 'take 1', and 'take 2'-to compare random variable parameters' influence on optimization algorithm results. In most cases the results do not differ significantly, up to 5% between the different approaches (Figure 12a,b). In individual cases, the final optimization result is slightly different (around 7-8%, Figure 11c), but the results still exhibit extremely strong convergence.
(a) (b) (c) Figure 12. Values of the fitness function for the best individuals from three trials; optimization in terms of (a) Δω2 for CF beam, ne = 32; (b) Δω4 for CF beam, ne = 64; (c) Δω7 for SS beam, ne = 64.

Analysis in Terms of Eigenvalue Problems
In this section, an analysis of obtained results and sample results from the optimization process are presented. Firstly, matching the winning individuals to the objective function will be considered. Here, the best individuals from every population, for every considered case, are presented: SS in Figures 13 and 14, and CF in Figures 15 and 16.
The results presented in the following subsection provide further insight into the analysis regarding the influence of the number of elements n on the quality of the obtained optimum solution. Figure 12. Values of the fitness function for the best individuals from three trials; optimization in terms of (a) ∆ω 2 for CF beam, n e = 32; (b) ∆ω 4 for CF beam, n e = 64; (c) ∆ω 7 for SS beam, n e = 64.

Analysis in Terms of Eigenvalue Problems
In this section, an analysis of obtained results and sample results from the optimization process are presented. Firstly, matching the winning individuals to the objective function will be considered. Here, the best individuals from every population, for every considered case, are presented: SS in Figures 13 and 14, and CF in Figures 15 and 16.   The results presented in the following subsection provide further insight into the analysis regarding the influence of the number of elements n on the quality of the obtained optimum solution.
For both SS and CF beams there are no significant differences between cross-section distribution of obtained best solutions for n e = 32 and 64, but only at low frequencies (∆ω 1 and ∆ω 2 ). As the natural frequency mode number increases, differences in the crosssectional shapes of the beams also increase, and consequently the differences in their fitness function values also increase. Exact values of the differences are presented in Table 1. For ∆ω 1 the differences remain within the range of 0.05% or less, for both SS and CF. At higher frequencies, the increase in differences depends on the static scheme and in most cases is within 5%. The highest values of difference were observed for ∆ω 8 .                Figure 17 illustrates the relationship between the optimized beam cross-section and mode shapes. Clear dependencies can be observed between the locations of cross-sections with reduced mass and stiffness, and the shape of the natural mode. In places where the higher frequency (ω k+1 ) mode shape plot crosses the zero-amplitude value (which are also its inflection points), and simultaneously the lower frequency mode (ω k ) shape plot reaches a local extreme, a reduction in mass and stiffness occurs. This indicates that there is a correlation between the locations of mass and stiffness reduction and the characteristics of the mode shapes. This regularity applies to both SS and CF beams, but only for areas inside the span.   Comparison of the natural frequencies between several examples of reference and optimized beams is presented in Figures 18-21. Both for SS and CF beams, the optimized individuals obtain the best results compared to the reference beams at higher eigenfrequencies. Furthermore, slightly better results are achieved by individuals divided into 64 elements compared to those divided into 32 elements. In the case of ∆ω 4 , the optimized beam is twice as good as the reference individual, and for ∆ω 8 , it is even three times better. For differences in the lowest natural frequencies, improvements in the properties of the optimized beam are also evident, although they are modest, around 10-15% for ∆ω 1 . The comparison results are similar for SS and CF beams. The results are also presented in Tables 2 and 3.

Analysis in Terms of Forced Vibrations
Here, we present analysis of optimized beams in terms of dynamic properties. The optimization aimed at maximizing gaps between adjacent frequencies also affected their dynamic amplitude response properties. The maximum amplitude of the beams was analyzed by comparing the optimized individuals with the reference individuals. The results are presented in Figures 22-25.

Analysis in Terms of Forced Vibrations
Here, we present analysis of optimized beams in terms of dynamic properties. The optimization aimed at maximizing gaps between adjacent frequencies also affected their dynamic amplitude response properties. The maximum amplitude of the beams was analyzed by comparing the optimized individuals with the reference individuals. The results are presented in    Although the optimization process undeniably influenced the resonance response, it is not possible to define a clear relationship describing this impact. For SS beams, in the majority of analyzed cases, the maximum amplitude increased after optimization, but only in the low-frequency range. For CF beams, the maximum deflection was smaller for  Although the optimization process undeniably influenced the resonance response, it is not possible to define a clear relationship describing this impact. For SS beams, in the majority of analyzed cases, the maximum amplitude increased after optimization, but only in the low-frequency range. For CF beams, the maximum deflection was smaller for Although the optimization process undeniably influenced the resonance response, it is not possible to define a clear relationship describing this impact. For SS beams, in the majority of analyzed cases, the maximum amplitude increased after optimization, but only in the low-frequency range. For CF beams, the maximum deflection was smaller for optimized individuals, but only when optimization was conducted within the ∆ω 1 -∆ω 4 range. For ∆ω 5 -∆ω 8 , the optimized individuals achieved either higher or lower maximum amplitude values. It was also noted that the value of n e had a significant influence on the amplitude response. In some cases, depending on the element division, the same beam achieved a higher amplitude after or before optimization.

Summary and Conclusions
In the presented paper, application of genetic algorithms for the optimization of simply supported and clamped-free beams was investigated, with a focus on maximizing the gaps between adjacent natural frequencies. The obtained results were analyzed to formulate the following conclusions:

•
The application of GAs proved to be effective in optimizing the beams for maximizing the gaps between natural frequencies. Optimized beams exhibited increased gaps between adjacent natural frequencies, according to the defined fitness function.
• Based on the conducted analyses, it can be concluded that for relatively low natural frequencies (∆ω 1 , ∆ω 2 ), a division into larger elements can be successfully applied. This will result in shorter computational time while maintaining satisfying results.

•
The randomness of parameters in the GA has a negligible influence on the final results. This was confirmed by the analysis of three independent approaches for each case. The ultimate results obtained from each approach for individual cases do not significantly differ. • All optimized beams exhibit a periodic-like structure that is strongly correlated with the mode shape. Mass and stiffness reduction occurs at points where the lower mode shape of adjacent frequency k crosses the amplitude axis at 0 and the higher mode shape of frequency k + 1 reaches an extreme value. • Both SS and CF optimized beams performed better than the reference beams at higher vibration frequencies.

•
Optimization aimed at improving the properties of beams related to natural vibrations also resulted in a dynamic response. The optimization process had a complex impact on the resonance response, with no clear relationship identified.

•
Although the adopted objective function is convenient to use due to limited numerical values, it may, however, lead to solutions in which the absolute value of the gap is not the maximum.
It has to be stressed that in GA algorithms, as a heuristic, stochastic search method, there is no proof that the solution is the global extreme. However, obtained results suggest that GAs can be a valuable tool for engineers and researchers in optimizing beams with specific frequency requirements.
Further research could be directed into applying more accurate beam models, such as Timoshenko-Ehrenfest thick beam theory, the use of finite elements with variable stiffness, and imposing restrictions on differences in the dimensions of adjacent elements. It would also be desirable to obtain experimental results for dynamics characteristics of optimized elements.