# Development and Optimization for a New Planar Spring Using Finite Element Method, Deep Feedforward Neural Networks, and Water Cycle Algorithm

Authors: Ngoc Le Chau; Hieu Giang Le; Van Anh Dang; Thanh-Phong Dao
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

The gravity balance mechanism plays a vital role in maintaining the equilibrium for robots and assistive devices. The purpose of this paper was to optimize the geometry of a planar spring, which is an essential element of the gravity balance mechanism. To implement the optimization process, a hybrid method is proposed by combining the finite element method, the deep feedforward neural network, and the water cycle algorithm. Firstly, datasets are collected using the finite element method with a full experiment design. Secondly, the output datasets are normalized to eliminate the effects of the difference of units. Thirdly, the deep feedforward neural network is then employed to build the approximate models for the strain energy, deformation, and stress of the planar spring. Finally, the water cycle algorithm is used to optimize the dimensions of the planar spring. The results found that the optimal geometries of the spring include the length of 45 mm, the thickness of 1.029 mm, the width of 9 mm, and the radius of 0.3 mm. Besides, the predicted results determined that the strain energy, the deformation, and the stress are 0.01123 mJ, 33.666 mm, and 79.050 MPa, respectively. The errors between the predicted result and the verifying results for the strain energy, the deformation, and the stress are about 1.87%, 1.69%, and 3.06%, respectively.


---

## Body

## 1. Introduction

A device is balanced when it can maintain equilibrium in any configuration or position without the need for external forces or actuators [1]. Generally, when a device achieves a gravity balance, it can move like in a gravity-less environment [2, 3]. For a device to reach equilibrium, scientists have researched balancers to compensate for the gravity of machines. Gravity balances can be classified in the following ways: active balance and passive balance, and gravity balancer mechanisms can adjust loads or cannot adjust loads [4]. Besides, some other mechanisms employ counterweights, springs, or coupling of counterweights and springs [2]. Among them, a gravity balance mechanism with springs is of great interest for research by scientists because of its suitability in applications and simple adjustment [5, 6]. These types of mechanisms are capable of adjusting loads via using traditional springs [7, 8].Previously, a gravity balance mechanism with adjusted loads was designed by the combination of a compliant spring and a torsion spring [9]. Besides, a compliant rotary joint for the gravity balance mechanism was designed by creating a torque that balances the torque of the load [10]. The spring and the joint were built based on advantages of compliant mechanisms; however, the stiffness of the spring is not high [11].Although scientists have had great success in studying many of the different types of mechanisms, a large amount of energy is still required during the adjustment process. Therefore, the present study proposes a new gravity balance mechanism according to the principle of compliant mechanisms. Compliant mechanism is selected to create the planar spring (PS) because it is a monolithic mechanism, which offers less lubricant, no friction, and minimal cost of manufacturing [12]. The gravity balance mechanism is a combination of a torsion spring and a planar spring. This combination allows the spring to easily adjust its stiffness when adjusting the load. In the proposed balancing mechanism, the PS is a very important detail. The PS is deformed during the working process, and it creates a strain energy and elastic force to compensate for the gravity generated by the mass. In order to work well, the strain energy of the PS should offer as large as possible and the stiffness of the PS should be ensured to create an elastic force that balances with the gravity due to the mass. In addition, the stress concentration must be less than the permissible stress.In order to serve for a practical application, the PS should concern a full set of performances, including deformation, strain energy, and stress. However, these desirable properties have mutual contradictions, and these properties are very sensitive to PS geometrical dimensions. Therefore, optimization of the PS is necessary to balance its properties. In this study, an optimization process is performed to maximize or minimize one or more properties of the PS. It is noted that the proposed PS is designed based on the principle of compliant mechanisms. It is therefore difficult to build precisely mathematical models that show the relationship between deformation, stress, and strain energy with its geometrical factors. Therefore, in this study, a hybrid method of finite element method (FEM), deep feedforward neural network (DFNN), and water cycle algorithm (WCA) is aimed to build surrogate models and optimize the geometry of the PS.Nowadays, the FEM is a widely used method to solve complex arithmetic problems [13, 14]. This method is capable of accurately predicting the phenomena and behavior of complex problems with little cost and time. Until now, the FEM has been used effectively to simulate the behavior of compliant mechanism [15, 16], healthy human intervertebral discs [17], and double-row tapered roller bearing [18]. Therefore, this study adopts the FEM to predict the behaviors of the PS. The DFNN is extended to model the performances [19]. The DFNN has the ability to approximate the relationships between the independent input variables to the output responses of highly nonlinearly complex models. However, the accuracy of the approximate model depends greatly on the structure of the DFNN [20]. Therefore, before building the approximate models, the structure optimization of the DFNN needs to be performed. This process is to find the training function, the number of hidden layers, the number of nodes in each hidden layer, and the data division rate that best matches the dataset. The proposed PS is desired to achieve the maximum strain energy but must ensure the required stiffness and durability when working. This is an optimization problem with many constraints. The WCA is capable of solving the optimization with multiple constraints [21, 22]. Therefore, the WCA is used to optimize the geometry of the PS. Although there have been studies on many different gravity balance mechanisms, a full consideration of the performances of the spring has not been considered yet.In summary, the present paper is aimed to optimize the geometry factors of a planar spring, which is used for the gravity compensation mechanism. To perform the optimization process, the FEM method is used to simulate and collect data. Next, regression models are built by the DFNN. Before using the DFNN, the structure of the DFNN is selected by optimizing the controllable parameters of the DFNN by using the Taguchi method. Finally, the WCA is applied to optimize the geometry of the planar spring.


## 2. Mechanical Design

### 2.1. Design of Gravity Balancing Mechanism

Figure1 shows a design of a gravity balance mechanism. It consists of a bar that carries an object. The bar is connected to the planar spring (k2) through the pulley and cable. The planar spring is combined with the pulley and cable to create a zero-free-length spring. At the hinge joint, a torsion spring with stiffness k1 is considered as a rotation spring. During the working process, when the bar rotates clockwise by angle φ, the torsion spring is also deformed by an angle φ, and the planar spring is stretched by an amount equal to l.Figure 1
Structure of gravity balance mechanism.Then, the moment balance equation of the mechanical system is expressed as follows:(1)0.5m1+m2Lgsinφ=k1φ+k2l,where m1 is the mass of the bar, m2 is the mass of the object, L is the length of the bar, k1 is the stiffness of torsion spring, k2 is the stiffness of a spring of zero free length, and l is deformation of a spring of zero free length.(2)l=2a2sinφ,where a is the distance from the rotating center to the connection point of a spring of zero free length.In the proposed design, the bar is made of aluminum alloy withm1 = 0.5 kg, the mass m2 of the object allows to be adjusted in the range from 0.5 kg to 3 kg. The distance a is 65 mm and the length L of the bar is 400 mm. To ensure working requirements, the stiffness of the torsion spring is selected as 200 N/mm and the stiffness of the planar spring is adjustable in the range from 0.325 N/mm to 1.468 N/mm. Based on the required stiffness, a planar spring is designed in Section 2.2.


### 2.2. Design Planar Spring

To ensure an adjustable stiffness in the range of 0.325 N/mm to 1.468 N/mm, deformation of the spring is required from 0 to 30 degrees, and the planar spring is designed with 31 component springs that are connected in series, as shown in Figure2. The component springs are formed by arranging the leaf springs in parallel and series styles, as shown in Figure 3. The geometrical parameters of the PS include the thickness t, length L, width w, radius r, height H, and width a.Figure 2
Structure of planar spring.Figure 3
Structure of component spring.


## 2.1. Design of Gravity Balancing Mechanism

Figure1 shows a design of a gravity balance mechanism. It consists of a bar that carries an object. The bar is connected to the planar spring (k2) through the pulley and cable. The planar spring is combined with the pulley and cable to create a zero-free-length spring. At the hinge joint, a torsion spring with stiffness k1 is considered as a rotation spring. During the working process, when the bar rotates clockwise by angle φ, the torsion spring is also deformed by an angle φ, and the planar spring is stretched by an amount equal to l.Figure 1
Structure of gravity balance mechanism.Then, the moment balance equation of the mechanical system is expressed as follows:(1)0.5m1+m2Lgsinφ=k1φ+k2l,where m1 is the mass of the bar, m2 is the mass of the object, L is the length of the bar, k1 is the stiffness of torsion spring, k2 is the stiffness of a spring of zero free length, and l is deformation of a spring of zero free length.(2)l=2a2sinφ,where a is the distance from the rotating center to the connection point of a spring of zero free length.In the proposed design, the bar is made of aluminum alloy withm1 = 0.5 kg, the mass m2 of the object allows to be adjusted in the range from 0.5 kg to 3 kg. The distance a is 65 mm and the length L of the bar is 400 mm. To ensure working requirements, the stiffness of the torsion spring is selected as 200 N/mm and the stiffness of the planar spring is adjustable in the range from 0.325 N/mm to 1.468 N/mm. Based on the required stiffness, a planar spring is designed in Section 2.2.


## 2.2. Design Planar Spring

To ensure an adjustable stiffness in the range of 0.325 N/mm to 1.468 N/mm, deformation of the spring is required from 0 to 30 degrees, and the planar spring is designed with 31 component springs that are connected in series, as shown in Figure2. The component springs are formed by arranging the leaf springs in parallel and series styles, as shown in Figure 3. The geometrical parameters of the PS include the thickness t, length L, width w, radius r, height H, and width a.Figure 2
Structure of planar spring.Figure 3
Structure of component spring.


## 3. Formulation of Optimization Problem

In order to offer an efficient work for the gravity balance mechanism, the performances of the PS should be enhanced because the efficiency of the overall mechanism is highly dependent on the properties of the PS. Meanwhile, the performances of the PS are very sensitive to the geometrical dimensions of the leaf springs, as given in Figures2 and 3. The main design parameters include the length L, width w, thickness t, and radius r of the leaf spring. Therefore, if there is an expectation to improve the characteristics of the spring, the geometry of the leaf springs should be optimized. In this gravity balance mechanism, the spring should be met the following requirements:(i)
The generated deformation has to be large enough so that the bar rotates at an angle from 0 to 30 degrees, and creates a moment for balancing.(ii)
The generated stress must be less than the yield strength of the material. In this study, a maximum load of 3 kg and a stiffness of planar spring of 1.436 N/mm are utilized.(iii)
The strain energy is as large as possible so that the PS can do highly efficient work.(iv)
The fatigue should also be considered. It is remarked that the performances of the PS often contradict each other. Therefore, the question arises as to how to balance these properties. So, the WCA optimization algorithm is applied to solve the optimization with multiple constraints.


