\documentclass[../main.tex]{subfiles}
\graphicspath{{\subfix{../images/}}}

\begin{document}
\section{Results and Discussion}
The simulations were performed using a constant configuration for the Penning trap, where the values of $B_{0}$, $V_{0}$, and $d$ can be found in table \ref{tab:penning_config}. We also used a constant configuration for the particles, found in table \ref{tab:particle_config}. Initial position of particle 1 $p_{1}$ was set to $(20, 0, 20) \mu m$ with velocity $(0, 25, 0) \mu m/ \mu s$, whereas the position of particle 2 $p_{2}$ was set to $(25, 25, 0) \mu m$ with velocity $(0, 40, 5) \mu m/ \mu s$.

First, we simulated a single particle for $50 \mu s$, approximating the particle's motion using the RK4 method. In addition we compared the result with the analytical solution in figure \ref{fig:single_particle}. The approximated solution completely overlap the analytical, suggesting the implemented method is approximating the solution with minimal error. The angular frequency is
\begin{align*}
    \omega_{z} &= \sqrt{\frac{2 q V_{0}}{m d^{2}}} = \sqrt{\frac{2 \cdot 1 \cdot 9.65}{40.078}} \approx 0.694 \text{ rad/\textmu s},
\end{align*}
which result in a period (P) of
\begin{align*}
    \text{P} &= \frac{2 \pi}{|\omega_{z}|} \approx 9.054 \text{\textmu s}.
\end{align*}
From figure \ref{fig:single_particle} we see that the period, the time it takes for the particle to reach the same position, is close to 9 \textmu s. This is what we would expect given the value of $\omega_{z}$.
% Figure: single_particle.pdf
\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/single_particle.pdf}
    \caption{Movement of a single particle in z-direction. Approximated using the 4th order Runge-Kutta method, compared to the analytical solution $z(t) = z_{0} \cos (\omega_{z} t)$.}
    \label{fig:single_particle}
\end{figure}

To evaluate the implemented methods we simulated the particle using both forward Euler (FE) and RK4, with different time steps given in \ref{tab:time_steps}. Again, we simulated the particle movement for $50$ \textmu s, and estimated the relative error of each method. The result can be found in figure \ref{fig:relative_error}. The relative error of FE is large compared to the relative error of RK4. The error convergence rate for FE is $r_{\text{err}} \approx 1.39652$, and RK4 $r_{\text{err}} \approx 3.99998$, which means RK4 converges faster compared to FE.
\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/relative_error.pdf}
    \caption{Relative error measured for 4th order Runge-Kutta \(a\) and foreward Euler \(b\). Important to notice when reading the plot, that the scale of measured relative error differ between the methods.}
    \label{fig:relative_error}
\end{figure}
RK4 is a more complex method, which requires four times the calculations compared to FE. When the simulation is done with $n_{4} = 32000$ time steps, the difference in relative error decreases. The cost of calculation exceed the benefit of accuracy. That is, at a large number of time steps we could find a satisfying approximation to the solution using FE, with less calculations. 

Next, we simulated the movement of two particles in radial direction. In figure \ref{fig:two_particles_radial}, we see the path of both particles without interaction. The starting position of particle 1 $p_{1}$ is closer to the center of the Penning trap, than the starting position of $p_{}$. Both particles move in an orbital path arount the center, however, the starting velocity of each particles determine the minimum and maximum distance a particle moves from the center. We find these values bounds using eq. \ref{eq:upper_b} and eq. \ref{eq:lower_b}
\begin{align*}
    R_{+} &= A_{+} + A_{-} \\
    &= -12.3232 \text{\textmu m} + 32.3232 \text{\textmu m} \\
    &= 20.00 \text{\textmu m},
\end{align*}
and
\begin{align*}
    R_{-} &= |A_{+} - A_{-}| \\
    &= |-12.3232 \text{\textmu m} - 32.3232 \text{\textmu m}| \\
    &= 44.6464 \text{\textmu m}.
\end{align*}
The distance is similar that in figure \ref{fig:two_particles_radial}. In addition, we can see from \ref{fig:phase_nointer_x} that the distance differ between $p_{1}$ and $p_{2}$. When we study the particle movement in z-direction, in figure \ref{fig:phase_nointer_z}, we see a circular movement. Again, the distance the particle moves from the center is determined by its initial conditions. 

