# A Spring Search Algorithm Applied to Engineering Optimization Problems
## 3 Spring Force Law  
If a force that moves an object in a closed path (forward and backward) is not affected by the object's trajectory, that force is conservative. Another method for diagnosing conservative forces is that the work done by the force in different paths is equal to the difference between the initial and final points. The spring force is a type of conservative force [83]. Consider a spring that imposes a force on a particle with mass'm'. The particle moves horizontally in the \(x\) direction. When a particle is at the origin (\(x=0\)), the spring is balanced. An external force (\(F_{ext}\)) influences the object in the anti-clock wise direction of the spring. The external force is always equal to the spring force. Thus, the particle is always in balance. Consider that the particle is moved a distance \(x\) from its initial location \(x=0\). When the external factor imposes a force \(F_{ext}\) on the particle, the spring offers a resistance force \(F_{s}\) on the particle. This force can be described by the spring force or [PERSON]'s law as follows:  
\[F_{s}\ =\ -kx \tag{1}\]  
where \(k\) is the spring force constant and \(x\) denotes the spring displacement (strain or compression) from the balance point. Most real springs properly follow [PERSON]'s law up to a limit [84]. The system behavior is investigated in an isolated system as shown in Figure 1. It is assumed that only the spring force is imposed on the object. In Figure 1, forces imposed on object \(j\) can be grouped into two, \(F_{total_{R}}\), which variables as described in Equation (2), is the sum of forces imposed from the right and \(F_{total_{L}}\), which, as shown in Equation (3), is the sum of forces imposed from the left. It is necessary to mention that the springs that are attached to the object from either right or left, are also attached to robust points at their other ends. \[F_{total_{R}}^{j}=\ \sum_{i=1}^{n_{R}}K_{i,j}x_{i,j} \tag{2}\]  
Figure 1: An isolated system is composed of object and spring forces. \[F^{j}_{total_{L}}=\sum_{l=1}^{n_{L}}K_{l,j}x_{l,j} \tag{3}\]  
where, \(n_{R}\) and \(n_{L}\) are the number of left and right spring forces, \(x_{i,j}\) and \(x_{l,j}\) show the distance between the object \(j\) and the fixed left and right points, \(K_{i,j}\) and \(K_{l,j}\) are the spring stiffness coefficients between the object \(j\) and the fixed points. The object is initially balanced with no force exerted on it. Then, by applying the spring forces, the object is pulled from the right and the left. Considering the magnitude of these forces, the spring either shifts to left or right until the system reaches a new equilibrium position. It is apt to mention that if the right and left forces are equal, the object remains at its original position. Considering the stiffness coefficient of the springs that are connected to the object, two new parameters may be defined as below:  
\[K^{j}_{equal_{R}}=\sum_{i=1}^{n_{R}}K_{i,j} \tag{4}\]  
\[K^{j}_{equal_{L}}=\sum_{l=1}^{n_{L}}K_{l,j} \tag{5}\]  
\(K^{j}_{equal_{R}}\) and \(K^{j}_{equal_{L}}\) are the right and the left constants of the spring, respectively. Considering Equation (1) the displacement values at each side may be defined as follows:  
\[dX^{j}_{R}=\frac{F^{j}_{total_{R}}}{K^{j}_{equal_{R}}} \tag{6}\]  
\[dX^{j}_{L}=\frac{F^{j}_{total_{L}}}{K^{j}_{equal_{L}}} \tag{7}\]  
here, \(dX^{j}_{R}\) and \(dX^{j}_{L}\) are the displacement values of object \(j\) to the right and left, respectively. Therefore, the total displacement may be defined as follows:  
\[X^{j}=dX^{j}_{R}+dX^{j}_{L} \tag{8}\]  
\(dX^{j}\) is the final object \(j\) displacement value that may be a positive or negative value. Figure 1.0  
Equation (9), \(X^{j}\) relates to the location of the new balance point of the system and object \(j\). Besides, \(X^{j}_{0}\) is the initial balance of object \(j\). By simulating [PERSON]'s law within the discrete time domain, a new optimization algorithm called the spring optimization was designed, which is explained further in the following section.