### 3.1. Design Variables

Based on the proposed design in Figures2 and 3, the deformation, stress, and strain energy of the PS depend on the leaf springs’ properties. The leaf spring’s properties are very sensitive to length L, width w, thickness t, and radius r. Therefore, these dimensions are chosen as the design variables. The limited dimensions of the design variables are selected based on the machining technology capabilities, the desired size of the system, and the designer’s experience. These are represented as follows:(3)45mm≤L≤55mm,1mm≤t≤1.4mm,9mm≤w≤14mm,0.1mm≤r≤0.3mm.


### 3.2. Objective Function

As stated in the formulation of optimization problem above, the PS should posses a large strain energy to store and release a good elastic deformation. Therefore, the strain energyf1(X) is chosen as the objective function of the optimization process.


### 3.3. Constraint Functions

In order to ensure the gravity balance mechanism safely, the PS must create a large enough deformation so that the mechanism can work in the range of 0–30 degrees. In addition, the deformation of the PS should be sufficient to create a moment that is equal to the moment generated by the mass. In addition, the stress of the PS should be less than the yield strength when the mechanism is operating at maximum load to ensure that the spring works safely. Hence, the deformationg1X and stress g2X are selected as the constraints of the optimization process.The optimization problem for the PS is briefly stated as follows:Find:X = [r, l, t, w](4)maxf1X.Subject to constraints,(5)g1X=33.646mm,g2X≤120MPa.


## 3.1. Design Variables

Based on the proposed design in Figures2 and 3, the deformation, stress, and strain energy of the PS depend on the leaf springs’ properties. The leaf spring’s properties are very sensitive to length L, width w, thickness t, and radius r. Therefore, these dimensions are chosen as the design variables. The limited dimensions of the design variables are selected based on the machining technology capabilities, the desired size of the system, and the designer’s experience. These are represented as follows:(3)45mm≤L≤55mm,1mm≤t≤1.4mm,9mm≤w≤14mm,0.1mm≤r≤0.3mm.


## 3.2. Objective Function

As stated in the formulation of optimization problem above, the PS should posses a large strain energy to store and release a good elastic deformation. Therefore, the strain energyf1(X) is chosen as the objective function of the optimization process.


## 3.3. Constraint Functions

In order to ensure the gravity balance mechanism safely, the PS must create a large enough deformation so that the mechanism can work in the range of 0–30 degrees. In addition, the deformation of the PS should be sufficient to create a moment that is equal to the moment generated by the mass. In addition, the stress of the PS should be less than the yield strength when the mechanism is operating at maximum load to ensure that the spring works safely. Hence, the deformationg1X and stress g2X are selected as the constraints of the optimization process.The optimization problem for the PS is briefly stated as follows:Find:X = [r, l, t, w](4)maxf1X.Subject to constraints,(5)g1X=33.646mm,g2X≤120MPa.


## 4. Proposed Hybrid Optimization Approach

As discussed in Section3, in order to ensure the efficient working of the gravity balancing mechanism, the PS must have three properties (deformation, stress, and strain energy). However, these properties have mutual contradiction. Hence, a hybridization of experiment design, FEM, DFNN, and WCA is developed. First, the experimental design is built by full factor experiment for collecting data. Then, the DFNN was used to establish the approximate models. Before establishing an approximate model, the structure of the DFNN needs to be optimized to get the best structure of the DFNN. Finally, the WCA is employed to optimize the geometrical sizes of the spring. This method is carried out through 4 stages, as shown in Figure 4.Figure 4
Flowchart of the hybrid approach.


### 4.1. Stage 1: Mechanical Design

The mechanical design process is performed by the following steps:Step 1: identify the problemWhen the working load is changed, the balance condition will be broken. Besides, when the load is adjusted, the gravity balance mechanism needs to be changed to maintain the equilibrium condition. One of the popular methods for adjusting the gravity balance mechanism is an adjustment of the stiffness of the spring. In this study, the proposed planar spring is designed to adjust easily the number of active leaf springs. So, the stiffness of PS can be adjusted without extra energy. To meet work requirements of the gravity balance mechanism, the design and optimization of the PS is essential.Step 2: original designBased on the requirements of the problem, the original gravity balance mechanism is designed, as shown in Figure1. The principle of this mechanism is presented in Section 2.1. This study proposes the structure of PS as shown in Figure 2.Step 3: define design variables, objective functions, and constraintsThe PS is designed to meet technical requirements. A deformation must be large enough, the stress must be less than the yield strength, and the strain energy is large. The objective function, constraint, and design variable are presented in Section3.


### 4.2. Stage 2: General Numerical Data

The purpose of this stage is to create datasets to build the approximate models, and the datasets were generated by the numerical simulation in ANSYS 18.2 software. The sequence of steps is as follows:Step 4: experiment designExperimental design is the statistical technique that is widely used in product development. To accurately evaluate the effect of each design variable on the performance of a product, the full factor experiment is used.Step 5: simulate and collect dataSimulation is a technique of predicting the behavior of the structure. It is applied in engineering to reduce the costs of experimentation. A 3D model is built, and the boundary conditions and load are set up. The simulation process is performed to collect data.Step 6: normalize dataThe properties of a planar spring have different units; to avoid the effect of the different units on the optimal result, the output response should be normalized. This normalization only changes the value of the response, but does not change the nature of the data. Moreover, this process can evaluate fairly. In this study, the properties of PS need to be standardized to unify the units. The standardization process is performed by the following formula:(6)zi=yi−minyimaxyi−minyi,wherezi is the normalized value and yi is the real value.


### 4.3. Stage 3: Optimize the Structure of the DFNN

To approximate the relationship between the geometry sizes and the output characteristics of the PS, the DFNN is applied to create regression models. The working diagram of the DFNN is shown in Figure5. Net input (zij) of node jth of layer ith is calculated according to the following formula:(7)zij=∑i=1nwi,jjai−1j+bij,where wij is the weighted input of the node jth of the hidden layer ith, bij is a constant value called bias, and ai−1j output of node jth of layer (i − 1)th.Figure 5
Structure of deep feedforward neural network.The net input of nodejth of layer ith is then passed through an activation function to produce the output of node jth of layer ith, which is then transmitted to other neurons.(8)aij=gzij,where g is the active function.The approximate models are greatly dependent on the structure of the DFNN and the actual data. To get the exact approximate models, the structure of the DFNN is optimized in this study. The optimization process for the structure of the DFNN is performed as follows:Step 7: define the objective function of the DFNN structure.The accuracy of the approximate model is usually assessed through coefficient of determination (R2) and mean squared error (MSE). In practice, if the value of MSE is smaller, the value of R2 will be larger and the predicted model is more accurate. Therefore, in this study, MSE is selected as the objective function to optimize the structure of the DFNN.The MSE andR2 are calculated by using the following formula:(9)MSE=1n∑i=1nyi−y^i2,R2=1−residual sum of squarestotal sum of squares,whereyi is the ith observed value y^iis the ith predicted value and n is the experiment number.Step 8: select the input parameters of the DFNN structureA basic structure of the DFNN includes the number of hidden layers, the number of nodes in each hidden layer, training function, activation function, bias coefficient, ratio of division of data for training, validation, and testing. However, in this study, the number of hidden layers, the number of nodes in each hidden layer, the transfer function and the ratio of division of data are chosen as controllable variables.Normally, researchers usually use training functions: trainlm, trainbr, and trainscg. However, trainbr only uses 2 datasets: training and validating while the other transfer functions use 3 datasets: training, validating, and testing. Therefore, to evaluate equity, this study proposes to choose 3 training functions: trainlb, traincgs, and trainscg.The number of nodes in hidden layers can be selected differently based on the position of the hidden layer and the number of nodes of the input layer. According to Chen [23], the number of nodes in the hidden layer can be calculated as follows:(10)number node of hidden layer1=2x+1,number node of hidden layeri+1=n2x+1,wherex is the number of input variables, and n is the number of output variables. In this study, x = 4 and n = 1, so the number of nodes in each hidden layer is selected around 9.According to Seo et al. [20], the accuracy of the approximate models can be improved as the number of hidden layers increases. However, the complexity of the algorithm also increases. The authors also indicate that when the number of hidden layers is equal or larger than 4, the accuracy increased slightly. For the data that have a small signal to noise, the approximate model has a good accuracy as well when using 2 or 3 hidden layers. Therefore, in this study, the number of hidden layers is selected as 2, 3, and 4. The ratio of division of data for training, validating, and testing is chosen with the ratios of 60 : 20 : 20, 70 : 15 : 15, and 80 : 10 : 10.Step 9: collect data and optimize the structure of the DFNNTaguchi is often used to improve a product’s quality [24]. Nowadays, the Taguchi method is widely used to solve technical problems, especially for the single-objective problem with discrete variables [25, 26]. Hence, it is chosen to optimize the structure of the DFNN. The Taguchi method uses two major tools, including signal-to-noise ratio (S/N) and orthogonal array. There are three quality characteristics: “nominal is best,” “smaller is better,” and “larger is better.” Their mathematical formula can be presented as follows:Nominal is the best:(11)S/N=10log10y¯s2.The smaller is better:(12)S/N=−10log10∑i=1Nyi2N.The bigger is better:(13)S/N=−10log10∑i=1N1/yi2N,whereyi is responses, and N is repetition of ith experiment.The Taguchi method used orthogonal arrays to reduce the number of experiments required but ensured that design variables are evaluated independently. The purpose of this step is to find the structure of the DFNN that best matches the existing dataset by minimizing MSE by using equation (12).Step 10: evaluate the value of MSEAfter optimizing the structure of the DFNN, the value of MSE has to be evaluated to find the most suitable structure for the dataset. If the value of MSE is not satisfied, it means that the most suitable structure has not been found, then go back to step 8. If the value of MSE is satisfied, then go to the next step.


### 4.4. Stage 4: Optimization Using the WCA