In figure \ref{fig:two_particles_radial_interaction} we see the movement in radial direction, where particle interaction is included. The orbital path is similar to what we see without particle interaction. However, the additional force acting on the particle is affecting it's trajectory. The distance each particle is moving from the center, differs depending on the position. Which is also seen in figure \ref{fig:phase_inter_x}, where we see the trajectory of the particle at a given position. When we study the phase space plot, where particle interaction is included, in figure \ref{fig:phase_inter_z} a similar difference is observed. In figure \ref{fig:3d_particles} we see the movement of two particles in both the radial direction and z-direction. The figure include particle movement with and without interaction, where we can observe the change in movement.% Something about the trajectory related to the interaction?

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/simulate_2_particles_no_interaction_xy.pdf}
    \caption{Path of two particles, $p_{1}$ and $p_{2}$, without interaction. The black dot marks the starting position of each particle.}
    \label{fig:two_particles_radial}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/simulate_2_particles_interaction_xy.pdf}
    \caption{Path of two particles, $p_{1}$ and $p_{2}$, with interaction. The black dot marks the starting position of each particle.}
    \label{fig:two_particles_radial_interaction}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/phase_space_no_interaction_x.pdf}
    \caption{Particle trajectory at a given position $x$, without particle interaction. The black dot marks the starting position of each particle.}
    \label{fig:phase_nointer_x}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/phase_space_no_interaction_z.pdf}
    \caption{Particle trajectory at a given position $z$, without particle interaction. The black dot marks the starting position of each particle.}
    \label{fig:phase_nointer_z}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/phase_space_interaction_x.pdf}
    \caption{Particle trajectory at a given position $x$, with particle interaction. The black dot marks the starting position of each particle.}
    \label{fig:phase_inter_x}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/phase_space_interaction_z.pdf}
    \caption{Particle trajectory at a given position $z$, with particle interaction. The black dot marks the starting position of each particle.}
    \label{fig:phase_inter_z}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/3d_plot.pdf}
    \caption{The movement of particles in a Penning trap. Where $p_{1}$ and $p_{2}$ is without interaction, $\hat{p}_{1}$ and $\hat{p}_{2}$ is without interaction.}
    \label{fig:3d_particles}
\end{figure}

Finally, by subjecting the system to a time-dependent field, making the replacement in \ref{eq:pertubation}, we study the fraction of particles left at different amplitudes $f$. We can see how the different amplitudes lead to loss of particles, at different angular frequencies $\omega_{V}$ in \ref{fig:wide_sweep}. We study frequencies in the range $\omega_{V} \in (0.2, 2.5)$ MHz, with steps of $0.02$ MHz, and find that angular frequencies in the range $(1.0, 2.5)$ is effective in pushing the particles out of the Penning trap. 

We explore the range $\omega_{V} \in (1.0, 1.7)$ MHz closer in figure \ref{fig:narrow_sweep}, and observe a loss of particles for amplitude $f_{1} = 0.1$ in the range $\omega_{V} \in (1.3, 1.5)$, for $f_{2} = 0.4$ in the range $\omega_{V} \in (1.2, 1.6)$, and $f_{3} = 0.7$ in the entire range explored. When we introduce particle interaction, we observe the amplitude with higher value will result in a larger bound for the particle movement, and particles are easily pushed out. When we add particle interaction the angular frequencies, which result in particles being pushed out, are similar as in no interaction. As we see in figure \ref{fig:narrow_sweep_interactions} the particle's behavior, when interactions are added, is disrupted and add to the force resulting in the particle being pushed out of the Penning trap. We see that fewer particles tend to be left in the Penning trap, than without any particle interactions. We also see that the fraction of particles left is more unpredictable with particle interactions. 

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/particles_left_wide_sweep.pdf}
    \caption{Exploring the behavior of particles, where the amplitude of time-dependent potential $f = [0.1, 0.4, 0.7]$, for angular frequency $\omega_{V} \in (0.2, 2.5)$ MHz.}
    \label{fig:wide_sweep}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/particles_left_narrow_sweep.pdf}
    \caption{Exploring the behavior of particles, where the amplitude of time-dependent potential $f = [0.1, 0.4, 0.7]$, for angular frequency $\omega_{V} \in (1.1, 1.7)$ MHz.}
    \label{fig:narrow_sweep}
\end{figure}

\begin{figure}[H]
    \centering
    \includegraphics[width=\linewidth]{images/particles_left_narrow_sweep_interactions.pdf}
    \caption{Exploring the behavior of particles, where the amplitude of time-dependent potential $f = [0.1, 0.4, 0.7]$, for angular frequency $\omega_{V} \in (1.1, 1.7)$ MHz with particle interactions.}
    \label{fig:narrow_sweep_interactions}
\end{figure}
\end{document}
