## 4 Optimal Trajectory
### Optimization Method
The kinetic energy at start is zero, while the kinetic energy \(E_{KL}\) at launch is  
\[E_{KL}=\frac{1}{2}m\left(\dot{x}_{L}^{2}+y_{L}^{2}+\dot{z}_{L}^{2}\right) \tag{26}\]  
Substituting Equations (24) and (25) in Equation (26) yields, after rearrangement  
\[E_{KL}=\frac{1}{2}m\|\dot{\mathbf{p}}_{T}\|^{2}+\frac{n_{Tz}}{n_{T,xy}}mg\Delta xy _{LT}+\frac{1}{2}mg^{2}\frac{\Delta xy_{LT}^{2}}{\|\dot{\mathbf{p}}_{T}\|^{2} n_{T,xy}^{2}} \tag{27}\]  
The variation of the potential energy as the EE moves from center point \(P_{\text{C}}\) to launch point \(P_{L}\) is  
\[\Delta E_{P}=E_{PL}-E_{PC}=mg\left(z_{L}-z_{C}\right) \tag{28}\]  
As the EE moves from \(P_{\text{C}}\) to \(P_{L}\), the total energy provided by the motors is then at least  
\[\Delta E_{L}=E_{KL}-E_{\text{KC}}+E_{PL}-E_{PC}=E_{KL}+\Delta E_{P} \tag{29}\]  
Another possible approach is to consider the energy variation \(\Delta E_{max}\) from \(P_{\text{C}}\) to the point on \(\Gamma\) that has the maximum value of \(\Delta E\), instead of the energy variation from \(P_{\text{C}}\) to \(P_{L}\): \(\Delta E_{max}\) can be of interest for the optimization, as the motors will have to provide that amount of energy to the EE. The total energy variation at any point on \(\Gamma\) (with respect to the start point \(P_{\text{C}}\)) can be expressed as  
\[\Delta E=\frac{1}{2}m\|\dot{\mathbf{p}}\|^{2}+mg\left(z-z_{C}\right) \tag{30}\]  
and thus, by differentiating with respect to time  
\[\frac{d}{dt}\Delta E=m\dot{p}\ddot{p}+mg\dot{z}=0 \tag{31}\]Here, \(\dot{p}=\|\dot{\mathbf{p}}\|\) and \(\ddot{p}=\|\ddot{\mathbf{p}}\|\), while \(\dot{z}\) is the component of \(\dot{\mathbf{p}}\) along the \(z\) axis. Substituting Equation (6) into Equation (31) and introducing \(s=\tan\left(\frac{\omega t}{2}\right)\) yields  
\[\dot{y}_{L} =\dot{y}_{T} \tag{24}\]0  
where  
\[ \begin{split} c_{0}&=g\left(z_{rc}+z_{rs}\right)\\ c_{1}&=2\omega^{2}\left(x_{rc}^{2}+y_{rc}^{2}+z_{ rc}^{2}-x_{rs}^{2}-y_{rs}^{2}-z_{rs}^{2}\right)-2 gz_{rc}\\ c_{2}&=4\omega^{2}\left(x_{rc}x_{rs}+y_{rc}y_{rs}+z_ {rc}z_{rs}\right)-2 gz_{rc}\\ c_{3}&=2\omega^{2}\left(x_{rs}^{2}+y_{rs}^{2}+z_{ rs}^{2}-x_{rc}^{2}-y_{rc}^{2}-z_{rc}^{2}\right)-2 gz_{rc}\\ c_{4}&=g\left(z_{rc}-z_{rs}\right)\end{split}  \tag{33}\]  
Equation (32) is a fourth-degree polynomial equation, which can be solved either analytically or numerically for the unknown variable \(s\); from the four roots of \(s\) we get four possible values of \(\alpha=\omega t\) and, thus, four local extrema of \(\Delta E(\alpha)\), the largest of which is the maximum energy \(\Delta E_{max}\) along the trajectory. In defining our objective function (see Equation (23)), \(E\) can be defined as either the maximum energy \(\Delta E_{max}\) seen above or as \(\Delta E_{L}\) in Equation (29), according to the designer's preference. In the following, we use the definition in Equation (29), for simplicity. From Equation (8), one can see that, when \(\Delta_{xy,LT}\) and \(\|\dot{\mathbf{p}}_{T}\|\) are determined, \(\mathbf{p}_{L}\) can also be found from \(\mathbf{p}_{T}\) and \(\mathbf{n}_{T}\); then, one can also find \(\dot{\mathbf{p}}_{L}\) by using Equation (24). We can show, from Equations (25) and (27)-(29), that the time to reach \(P_{T}\) and the launch energy do not depend on \(x_{C}\) and \(y_{C}\); the same is also true if we consider the maximal energy obtained from Equation (30) and the solution of Equation (32). Thus, we may assume the coordinates \(x_{C}\) and \(y_{C}\) to be given, while we seek to optimize the starting height \(z_{C}\). The optimal path \(\Gamma_{opt}\) is uniquely defined from \(\mathbf{p}_{C}\), \(\mathbf{p}_{L}\), the direction of \(\dot{\mathbf{p}}_{L}\) and the linear eccentricity \(\varepsilon\) of \(\Gamma_{opt}\); \(\varepsilon\) is defined as the distance from the center of the ellipse to either of its two foci. The frequency \(\omega\) can then be found from \(\Gamma_{opt}\), \(\mathbf{p}_{L}\) and \(\|\dot{\mathbf{p}}_{L}\|\).