The WCA is an optimal algorithm inspired by the water cycle. It was developed by Eskandar [21] and widely used to solve technical problems [27–29]. However, this algorithm has not been applied to solve the problem of optimizing strain energy of the PS. The flowchart of the WCA is presented, as shown in Figure 6.Step 11: choose the initial parameters of the WCAInitial rain drops (Npop—initial population), number of rivers and sea (Nsr), maximum distance between streams and rivers, between rivers and sea dmax, and the maximum iteration must be preselected. Nsr and Nraindrop are calculated as follows:(14)Nsr=number of rivers+sea,Nraindrop=Npop−Nsr,whereNsr is the number of sea and rivers, Npop is the number of the initial population, and Nraindrop is the number of streams.Step 12: generate random initial populationInitial population is generated by random variables as follows:(15)population of raindrop=x11x21...xNvar1x12x22...xNvar2..................x1Npopx2Npop...xNvarNpop,wherexij is the value of the variable ith of the raindrop jth, i is the number of variables, j is the number of the initial population, and Nvar is the number of variables.Step 13: calculate the value of the initial raindropIn order to select raindrops representing the sea and rivers, the value of the initial raindrop needs to be calculated and they are calculated according to the following formula:(16)Pi=costi=fXi,i=1,2,3,…,Npop,wherePi is the initial raindrop value. i is raindrop.Step 14: determine the intensity of flow for rivers and seaThe raindrops flow to the rivers or sea depending on the intensity of the flow. The intensity of flow for rivers and sea are calculated by the following formula:(17)NSn=roundPn∑i=1NsrPi⋅Nraindrop,n=1,2,…,Nsr,whereNSn is the number of streams flowing directly into the rivers or sea, Pn is the value of sea or rivers nthStep 15: the streams flow to the riversDuring the streams’ flow to rivers, the positions of streams are continuously updated. The new position for the stream is determined as follows:(18)Xstreami+1=Xstreami+randxCxXriveri−Xstreami,where rand is a random number that is chosen between 0 and 1,Xstreami is the location of the stream ith, Xriveri is the location of the river ith, and C is a value between 1 and 2.Step 16: the rivers flow to the seaSimilar to a stream, when rivers flow to the sea, the position of the river is always updated, and the new position of the river is determined as follows:(19)Xriveri+1=Xriveri+randxCxXseai−Xriveri,where rand is a random number that is chosen between 0 and 1,Xriveri is the location of the stream ith, Xseai is the location of the river ith, and C is a value between 1 and 2.Step 17: exchange positions of the river with a streamTo offer the best solution, the new cost of a stream is updated. If the solution given by a stream is better than its connecting river, the positions of the river and stream are exchangedStep 18: exchange positions of the sea with a riverSimilar to streams, if the solution of the river is better than the sea, the positions of the sea and the river will be swappedStep 19: check the evaporation conditionEvaporation is one factor that prevents the algorithm from being optimized locally. As seen in nature, water from ponds, lakes, rivers, streams, seas, and the ground evaporates into clouds. Clouds fly up high then condense in the cold air to form water particles. Water particles fall down and form rain. Raindrops will form new streams that flow into rivers and the sea. In the WCA, the condition evaporation is determined as follows:(20)Xseai−Xriveri<dmax,i=1,2,3,…,Nsr−1,wheredmax is small number (close to zero),When the distance from the river to sea is less thandmax, it means the river has flowed into the sea. Then, the evaporation process is applied. After the evaporation is completed, rain will begin to create a new cycle.Step 20: reduce the value ofdmaxIn the WCA, the value ofdmax controls the search intensity near the sea. If the value of dmax is large, then the search density will reduce while a small value for dmax will increase the search density near the sea. Therefore, the value for dmax has to adaptively decrease as:(21)dmaxi+1=dmaxi−dmaximax iteration.Step 21: check the convergence criteriaLike other optimization algorithms, the stop condition of the WCA algorithm can be based on the maximum number of iterations, the CPU time, or the error between the last two results less than a certain tolerance value. If the stopping condition is satisfied, the optimization will be finished, otherwise return to step 5.Figure 6
Flowchart of the WCA.


## 4.1. Stage 1: Mechanical Design

The mechanical design process is performed by the following steps:Step 1: identify the problemWhen the working load is changed, the balance condition will be broken. Besides, when the load is adjusted, the gravity balance mechanism needs to be changed to maintain the equilibrium condition. One of the popular methods for adjusting the gravity balance mechanism is an adjustment of the stiffness of the spring. In this study, the proposed planar spring is designed to adjust easily the number of active leaf springs. So, the stiffness of PS can be adjusted without extra energy. To meet work requirements of the gravity balance mechanism, the design and optimization of the PS is essential.Step 2: original designBased on the requirements of the problem, the original gravity balance mechanism is designed, as shown in Figure1. The principle of this mechanism is presented in Section 2.1. This study proposes the structure of PS as shown in Figure 2.Step 3: define design variables, objective functions, and constraintsThe PS is designed to meet technical requirements. A deformation must be large enough, the stress must be less than the yield strength, and the strain energy is large. The objective function, constraint, and design variable are presented in Section3.


## 4.2. Stage 2: General Numerical Data

The purpose of this stage is to create datasets to build the approximate models, and the datasets were generated by the numerical simulation in ANSYS 18.2 software. The sequence of steps is as follows:Step 4: experiment designExperimental design is the statistical technique that is widely used in product development. To accurately evaluate the effect of each design variable on the performance of a product, the full factor experiment is used.Step 5: simulate and collect dataSimulation is a technique of predicting the behavior of the structure. It is applied in engineering to reduce the costs of experimentation. A 3D model is built, and the boundary conditions and load are set up. The simulation process is performed to collect data.Step 6: normalize dataThe properties of a planar spring have different units; to avoid the effect of the different units on the optimal result, the output response should be normalized. This normalization only changes the value of the response, but does not change the nature of the data. Moreover, this process can evaluate fairly. In this study, the properties of PS need to be standardized to unify the units. The standardization process is performed by the following formula:(6)zi=yi−minyimaxyi−minyi,wherezi is the normalized value and yi is the real value.


## 4.3. Stage 3: Optimize the Structure of the DFNN

To approximate the relationship between the geometry sizes and the output characteristics of the PS, the DFNN is applied to create regression models. The working diagram of the DFNN is shown in Figure5. Net input (zij) of node jth of layer ith is calculated according to the following formula:(7)zij=∑i=1nwi,jjai−1j+bij,where wij is the weighted input of the node jth of the hidden layer ith, bij is a constant value called bias, and ai−1j output of node jth of layer (i − 1)th.Figure 5
Structure of deep feedforward neural network.The net input of nodejth of layer ith is then passed through an activation function to produce the output of node jth of layer ith, which is then transmitted to other neurons.(8)aij=gzij,where g is the active function.The approximate models are greatly dependent on the structure of the DFNN and the actual data. To get the exact approximate models, the structure of the DFNN is optimized in this study. The optimization process for the structure of the DFNN is performed as follows:Step 7: define the objective function of the DFNN structure.The accuracy of the approximate model is usually assessed through coefficient of determination (R2) and mean squared error (MSE). In practice, if the value of MSE is smaller, the value of R2 will be larger and the predicted model is more accurate. Therefore, in this study, MSE is selected as the objective function to optimize the structure of the DFNN.The MSE andR2 are calculated by using the following formula:(9)MSE=1n∑i=1nyi−y^i2,R2=1−residual sum of squarestotal sum of squares,whereyi is the ith observed value y^iis the ith predicted value and n is the experiment number.Step 8: select the input parameters of the DFNN structureA basic structure of the DFNN includes the number of hidden layers, the number of nodes in each hidden layer, training function, activation function, bias coefficient, ratio of division of data for training, validation, and testing. However, in this study, the number of hidden layers, the number of nodes in each hidden layer, the transfer function and the ratio of division of data are chosen as controllable variables.Normally, researchers usually use training functions: trainlm, trainbr, and trainscg. However, trainbr only uses 2 datasets: training and validating while the other transfer functions use 3 datasets: training, validating, and testing. Therefore, to evaluate equity, this study proposes to choose 3 training functions: trainlb, traincgs, and trainscg.The number of nodes in hidden layers can be selected differently based on the position of the hidden layer and the number of nodes of the input layer. According to Chen [23], the number of nodes in the hidden layer can be calculated as follows:(10)number node of hidden layer1=2x+1,number node of hidden layeri+1=n2x+1,wherex is the number of input variables, and n is the number of output variables. In this study, x = 4 and n = 1, so the number of nodes in each hidden layer is selected around 9.According to Seo et al. [20], the accuracy of the approximate models can be improved as the number of hidden layers increases. However, the complexity of the algorithm also increases. The authors also indicate that when the number of hidden layers is equal or larger than 4, the accuracy increased slightly. For the data that have a small signal to noise, the approximate model has a good accuracy as well when using 2 or 3 hidden layers. Therefore, in this study, the number of hidden layers is selected as 2, 3, and 4. The ratio of division of data for training, validating, and testing is chosen with the ratios of 60 : 20 : 20, 70 : 15 : 15, and 80 : 10 : 10.Step 9: collect data and optimize the structure of the DFNNTaguchi is often used to improve a product’s quality [24]. Nowadays, the Taguchi method is widely used to solve technical problems, especially for the single-objective problem with discrete variables [25, 26]. Hence, it is chosen to optimize the structure of the DFNN. The Taguchi method uses two major tools, including signal-to-noise ratio (S/N) and orthogonal array. There are three quality characteristics: “nominal is best,” “smaller is better,” and “larger is better.” Their mathematical formula can be presented as follows:Nominal is the best:(11)S/N=10log10y¯s2.The smaller is better:(12)S/N=−10log10∑i=1Nyi2N.The bigger is better:(13)S/N=−10log10∑i=1N1/yi2N,whereyi is responses, and N is repetition of ith experiment.The Taguchi method used orthogonal arrays to reduce the number of experiments required but ensured that design variables are evaluated independently. The purpose of this step is to find the structure of the DFNN that best matches the existing dataset by minimizing MSE by using equation (12).Step 10: evaluate the value of MSEAfter optimizing the structure of the DFNN, the value of MSE has to be evaluated to find the most suitable structure for the dataset. If the value of MSE is not satisfied, it means that the most suitable structure has not been found, then go back to step 8. If the value of MSE is satisfied, then go to the next step.


## 4.4. Stage 4: Optimization Using the WCA

