1 Introduction

The Levitron consist of a top, namely a magnetized rotationally symmetric rigid body of uniform mass that behaves as a magnetic dipole, and a base that provides a permanent magnetic field such that the interaction with the magnetic dipole compensates the gravitational force acting on the top when put to spin over it, see Fig. 1.

The stability of the magnetic levitation shown by the Levitron was studied by Berry as a six degrees of freedom Hamiltonian system using an adiabatic approximation in [1]. Further, Dullin and Easton [3] found critical spin rate bounds where the levitation persists, and Gans et al. [4] offered numerical results regarding the initial conditions’ manifold where this occurs.

The numerical studies presented in [3] were crucial for the comprehension of Levitron’s dynamics. Furthermore, the introduction of dimensionless constants proposed in [4] facilitated the analysis of the concomitant numerical simulations. Both papers followed the guideline drew by [1] and are the basis of both [6, 10], and the present work.

Moreover, in [8] a simple dipole interaction model and a Taylor series expansion for the magnetic field were used to predict certain features of the equilibrium and stability of the Levitron. This simple model, combined with measurements of the magnetic field along the axis, permitted a fairly accurate prediction of the upper and lower limits of the locus of stable equilibria.

Meanwhile, in [12] an analysis and numerical integration of the equations of motion for an experimental stemless top that includes gyroscopic precession around the local magnetic field lines is presented, and an upper spin limit for the top is observed experimentally and explained as an adiabatic condition.

The energy losses due to friction were considered for the first time in [11] and later on in [10], where a mechanical perturbation was first introduced to inject energy into the system.

The existence of invariant regions in phase space corresponding to persistent levitation of the top as well as equilibrium solutions were detected in [6]. Also therein, the numerical verification of the range for the spinning rates given in [1] was performed, and an asymptotic multi-scale analysis was carried out with the aim of studying the nonlinear interaction between the translational and rotational modes.

The aim of the present effort is the numerical study of the Levitron’s dynamics when not only damping forces but also mechanical perturbations are taken into account. For the sake of completeness and clarity the equations of motion are included at length, and invariant regions in phase space as well as equilibrium solutions are considered.

To account for a more realistic setting, dissipative terms are introduced in the equations of motion to model the air friction and, as a consequence, finite flight times are derived. Following [10], a strategy to inject energy into the system is numerically explored. It should be pointed out that our approach is of a mechanical nature, e.g. neither electromagnetic drive [11] nor air-jet propulsion [12] is considered. Though a first attempt in dealing with this scenario was presented in [10], herein we consider beyond the effect of a periodic mechanical perturbation acting upon the vertical position of the spinning top.

By means of extensive numerical experiments, we obtain bifurcation diagrams spanning a whole range of the parameters characterizing the mechanical perturbations and distinguish the stability regions which correspond to long levitation times. Moreover, we derive the maximum Lyapunov exponent (mLCE) by recourse to the Mean Exponential Growth factor of Nearby Orbits (MEGNO) (see [2] for details), thus obtaining an early prediction of the Levitron’s flight time. However, to reach this goal we had to overcome the singular character of the Jacobian matrix of the variational equations associated to the vanishing of the angle describing the top’s nutation.

This paper is organized as follows. First, two different formulations of the equations of motion are presented in Sect. 2. Section 3 is devoted to describing the general setting for our simulations and the adopted numerical techniques for our stability study of the Levitron’s dynamics; the MEGNO as a tool for studying the trajectories’ stability is outlined in the same section, where we point out how the maximum Laypunov exponent can be obtained in a fast fashion. A more realistic model including dissipation due to air friction is addressed in Sect. 4. A mechanical, either parametric or hysteretic, perturbation introduced to compensate the energy loss due to air friction is proposed in Sect. 5. The results of the numerical integration of the equations of motion over a grid in the perturbation parameter space are given in Sect. 6 via bifurcation diagrams exhibiting both flight times’ and MEGNO contour–plots, and the feasibility of obtaining an early prediction of the flight time by means of the MEGNO is discussed. The validity of the proposed scheme for computing the MEGNO from the reduced set of variational equations corresponding to the coordinates and momenta of the center of mass in the Eulerian description of the dynamics is verified in Sect. 7. Conclusions are derived in Sect. 8.

Fig. 1
figure 1

Levitron

2 Equations of motion

To describe the motion of the spinning top we recur to the Eulerian angles namely the tilt \(\theta \), the precession \(\psi \) (or the latitude and the longitude of the rotation axis respectively) and the spin \(\phi \), while the coordinates \({\bar{r}}=(x,y,z)\) denote the position of the top’s center of mass. Notice that due to the axial symmetry of the body we can assume that its inertia tensor is \(\varTheta =\text {diag}(\varTheta _1,\varTheta _1,\varTheta _2)\). We denote by \(\mu <0\) the magnitude of the dipole’s force, located at the center of mass of the spinning body and M is the magnetization in the z-direction (see [7]).

On scaling by the radius of the dipole ring a and a consistent time scale \(\tau \), and introducing (as in [4]):

$$\begin{aligned} x=aX,\qquad y=aY,\qquad z=aZ,\qquad t=(a/g)^{1/2}\tau , \end{aligned}$$

we obtain the dimensionless equations of motion for the spinning top. Indeed, the potential V can be written as

$$\begin{aligned}&V=\frac{M_{e}}{4\pi a^{2}}\bigg [f_{0}(Z)\!+\!(X^2\!+\!Y^2)f_{2}(Z)\!+\!O((X^2\!+\!Y^2)^2)\bigg ]\nonumber \\&\quad =:\frac{M_{e}}{4\pi a^{2}}\varPhi , \end{aligned}$$
(1)

