I am trying to find the required specifications of a RF trap, in which a proton can be confined.(trap dimensions, voltage frequency and amplitude used, etc). I have to solve the equations of motion numerically because the potential doesn't have a closed form for this specific geometry and equations of motion can not be solved analytically (indeed, only a series solution can be obtained for potential using Legendre polynomials and this series is present in the system of equations of motion). This is not the case for hyperbolic Paul trap where the equations are happen to be Mathieu equations.
For this purpose, I solve this system of ODEs numerically (ode45--> 4th and 5th order Runge-Kutta) and see if the ion leaves the trap. I can simulate the motion for a limited time span (typically about some milliseconds at most). So if the ion happen to leave the trap after a longer time span, I can't notice that.
The question is that how and when I can claim that the ion is confined in the trap? (using numerical methods)
The equations are: (in 2D polar coordinates with variables $r$ and $\theta$)(put some integer instead of $\infty$ in the series!)($C$ , $U$ , $V$ , $R$ and $\alpha$ are constants)
$$\ddot{r}-r\dot{\theta}^{2}=C(U+V\cos({\omega}t))\sum_{n=0}^{\infty}n(4n+1)\biggr[\sum_{m=0}^{n} (-1)^{m}\frac{(4n-2m)!(1-(\cos(\alpha))^{2n-2m+1})}{4^{n}m!(2n-m)!(2n-2m+1)!}\biggr]\frac{r^{2n-1}}{R^{2n}}P_{2n}(\cos(\theta))$$
$$r\ddot{\theta}+2\dot{r}\dot{\theta}=C(U+V\cos({\omega}t))\sum_{n=0}^{\infty}(4n+1)\biggr[\sum_{m=0}^{n} (-1)^{m}\frac{(4n-2m)!(1-(\cos(\alpha))^{2n-2m+1})}{4^{n}m!(2n-m)!(2n-2m+1)!}\biggr]\frac{r^{2n-1}}{R^{2n}}{d \over d\theta}(P_{2n}(\cos(\theta)))$$
which with this assignment:
$$X_1=r$$
$$X_2=\theta$$
$$X_3=\dot{r}$$
$$X_4=\dot{\theta}$$
becomes a simultaneous system of ODEs:
\begin{align*} \scriptsize { \dot{X_1} } &= \scriptsize { X_3 } \\ \scriptsize { \dot{X_2} } &= \scriptsize { X_4 } \\ \scriptsize { \dot{X_3} } & =\scriptsize { X_1X_4^{2}+C(U+V\cos({\omega}t))\sum_{n=0}^{\infty}n(4n+1)\biggr[\sum_{m=0}^{n} (-1)^{m}\frac{(4n-2m)!(1-(\cos(\alpha))^{2n-2m+1})}{4^{n}m!(2n-m)!(2n-2m+1)!}\biggr]\frac{r^{2n-1}}{R^{2n}}P_{2n}(\cos(X_2)) } \\ \scriptsize { \dot{X_4} } &= \scriptsize { \frac{-2X_3X_4}{X_1}+\frac{C(U+V\cos({\omega}t))\sum_{n=0}^{\infty}(4n+1)\biggr[\sum_{m=0}^{n} (-1)^{m} \frac{(4n-2m)!(1-(\cos(\alpha))^{2n-2m+1})}{4^{n}m!(2n-m)!(2n-2m+1)!}\biggr]\frac{r^{2n-1}}{R^{2n}}{d \over dX_2}(P_{2n}(\cos(X_2)))}{X_1} } \end{align*}