The WCA is an optimal algorithm inspired by the water cycle. It was developed by Eskandar [21] and widely used to solve technical problems [27–29]. However, this algorithm has not been applied to solve the problem of optimizing strain energy of the PS. The flowchart of the WCA is presented, as shown in Figure 6.Step 11: choose the initial parameters of the WCAInitial rain drops (Npop—initial population), number of rivers and sea (Nsr), maximum distance between streams and rivers, between rivers and sea dmax, and the maximum iteration must be preselected. Nsr and Nraindrop are calculated as follows:(14)Nsr=number of rivers+sea,Nraindrop=Npop−Nsr,whereNsr is the number of sea and rivers, Npop is the number of the initial population, and Nraindrop is the number of streams.Step 12: generate random initial populationInitial population is generated by random variables as follows:(15)population of raindrop=x11x21...xNvar1x12x22...xNvar2..................x1Npopx2Npop...xNvarNpop,wherexij is the value of the variable ith of the raindrop jth, i is the number of variables, j is the number of the initial population, and Nvar is the number of variables.Step 13: calculate the value of the initial raindropIn order to select raindrops representing the sea and rivers, the value of the initial raindrop needs to be calculated and they are calculated according to the following formula:(16)Pi=costi=fXi,i=1,2,3,…,Npop,wherePi is the initial raindrop value. i is raindrop.Step 14: determine the intensity of flow for rivers and seaThe raindrops flow to the rivers or sea depending on the intensity of the flow. The intensity of flow for rivers and sea are calculated by the following formula:(17)NSn=roundPn∑i=1NsrPi⋅Nraindrop,n=1,2,…,Nsr,whereNSn is the number of streams flowing directly into the rivers or sea, Pn is the value of sea or rivers nthStep 15: the streams flow to the riversDuring the streams’ flow to rivers, the positions of streams are continuously updated. The new position for the stream is determined as follows:(18)Xstreami+1=Xstreami+randxCxXriveri−Xstreami,where rand is a random number that is chosen between 0 and 1,Xstreami is the location of the stream ith, Xriveri is the location of the river ith, and C is a value between 1 and 2.Step 16: the rivers flow to the seaSimilar to a stream, when rivers flow to the sea, the position of the river is always updated, and the new position of the river is determined as follows:(19)Xriveri+1=Xriveri+randxCxXseai−Xriveri,where rand is a random number that is chosen between 0 and 1,Xriveri is the location of the stream ith, Xseai is the location of the river ith, and C is a value between 1 and 2.Step 17: exchange positions of the river with a streamTo offer the best solution, the new cost of a stream is updated. If the solution given by a stream is better than its connecting river, the positions of the river and stream are exchangedStep 18: exchange positions of the sea with a riverSimilar to streams, if the solution of the river is better than the sea, the positions of the sea and the river will be swappedStep 19: check the evaporation conditionEvaporation is one factor that prevents the algorithm from being optimized locally. As seen in nature, water from ponds, lakes, rivers, streams, seas, and the ground evaporates into clouds. Clouds fly up high then condense in the cold air to form water particles. Water particles fall down and form rain. Raindrops will form new streams that flow into rivers and the sea. In the WCA, the condition evaporation is determined as follows:(20)Xseai−Xriveri<dmax,i=1,2,3,…,Nsr−1,wheredmax is small number (close to zero),When the distance from the river to sea is less thandmax, it means the river has flowed into the sea. Then, the evaporation process is applied. After the evaporation is completed, rain will begin to create a new cycle.Step 20: reduce the value ofdmaxIn the WCA, the value ofdmax controls the search intensity near the sea. If the value of dmax is large, then the search density will reduce while a small value for dmax will increase the search density near the sea. Therefore, the value for dmax has to adaptively decrease as:(21)dmaxi+1=dmaxi−dmaximax iteration.Step 21: check the convergence criteriaLike other optimization algorithms, the stop condition of the WCA algorithm can be based on the maximum number of iterations, the CPU time, or the error between the last two results less than a certain tolerance value. If the stopping condition is satisfied, the optimization will be finished, otherwise return to step 5.Figure 6
Flowchart of the WCA.


## 5. Results and Discussion

### 5.1. Collecting and Processing Data

To perform simulation and collect data, firstly, the experimental design was constructed by a full experimental design. The four design variables of PS includer, L, t, and w, which are divided into three levels, as shown in Table 1. A matrix of experimental designs is formed, as seen in Table 2. Then, 3D models of the PS are drawn by Inventor software as shown in Figure 2. Next, the simulation for data collection is performed through ANSYS 18.2.Table 1
Design variables with three levels.
VariablesLevel 1Level 2Level 3t (mm)1.01.21.4L (mm)455055w (mm)911.514r (mm)0.10.20.3Table 2
Mechanical properties of the material.
DensityYield strength (MPa)Poisson’s ratioYoung modulus (MPa)2810 kg/m35030.3371700In this study, a nonlinear FEM is applied for the simulation process. The simulation process is set up as follows: the boundary condition and loads are given as shown in Figure7. The PS is fixed with two holes, and a force of 10.935 N is applied to the top surface of the PS. Al T63-7075 is selected for the PS. The mechanical properties of the material are given in Table 2. The mesh is divided by using the sizing method. The element size greatly affects the behavior of the PS. So, before the simulation, an exploratory meshing was performed to ensure the good results at the lowest computational cost. The results show that the smaller the mesh size, the larger the processing time and memory used for the simulation. However, if the mesh size is 1 mm, the deformation, stress, and strain energy change very little. Hence, a mesh size of 1 mm is chosen for this study. The result meshes have 101190 elements and 632792 nodes. The quality of the mesh greatly affects the simulation results. Especially, the PS has large deformation. Therefore, in this study, two mesh quality assessment standards are used at the same time. Skewness standard and Orthogonal Quality standard are utilized as two criteria to evaluate the quality of meshing. The quality of the mesh is assessed according to Skewness criteria. The results indicate that the average value of the meshing metric is about 0.21141, and the standard deviation of the meshing metric is approximately 0.194, as shown in Figure 8. According to the Skewness criteria, this value proved that the accuracy of meshing models is excellent. The quality of the mesh is assessed according to Orthogonal Quality criteria. The results indicate that the average value of the meshing metric is about 0.93498, and the standard deviation of the meshing metric is approximately 0.0751, as given in Figure 8. According to the Orthogonal Quality criteria, this value proved that the accuracy of meshing models is very good.Figure 7
Meshing model and boundary conditions.Figure 8
Evaluating the quality of the meshing.In this study, strain energy is considered an objective function; therefore, strain energy is a factor that needs data collection. In addition, deformation and stress are considered constraints so they also need to be collected as data. The results of data collection are shown in Table3.Table 3
Experimental design and simulation data.
No.t (mm)L (mm)w (mm)r (mm)Deformation (mm)Stress (MPa)Strain energy (mJ)114590.137.648143.880.01136214590.237.359126.560.011931314590.337.18191.5240.01208414511.50.129.158110.50.0075272514511.50.228.93397.4690.0073316614511.50.328.79470.2830.00742077145140.123.74389.1340.0049598145140.223.55978.8960.00522799145140.323.44556.80.00528961015090.152.955135.960.0152831115090.252.482183.470.0151911215090.352.271103.040.015341315011.50.141.035105.250.0101621415011.50.240.666141.990.010111515011.50.340.50279.320.01020616150140.133.42385.4540.006723617150140.233.121115.140.006693118150140.332.98764.1510.00675451915590.172.04175.370.0188362015590.271.362203.90.0188372115590.371.012114.560.0190142215511.50.155.856135.110.0125522315511.50.255.326158.020.0125642415511.50.355.05388.3120.01267925155140.145.508109.330.00832526155140.245.075128.30.008339527155140.344.85271.5130.008414281.24590.122.2296.9410.0065149291.24590.222.1366.2150.0063295301.24590.321.93365.4680.0062087311.24511.50.117.20574.7730.0040134321.24511.50.217.13551.1290.003901331.24511.50.316.98150.3230.003827341.245140.114.00760.5820.0028689351.245140.213.9541.4570.0027898361.245140.313.82440.6690.0027374371.25090.131.178108.370.0082735381.25090.231.01190.5010.0080522391.25090.330.78473.9850.0079012401.25011.50.124.15683.7850.0055193411.25011.50.224.02569.7160.0053739421.25011.50.323.84857.0090.005274431.250140.119.67167.9080.0036635441.250140.219.56556.3370.003569451.250140.319.41946.0960.0035029461.25590.142.206125.930.010211471.25590.242.03582.7750.010003481.25590.341.73881.780.0098491.25511.50.132.71797.8690.0068261501.25511.50.232.58464.170.0066893511.25511.50.332.35363.110.0065549521.255140.126.65279.5330.0045419531.255140.226.54352.1240.004453541.255140.326.35451.0990.0043642551.44590.114.3170.5150.0028812561.44590.214.2171.5320.0023315571.44590.314.10666.2730.0021754581.44511.50.111.07854.2790.0017708591.44511.50.21155.0960.0014267601.44511.50.310.91951.0380.0013319611.445140.19.017243.8680.0012658621.445140.28.953644.5570.0010189631.445140.38.887641.2510.00095013641.45090.120.00579.2040.0036771651.45090.219.88573.8890.002852661.45090.319.74774.8140.0027744671.45011.50.115.49661.1290.0024474681.45011.50.215.40357.0820.0018876691.45011.50.315.29557.7680.0018403701.450140.112.61849.4260.0016241711.450140.212.54146.180.0012489721.450140.312.45346.7050.0012188731.45590.127.05288.3110.0038068741.45590.226.89375.6660.0035977751.45590.326.72681.1910.0034145761.45511.50.120.96768.2450.0025272771.45511.50.220.84358.4450.002389781.45511.50.320.71362.7520.0022659791.455140.117.07855.2470.0016786801.455140.216.97647.3210.0015868811.455140.316.8750.7830.0015041The properties of the PS have different units. Therefore, in this study, datasets are normalized to eliminate the units of measurement for data. This normalization makes the evaluation process fair. Data are normalized using (6). Normalization results are presented in Table 4.Table 4
Data normalization results.
No.t (mm)L (mm)w (mm)r (mm)ZY1ZY2ZY3114590.10.4554130.63230.576281214590.20.4508360.5261930.607891314590.30.4480180.3115520.61614414511.50.10.3209760.4278050.364101514511.50.20.3174130.3479730.353273614511.50.30.3152120.1814240.3582057145140.10.2352310.2969110.2219288145140.20.2323170.234190.2368149145140.30.2305120.0988230.2402291015090.10.6977950.583780.7934551115090.20.6903050.874840.7883621215090.30.6869640.3821030.7966111315011.50.10.5090450.3956420.5099611415011.50.20.5032020.6207220.5070821515011.50.30.5006050.2367870.51239716150140.10.3885110.2743660.31961417150140.20.3837290.4562310.31792618150140.30.3816070.1438570.3213251915590.110.8252170.9901462015590.20.98926410.9902012115590.30.9837220.45267712215511.50.10.7437310.5785730.6422692315511.50.20.7353390.7189260.6429342415511.50.30.7310160.2918750.649325155140.10.5798730.4206370.40826626155140.20.5730170.5368530.40906927155140.30.5694860.1889590.413193281.24590.10.2111150.3447380.308061291.24590.20.209690.1565020.297797301.24590.30.206570.1519260.29111311.24511.50.10.1317040.2089310.16958321.24511.50.20.1305950.0640810.163358331.24511.50.30.1281570.0591430.159261341.245140.10.0810640.1219930.106221351.245140.20.0801620.0048280.101843361.245140.30.07816600.098942371.25090.10.3529620.4147560.405415381.25090.20.3503180.3052850.393164391.25090.30.3467230.2041030.384805401.25011.50.10.2417710.2641410.252945411.25011.50.20.2396960.177950.244896421.25011.50.30.2368940.1001040.239366431.250140.10.1707520.1668740.15021441.250140.20.1690740.0959870.144978451.250140.30.1667620.0332470.141319461.25590.10.5275870.5223330.512674471.25590.20.5248790.2579530.501159481.25590.30.5201770.2518580.489921491.25511.50.10.3773320.3504240.325289501.25511.50.20.3752260.1439740.317715511.25511.50.30.3715680.137480.310275521.255140.10.2812940.2380920.198837531.255140.20.2795680.0701770.193916541.255140.30.2765750.0638970.189551.44590.10.0858620.1828450.106902561.44590.20.0842790.1890760.076471571.44590.30.0826320.1568570.06783581.44511.50.10.0346840.0833790.045432591.44511.50.20.0334490.0883840.026382601.44511.50.30.0321670.0635230.021134611.445140.10.0020520.0195980.017475621.445140.20.0010450.0238190.003807631.445140.300.0035650641.45090.10.1760410.2360760.150963651.45090.20.1741410.2035150.105286661.45090.30.1719550.2091820.10099671.45011.50.10.1046420.1253440.082888681.45011.50.20.1031690.1005510.051898691.45011.50.30.1014590.1047530.049279701.450140.10.059070.0536480.03731711.450140.20.0578510.0337620.01654721.450140.30.0564570.0369780.014873731.45590.10.2876280.2918690.158143741.45590.20.285110.2144020.146567751.45590.30.2824660.2482490.136425761.45511.50.10.1912740.1689380.087305771.45511.50.20.189310.1089010.079655781.45511.50.30.1872520.1352870.07284791.455140.10.1296930.0893090.040327801.455140.20.1280770.0407520.035245811.455140.30.1263990.0619610.030667


