Lens law based optimization algorithm: a novel approach

The application of three different categories such as swarm-based, physics-based, and evolutionary-based techniques to various optimization problems related to different fields gained importance due to accuracy, speed and least chance to fall in local minima. Although there are number of physics based optimization techniques available to solve the optimization problems, however, they suffer from their complexity and may require multiple runs to achieve the optimum value. This paper focuses on a simple physics based problem which outperforms few of the existing algorithms. This work investigates the physics-based Lens formula integration using a population-based approach. The contender for a population-level solution to picture obstructions created by a convex, concave, or combination of the two lenses is the item with multiple dimensional locations. The object’s location is updated using the image position. The fundamental goals of population-based optimization algorithms are highlighted by the concave, convex, or combination of both lenses, which enhances the speed of exploration, exploitation, and local optimum avoidance of the search space. The focal length equation, controls how the object’s picture is produced, may be altered by specifying a number of random and adaptive factors to highlight the exploitation and exploration of the search space. The capacity of the proposed algorithm for exploitation, exploration, utilisation of the search space, avoidance of local minima, and attainment of global maxima is validated using unimodal, multimodal, and composite benchmark functions. In addition, a variety of real-world engineering issues taken into account to verify the performance of the proposed algorithm. The observations compared with few fundamental optimization techniques of the same category and found the proposed solution better performing in some context than the existing ones.