where

$$\begin{aligned} f_{0}(Z)=\frac{Z}{(1+Z^{2})^{3/2}}, \qquad f_{2}(Z)=-\frac{3}{4}\frac{(2Z^{2}-3)Z}{(1+Z^{2})^{7/2}},\nonumber \\ \end{aligned}$$
(2)

and \(M_e=2\pi M a\) is the net strength of the dipole, the outcoming Hamiltonian being

$$\begin{aligned}&\mathcal {H} =\frac{1}{2}\left( p_{X}^{2}+p_{Y}^{2}+p_{Z}^{2}+\frac{p_{\theta }^{2}}{A}+\frac{[p_{\psi }-p_{\phi }\cos \theta ]^{2}}{A \sin ^{2}\theta }+\frac{p_{\phi }^{2}}{C}\right) \\&\quad -\mathcal {M}\left[ \sin \theta \left( \cos \psi \frac{\partial \varPhi }{\partial X}+\sin \psi \frac{\partial \varPhi }{\partial Y} \right) + \cos \theta \frac{\partial \varPhi }{\partial Z} \right] +Z \end{aligned}$$

(see [6, 10] for a thorough description of the potential and kinetic energies of the spinning top). Therefore, the concomitant equations of motion, already given in [10] and included herein just for the sake of completeness, read