### 5.2. Optimization of the DFNN Structure

As presented in Section4, the DFNN is used to approximate the relationship between the design variable and the output characteristics. The accuracy of the approximated model depends on the structure of the DFNN. In this study, four factors of the DFNN structure are selected: training function, number of hidden layers, number of nodes in each hidden layer, and the division ratio of the dataset to create the most accurate approximated model possible. The factors are divided with 3 levels as illustrated in Table 5 and the orthogonal array L9 is used to establish the experimental plan as shown in Table 6.Table 5
DFNN parameters with 3 levels.
VariableLevel 1Level 2Level 3Training functionTrainlmTraincgbTrainscgNumber of hidden layers234Number of nodes7911Divide data60 : 20 : 2070 : 15 : 1580 : 10 : 10Table 6
Experimental design usingL9.
No.Training functionNumber of hidden layersNumber of nodesDivide data1trainlm2760 : 20 : 202trainlm3970 : 15 : 153trainlm41180 : 10 : 104traincgb2980 : 10 : 105traincgb31160 : 20 : 206traincgb4770 : 15 : 157trainscg21170 : 15 : 158trainscg3780 : 10 : 109trainscg4960 : 20 : 20As shown in Section4, normally, the approximation model’s accuracy is measured through two indices MSE and R2. However, when the MSE is small, the R2 is large and the approximation model has high accuracy. Therefore, in this study, MSE is selected as the objective function for the structural optimization of the DFNN. The approximate results depend on a weighted input that selects random as equation (7). So, in order to optimize the structure of the DFNN, each experiment is performed 10 times to collect data for MSE. MSE data collection results for deformation, stress, and strain energy are presented in Tables 7–9.Table 7
MSE results for deformation.
No.MSE1234567891010.00030.00000.00020.00060.00090.00020.00010.00010.00040.000220.00310.00720.00010.00040.00000.00070.00190.00480.00860.000630.01660.00290.00060.00080.00390.00580.00400.00260.00570.001340.01080.00360.00300.00100.00380.01500.00050.01310.00360.011050.00430.00380.00470.00580.00140.00790.00590.01580.00390.006160.00270.01100.01640.00690.00120.00930.00330.00640.03120.010470.00880.00180.00150.00320.00750.00450.00370.00610.00250.005780.01300.02390.00170.01410.02760.00280.01130.00340.00310.010690.01030.01210.01460.01340.02220.01090.00910.00680.02050.0075Table 8
MSE results for stress.
No.MSE1234567891010.00510.00230.01810.00220.01160.00630.00350.00230.00530.003920.01650.00460.01000.00750.01430.00840.01400.00560.00340.003230.00910.01030.00910.00090.01710.00780.00320.01040.03020.003640.00900.00760.00690.01500.00680.00870.01570.00430.00880.008650.00660.01290.01040.00820.00660.01550.00790.00750.00730.009060.01440.01060.01090.01270.01660.00880.01530.01320.01140.017970.00150.01150.01150.00240.00860.01180.00780.00490.00960.014680.05420.01540.01510.00370.01250.01380.03750.01620.03030.013790.01600.01240.01100.03560.00480.01060.01730.02700.01000.0283Table 9
MSE results for strain energy.
No.MSE1234567891010.00610.00010.00040.00030.00040.00010.00030.00370.00140.001620.02220.00370.00860.00070.00320.00240.00350.01640.00820.000830.00130.00110.02030.00110.01750.00190.02960.00050.00100.003440.01520.00600.00070.00930.00160.00720.01780.00490.00540.003650.00450.01500.00390.00670.00710.00580.00580.00180.00780.005160.00480.00430.00490.00580.00750.01030.00370.01070.00930.004370.01190.01180.00270.01430.00460.00250.00860.00390.00510.006780.00620.00470.00150.00630.00150.00200.04230.00730.00610.027390.00430.00340.03550.00610.01580.03570.00910.00470.02000.0104Based on MSE results obtained for deformation, stress, and strain energy, theS/N calculation and analysis for each experiment are performed, then ranking process for each input parameter of the DFNN structure are performed.The S/N analysis results for deformations (Figure9) show that, the training function “Trainlm” has the smallest error and the function “Trainscg” gives the largest error. The structure of the DFNN consists of 2 hidden layers for the smallest MSE value and 4 hidden layers with the largest error. The results found that when the number of nodes is 7 nodes, the error of the DFNN model is the smallest. Meanwhile, the when the number of nodes is 9 nodes, the error of the DFNN model is the largest. Besides, when the data are divided into the ratio of 60:20:20, the error of the DFNN model is the smallest; while the data ratio is 80:10:10, the error of the DFNN model is the largest. The analysis results also show that the training function in the DFNN structure has the greatest impact on the accuracy of the approximate model and the number of nodes in each hidden layer has the least effect on the accuracy of the equivalent model as shown in Table 10.Figure 9
Results analysis S/N for deformation.Table 10
Results of rank for deformation.
LevelTraining functionNumber of hidden layersNumber of nodesDivide data140.8451.8247.6049.46253.3142.6842.2743.84340.0739.7244.3440.91Delta13.2412.105.338.54Rank1243For the stress dataset, Figure10 shows that the training function “Trainlm” gives the largest S/N value and the training function “Trainscg” the minimum S/N value. Thus, the accuracy of the approximate model is best achieved using the training function “Trainlm.” At the same time, the number of hidden layers is 2, the number of nodes in a hidden layer is 7, and the data division ratio 70 : 15 : 15 gives the largest S/N. This means that the approximate model has the highest accuracy when the structure has 2 hidden layers, the number of nodes in each hidden layer is 7, and the data division ratio is 70 : 15 : 15. Table 11 also shows that, with data for stress, the number of layers hidden in the DFNN structure has the most influence on the accuracy of the approximate model.Figure 10
Results analysis S/N for stress.Table 11
Results of rank for stress.
LevelTraining functionNumber of hidden layersNumber of nodesDivide data139.3441.0137.1638.90240.0337.4438.1639.37335.5236.4439.5736.62Delta4.514.582.412.75Rank2143Figure11 depicts the calculation and analysis S/N results for the strain energy dataset. The results show the DFNN structure with the training function of “Trainlm,” the number of hidden layers of 2, the number of nodes in each hidden layer of 7, and the data division ratio of 60 : 20 : 20 give the best accurate approximate model. Table 12 shows that the number of hidden layers is ranked the highest. This means that among the four factors of the DFNN structure, the number of hidden layers has the highest influence on the accuracy of the approximate model.Figure 11
Results analysis S/N for strain energy.Table 12
Results of rank for strain energy.
LevelTraining functionNumber of hidden layersNumber of nodesDivide data142.3245.0843.7443.34243.5639.5938.6241.66337.3138.5240.8338.19Delta6.256.565.125.14Rank2143Table13 shows that for the deformation dataset, the optimal structure of the DFNN is: The training function is “trainlm,” the number of hidden layers is 2, the number of nodes in hidden layers is 7, and the data division ratio is 60 : 20 : 20. For the stress dataset, the optimal structure of the DFNN is: The training function is “trainlm,” the number of hidden layers is 2, the number of nodes in hidden layers is 11, and the data division ratio is 70 : 15 : 15. For the strain energy dataset, the optimal structure of the DFNN is: The training function is “trainlm,” the number of hidden layers is 2, the number of nodes in hidden layers is 9, and the data division ratio is 60 : 20 : 20.Table 13
The optimal structure of DFNN.
FunctionTraining functionNumber of hidden layersNumber of nodesDivide dataDeformationtrainlm2760 : 20 : 20Stresstrainlm21170 : 15 : 15Strain energytrainlm2760 : 20 : 20To evaluate the effectiveness of the structure of the DFNN, the appropriateness of the approximate model built by the DFNN and the linear model is compared with each other.Figure12 compares the suitability of the proposed model with a linear model. Figure 12(a) shows that the predicted points of the proposed model are more suitable with the experimental point than the linear model for the deformation dataset. The predicted points of the proposed model are distributed around the good fitness line. Similarly, the proposed model has better fitness between the predicted points and the experimental points than the linear model for stress and strain energy datasets, as shown in Figures 12(b) and 12(c).Figure 12
The good fitness of model (a) for deformation, (b) for stress, and (c) for strain energy.
(a)(b)(c)In addition, to evaluate the accuracy of the proposed model, the valueR2 and MSE of the proposed model are also compared with the value of the linear model. Table 14 compares the R2 value of the proposed model with the linear model for the 4 datasets: model, training, testing, and validation. The results indicate that the proposed model has much better R2 than the linear model. Table 15 also shows that the MSE of the proposed model is smaller than the error of the linear model for all three sets of deformation, stress, and strain energy data.Table 14
Compare the valueR2 of the proposed model and the linear model.
ResponseModel dataTraining dataValidating dataTesting dataDFNNLinearDFNNLinearDFNNLinearDFNNLinearDeformation0.990.910.990.911.00.920.990.96Stress0.970.760.900.730.950.780.950.82Strain energy0.990.890.990.971.00.890.990.93Table 15
Compare the value MSE of the proposed model and the linear model.
ResponseModel dataTraining dataValidating dataTesting dataDFNNLinearDFNNLinearDFNNLinearDFNNLinearDeformation2.82E − 40.00508.02E − 40.00534.14E − 50.00465.00E − 40.0014Stress0.00150.01210.00460.00995.98E − 60.01270.00310.0112Strain energy3.28E − 40.00699.5E − 40.00651.3E − 50.00616.70E − 40.0049As illustrated in Figure 13(a), the MSE values of the training dataset of the deformation continuously decreased at the 9th epoch, but the MSE values of the testing and validating dataset still remained stable. As depicted in Figure13(b), the MSE values of the training datasets of the stress still decreased, but the MSE values of the testing and validating datasets remained stable at 9th epoch. As depicted in Figure 13(c), the MSE values of the training datasets of the strain energy still decreased, but the MSE values of the testing and validating datasets remained stable at 8th epoch.Figure 13
The best validation performance: (a) for deformation, (b) for stress, and (c) for strain energy.
(a)(b)(c)Figure14 demonstrates that the errors of the three training, evaluation, and test datasets of all three sets of deformation, stress, and strain energy datasets are almost zero.Figure 14
Error histogram (a) for deformation, (b) for stress, and (c) for strain energy.
(a)(b)(c)Figure15 also demonstrates that the appropriateness of the approximate models is constructed by the DFNN through the value of R2 for the datasets.Figure 15
The fitness of model (a) for deformation, (b) for stress, and (c) for strain energy.
(a)(b)(c)


