## 2 System and Its Mathematical Model
It should be noted that the use of the final result of Equation (2) considerably reduces the time required for numerical integration and eliminates unwanted \"noisy\" variations of the quantity due to variations of turn dimensions that appear using surface integration over \(S_{t}\) and numerical differentiation with respect to \(y\). After evaluation of (2) for each turn of the cluster in Figure 2, the results are ordered with respect to value by sorting and numbering from 1 to \(N_{l}\). This makes the turn ordinal number a unique design variable. At this instance, it should also be noted that:  
* If, for example, the call from the search algorithm includes a request for \(N_{t}=100\), the above described model returns the values of quantity (2) determined for the first 100 turns with the highest contribution to the emf. Figure 2: Racetrack coil with dimensions: \(r_{c}\)—inner radius; \(L\)—active length; \(D\) wire diameter; \(\delta\)—air-gap between wires; \(w\), \(h\)—assumed width and height of coil walls, respectively. * Quantity (2) is determined without displacement of magnets 3 from the origin of the system of coordinates. It can be deduced that this position of the magnets corresponds with the maximum value of the turn-induced emf. * An important observation that makes the results of the optimization practical regards the fact that the ordered turns are not spread within the coil cross section, but they form an irregular cluster. This will be demonstrated further. Determination of power \(P\) generated by the system requires calculation of the coil impedance and the emf (sum of quantity (2) through \(j\)) vs. \(y\) for the given \(N_{l}\). The resistance and inductance are calculated using analytical formulas [26; 27], taking into account the active and end-turn segments of the coil (Figure 2)  
\[R_{c}=\sum_{i=1}^{N_{l}}\frac{2\pi r_{c,i}}{\sigma_{Cu}\pi\left(\frac{D}{2} \right)^{2}}+N_{t}\frac{2L}{\sigma_{Cu}\pi\left(\frac{D}{2}\right)^{2}}, \tag{3}\]  
\[L_{c}=\sum_{i=1}^{N_{l}}L_{r,i}+N_{l}L_{z}+\sum_{i=1}^{N_{l}}\sum_{j=1}^{N_{l} }M_{z,ij}+\sum_{i=1}^{N_{l}}\sum_{j=1}^{N_{l}}M_{r,ij}, \tag{4}\]  
where \(r_{c,i}\), \(\sigma_{Cu}\) are inner radius of \(i\)-th turn and copper conductivity, respectively. The end-turn inductance of \(i\)-th turn \(L_{r,i}\), inductance of active segment of turn \(L_{z}\), end-turn mutual inductance of \(i\)-th and \(j\)-th turns \(M_{r,ij}\) and mutual inductance of active segments of \(i\)-th and \(j\)-th turns \(M_{z,ij}\) are calculated from formulas  
\[L_{r,i}=2\mu_{0}r_{c,i}\left(\ln\frac{8r_{c,i}}{D}-1\right), \tag{5}\]  
\[L_{z}=\frac{\mu_{0}}{\pi}\left(2L\ln\frac{\sqrt{2\left(L^{2}+\left(\frac{D}{2} \right)^{2}\right)}}{D}-\sqrt{L^{2}+\left(\frac{D}{2}\right)^{2}}+\frac{D}{2} \right), \tag{6}\]  
Figure 1:0  
Figure 1:1  
where \(\text{K}(\kappa)\) and \(\text{E}(\kappa)\) are complete elliptic integrals of the first and second kind and  
Figure 1:2  
Please note that the above formulas are valid even when \(L=0\), which means that the racetrack coil becomes a solenoid. The purpose of optimization is thus not only to optimally distribute turns within the coil cross-section but also decide whether a racetrack-like shape is better or worse than a solenoidal one. The power \(P\) is determined at a single frequency assuming a sinusoidal variation, a constant magnitude of displacement of magnets 3 and considering the power converter in Figure 1c. The steady-state time-periodic circuit simulation using interpolated variation of \(\partial\lambda/\partial y\) vs. \(y\) is carried out for this purpose using program Plecs [28]. The diagram of the computer model which implements all of the above described equations is shown in Figure 1:3