$$\begin{aligned} \dot{X}&=p_{X} \end{aligned}$$
(3a)
$$\begin{aligned} \dot{Y}&=p_{Y} \end{aligned}$$
(3b)
$$\begin{aligned} \dot{Z}&=p_{Z} \end{aligned}$$
(3c)
$$\begin{aligned} \dot{\theta }&=\frac{p_{\theta }}{A} \end{aligned}$$
(3d)
$$\begin{aligned} \dot{\psi }&=\frac{p_{\psi }-p_{\phi }\cos \theta }{A \sin ^{2}\theta } \end{aligned}$$
(3e)
$$\begin{aligned} \dot{\phi }&=-\cos \theta \cdot \frac{p_{\psi }-p_{\phi }\cos \theta }{A \sin ^{2}\theta }+\frac{p_{\phi }}{C} \end{aligned}$$
(3f)
$$\begin{aligned} \dot{p_{X}}&=2\mathcal {M}\left[ f_{2}(Z)\sin \theta \cos \psi +X f_{2}'(Z)\cos \theta \right] \end{aligned}$$
(3g)
$$\begin{aligned} \dot{p_{Y}}&=2\mathcal {M}\left[ f_{2}(Z)\sin \theta \sin \psi +Y f_{2}'(Z)\cos \theta \right] \end{aligned}$$
(3h)
$$\begin{aligned} \dot{p_{Z}}&=\mathcal {M}\left[ 2f_{2}'(Z)\sin \theta (X \cos \psi +Y\sin \psi )\right. \nonumber \\&\quad \left. +\cos \theta (f_{0}''(Z)+(X^{2}+Y^{2})f_{2}''(Z))\right] -1 \end{aligned}$$
(3i)
$$\begin{aligned} \dot{p_{\theta }}&=-\frac{(p_{\phi }\cos \theta -p_{\psi })(p_{\psi }\cos \theta -p_{\phi })}{A\sin ^{3}\theta }\nonumber \\&\quad +\mathcal {M}\left[ 2f_{2}(Z)\cos \theta (X\cos \psi +Y\sin \psi )\right. \nonumber \\&\quad \left. -\sin \theta (f_{0}'(Z)+(X^{2}+Y^{2})f_{2}'(Z)) \right] \end{aligned}$$
(3j)
$$\begin{aligned} \dot{p_{\psi }}&=2\mathcal {M} f_{2}(Z) \sin \theta (Y\cos \psi -X\sin \psi ) \end{aligned}$$
(3k)
$$\begin{aligned} \dot{p_{\phi }}&=0 \end{aligned}$$
(3l)

where

$$\begin{aligned} A=\frac{\varTheta _1}{ma^{2}},\qquad C=\frac{\varTheta _2}{ma^{2}}, \qquad \mathcal {M}=\frac{-\mu M_{e}}{4\pi mga^{4}}, \end{aligned}$$
(4)

are positive constants and where m denotes the mass of the top. Notice should be taken that both \(\mathcal {H}\) and \(p_{\phi }\) are conserved quantities.

Let us remark, however, that the Hamiltonian becomes singular for \(\theta =0\). To overcome this issue several authors ([3, 5, 11]) use a different set of angular coordinates other than the Eulerian angles. These are the yaw-pitch-roll angles which do not lead to singular equations and the concomitant rotation matrix reads \(R(\psi ,\theta ,\phi )=R_z(\psi )R_y(\theta )R_x(\phi )\), where \(\psi \) is the angle between the axis of the top and the x-axis of the system, \(\theta \) is measured to the y-axis and \(\phi \) describes the angle to the z-axis.

Since we will be integrating either one or the other set of equations according convenience, we also recast the non singular equations of motion given in [3], but herein in its dimensionless version:

$$\begin{aligned} \dot{X}&=p_{X} \end{aligned}$$
(5a)
$$\begin{aligned} \dot{Y}&=p_{Y} \end{aligned}$$
(5b)
$$\begin{aligned} \dot{Z}&=p_{Z} \end{aligned}$$
(5c)
$$\begin{aligned} \dot{\theta }&=\frac{p_{\theta }}{A} \end{aligned}$$
(5d)
$$\begin{aligned} \dot{\phi }&=\frac{p_{\phi }-p_{\psi }\sin \theta }{A \cos ^{2}\theta } \end{aligned}$$
(5e)
$$\begin{aligned} \dot{\psi }&=-\sin \theta \cdot \frac{p_{\psi }\sin \theta -p_{\phi }}{A \cos ^{2}\theta }+\frac{p_{\psi }}{C} \end{aligned}$$
(5f)
$$\begin{aligned} \dot{p_{X}}&= \mathcal {M} \left[ f_{2}(Z) \sin \theta /2+ X f_{2}'(Z) \cos \theta \cos \phi /{2}\right] \end{aligned}$$
(5g)
$$\begin{aligned} \dot{p_{Y}}&= \mathcal {M} \left[ f_{2}(Z) \cos \theta \sin \phi /2 + Y f_{2}'(Z) \cos \theta \cos \phi /2 \right] \end{aligned}$$
(5h)
$$\begin{aligned} \dot{p_{Z}}&= \mathcal {M} \left[ f_{2}'(Z) ( X \sin \theta + Y \cos \theta \sin \phi )/2 \right. \nonumber \\&\quad \left. -\cos \theta \cos \phi (f_{0}''(Z)+(X^{2}+Y^{2})f_{2}''(Z)/4)\right] -1 \end{aligned}$$
(5i)
$$\begin{aligned} \dot{p_{\theta }}&=-\frac{(p_{\psi }\sin \theta -p_{\phi })(p_{\phi }\sin \theta -p_{\psi })}{A\cos ^{3}\theta }\nonumber \\&\quad \mathcal {M}\left[ f_{2}(Z)\cos \theta /2- Y \sin \theta \sin \psi /2)\right. \nonumber \\&\quad \left. -\sin \theta \cos \phi (-f_{0}'(Z)+ (X^{2}+Y^{2}) f_{2}'(Z)/4) \right] \end{aligned}$$
(5j)
$$\begin{aligned} \dot{p_{\phi }}&=\mathcal {M} \left[ Y f_{2}(Z) \cos \theta \cos \phi - \cos \theta \sin \phi (-f_{0}'(Z)\right. \nonumber \\&\quad \left. + (X^{2}+Y^{2}) f_{2}'(Z)/4) \right] \end{aligned}$$
(5k)
$$\begin{aligned} \dot{p_{\psi }}&=0 \end{aligned}$$
(5l)

Now, the Hamiltonian equations are regular for \(\theta =0\) and the singularity is shifted to \(\theta =\pi /2\), which causes no problem since before reaching such a value the top has fallen already. Moreover, the associated Jacobian matrix, needed for the stability analysis of the system remains non singular (see Sect. 7 for related discussion). The Eulerian angles in (3) instead, have the benefit of providing a clear physical interpretation of the top’s motion.

3 Numerical study: general frame and suitable numerical schemes

In our numerical experiments we adopted for the parameters A and C the same values used in [4], namely,

$$\begin{aligned} A=0.089,\qquad C=0.139, \end{aligned}$$

which correspond to physical measurements, while \(a=34.7\, {\text {mm}}\) was the adopted value for the effective radius.

As in [10] we used a Runge-Kutta 7–8 method (RK78) to integrate the equations of motion (3) in regions of phase space where the system can turn stiff. As the equations (3e), (3f) and (3j) become singular whenever \(\theta = 0\) or \(\theta =\pi \), we needed to overcome such an issue by controlling the numerators in the concomitant expressions. Therefore, for instance, we fixed to zero the field entry for \(\psi \) in (3e) whenever it was

$$\begin{aligned} |p_\psi -p_\phi \cos \theta |\le tol, \end{aligned}$$

with the value of tol calibrated numerically, not having found any significant difference for values smaller than 0.0001. The same control was kept in the other two equations.

At this point let us mention that our results confirmed the ones in [1], who showed that both the precession and spin rates must be comparable in order for the top to have a persistent levitation. In fact, we verified that \(p_\phi \) and \(p_\psi \) should be close in order to have a stable flight of the spinning top.

Even if the singularity in (3) requires of an extra effort to determine the suitable value for tol, the Eulerian angles in the singular equations of motion allows for a straightforward visualization of the top’s motion in space.

Alternatively, we can integrate the non singular equations of motion (5) which include the yaw-pitch-roll angles to describe the rotation of the top with respect to a local reference frame.

As a result of our profuse numerical experimentation concerning the integration of the equations of motion, we observed that the RK78 scheme’s performance is convenient when the concomitant variational equations (involved in the stability studies) are also integrated as the number of equations in the system gets twice as large. Nonetheless, the fact that equations (3) become singular whenever \(\theta \) vanishes suggests the Runge-Kutta-Gauss implicit method as a more suitable tool for their numerical integration. In fact, (3) were integrated by means of a sixth order such a scheme. The RK78 instead resulted far more efficient for the integration of the non-singular equations (5) and its variationals.

Our numerical experiments encompass stability studies based on the evaluation of the maximum Lyapunov characteristic exponent (mLCE) which accounts for the exponential divergence of nearby trajectories. Notwithstanding, the computation of the mLCE is computationally expensive and, since the flying time of the Levitron varies drastically under the change of either the parameter values or the initial conditions, it is extremely useful to count with a fast alternative for estimating the mLCE, such as the Mean Exponential Growth factor of Nearby Orbits (MEGNO), (see [2] for details).

Therefore, let us now revisit the MEGNO’s behavior as a quick dynamical indicator and its relationship with the mLCE for a given trajectory \(\varphi (t)\). The associated mLCE, \(\sigma (\varphi )\), is defined as

$$\begin{aligned} \sigma (\varphi )=\lim _{t\rightarrow \infty }\sigma _1(\varphi (t)),\qquad \sigma _1(\varphi (t))= {1\over t}\ln {\Vert \mathbf {\delta }(\varphi (t))\Vert \over \ \Vert \mathbf {\delta }_0\Vert }, \nonumber \\ \end{aligned}$$
(6)

where \(\mathbf {\delta }(\varphi (t))\) and \(\mathbf {\delta }_0\) are “infinitesimal displacements” from \(\varphi \) at times t and 0, respectively—, and \(\Vert \cdot \Vert \) denotes, for instance, the usual Euclidean norm (though any other norm would serve as well). Then, the computation of the mLCE requires the long-term integration of the variational equations along with the equations of motion.

Meanwhile, the MEGNO, usually denoted as \(Y(\varphi (t))\), is a fast chaos indicator which allows to determine the character of the motion, either regular or chaotic, by integrating both the equations of motion and the variationals during rather short motion times. Furthermore, the asymptotic behavior of its temporal average over the orbit, \(\overline{Y}(\varphi (t))\), can be condensed as

$$\begin{aligned} \overline{Y}(\varphi (t))\approx a_{\varphi }t+b_{\varphi } \end{aligned}$$
(7)

where \(a_{\varphi }=\sigma _{\varphi }/2\) and \(b_{\varphi }\approx 0\) for chaotic motion, while \(a_{\varphi }=0\) and \(b_{\varphi }\approx 2\) for stable quasiperiodic motion. Slight departures from the value \(b_{\varphi }\approx 2\) indicate that \(\varphi \) is close to some periodic orbit, being \(b_{\varphi }\lesssim 2\) and \(b_{\varphi }\gtrsim 2\) for stable or near–unstable periodic orbits, respectively.

Thus, we will take advantage of the fact that in the case of chaotic motion, \(\overline{Y}\) grows linearly with time at a rate equal to \(\sigma _{\varphi }/2\). Therefore, a fairly accurate estimate of the mLCE can be obtained in rather short times by means of a linear least-squares fit on \(\overline{Y}\left( \varphi (t)\right) \). This is the procedure that we apply in the sequel to derive the mLCE for characterizing the dynamics of the Levitron.

4 Dissipative equations

A more realistic model for the Levitron should include the dissipation due to air friction. Since the spinning top undergoes both translation and rotation, at least two positive constants are needed, \(C_T\) and \(C_R\), to model its flight. The dissipative linear terms \(-C_Tp_X\), \(-C_Tp_Y\) and \(-C_Tp_Z\) are to be added to the equations (3g)–(3i) in \(\dot{p}_X,\dot{p}_Y,\dot{p}_Z\), respectively, while, since the rotational velocity is very high compared to the translational velocity, quadratic terms would be required to model the concomitant friction. Therefore, the dissipative terms \(-C_Rp_\theta |p_\theta |\), \(-C_Rp_\psi |p_\psi |\) and \(-C_Rp_\phi |p_\phi |\) should be added to the equations (3j)–(3l) respectively. (The absolute value preserves the sign of the rotation velocity ensuring that all three terms act against the rotation of the spinning top.) The values of the dissipation constants outcomes from numerical calibration.

For our first simulation we adopted equal values for the initial angular velocities \(p_\phi =p_\psi \), the adopted initial conditions being

$$\begin{aligned}&(X,Y,Z,\theta ,\psi ,\phi ,p_X,p_Y,p_Z,p_{\theta },p_{\psi },p_{\phi })\nonumber \\&\quad =(0,0,3.34,0.005, 0, 0 ,0, 0, 0, 0, 5.0, 5.0). \end{aligned}$$
(8)

In the absence of dissipation, these initial conditions lead to a trajectory in which the coordinate Z oscillates around the stable initial value \(Z_s=3.34\) while the coordinates (XY) remain fixed at the origin. The result of the integration of the equations of motion including dissipative terms with \(C_T=C_R=0.1\) are displayed in Figs. 2 and 3. In particular, Fig. 3 shows how the stable position in the (XY)-plane is lost, the spinning top falling after a short period of time, namely 60 time units. In the more realistic case corresponding to the values \(C_T=0.2\) and \(C_R=0.01\), the numerical experiments reveal that the top falls after \(\sim 23\) time units.

Fig. 2
figure 2

Time evolution of the Z-coordinate

Fig. 3
figure 3

(XY)-coordinates

Since the Z-coordinate could have a larger variation due to air friction than that of the X or Y-coordinates, a different third dissipative constant could be introduced to add a larger dissipation in the vertical direction. In fact, our numerical simulations using a third dissipation constant for the Z-coordinate revealed that even more longer periods of time of stable flight of the spinning top are feasible.

The top’s stability strongly depends on the evolution of the momentum associated with the spin and precession angles, \(p_\phi \) and \( p_\psi \), particularly on their proximity.

In the absence of friction, whenever the behavior of the \(| p_\phi - p_\psi |\) are alike and \(\theta \) is close to zero, Eq. (3) remain stable even through the singularity, as Fig. 4 illustrates.

Indeed, only if the inequality \(|p_\phi - p_\psi |<<1\) is satisfied, will the quotient \(({p_\psi - p_\phi \cos \theta })/{\sin ^2\theta }\) in (3) not diverge for \(|\theta | \rightarrow 0\).

Let us notice that, even in the dissipative case, both \(p_\phi \) and \(p_\psi \) remain close to each other during the levitation as Fig. 5 shows. In fact, those quantities are very similar up to the very moment in which the stability is lost, that is to say till the top falls to the ground.

Fig. 4
figure 4

Temporal evolution of \(\log (|p_{\psi } - p_{\phi }|)\) in the absence of friction

Fig. 5
figure 5

Evolution of \(\log (|p_{\psi } - p_{\phi }|)\) when losses due to air friction are taken into account

Summing up, the Levitron ’s stability strongly depends on the spin and precession dynamics; namely, even though \(p_{\psi }\) and \( p_{\phi }\) change due to friction, as long as their difference remains small the mechanical stability of the system is assured.

5 Forced equations

In the past, several strategies to force the equations of motion by recourse to electromagnetic fields that introduce torques in the system were extensively applied (see for instance [11]). Herein instead, we propose two mechanical schemes to force the vertical location of the permanent magnetic base by small motions so as to inject energy into the system.

The due procedure and the outcoming linearized equation for the Z coordinate for either parametric or hysteretic forcing are outlined in the forthcoming subsections.

To such an aim let us recall that, as we obtained in [10], the equations of motion allows for the invariant set

$$\begin{aligned} Inv= & {} \{X=Y=0,\ \theta =0,\ p_{X}=p_{Y}=0,\\&p_{\theta }=0,\ p_{\psi }=p_{\phi } \}, \end{aligned}$$

and the dynamics in this region is given by

$$\begin{aligned} \dot{Z}&=p_{Z}&\dot{p_{Z}}&=\mathcal {M} f_{0}''(Z)-1 \end{aligned}$$
(9)
$$\begin{aligned} \dot{\phi }&=-\frac{p_{\phi }}{2A}+\frac{p_{\phi }}{C} = \sigma&\dot{p_{\phi }}&=0. \end{aligned}$$
(10)

This system has two fixed points, one stable and the other unstable, which are defined by the relationship

$$\begin{aligned} f_0''(Z)=\frac{1}{\mathcal {M}} \end{aligned}$$
(11)

(See [6] for details). Further, the linearized system of (9) near the point \((Z_s,0)\) is a harmonic oscillator:

$$\begin{aligned} \ddot{Z}+ V_{Inv}''(Z_s)Z=0, \end{aligned}$$
(12)

where

$$\begin{aligned} V_{Inv}=-\mathcal {M} f_0'(Z)+Z. \end{aligned}$$
(13)

5.1 Parametric forcing

A parametric perturbation of the magnetic base of the Levitron can be modelled just by changing the equilibrium point of (12) according to

$$\begin{aligned} Z_s\longmapsto Z_s (1 + \beta \cos \omega t). \end{aligned}$$
(14)

Therefore, the linearized equation near the point \((Z_s,0)\) can be recast as

$$\begin{aligned} \ddot{Z} + V''_{Inv}\bigl [Z_s(1+\beta \cos (\omega t))\bigl ]Z=0, \end{aligned}$$
(15)

where, from (13), it is

$$\begin{aligned} V''_{Inv}&=-\mathcal {M} f_3(Z)=-\mathcal {M} f_0'''(Z)\nonumber \\&=-\mathcal {M}\,\,\frac{90Z^2(1+Z^2)-9(1+Z^2)^2-105Z^4}{(1+Z^2)^{9/2}}.\nonumber \\ \end{aligned}$$
(16)

By taking only up to the linear term in the Taylor expansion of (16) near \(Z_s\), Eq. (15) reads

$$\begin{aligned} \ddot{Z} -\mathcal {M}\bigl [ f_3(Z_s)+ f_4(Z_s)Z_s\beta \cos (\omega t)\bigl ]Z=0, \end{aligned}$$
(17)

where \(f_3(Z)\) is defined through (16) and \(f_4(Z)\) by

$$\begin{aligned}&V'''_{Inv}(Z) =-\mathcal {M} f_4(Z)=-\mathcal {M} f_0^{(iv)}(Z)\nonumber \\&\quad =-\mathcal {M}\,\,\frac{225Z(1+Z^2)^2-1050Z^3(1+Z^2)+945Z^5}{(1+Z^2)^{11/2}}.\nonumber \\ \end{aligned}$$
(18)

Notice that (17) is a Mathieu equation which can be integrated by numerical means just by substituting (14) directly into (12).

Since from this setting the parametric oscillation of the base locally gives rise to a Mathieu equation in the Z-coordinate, we expect that the parameters \(\beta \) and \(\omega \) yield a stability diagram for the solutions of the Levitron with an Arnold’s tongue structure.

On adding a dissipative term to the equation we expect that the perturbation applied to the magnetic base, with a suitable calibration of amplitude and frequency of the perturbation, will inject energy leading to a steady levitation of the spinning top for a long time. The parameters \(\beta \) and \(\omega \) will be found numerically since the local analysis could turn rather complicated.

5.2 Hysteretic forcing

Let us now model a hysteretic perturbation of the magnetic base by forcing the equilibrium point of the system (12) to vary in the fashion

$$\begin{aligned} Z_s&\longmapsto Z_s + \beta \cos \omega t, \end{aligned}$$
(19)

and there results

$$\begin{aligned} \ddot{Z} + V''_{Inv}\bigl [Z_s+\beta \cos (\omega t)\bigl ]Z=0. \end{aligned}$$
(20)

Once again, on considering up to the linear term in the Taylor expansion of (13), (20) reads

$$\begin{aligned} \ddot{Z} - \mathcal {M} [f_3(Z_s)+f_4(Z_s)\beta \cos (\omega t)]Z=0, \end{aligned}$$

where \(f_3\) and \(f_4\) are given by (16) and (18) respectively.

As in the parametric case, we can numerically integrate Eq. (20) by doing the change (19) directly in the Eq. (12). Besides, just as for the parametric perturbation, the hysteretic oscillation of the base is locally described by a Mathieu equation in the Z-coordinate. Therefore, again, we would expect that the stability portrait for the Levitron’s solutions presents an Arnold’s tongue structure in the parameter space \((\beta , \omega )\).

The equations of motion (3) plus the dissipative term introduced in Sect. 4 provide a realistic model for the flight of the spinning top. In this subsection we introduce the forced equations by simulating a small vertical motion of the magnetic base to inject energy into the system. We will show by numerically means that considering such a perturbation results in a long–period stable flight of the Levitron and, as expected, a stability diagram showing an Arnold’s tongue structure is obtained (see [9]).

6 Bifurcation diagrams

With the aim of studying the flying time variation while changing the perturbation parameters in both the parametric and the hysteretic case, we performed numerical experiments taking 2000 equispaced values of \(\beta \) in the range [0, 2], and 1000 values of the oscillation frequency in the interval [0, 4] for each \(\beta \), which accounts for a total of two millions different trajectories corresponding to a unique initial condition in different scenarios. All the simulations were carried out on the GPU-cluster of IIMAS-UNAM.

We will unfold the description of our numerical experiments which concern both sets of equations of motion revisited in Sect. 2.

In the first place, we will refer to those involving the Eq. (3), for which we adopted the initial condition (8) taken in Sect. 4, the values \(C_T=0.2\) and \(C_R=0.01\) for the damping parameters and \({{\mathcal {M}}}=32.75367\). Besides the damping forces we considered a mechanical perturbation to inject energy into the system, either parametric or hysteretic.

The numerical integration of the equarions of motion was performed by means of a Runge-Kutta 7–8 scheme, the initial step-size being 0.001 and the local tolerance used for selecting the successive steps of order \(10^{-14}\). The stop condition used for the numerical integration is

$$\begin{aligned} |X|+|Y|+|Z-Z_s|> 2, \end{aligned}$$
(21)

where \(Z_s\) is the equilibrium point given in Sect. 4.

Figure 6 displays the value of the flight time, in a logarithmic scale, in the \((\omega ,\beta )\) plane for the parametric perturbation, the largest flight time being \(\sim 96 u.t.\)Footnote 1.

The plot 6 displays Arnold’s tongues structure that characterizes the bifurcation diagram for the nonlinear Mathieu equation. The solutions subjected to exponential damping evolve during short flying times since they promptly leave the equilibrium region and then the top falls to the ground; at this point the integration is stopped. On the other hand, solutions with large flying times correspond to the cases in which a delicate equilibrium is preserved between the excitation and dissipative forces while integrating the perturbed nonlinear Eq. (3). Figure 6 shows that the largest flying times correspond to the perturbation parameters in the region \(0< \omega < 1.0\) and \(0< \beta < 2.0\).

The parametric excitation can not restore the loss of the rotational energy. Nevertheless, the stable regions in the Arnold’s tongues correspond to solutions for which the quotients

$$\begin{aligned} \frac{p_{\psi } - p_{\phi }\cos \theta }{\sin ^2\theta } \;\;\;\; \mathrm {and} \;\;\; \frac{(p_{\phi }\cos \theta - p_{\psi })(p_{\psi }\cos \theta - p_{\phi })}{\sin ^3\theta }\;\;, \nonumber \\ \end{aligned}$$
(22)

remain finite even when \(\theta \) is close to zero.

The values of \(|p_{\phi }|\) and \(|p_{\psi }|\) reduce their value in a monotonic fashion, while the quotients (22) remain bounded in the stable regions in Fig. 6. Indeed, the difference \(|p_{\phi } - p_{\psi }|\) stays small and exhibits a behavior somewhat similar to that displayed in Fig. 5, even in the dissipative case in which \(p_{\phi }\) is no longer a constant of motion.

To estimate the Levitron’s flying time by recourse to a low cost technique other than numerically integrating the equations of motion until the top falls to the ground, we propose the computation of the MEGNO values corresponding to the whole set of perturbation parameters and a given initial condition. Let us remark that in the case of Eq. (3) it is requisite to deal with a reduced set of the variational equations of the cartesian coordinates and their associated momentum variables and discard those corresponding to the angular variables and their corresponding momenta due to the behavior of the quantities (22). Indeed, the full system turns very unstable when \(\theta \rightarrow 0\), since the concomitant Jacobian matrix \(\varLambda (\varphi (t))\) becomes singular in such a case. This is a rather severe shortcoming of Eq. (3) which is neared with the hope of having a clear visualization of the top’s motion in space instead. Alternatively, we should resort to the integration of the regular Eq. (5), which we have done and discuss later on in the present section.

With our aim in mind we computed the bifurcation diagram of the mLCEs obtained from the \(\overline{Y}\) values and compared the outcoming portrait with that shown in Fig. 6 for the parametric case. In Fig. 7 the mLCE values are given in a logarithmic scale and again an Arnold’s tongues structure is observed.

On dealing with an hysteretic perturbation, we considered the domain \([0,1.3]\times [0,4]\) in the \((\omega ,\beta )\) plane. Again, Figs. 8 and 9 display, in logarithmic scale, the value of the flight time and that of the mLCE derived from the MEGNO respectively. Let us notice that for the hysteretic case we obtained a structure where the Arnold’s tongues are not so clearly distinguished and the long flight time zones are somewhat smaller than those corresponding to the parametric case. It is worth mentioning though that with an hysteretic perturbation we obtained stable flight times of an order of magnitude larger than those observed in the parametric case, namely as long as \(\sim 10^3\,{\text {u.t.}}\)

Fig. 6
figure 6

Parametric case. The axes correspond to the perturbation frequency (\(\omega \)) and amplitude (\(\beta \)). The flight time is represented in a logarithmic scale according to the colour code on the side

Fig. 7
figure 7

Parametric case. The axes correspond to the perturbation frequency (\(\omega \)) and amplitude (\(\beta \)). The colour scale on the side corresponds to the logarithm of mLCE values obtained from the MEGNO

Fig. 8
figure 8

Hysteretic case. The axes correspond to the perturbation frequency (\(\omega \)) and amplitude (\(\beta \)). The flight time is represented in a logarithmic scale according to the colour code on the side

Fig. 9
figure 9

Hysteretic case. The axes correspond to the perturbation frequency (\(\omega \)) and amplitude (\(\beta \)). The colour scale on the side corresponds to the logarithm of mLCE values derived from the MEGNO

Therefrom, we can conjecture that MEGNO would well serve as an early indicator of the levitation time. To reinforce this claim, in Fig. 10 we illustrate the results of numerical experiments concerning the parametric perturbation already discussed in [10]. Our outcomes are restrained to a small region of the bifurcation diagram in Fig. 6. Indeed, panel (a) displays the flying time limited to \(t < 15\,{\text {u.t.}},\) and no structure at all can be distinguished. It is by extending the total limit time up to \(t\le 100\,{\text {u.t.}}\), that the expected Arnold’s tongues structure previously disclosed shows up, as panel (c) shows.

On the other hand, in the bifurcation diagram obtained through the MEGNO, already for \(t < 15\,{\text {u.t.}}\) an early formation of the Arnold’s tongues can be detected, as seen in panel (b). Such a structure is clearly defined in Fig. 10d, which displays the \(\overline{Y}\) bifurcation diagram obtained for \(t\le 100\,{\text {u.t.}}\).

In sum, we can state that the MEGNO provides an early indication of the stability of any solution of the Levitron’s equations; regular solutions being good candidates to have very long flying times.

Fig. 10
figure 10

Bifurcation diagrams for the parametric perturbation (taken from [10]); \(\omega \) and \(\beta \) are represented in the horizontal and vertical axes respectively. In a and c the bifurcation diagram depicts the flying time according to the colour scale on the side bars. Plots on b and d panels show the bifurcation diagram obtained through MEGNO. Experiments illustrated in a and b are limited in time to \(t < 15\,{\text {u.t.}}\); for those presented in c and d the limit time is \(t < 100\,{\text {u.t.}}\)

Let us now outline the highlights of the bifurcation diagrams that we obtained when dealing with the alternative set of variables introduced in Sect. 2. For integrating the perturbed nonsingular equations (i.e. (5) plus a perturbation) for the same initial conditions of the concomitant variables used in [3], namely

$$\begin{aligned}&(X,Y,X,\theta ,\psi ,\phi ,p_X,p_Y,p_Z,p_{\theta },p_{\psi },p_{\phi })\\&\quad =(0.0,0.0,1.2436, 0.03,0.0,0.0, \\&\qquad 0.0,0.0,0.0, 0.0,21.500,0.0), \end{aligned}$$

we adopted the values \(C_T=0.001\) and \(C_R=0.0001\) for the damping parameters, and \(\mathcal{{M}}=0.033\). Notice that these values are different from the ones taken for the previous experiments concerning the singular equations of motion.

Our main interest in dealing with this set of equations is to take advantage of the larger freedom due to their regular character that allows the exploration of a wider spectrum of dynamical conditions, which are thought of cumbersome physical interpretation.

In Fig. 11 we clearly observe that the spinning top levitates during a larger lapse of time for the perturbation parameter values close to the parabola in the \((\omega ,\beta )\) plane with vertex at \(\omega =0.3\). There exists a small region where the longest levitations take place centered in the values (0.8, 0.8) and another tiny one close to (1.2, 0.8). From values of \(\omega >1.5\) and \(\beta \sim 0.8\) a horizontal thin region exhibiting large flight times can be observed. For values of the parameters enclosed within the parabola the motion becomes very unstable and the top promptly falls down.

Meanwhile, in Fig. 12 we present the contour–plot of the mLCE computed at the very moment in which the top’s stability is lost. Therein a similar structure is observed, the smaller values of the mLCE corresponding to the largest levitation times.

For the sake of comparison, we include in Fig. 13 a contour plot of the MEGNO’s slope which gives an indication of the mLCE as already mentioned. In particular, for \(0.5< \beta < 1.0\) similar values as in Fig. 12 are obtained and the same overall structure is observed.

Fig. 11
figure 11

Parametric case for Eq. (5). The axes correspond to the perturbation frequency (\(\omega \)) and amplitude (\(\beta \)). The flight time is represented in logarithmic scale by the colour code aside

Fig. 12
figure 12

Parametric case for Eq. (5). The axes correspond to the perturbation frequency (\(\omega \)) and amplitude (\(\beta \)). The logarithm of mLCE is represented following the colour scale

Fig. 13
figure 13

Parametric case for Eq. (5). Bifurcation diagram obtained by recourse to the \(\overline{Y}(\varphi (t))\) slope according to the colour scale on the side. Take notice particularly of the values corresponding to \(0.5 \beta < 1.0\)

7 Lyapunov characteristic exponents

The Lyapunov Characteristic Exponents (LCEs) are a well-known suitable tool for determining the asymptotic behavior of dynamical systems. For a measure-preserving flow the sum of the LCEs equals zero, while for an attractor of a dissipative system, contraction must overweigh expansion and the sum must be negative. Therefrom, when friction forces are considered the dynamical picture of the system would entail the computation of the whole set of LCEs, since the only estimation of the mLCE might not yield a proper description of the associated dynamics.

The determination of the Lyapunov spectrum requires the integration of the first variational equations along with the equations of motions (i.e. a total of 24 first-order differential equations are to be integrated for the Levitron). This computation is rather expensive since the integration must cover long time-spans (in contrast to MEGNO’s requirement, which is a fast dynamical indicator that also allows the determination of the mLCE).

Indeed, we needed to numerically integrate the non singular equations of motion (5) and their variationals in order the \(12 \times 12\) Jacobian matrix be non singular and as a consequence the concomitant LCEs be properly estimated. Instead, when dealing with the singular equations of motion (3), only could the variationals corresponding to the spacial location of the top’s center of mass be integrated.

Let us restate that the numerical integrator plays a fundamental role in the stability study. Indeed, while the non-singular set of equations could be integrated by a variable-step Runge-Kutta 7–8 method obtaining satisfactory results, the singular system (3) requires the application of some other suitable integrator. In fact, the integration of a stiff problem by means of a Runge-Kutta 7–8 for a rather short time interval could demand an extremely huge number of steps, in contrast to the few thousands required by an implicit method such as the Runge-Kutta-Gauss (even of rather low order).

The obtained results for the same initial conditions adopted in the previous section while considering either the reduced or the complete Jacobian matrix depending on the chosen set of unperturbed equations of motion, are presented in Figs. 14 and 15 respectively. In the latter, also has the sum of the whole spectrum of LCEs been included, which is seen to tend to zero as expected for a Hamiltonian flow.

In Figs. 14 the LCEs experience an abrupt increase in the vecinity of the singularity, that is for \(\theta \rightarrow 0\). It is worth remarking that, even when dealing with the reduced \(6 \times 6\) matrix encompassing only the coordinates and momenta of the center of mass for (3), the sum of the computed LCEs approximately vanishes as it should for a conservative system.

This test validates our results obtained in the previous section for the perturbed Eq. (3), where the MEGNO values were computed integrating just the reduced set of variational equations to avoid the singularity. Thus, we could say that the adopted procedure is suitable to perform a stability study for the Levitron’s dynamics, the MEGNO allowing to obtain a clear dynamical picture in rather short motion times in contrast to the computationally very expensive evaluation of the LCEs, which requires the long-term integration of the first variational equations along with the equations of motions.

Fig. 14
figure 14

LCE’s spectrum vs. time for (3). Notice that their sum practically vanishes

Fig. 15
figure 15

\(\log _{10}| \mathrm{lyap}_i|\) vs. time for the set of non singular Eq. (5). The lower dotted curve corresponds to \(\log _{10}{|\sum {\text {lyap}}_ i|}\)

8 Conclusions

In this effort, we studied the Levitron’s dynamics dealing with two different sets of equations of motion, one using the Eulerian angles given in (3), and the other one, the non singular Eq. (5), which include the yaw-pitch-roll angles to describe the rotation of the top with respect to a local reference frame. Even if the integration of (3) requires of an extra effort to surpass the singularity arising for \(\theta \rightarrow 0\), the Eulerian angles allows for a straightforward visualization of the top’s motion in space.

In particular, we addressed the effect upon the flying time as a result of introducing dissipation in the concomitant equations of motion. In fact, for the realistic case studied in 4 where air friction is taken into account, the flying time of the spinning body is limited to \(t< 23\,{\text {u.t.}}\)

It is with the aim of extending this limit time that we introduced a mechanical, either parametric or hysteretic, perturbation to the magnetic force field at low frequencies, Such a mechanical excitation results from the periodic vertical motion of the permanent magnet, the perturbation frequency being of the same order as that of the Levitron’s vertical oscilation (i.e. less than 2 Hz). As a consequence we found that the flying time can be enlarged from five to ten times that corresponding to the solely dissipative case.

On performing an extensive systematic study of the flying time as a function of the two parameters involved in the perturbation, we obtained detailed bifurcation diagrams displayed in Figs. 6 and 8, which show the formation of Arnold’s tongues where the flying time almost reaches a hundred time units.

We also analysed the stability of these solutions by means of the MEGNO, a fast technique to compute the maximum Lyapunov exponent, and thus obtained suitable bifurcation diagrams (Figs. 7 and 9) that reproduced such Arnold’s tongue structure at short motion times.

Since the computation of the MEGNO as well as that of the Lyapunov Characteristic Exponents require of our integrating the first variationals along with the equations of motion, the whole concomitant \(12 \times 12\) Jacobian matrix should be non singular. This is the case for Eq. (5) but when dealing with the singular equations of motion (3), only could the variationals corresponding to the spacial location of the top’s center of mass be integrated. However, by computing the whole spectrum of the LCEs in absence of perturbations, we verified that, even when dealing with the reduced \(6 \times 6\) matrix encompassing only the coordinates and momenta of the center of mass for (3), the applied scheme for the stability study of the Levitron’s dynamics by recourse to the MEGNO is suitable.

Our numerical experiments confirmed that the MEGNO serves as an early indicator of the stability of the Levitron’s flights, regular solutions being good candidates to allow for very long flying times.