### 5.3. Optimal Results

After optimizing the structure of the DFNN, an alternative model using the DNFF was established. Then, the WCA algorithm was carried out using Matlab R2018a to optimize the parameters of the planar spring. The parameters of the WCA were initialized as initial rain drops of 50, number of rivers and sea of 4, maximum distance between streams and rivers, between river and sea of 10−5, and the maximum iteration of 2000.The optimal results were generated as Table16. The evaporation-rate-based water cycle algorithm (ER-WCA) was developed based on the WCA to speed up convergence [29]. However, with the proposed PS, the WCA has higher convergence rate and stability than the ER-WCA. The results in Table 16 show that the optimal mean strain energy is 0.01123 when optimized by the WCA. It is higher than the ER-WCA optimal value. The standard deviation of energy when optimized by the WCA is also smaller than when optimized by the ER-WCA. The average search time also shows that the WCA has a shorter search time than the ER-WCA. The standard deviation of the search time of the WCA is also smaller than the ER-WCA. The optimal results show that the optimal parameters of the planar spring t, L, w, and r is 1.029 mm, 45 mm, 9 mm, 0.3 mm, respectively.Table 16
Optimal results.
No.WCAER-WCAStrain energy (mJ)Time (s)Strain energy (mJ)Time (s)10.0115092.62E + 030.0115093.05E + 0320.0115092.59E + 030.0115093.08E + 0330.0106542.63E + 030.0106542.84E + 0340.0106542.63E + 030.0106542.90E + 0350.0111272.62E + 030.0111272.96E + 0360.0113142.63E + 030.0113143.61E + 0370.0113642.63E + 030.0113643.56E + 0380.0115092.62E + 030.0115093.57E + 0390.0107172.63E + 030.0107173.17E + 03100.0115092.63E + 030.0115093.07E + 03110.0106752.65E + 030.0106753.03E + 03120.0115092.33E + 030.0115092.90E + 03130.0115092.67E + 030.0115092.98E + 03140.0115092.67E + 030.0115093.05E + 03150.0115092.90E + 030.0115093.02E + 03160.0107162.68E + 030.0107163.05E + 03170.0115092.68E + 030.0115092.89E + 03180.0115092.72E + 030.0115092.85E + 03190.0115092.85E + 030.0115092.94E + 03200.0115092.80E + 030.0115092.85E + 03210.0112572.95E + 030.0112572.86E + 03220.0107082.69E + 030.0107082.93E + 03230.0106562.94E + 030.0106563.02E + 03240.0115092.94E + 030.0115093.06E + 03250.0115092.96E + 030.0115093.09E + 03260.0106752.63E + 030.0106753.19E + 03270.0115092.65E + 030.0115093.05E + 03280.0115092.68E + 030.0115093.05E + 03290.0115092.95E + 030.0115093.05E + 03300.0107162.96E + 030.0107162.84E + 03Average0.011232717.7550.011193057.928Standard deviation0.000373149.22290.000568202.8228


## 5.1. Collecting and Processing Data

