# Magnetic Force Enhancement Using Air-Gap Magnetic Field Manipulation by Optimized Coil Currents
## 3 Optimization Strategy
The proposed interpolation functions in (3) and (4) could determine the number of coil turns together with the material state. In the optimization result, the number of coil turns need to be an integer value. To achieve this, the continuous and discrete optimization scheme proposed in [17], ref. [29] is employed in this work. In this scheme, a physical property is penalized when a corresponding design variable is located at intermediate values between the desired integer values. The optimization in this work aimed to maximize the magnetic force. The magnetic force becomes large when the magnetic flux density \(\mathbf{B}\) is large. The magnetic flux density \(\mathbf{B}\) is large when the electric current input is large. Therefore, reduced current magnitude worked as penalization in this optimization problem for maximizing the magnetic force. Using this working principle, the physical property \(\mathbf{I}_{0}\) in (3) is penalized (i.e., reduced) when the design variable \(\beta_{i}\) is not located at an integer value. For this, the current \(\mathbf{I}_{0}\) is first defined as  
\[\tilde{\mathbf{I}}_{0}=I_{0}\left[1+(1-s)\frac{\sum_{n=1}^{\infty}0.7^{n-1}( \cos(2\pi n\beta_{i})-1)}{\sum_{n=1}^{\infty}0.7^{n-1}(\cos(2\pi n)-\cos(\pi n ))}\right] \tag{5}\]  
where \(I_{0}\) is the fixed maximum current, and \(s\in[0,1]\) is the penalty parameter. Figure 5 shows the plot of the current \(\tilde{\mathbf{I}}_{0}\) with respect to the design variable \(\beta_{i}\). When the penalty parameter \(s\) is set to 1, the current \(\tilde{\mathbf{I}}_{0}\) is not penalized, which means \(\tilde{\mathbf{I}}_{0}\) is fixed as \(I_{0}\) at every value of \(\beta_{i}\). As the parameter \(s\) decreased, the strong penalty is applied to \(\tilde{\mathbf{I}}_{0}\) when the design variable \(\beta_{i}\) is not located at integer values. Consequently, the design variable \(\beta_{i}\) tended to locate at integer values to avoid the penalization on the current \(\tilde{\mathbf{I}}_{0}\). It is noted that the parameters \(p\) in (4) and \(s\) in (5) are updated using the continuation scheme proposed in [17], ref. [27] during the optimization iteration. Figure 4: The plot of the interpolation functions for (**a**) current density \(\mathbf{J}_{a}^{i}\) in (3), and (**b**) relative permeability \(\mu_{r}^{i}\) in (4), with respect to design variable \(\beta_{i}\). When the design variable \(\beta_{i}\) is located around zero, the aforementioned penalization scheme did not work because the penalization in \(\mathbf{I}_{0}\) did not pass to the current density \(\mathbf{J}_{a}^{i}\) in (3) due to the small value of \(\beta_{i}\). To resolve this problem, the electric current \(\mathbf{I}_{0}\) in (3) is defined as  
\[\mathbf{I}_{0}=\left\{ \begin{array}{ll}0,&\text{if }-0.7\leq\beta_{i}\leq 0.7\\ \mathbf{I}_{0},&\text{otherwise}\end{array} \right. \tag{6}\]  
Here, the current \(\mathbf{I}_{0}\) is set as zero when the design variable \(\beta_{i}\) is located near zero. If the design variable \(\beta_{i}\) is located near zero, it tended to move to zero (i.e., desired discrete integer number) through the penalization of the permeability in (4) instead of the penalization in (5). Thus, the range \(\pm 0.7\) in (6) is related to the function shape of (4). A smaller range (e.g., \(\pm 0.5\)) might be suitable when the function shape in Figure 4b is narrow (i.e., large \(p\) in (4)), and vice versa. When the design variable \(\beta_{i}\) is located far away from zero, the penalization scheme in (5) is applied to achieve the design result with discrete integer numbers. The proposed continuous and discrete optimization scheme in (5) and (6) enabled us to achieve a discrete integer number of coil turns with continuous design variables.