Introduction
The term ''optimization'' refers to tailoring search methods to discover the maximum or minimum of a multi-objective or single-objective function under several constraints (Bonabeau et al. 1999;James 2003;Boussaïd et al. 2013). By utilising the idea of evolution in nature, Holland created the population-based stochastic algorithm in 1977, naming it the genetic algorithm (GA) (Holland and Reitman 1977;Holland 1992). The Darwin's theory of evolution, which states that genes in nature are subject to selection, recombination, and mutation, served as the basis for determining the GA's optimum point. Inspired by GA optimization, researchers examined numerous evolutionary strategies to address various optimization issues in diverse application domains (Fogel 2009;Koza 1992;Kirkpatrick 1983;Goldberg 2003;Jacq and Roux 1995;Yao et al. 1999;Huang et al. 2007). Evolutionary strategy (ES), biographicbased optimization algorithm (BBO), and differential evolution (DE) are a few examples of evolutionary techniques (Rechenberg 1994;Simon 2008;Kennedy and Eberhart 1995). After observing how birds move in synchronised social manners, Kennedy et al. devised the Particle Swarm Optimization (PSO) algorithm for resolving optimization-related mathematical problems (Mirjalili and Hashim 2010). According to PSO, researchers concentrated on the social behaviour of particles, and as a result, several algorithms developed for research communities to use in order to solve optimization issues in their respective fields (Mirjalili et al. 2012;Li 2003;Roth 2005;Pinto et al. 2007;Mucherino and Seref 2007;Yang and Deb 2009;Shiqin et al. 2009;Gandomi and Alavi 2012;Pan 2012;Dorigo et al. 2006). Ant Colony Optimization (ACO), Artificial Bee Colony (ABC), Grey Wolf Optimization (GWO), and Whale Optimization Algorithm (WOA) are a few of the algorithms created using intelligence approaches behaviour of species (Abbass 2001;Lu and Zhou 2008;Mirjalili 2014;Mirjalili and Lewis 2016;Kashan 2014;Sadollah et al. 2013). Additionally, the mathematical formulation of human-related behaviour into an algorithm for use in the optimization sector was studied. A few of these are Teaching-Learning-Based Optimization (TLBO), Mine Blast Algorithm (MBA), and League Championship Algorithm (LCA) (Rao et al. 2011;Webster and Bernhard 2003;Erol and Eksin 2006). The researchers presented physics-based algorithms since they were looking for alternative phenomena to solve optimization challenges. Some of these are the Gravitational Search Algorithm (GSA), Colliding Bodies Optimization (CBO), Black Hole (BH), and Sine Cosine Algorithm (SCA). In contrast to traditional optimization methods like Gradient Descent and the Quasi-Newton method, analysed using differential techniques (Rashedi et al. 2009;Talatahari 2010, 2012;Formato 2007;Alatas 2011;Hatamlou 2012;Biswas et al. 2013;SeyedaliMirjalili 2016;Alba and Dorronsoro 2005;Lin and Gen 2009), all of the aforementioned algorithms are stochastic, making them unique and potentially free from falling local minima.
Different from traditional optimization algorithms, certain stochastic optimization techniques approach the optimization issue as a ''black box'' and resolve it by specifying the population-based (number of particles) with their locations distributed randomly. The algorithm developed to update the particles as they approach the objective location. In contrast to traditional differential algorithms, those algorithms gain from local optima avoidance since randomization added to and maintained. There are certain optimizations that are individual-based rather than population-based, where only one solution created at random and improved through iteration to achieve the goal. All of them are referred to as metaheuristics since they employ broad candidate spaces to get the best value with little to no assumptions. A metaheuristic optimization, however, does not provide an ideal result on each run (Wolpert and Macready 1997).
Before using the optimization methods, the objective function or cost function must be specified with a variety of equality and inequality constraints according to the demands of a task. The objective function might have a single goal or several goals. The handling of multiple-objectives, when there are many objectives, calls for particular consideration and covered in depth in the literature (Yao et al. 1999). The single-objective function is the main subject of this study.
The No Free Lunch (NFL) theorem states that no algorithm is able to solve every issue, despite the fact that there are many optimization techniques accessible in the literature for addressing realistically difficult problems (Digalakis and Margaritis 2001). Some algorithms might have provided the best answers to some particular issues, but they might not have succeeded in solving other problems. In addition, a single run cannot yield precise findings (Mirjalili and Lewis 2013;Liang et al. 2005;Suganthan et al. 2005;Coello , 2002. Therefore, standard deviation, averaging, or other statistical approaches repeated several times can be used to determine the effectiveness of optimization algorithms. The main factors that contribute to the failure of issue optimization include the rate of exploitation and exploration, change from exploitation to exploration, use of the search space, and trapping in local minima/maxima. The NFL theorem enables academics to investigate on new algorithm types or modifications of current algorithms to address issues in many domains. Motivated by NFL theorem, this paper proposes a novel optimization algorithm based on different structure of lenses refracted the light rays differently to form the images of the objects. The refracted rays from the objects may converge or diverge which depends on the structure of lens determined by the position of the focal point. The proposed Lens Law Optimization (LLO) method is inspired by the simple lens law formula and found to be accurate estimation of both Single-solution and multiplesolution problems with complexity constraints. The equation used for interpolation and extrapolation of population is very simple and linear without any complex non-linear functions used in other existing physics based algorithms, for example sine-cosine algorithms. This reduces the time burden for movements of populations to targeting the optimal value. The results show the LLO has better convergence rate and may be improved by incorporating chaos into the LLO algorithms if the problems are more complex with unpredictable behaviour.
In Sect. 2, the Lens Law Optimization in included with complete mathematical model and update procedures of each particle in the course of iterations. The unimodal, multimodal and composite benchmark functions are considered for validation of proposed algorithm in Sect. 3. Besides this, some engineering problems with number of constraints are considered to prove effectiveness of the proposed algorithm compared with available literatures (Arora 2004;Belegundu 1983;Coello and Mezura 2002;Choudhury 2018, 2019;Mohapatra et al. 2018;Nayak et al. 2013Kennedy and Eberhart 1997;Zhou et al. 2011;Gharehchopogh and Gholizadeh 2019;Ghafori and Gharehchopogh 2022;Gharehchopogh et al. 2023Gharehchopogh et al. , 2020. The results obtained are presented and discussed in Sect. 4. At the end, Sect. 5 presents the conclusion of the work. 2 Proposed algorithm: lens law optimization (LLO) The principle of an optical lens served as inspiration for LLO. The refraction of light as it travels through the lens creates the object's picture. Depending on the two sides of the lens, the location of the focal length, and the distance of an object from the optical point, the image may be enlarged, decreased, actual, virtual, inverted, or erect. The convergence or divergence of the light beam is what causes the picture to form. For instance, if a collimated beam of light encounters barriers caused by biconvex or planoconvex lenses, they will converge to a virtual focal point behind the lens, and they will diverge to a virtual focus point in front of the lens, respectively. The diverging lens has a negative focal length, whereas the convergent lens has a positive focal length. Three variables control the focal length equation. The lens's two surfaces with a radius of curvature (r 2 and r 3 ) and r 1 is the ratio of the refractive index of the lens to medium and expressed as: where d represents thickness of lens. The lens formula can be written as: where u is object and v is the image. The image of the object is thus: v Converging lenses help with exploitation, but diverging lenses help with search agent exploration. In this case, the object serves as a search agent and the focus length affects the image's creation. Positive focus lengths signify exploitation, whereas negative focal lengths support exploration. In order to update search agent positions, the image position is used to update. To shift from the exploitation to exploration and vice-versa the two random numbers r 2 and r 3 in the range [-1,1] which are analogous to the radius of curvatures of concave, convex or combination of both are defined. The r 1 and r 4 random numbers which are analogous to the ratio of the refractive index of the lens to medium and thickness of the lens are used to balance between exploitation and exploration and avoid trapping on local minima. The ratio of the refractive index of a lens to medium r 1 is changed adaptively based on the following equation: where a is a constant, t is the current iteration and T is the number of iterations. The f is the focal length of lens and expressed as: The speediness of optimization algorithm can be improved by discarding the third term of focal length equation (assume r 4 = d = 0).
The positions of particles are updated with following equation: where X t i is the position of current solution in i-th dimension and t-th iteration, P t i is the position of destination point in i-th dimension and t-th iteration and || indicate the absolute value. Figure 1a shows the exploitation behaviour of the object and how it converges to the optimal point whereas Fig. 1b depicts the exploration phenomenon of an object. The combination and transition between the exploitation to the exploration using a wider search range and finally focus to global optima point as in Eq. (6) is illustrated in Fig. 1c.
The pseudo-code of the LLO algorithm is presented in Fig. 2. The figure explains the algorithms starts with the number of objects (random solutions) formed by random initial positions based on the variables of the cost function of the problem which to be optimized. The algorithm then saves the best object (best solution) obtained so far. The positions of the other objects are updated through its image concerning the best solution. Simultaneously, the focal length is updated to emphasize the exploitation and exploration of the search space as the iteration counter increases. The LLO algorithm terminates when the iteration counts equal to the maximum number of iterations defined.
The proposed algorithm (LLO) can determine the global optimum of optimization problems due to the following reasons: • LLO is population based algorithm where the objects have randomly placed because of random positions. Since the placements are random, it avoids the fall in local optima and covers wide search area.
Lens law based optimization algorithm: a novel approach 9503 • Due to random variation of parameters the structure of lens is randomly changed, which helps to explore the larger search area and exploited the promising reason of search space. Exploration for concave lens and exploitation for convex lens are the criterion which depends on the f \ 1 and f [ 1 respectively. • The LLO algorithm smoothly transit from exploration to exploitation using adaptive range of random numbers in reciprocal of focal length equation • The best value is stored in a variable as destination point and never gets lost during optimization. • The updates are carried out with respect to the best value obtained so far, there is a tendency towards the best value of the search space during optimization. • Since LLO consider as black box, it can be modified to support to any other optimization field.

Test benches for optimization through LLO
To prove the effectiveness of the proposed algorithm, the number of existing various benchmark functions are considered. They are categorized as unimodal, multimodal and composite functions. The multimodal functions are further classified as fixed-dimension multimodal and variable-dimension multimodal depending on dimensions (mathematical variables) are fixed or adapting the number of variables for solving the problems. The 23 number of test functions are considered for testing the proposed LLO algorithm. The functions F1-F7 listed in Table 3 are unimodal because they possess only one global optima point without any local minima (Sadollah et al. 2013). Since unimodal function has only one global optimum point, it helps to judge the exploitation behaviours of optimization algorithms. To validate the exploration capability, the  Tables 4 and 5 respectively.
The composite mathematical functions are complicated as they are shifted, rotated, expanded and combined variants . These functions are formed by combining the number of existing benchmark functions (fi) using Gaussian structure. By controlling the different functions and parameters such as f i ,s i ,k i , o i and M i the composition function is formed which has the capability of shifting, rotating and expanding (Coello , 2002Arora 2004). Avoiding local optima depends on the proper balance and transition rate between the exploitation to exploration or vice-versa. Since the composite functions are built to perform the shifting, rotating and expanding adaptively, the control of exploitation to exploration and thereby, the escape from the local optima and to reach the global minima using optimization algorithm can be analyzed through these functions. The composite benchmark functions F24, F25 and F26 are shown in Table 6 in Appendix 1.

Engineering problems
To strengthen the prove of optimization capabilities of the proposed algorithm, the numbers of practical engineering problems from mechanical engineering to electrical engineering are briefly highlighted. The considered engineering problems for optimization through LLO are given below: The engineering problems cited above have several equalities and non-equalities constraints. To reach the global optima facing several constraints and avoiding the local minima is the complicated task while running through optimization algorithm. Optimization algorithm must have strong enough to solve the number of equalities and nonequalities constraint problems. The brief reviews and formulation for solving the engineering optimization problems are discussed and detail can be found in the literature (Mirjalili and Lewis 2016;Kashan 2014;Sadollah et al. 2013;Coello and Mezura 2002;Choudhury 2018, 2019;Mohapatra et al. 2018;Nayak et al. 2013Kennedy and Eberhart 1997;Zhou et al. 2011;Gharehchopogh and Gholizadeh 2019;Ghafori and Gharehchopogh 2022;Gharehchopogh et al. 2023Gharehchopogh et al. , 2020.

Welded beam design problem (F 27 )
The welded beam design problem is a four-dimensional constraint problem used to design the welded beam for minimizing the cost function taken from Coello Coello and Mezura (2002),  and . The constraints are shear stress, bending stress in the beam h, buckling load on the bar (Pc), end deflection of the beam, and side constraints. There are four design variables as shown in Fig. 3, i.e., h = (x 1 ), l = (x 2 ), t = x 3 , and b = x 4 . The problem can be mathematically formulated as follows: Minimize Subjected to constraints: Lens law based optimization algorithm: a novel approach 9505

Simulation results for a tension/compression string design problem (F 28 )
This is the three-dimensional constraints problem requires to minimize the weight of a tension/compression spring taken from . The constraints are a minimum deflection, shear stress, surge frequency. The x 1 , x 2 , and x 3 represent wire diameter d, mean coil diameter D, and the number of active coils P respectively are used as the design variables for being determined. The mathematical formulation of this problem can be expressed as follows (Figs. 4,5,6): Minimize Subject to:

Gear train design problem (F 29 )
The minimization of the cost of gear ratio of the gear train is a four-dimensional unconstrained (no equality or inequality constraints except a boundary constraint) problem. The parameters of this problem are discrete with the increment size of 1 since they define the teeth of the gears (A, B, C, D), expressed mathematically as variables (x 1 , x 2 , x 3 x 4 ) for the formulation of cost function as: Minimize The cut-off frequencies and the quality factors can be written as Eqs. (22-25), To make compatible with E series the passive parameters can be mathematical model as: So, 16 dimension problems [p, q, r, s, a, b, c, d, t, u, v, w, e, f, g, h] should be optimized to find the minima of objective function formed as: where DW ¼ w c1 Àw c j j þw c2 Àw c j j w c and ÃDQ ¼ Q 1 À 1 0:7654 þ Q 2 À 1 1:8478

Parameter estimation of PV module (F 31 )
Manufacturer of the photovoltaic (PV) module does not provide all the parameters for modelling and analysis of PV module. The three unknown parameters such as shunt resistance (R sh ),series resistance(R se ) and diode quality factor (a) are required to estimate through optimization technique by formulating the three dimensional cost function Kennedy and Eberhart 1997). The multi-objective function is converted to single-objective function (F(x)). The mathematical model of PV model is expressed by three equations represented in Eqs. (27-29), where I pv is the module's output current, the diode current is I d and V d is the voltage appears across the diode. V t is the thermal voltage, which can be mathematically expressed as V r ¼ KT=Q, K is the Boltzmann's constant, T in Kelvin is the junction temperature, Q is the electron charge, and N s represents the number of series cells in the module. The model of PV module is shown in Fig. 7. The cost function can be formed as in Eq. (30), subjected to constraints for minimum and maximum values of the parameters as given: The determination of seven unknown parameters of dc separately excited motor can be realized through proposed optimization technique by updating the response of adaptive model with experimental data model considered as reference model (Zhou et al. 2011). The adaptive model is implemented though the mathematical expression represented as: where i a , x m , T L and V are the armature current (ampere) and mechanical speed (rad/sec), load torque and armature voltage (Volt) respectively. The five unknown parameters are I and B. The experimental data taken from optical encoder attached to the shaft and the adaptive model created from mathematical expressions are built in MATLAB simulink as shown in Fig. 8. The adaptive model will adopt the experimental data model by running the number of times equal to the number of iterations inside the MATLAB simulink based on the cost function (ITSE) as given: The block diagram of simulink model is shown below: The experimental data curve and Optimized curve using LLO by formulating cost functions based on Integral Time Absolute Error (ITAE) and Integral Time Square Error (ITSE) is shown in Fig. 9. From the Fig. 9, it is concluded that the LLO algorithm can be used for curve fitting and finding the parameters although there is deviation during transient period. The values of parameters determined by LLO is given in Table 2 and compared with the existing algorithms.

Results and discussion
The LLO algorithm is tested through the 26 benchmark functions categorized as unimodal, multimodal and composite functions (F1-F26) and indexed in Appendix A in the form of Tables 3, 4, 5 and 6. Besides, the seven real engineering problems (F27-F33) with equalities and nonequalities constraints are also used to test the effectiveness of LLO algorithm. The LLO algorithm is compared with some of the existing algorithms such as PSO, SCA, GWO, and WOA. For solving the aforementioned test function, 40 search agents are considered to determine the global   optimum value over 500 iterations. Except for engineering problems, all of the algorithms are run 10 times and statistical results such as mean and standard deviation are collected and reported in Table 1. The global optimum points are normalized concerning the corresponding minimum value of f min . The information (…) line marked in Table 1 represents the random outputs been collected from corresponding the benchmark function running for ten times. However, this information does not mean that the algorithm would not able to optimize globally. To get the accurate result it requires to run for more number of times. For engineering problems, the minimum value of the corresponding variables is collected by running 5 times and represented in Table 2.
The LLO algorithm performs well compared to other algorithms (PSO, SCA, GWO, and WOA) in unimodal functions tabulated in Table 1. In F1 the LLO outperforms SCA but PSO, GWO, and WOA show the best result. The performance of LLO is worst in F2 function. In functions F3 and F4, the LLO performance suppresses all other algorithms except GWO. The superiority of LLO among all algorithms can be seen in F5 in Table 1. The results derived from the LLO from F6 can be comparable with the results obtained from all algorithms except F7 where it fails to get accurate result running for ten times. Since the overall performance of LLO for unimodal functions is good and comparable with the well-existing algorithms, it can be concluded that the LLO has strong capability of exploitation and convergence which are the main characteristics of unimodal functions. Secondly, Table 1 shows that the performance of LLO is comparable with the results of other algorithms and in some functions (F8 and F14-F23), the results of LLO outperforms the corresponding results of all the algorithms employed in multimodal test functions. This indicates the capability of exploration of search agents and avoidance of local minima of the proposed algorithm. Finally, to determine the strength of the proposed optimization algorithm under challenging search space defined by composite functions is also carried out and the results are given in Table 1. The result shows that the proposed algorithm overcomes the challenging search space and is comparable with all the algorithms. To the best knowledge  of the authors, the p-values of the existing algorithms are not available, however, the values for the proposed algorithm has been included into the table.
The convergence curves of the LLO compared with the aforementioned algorithms of some functions are shown in Fig. 10. The convergence figures of Fig. 10 shows that the average fitness of the search agents during iterations. From the figure, it is concluded that the high fluctuations during the initial periods of iterations, almost all functions, nearly 50 iterations in the exploration phase and converge to optimum value after the initial iterations, where the exploitation phase dominate the exploration phase. However, this figure does not provide the information about each search agent behaviour of exploration and exploitation and therefore, the trajectories of the first variable of first search agent are depicted in subfigures of Fig. 10. Subfigures of Fig. 10 confirm that the variable of one of the search agents fluctuates by a large amount during the early stage of iterations and then, slowly settles in the latter stages of iterations. The shape of the trajectory confirms that the search agent first explores the search area and then exploits for converging around the best solution obtained in the exploration phase. The trajectory path of all algorithms of some of the functions given in one subfigure is used to judge and compare the exploration and exploitation capability of different algorithms. The proposed LLO uses the search area in best possible ways while going to the best solution and in some of the functions it outperforms the other algorithms.
The results and discussion through figures and tables confirm that the LLO algorithm is able to reach close to the optimum point in almost all functions and it gives the best solutions among all the algorithms used for determining the optimum solution in some functions (Sadollah Fig. 11 continued et al. 2013). However, in most of the real problems such as engineering problems, the optimal point may be unknown. In addition, they may have a large number of equality and inequality constraints. The penalty factor is required to be properly incorporated for violation of equality and inequality constraints. There are various types of penalty functions such as static, dynamic, annealing, adaptive, coevolutionary, and death penalty . The death penalty is the simple and low computational cost method. The penalty is added if the constraints are violated and due to this process automatically by discarding the infeasible solution during the course of iterations. For the solution of engineering problems with constraints through LLO, the death penalty function is used. The gear design problem used here is the binary optimization problem and it is solved by incorporating the transfer function inspired by literature (Belegundu 1983;Zhou et al. 2011). The last engineering problem that is, machine parameter estimation address the fitting of the experimental curve by optimizing the parameters of the DC machine. The experimental data and the machine with unknown parameters are built-in MATLAB Simulink environment as shown in Fig. 8 and it was running in the loop of LLO optimization algorithm up to the end of iterations by adjusting the parameters of the machine. The statistical data analysis of LLO are compared with SCA, WOA, GWO in Table 2 and the convergence curves with trajectories of first unknown parameter are given in Fig. 11. It can be seen that the proposed algorithm strongly guarantees the ability to reach the optimize value, avoid the local minima and well utilization of search space and therefore it is as strong as the other algorithms.

Conclusion and future works
The results obtained by the optimization algorithm states a clear observation of better efficacy, faster resolution through the proposed algorithm in comparison with the existing ones such as WOA, SCA, GWO, etc. In-depth research carried out on 26 mathematical benchmark functions to draw conclusions about how search agents behave in order to achieve the global aim point by utilising their skills for exploration, exploitation, local optimum avoidance, and search space usage. It has been determined that LLO is sufficiently competitive with other meta-heuristic algorithms. In addition, solutions are found to six engineering challenges, ranging from restrictions to curve fitting. In constraint issues, a penalty function is applied to prevent constraints from being violated. The convergence curves pertaining to benchmark functions F1-F26, and engineering problem based functions F27-F32 shows the LLO reaches the desired solution quickly as compared to the other existing solutions. Due to certain limitations, the discretized objective functions could not be validated, however, the continuous time objective functions are well executed satisfactorily by the proposed Lens Law Optimization technique. As a future course of action, Levy flight trajectory can be included to improve the effectiveness on exploitation, exploration leading to avoidance of local minima, speed up the operation & amplify the population movement.
Data availability Enquiries about data availability should be directed to the authors.

Declarations
Conflict of interest Author 1 declares that he/she has no conflict of interest. Author 2 declares that he/she has no conflict of interest.
Ethical approval This article does not contain any studies with human participants performed by any of the authors. Lens law based optimization algorithm: a novel approach 9517