To perform simulation and collect data, firstly, the experimental design was constructed by a full experimental design. The four design variables of PS includer, L, t, and w, which are divided into three levels, as shown in Table 1. A matrix of experimental designs is formed, as seen in Table 2. Then, 3D models of the PS are drawn by Inventor software as shown in Figure 2. Next, the simulation for data collection is performed through ANSYS 18.2.Table 1
Design variables with three levels.
VariablesLevel 1Level 2Level 3t (mm)1.01.21.4L (mm)455055w (mm)911.514r (mm)0.10.20.3Table 2
Mechanical properties of the material.
DensityYield strength (MPa)Poisson’s ratioYoung modulus (MPa)2810 kg/m35030.3371700In this study, a nonlinear FEM is applied for the simulation process. The simulation process is set up as follows: the boundary condition and loads are given as shown in Figure7. The PS is fixed with two holes, and a force of 10.935 N is applied to the top surface of the PS. Al T63-7075 is selected for the PS. The mechanical properties of the material are given in Table 2. The mesh is divided by using the sizing method. The element size greatly affects the behavior of the PS. So, before the simulation, an exploratory meshing was performed to ensure the good results at the lowest computational cost. The results show that the smaller the mesh size, the larger the processing time and memory used for the simulation. However, if the mesh size is 1 mm, the deformation, stress, and strain energy change very little. Hence, a mesh size of 1 mm is chosen for this study. The result meshes have 101190 elements and 632792 nodes. The quality of the mesh greatly affects the simulation results. Especially, the PS has large deformation. Therefore, in this study, two mesh quality assessment standards are used at the same time. Skewness standard and Orthogonal Quality standard are utilized as two criteria to evaluate the quality of meshing. The quality of the mesh is assessed according to Skewness criteria. The results indicate that the average value of the meshing metric is about 0.21141, and the standard deviation of the meshing metric is approximately 0.194, as shown in Figure 8. According to the Skewness criteria, this value proved that the accuracy of meshing models is excellent. The quality of the mesh is assessed according to Orthogonal Quality criteria. The results indicate that the average value of the meshing metric is about 0.93498, and the standard deviation of the meshing metric is approximately 0.0751, as given in Figure 8. According to the Orthogonal Quality criteria, this value proved that the accuracy of meshing models is very good.Figure 7
Meshing model and boundary conditions.Figure 8
Evaluating the quality of the meshing.In this study, strain energy is considered an objective function; therefore, strain energy is a factor that needs data collection. In addition, deformation and stress are considered constraints so they also need to be collected as data. The results of data collection are shown in Table3.Table 3
Experimental design and simulation data.
No.t (mm)L (mm)w (mm)r (mm)Deformation (mm)Stress (MPa)Strain energy (mJ)114590.137.648143.880.01136214590.237.359126.560.011931314590.337.18191.5240.01208414511.50.129.158110.50.0075272514511.50.228.93397.4690.0073316614511.50.328.79470.2830.00742077145140.123.74389.1340.0049598145140.223.55978.8960.00522799145140.323.44556.80.00528961015090.152.955135.960.0152831115090.252.482183.470.0151911215090.352.271103.040.015341315011.50.141.035105.250.0101621415011.50.240.666141.990.010111515011.50.340.50279.320.01020616150140.133.42385.4540.006723617150140.233.121115.140.006693118150140.332.98764.1510.00675451915590.172.04175.370.0188362015590.271.362203.90.0188372115590.371.012114.560.0190142215511.50.155.856135.110.0125522315511.50.255.326158.020.0125642415511.50.355.05388.3120.01267925155140.145.508109.330.00832526155140.245.075128.30.008339527155140.344.85271.5130.008414281.24590.122.2296.9410.0065149291.24590.222.1366.2150.0063295301.24590.321.93365.4680.0062087311.24511.50.117.20574.7730.0040134321.24511.50.217.13551.1290.003901331.24511.50.316.98150.3230.003827341.245140.114.00760.5820.0028689351.245140.213.9541.4570.0027898361.245140.313.82440.6690.0027374371.25090.131.178108.370.0082735381.25090.231.01190.5010.0080522391.25090.330.78473.9850.0079012401.25011.50.124.15683.7850.0055193411.25011.50.224.02569.7160.0053739421.25011.50.323.84857.0090.005274431.250140.119.67167.9080.0036635441.250140.219.56556.3370.003569451.250140.319.41946.0960.0035029461.25590.142.206125.930.010211471.25590.242.03582.7750.010003481.25590.341.73881.780.0098491.25511.50.132.71797.8690.0068261501.25511.50.232.58464.170.0066893511.25511.50.332.35363.110.0065549521.255140.126.65279.5330.0045419531.255140.226.54352.1240.004453541.255140.326.35451.0990.0043642551.44590.114.3170.5150.0028812561.44590.214.2171.5320.0023315571.44590.314.10666.2730.0021754581.44511.50.111.07854.2790.0017708591.44511.50.21155.0960.0014267601.44511.50.310.91951.0380.0013319611.445140.19.017243.8680.0012658621.445140.28.953644.5570.0010189631.445140.38.887641.2510.00095013641.45090.120.00579.2040.0036771651.45090.219.88573.8890.002852661.45090.319.74774.8140.0027744671.45011.50.115.49661.1290.0024474681.45011.50.215.40357.0820.0018876691.45011.50.315.29557.7680.0018403701.450140.112.61849.4260.0016241711.450140.212.54146.180.0012489721.450140.312.45346.7050.0012188731.45590.127.05288.3110.0038068741.45590.226.89375.6660.0035977751.45590.326.72681.1910.0034145761.45511.50.120.96768.2450.0025272771.45511.50.220.84358.4450.002389781.45511.50.320.71362.7520.0022659791.455140.117.07855.2470.0016786801.455140.216.97647.3210.0015868811.455140.316.8750.7830.0015041The properties of the PS have different units. Therefore, in this study, datasets are normalized to eliminate the units of measurement for data. This normalization makes the evaluation process fair. Data are normalized using (6). Normalization results are presented in Table 4.Table 4
Data normalization results.
No.t (mm)L (mm)w (mm)r (mm)ZY1ZY2ZY3114590.10.4554130.63230.576281214590.20.4508360.5261930.607891314590.30.4480180.3115520.61614414511.50.10.3209760.4278050.364101514511.50.20.3174130.3479730.353273614511.50.30.3152120.1814240.3582057145140.10.2352310.2969110.2219288145140.20.2323170.234190.2368149145140.30.2305120.0988230.2402291015090.10.6977950.583780.7934551115090.20.6903050.874840.7883621215090.30.6869640.3821030.7966111315011.50.10.5090450.3956420.5099611415011.50.20.5032020.6207220.5070821515011.50.30.5006050.2367870.51239716150140.10.3885110.2743660.31961417150140.20.3837290.4562310.31792618150140.30.3816070.1438570.3213251915590.110.8252170.9901462015590.20.98926410.9902012115590.30.9837220.45267712215511.50.10.7437310.5785730.6422692315511.50.20.7353390.7189260.6429342415511.50.30.7310160.2918750.649325155140.10.5798730.4206370.40826626155140.20.5730170.5368530.40906927155140.30.5694860.1889590.413193281.24590.10.2111150.3447380.308061291.24590.20.209690.1565020.297797301.24590.30.206570.1519260.29111311.24511.50.10.1317040.2089310.16958321.24511.50.20.1305950.0640810.163358331.24511.50.30.1281570.0591430.159261341.245140.10.0810640.1219930.106221351.245140.20.0801620.0048280.101843361.245140.30.07816600.098942371.25090.10.3529620.4147560.405415381.25090.20.3503180.3052850.393164391.25090.30.3467230.2041030.384805401.25011.50.10.2417710.2641410.252945411.25011.50.20.2396960.177950.244896421.25011.50.30.2368940.1001040.239366431.250140.10.1707520.1668740.15021441.250140.20.1690740.0959870.144978451.250140.30.1667620.0332470.141319461.25590.10.5275870.5223330.512674471.25590.20.5248790.2579530.501159481.25590.30.5201770.2518580.489921491.25511.50.10.3773320.3504240.325289501.25511.50.20.3752260.1439740.317715511.25511.50.30.3715680.137480.310275521.255140.10.2812940.2380920.198837531.255140.20.2795680.0701770.193916541.255140.30.2765750.0638970.189551.44590.10.0858620.1828450.106902561.44590.20.0842790.1890760.076471571.44590.30.0826320.1568570.06783581.44511.50.10.0346840.0833790.045432591.44511.50.20.0334490.0883840.026382601.44511.50.30.0321670.0635230.021134611.445140.10.0020520.0195980.017475621.445140.20.0010450.0238190.003807631.445140.300.0035650641.45090.10.1760410.2360760.150963651.45090.20.1741410.2035150.105286661.45090.30.1719550.2091820.10099671.45011.50.10.1046420.1253440.082888681.45011.50.20.1031690.1005510.051898691.45011.50.30.1014590.1047530.049279701.450140.10.059070.0536480.03731711.450140.20.0578510.0337620.01654721.450140.30.0564570.0369780.014873731.45590.10.2876280.2918690.158143741.45590.20.285110.2144020.146567751.45590.30.2824660.2482490.136425761.45511.50.10.1912740.1689380.087305771.45511.50.20.189310.1089010.079655781.45511.50.30.1872520.1352870.07284791.455140.10.1296930.0893090.040327801.455140.20.1280770.0407520.035245811.455140.30.1263990.0619610.030667


## 5.2. Optimization of the DFNN Structure

As presented in Section4, the DFNN is used to approximate the relationship between the design variable and the output characteristics. The accuracy of the approximated model depends on the structure of the DFNN. In this study, four factors of the DFNN structure are selected: training function, number of hidden layers, number of nodes in each hidden layer, and the division ratio of the dataset to create the most accurate approximated model possible. The factors are divided with 3 levels as illustrated in Table 5 and the orthogonal array L9 is used to establish the experimental plan as shown in Table 6.Table 5
DFNN parameters with 3 levels.
VariableLevel 1Level 2Level 3Training functionTrainlmTraincgbTrainscgNumber of hidden layers234Number of nodes7911Divide data60 : 20 : 2070 : 15 : 1580 : 10 : 10Table 6
Experimental design usingL9.
No.Training functionNumber of hidden layersNumber of nodesDivide data1trainlm2760 : 20 : 202trainlm3970 : 15 : 153trainlm41180 : 10 : 104traincgb2980 : 10 : 105traincgb31160 : 20 : 206traincgb4770 : 15 : 157trainscg21170 : 15 : 158trainscg3780 : 10 : 109trainscg4960 : 20 : 20As shown in Section4, normally, the approximation model’s accuracy is measured through two indices MSE and R2. However, when the MSE is small, the R2 is large and the approximation model has high accuracy. Therefore, in this study, MSE is selected as the objective function for the structural optimization of the DFNN. The approximate results depend on a weighted input that selects random as equation (7). So, in order to optimize the structure of the DFNN, each experiment is performed 10 times to collect data for MSE. MSE data collection results for deformation, stress, and strain energy are presented in Tables 7–9.Table 7
MSE results for deformation.
No.MSE1234567891010.00030.00000.00020.00060.00090.00020.00010.00010.00040.000220.00310.00720.00010.00040.00000.00070.00190.00480.00860.000630.01660.00290.00060.00080.00390.00580.00400.00260.00570.001340.01080.00360.00300.00100.00380.01500.00050.01310.00360.011050.00430.00380.00470.00580.00140.00790.00590.01580.00390.006160.00270.01100.01640.00690.00120.00930.00330.00640.03120.010470.00880.00180.00150.00320.00750.00450.00370.00610.00250.005780.01300.02390.00170.01410.02760.00280.01130.00340.00310.010690.01030.01210.01460.01340.02220.01090.00910.00680.02050.0075Table 8
MSE results for stress.
No.MSE1234567891010.00510.00230.01810.00220.01160.00630.00350.00230.00530.003920.01650.00460.01000.00750.01430.00840.01400.00560.00340.003230.00910.01030.00910.00090.01710.00780.00320.01040.03020.003640.00900.00760.00690.01500.00680.00870.01570.00430.00880.008650.00660.01290.01040.00820.00660.01550.00790.00750.00730.009060.01440.01060.01090.01270.01660.00880.01530.01320.01140.017970.00150.01150.01150.00240.00860.01180.00780.00490.00960.014680.05420.01540.01510.00370.01250.01380.03750.01620.03030.013790.01600.01240.01100.03560.00480.01060.01730.02700.01000.0283Table 9
MSE results for strain energy.
No.MSE1234567891010.00610.00010.00040.00030.00040.00010.00030.00370.00140.001620.02220.00370.00860.00070.00320.00240.00350.01640.00820.000830.00130.00110.02030.00110.01750.00190.02960.00050.00100.003440.01520.00600.00070.00930.00160.00720.01780.00490.00540.003650.00450.01500.00390.00670.00710.00580.00580.00180.00780.005160.00480.00430.00490.00580.00750.01030.00370.01070.00930.004370.01190.01180.00270.01430.00460.00250.00860.00390.00510.006780.00620.00470.00150.00630.00150.00200.04230.00730.00610.027390.00430.00340.03550.00610.01580.03570.00910.00470.02000.0104Based on MSE results obtained for deformation, stress, and strain energy, theS/N calculation and analysis for each experiment are performed, then ranking process for each input parameter of the DFNN structure are performed.The S/N analysis results for deformations (Figure9) show that, the training function “Trainlm” has the smallest error and the function “Trainscg” gives the largest error. The structure of the DFNN consists of 2 hidden layers for the smallest MSE value and 4 hidden layers with the largest error. The results found that when the number of nodes is 7 nodes, the error of the DFNN model is the smallest. Meanwhile, the when the number of nodes is 9 nodes, the error of the DFNN model is the largest. Besides, when the data are divided into the ratio of 60:20:20, the error of the DFNN model is the smallest; while the data ratio is 80:10:10, the error of the DFNN model is the largest. The analysis results also show that the training function in the DFNN structure has the greatest impact on the accuracy of the approximate model and the number of nodes in each hidden layer has the least effect on the accuracy of the equivalent model as shown in Table 10.Figure 9
Results analysis S/N for deformation.Table 10
Results of rank for deformation.
LevelTraining functionNumber of hidden layersNumber of nodesDivide data140.8451.8247.6049.46253.3142.6842.2743.84340.0739.7244.3440.91Delta13.2412.105.338.54Rank1243For the stress dataset, Figure10 shows that the training function “Trainlm” gives the largest S/N value and the training function “Trainscg” the minimum S/N value. Thus, the accuracy of the approximate model is best achieved using the training function “Trainlm.” At the same time, the number of hidden layers is 2, the number of nodes in a hidden layer is 7, and the data division ratio 70 : 15 : 15 gives the largest S/N. This means that the approximate model has the highest accuracy when the structure has 2 hidden layers, the number of nodes in each hidden layer is 7, and the data division ratio is 70 : 15 : 15. Table 11 also shows that, with data for stress, the number of layers hidden in the DFNN structure has the most influence on the accuracy of the approximate model.Figure 10
Results analysis S/N for stress.Table 11
Results of rank for stress.
LevelTraining functionNumber of hidden layersNumber of nodesDivide data139.3441.0137.1638.90240.0337.4438.1639.37335.5236.4439.5736.62Delta4.514.582.412.75Rank2143Figure11 depicts the calculation and analysis S/N results for the strain energy dataset. The results show the DFNN structure with the training function of “Trainlm,” the number of hidden layers of 2, the number of nodes in each hidden layer of 7, and the data division ratio of 60 : 20 : 20 give the best accurate approximate model. Table 12 shows that the number of hidden layers is ranked the highest. This means that among the four factors of the DFNN structure, the number of hidden layers has the highest influence on the accuracy of the approximate model.Figure 11
Results analysis S/N for strain energy.Table 12
Results of rank for strain energy.
LevelTraining functionNumber of hidden layersNumber of nodesDivide data142.3245.0843.7443.34243.5639.5938.6241.66337.3138.5240.8338.19Delta6.256.565.125.14Rank2143Table13 shows that for the deformation dataset, the optimal structure of the DFNN is: The training function is “trainlm,” the number of hidden layers is 2, the number of nodes in hidden layers is 7, and the data division ratio is 60 : 20 : 20. For the stress dataset, the optimal structure of the DFNN is: The training function is “trainlm,” the number of hidden layers is 2, the number of nodes in hidden layers is 11, and the data division ratio is 70 : 15 : 15. For the strain energy dataset, the optimal structure of the DFNN is: The training function is “trainlm,” the number of hidden layers is 2, the number of nodes in hidden layers is 9, and the data division ratio is 60 : 20 : 20.Table 13
The optimal structure of DFNN.
FunctionTraining functionNumber of hidden layersNumber of nodesDivide dataDeformationtrainlm2760 : 20 : 20Stresstrainlm21170 : 15 : 15Strain energytrainlm2760 : 20 : 20To evaluate the effectiveness of the structure of the DFNN, the appropriateness of the approximate model built by the DFNN and the linear model is compared with each other.Figure12 compares the suitability of the proposed model with a linear model. Figure 12(a) shows that the predicted points of the proposed model are more suitable with the experimental point than the linear model for the deformation dataset. The predicted points of the proposed model are distributed around the good fitness line. Similarly, the proposed model has better fitness between the predicted points and the experimental points than the linear model for stress and strain energy datasets, as shown in Figures 12(b) and 12(c).Figure 12
The good fitness of model (a) for deformation, (b) for stress, and (c) for strain energy.
(a)(b)(c)In addition, to evaluate the accuracy of the proposed model, the valueR2 and MSE of the proposed model are also compared with the value of the linear model. Table 14 compares the R2 value of the proposed model with the linear model for the 4 datasets: model, training, testing, and validation. The results indicate that the proposed model has much better R2 than the linear model. Table 15 also shows that the MSE of the proposed model is smaller than the error of the linear model for all three sets of deformation, stress, and strain energy data.Table 14
Compare the valueR2 of the proposed model and the linear model.
ResponseModel dataTraining dataValidating dataTesting dataDFNNLinearDFNNLinearDFNNLinearDFNNLinearDeformation0.990.910.990.911.00.920.990.96Stress0.970.760.900.730.950.780.950.82Strain energy0.990.890.990.971.00.890.990.93Table 15
Compare the value MSE of the proposed model and the linear model.
ResponseModel dataTraining dataValidating dataTesting dataDFNNLinearDFNNLinearDFNNLinearDFNNLinearDeformation2.82E − 40.00508.02E − 40.00534.14E − 50.00465.00E − 40.0014Stress0.00150.01210.00460.00995.98E − 60.01270.00310.0112Strain energy3.28E − 40.00699.5E − 40.00651.3E − 50.00616.70E − 40.0049As illustrated in Figure 13(a), the MSE values of the training dataset of the deformation continuously decreased at the 9th epoch, but the MSE values of the testing and validating dataset still remained stable. As depicted in Figure13(b), the MSE values of the training datasets of the stress still decreased, but the MSE values of the testing and validating datasets remained stable at 9th epoch. As depicted in Figure 13(c), the MSE values of the training datasets of the strain energy still decreased, but the MSE values of the testing and validating datasets remained stable at 8th epoch.Figure 13
The best validation performance: (a) for deformation, (b) for stress, and (c) for strain energy.
(a)(b)(c)Figure14 demonstrates that the errors of the three training, evaluation, and test datasets of all three sets of deformation, stress, and strain energy datasets are almost zero.Figure 14
Error histogram (a) for deformation, (b) for stress, and (c) for strain energy.
(a)(b)(c)Figure15 also demonstrates that the appropriateness of the approximate models is constructed by the DFNN through the value of R2 for the datasets.Figure 15
The fitness of model (a) for deformation, (b) for stress, and (c) for strain energy.
(a)(b)(c)


## 5.3. Optimal Results

After optimizing the structure of the DFNN, an alternative model using the DNFF was established. Then, the WCA algorithm was carried out using Matlab R2018a to optimize the parameters of the planar spring. The parameters of the WCA were initialized as initial rain drops of 50, number of rivers and sea of 4, maximum distance between streams and rivers, between river and sea of 10−5, and the maximum iteration of 2000.The optimal results were generated as Table16. The evaporation-rate-based water cycle algorithm (ER-WCA) was developed based on the WCA to speed up convergence [29]. However, with the proposed PS, the WCA has higher convergence rate and stability than the ER-WCA. The results in Table 16 show that the optimal mean strain energy is 0.01123 when optimized by the WCA. It is higher than the ER-WCA optimal value. The standard deviation of energy when optimized by the WCA is also smaller than when optimized by the ER-WCA. The average search time also shows that the WCA has a shorter search time than the ER-WCA. The standard deviation of the search time of the WCA is also smaller than the ER-WCA. The optimal results show that the optimal parameters of the planar spring t, L, w, and r is 1.029 mm, 45 mm, 9 mm, 0.3 mm, respectively.Table 16
Optimal results.
No.WCAER-WCAStrain energy (mJ)Time (s)Strain energy (mJ)Time (s)10.0115092.62E + 030.0115093.05E + 0320.0115092.59E + 030.0115093.08E + 0330.0106542.63E + 030.0106542.84E + 0340.0106542.63E + 030.0106542.90E + 0350.0111272.62E + 030.0111272.96E + 0360.0113142.63E + 030.0113143.61E + 0370.0113642.63E + 030.0113643.56E + 0380.0115092.62E + 030.0115093.57E + 0390.0107172.63E + 030.0107173.17E + 03100.0115092.63E + 030.0115093.07E + 03110.0106752.65E + 030.0106753.03E + 03120.0115092.33E + 030.0115092.90E + 03130.0115092.67E + 030.0115092.98E + 03140.0115092.67E + 030.0115093.05E + 03150.0115092.90E + 030.0115093.02E + 03160.0107162.68E + 030.0107163.05E + 03170.0115092.68E + 030.0115092.89E + 03180.0115092.72E + 030.0115092.85E + 03190.0115092.85E + 030.0115092.94E + 03200.0115092.80E + 030.0115092.85E + 03210.0112572.95E + 030.0112572.86E + 03220.0107082.69E + 030.0107082.93E + 03230.0106562.94E + 030.0106563.02E + 03240.0115092.94E + 030.0115093.06E + 03250.0115092.96E + 030.0115093.09E + 03260.0106752.63E + 030.0106753.19E + 03270.0115092.65E + 030.0115093.05E + 03280.0115092.68E + 030.0115093.05E + 03290.0115092.95E + 030.0115093.05E + 03300.0107162.96E + 030.0107162.84E + 03Average0.011232717.7550.011193057.928Standard deviation0.000373149.22290.000568202.8228


## 6. Verifications

Optimized results are used to build the 3D model. The model was then used for finite element analysis. Finite element analysis results are presented in Table17 and Figure 16. FEM results show with optimal parameters. Characteristics of planar spring with strain energy, stress, deformation, and life are 0.01102 mJ, 34.236 mm, 81.475 MPa, and 299 million cycles, respectively. Comparison between the prediction results with the FEM results shows that the strain energy error is 1.87%, the strain error is 1.69%, and the stress error is 3.06%. With small error values, it shows that the proposed optimal method has high reliability.Table 17
Results of evaluation.
Strain energy (mJ)Deformation (mm)Stress (MPa)Life (106 cycle)Prediction0.0112333.66679.050FEM0.0110234.23681.475299Error (%)1.871.693.06Figure 16
FEM results for (a) deformation, (b) stress, (c) strain energy, and (d) life.
(a)(b)(c)(d)


## 7. Conclusions

This paper proposes a method for the development and optimization of a planar spring used for a gravity balance mechanism. The proposed method is a combination of finite FEM, DFNN, and WCA. First, the FEM was used to collect data. Next, the approximated model was constructed using the DFNN, and finally, the geometry of the planar spring was optimized by the WCA. The effectiveness of the proposed method was tested by comparison with the optimal results of the ER-WCA. The comparison results show that the convergence speed and search stability of the proposed algorithm are better than the ER-WCA. The optimal parameters of PS are used to build 3D models. This model is used to be FEM. Comparing the FEM results with the optimal prediction results shows that the errors of energy strain, deformation, and stress are 1.87%, 1.69%, and 3.06%, respectively. This error shows that the proposed solution is highly robust. In addition, the life of the PS was also predicted with 299 million cycles. For future research, prototypes will be manufactured and measured to verify the numerical results. The optimization method will be utilized for other compliant mechanisms.



---

*Source: 9921383-2021-06-14.xml*