Update docs

This commit is contained in:
2023-10-14 03:11:43 +02:00
parent c4aa6f2179
commit 22c8b9707d
105 changed files with 3315 additions and 1025 deletions

View File

@@ -1,4 +1,4 @@
.TH "PenningTrap" 3 "Sun Oct 8 2023" "Penning Trap Simulation" \" -*- nroff -*-
.TH "PenningTrap" 3 "Sat Oct 14 2023" "Penning Trap Simulation" \" -*- nroff -*-
.ad l
.nh
.SH NAME
@@ -13,51 +13,77 @@ PenningTrap \- A class that simulates a Penning trap\&.
.in +1c
.ti -1c
.RI "\fBPenningTrap\fP (double \fBB_0\fP=\fBT\fP, double \fBV_0\fP=25\&.*\fBV\fP/1000\&., double \fBd\fP=500\&.)"
.RI "\fBPenningTrap\fP (double \fBB_0\fP=\fBT\fP, std::function< double(double)> \fBV_0\fP=[](double \fBt\fP) { return 25\&. *\fBV\fP/1000\&.;}, double \fBd\fP=500\&., double \fBt\fP=0\&.)"
.br
.RI "Set B_0, V_0 and d\&. "
.RI "Constructor for the \fBPenningTrap\fP class\&. "
.ti -1c
.RI "\fBPenningTrap\fP (unsigned int i, double \fBB_0\fP=\fBT\fP, std::function< double(double)> \fBV_0\fP=[](double \fBt\fP) { return 25\&. *\fBV\fP/1000\&.;}, double \fBd\fP=500\&., double \fBt\fP=0\&.)"
.br
.RI "Constructor for the \fBPenningTrap\fP class\&. "
.ti -1c
.RI "\fBPenningTrap\fP (std::vector< \fBParticle\fP > \fBparticles\fP, double \fBB_0\fP=\fBT\fP, std::function< double(double)> \fBV_0\fP=[](double \fBt\fP) { return 25\&. *\fBV\fP/1000\&.;}, double \fBd\fP=500\&., double \fBt\fP=0\&.)"
.br
.RI "Constructor for the \fBPenningTrap\fP class\&. "
.ti -1c
.RI "void \fBadd_particle\fP (\fBParticle\fP particle)"
.br
.RI "Add a particle to the system\&. "
.ti -1c
.RI "arma::vec \fBexternal_E_field\fP (arma::vec r)"
.RI "\fBvec_3d\fP \fBexternal_E_field\fP (\fBvec_3d\fP r)"
.br
.RI "Calculate E at point r\&. "
.ti -1c
.RI "arma::vec \fBexternal_B_field\fP (arma::vec r)"
.RI "\fBvec_3d\fP \fBexternal_B_field\fP (\fBvec_3d\fP r)"
.br
.RI "Calculate B at point r\&. "
.ti -1c
.RI "arma::vec \fBforce_on_particle\fP (int i, int j)"
.RI "\fBvec_3d\fP \fBforce_on_particle\fP (unsigned int i, unsigned int j)"
.br
.RI "Calculate the force between 2 particles\&. "
.ti -1c
.RI "arma::vec \fBtotal_force_external\fP (int i)"
.RI "\fBvec_3d\fP \fBtotal_force_external\fP (unsigned int i)"
.br
.RI "Calculate the total external force on a particle\&. "
.ti -1c
.RI "arma::vec \fBtotal_force_particles\fP (int i)"
.RI "\fBvec_3d\fP \fBtotal_force_particles\fP (unsigned int i)"
.br
.RI "Calculate the total force on a particle from other particles\&. "
.RI "Calculate the total force on a particle p_i from other particles\&. "
.ti -1c
.RI "arma::vec \fBtotal_force\fP (int i)"
.RI "\fBvec_3d\fP \fBtotal_force\fP (unsigned int i)"
.br
.RI "calculate the total force on a particle\&. "
.RI "calculate the total force on a particle p_i\&. "
.ti -1c
.RI "void \fBevolve_RK4\fP (double dt)"
.RI "void \fBevolve_RK4\fP (double dt, bool particle_interaction=true)"
.br
.RI "Go forward one timestep using the RK4 method\&. "
.ti -1c
.RI "void \fBevolve_forward_euler\fP (double dt)"
.RI "void \fBevolve_forward_euler\fP (double dt, bool particle_interaction=true)"
.br
.RI "Go forward one timestep using the forward Euler method\&. "
.ti -1c
.RI "arma::vec \fBget_particle\fP (int i)"
.RI "\fBsim_arr\fP \fBsimulate\fP (double time, unsigned int steps, std::string method='rk4', bool particle_interaction=true)"
.br
.RI "Simulate the particle system inside the Penning trap over a certain amount of time\&. "
.ti -1c
.RI "double \fBget_d\fP ()"
.RI "void \fBwrite_simulation_to_dir\fP (std::string path, double time, unsigned int steps, std::string method='rk4', bool particle_interaction=true)"
.br
.RI "Simulate and write the displacement of all particles to files\&. "
.ti -1c
.RI "double \fBfraction_of_particles_left\fP (double time, unsigned int steps, std::string method='rk4', bool particle_interaction=true)"
.br
.RI "Simulate and calculate what fraction of particles are still left inside the Penning trap after the simulation\&. "
.in -1c
.SS "Private Member Functions"
.in +1c
.ti -1c
.RI "\fBvec_3d\fP \fBv_func\fP (unsigned int i, unsigned int j, double dt)"
.br
.RI "Helper for evolve_RK4 when calculating $k_{v,i,j}$ values\&. "
.ti -1c
.RI "\fBvec_3d\fP \fBr_func\fP (unsigned int i, unsigned int j, double dt)"
.br
.RI "Helper for evolve_RK4 when calculating $k_{r,i,j}$ values\&. "
.in -1c
.SS "Private Attributes"
@@ -67,7 +93,7 @@ PenningTrap \- A class that simulates a Penning trap\&.
.br
.RI "Magnetic field strength\&. "
.ti -1c
.RI "double \fBV_0\fP"
.RI "std::function< double(double)> \fBV_0\fP"
.br
.RI "Applied potential\&. "
.ti -1c
@@ -75,9 +101,19 @@ PenningTrap \- A class that simulates a Penning trap\&.
.br
.RI "Characteristic dimension\&. "
.ti -1c
.RI "double \fBt\fP"
.br
.RI "Current time\&. "
.ti -1c
.RI "std::vector< \fBParticle\fP > \fBparticles\fP"
.br
.RI "The particles in the Penning trap\&. "
.ti -1c
.RI "\fBsim_arr\fP \fBk_v\fP"
.br
.ti -1c
.RI "\fBsim_arr\fP \fBk_r\fP"
.br
.in -1c
.SH "Detailed Description"
.PP
@@ -85,15 +121,70 @@ A class that simulates a Penning trap\&.
This class simulates a Penning trap\&. It can take in a number of particles and simulate how they would behave inside a Penning trap\&.
.PP
Definition at line \fB29\fP of file \fBPenningTrap\&.hpp\fP\&.
Definition at line \fB30\fP of file \fBPenningTrap\&.hpp\fP\&.
.SH "Constructor & Destructor Documentation"
.PP
.SS "PenningTrap::PenningTrap (double B_0 = \fC\fBT\fP\fP, double V_0 = \fC25\&.*\fBV\fP/1000\&.\fP, double d = \fC500\&.\fP)"
.SS "PenningTrap::PenningTrap (double B_0 = \fC\fBT\fP\fP, std::function< double(double)> V_0 = \fC[](double \fBt\fP) { return 25\&. * \fBV\fP / 1000\&.; }\fP, double d = \fC500\&.\fP, double t = \fC0\&.\fP)"
.PP
Set B_0, V_0 and d\&.
Constructor for the \fBPenningTrap\fP class\&.
.PP
Definition at line \fB20\fP of file \fBPenningTrap\&.cpp\fP\&.
\fBParameters\fP
.RS 4
\fIB_0\fP The magnetic field strength
.br
\fIV_0\fP The time dependent applied potential
.br
\fId\fP The characteristic dimension
.br
\fIt\fP The starting time
.RE
.PP
.PP
Definition at line \fB18\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "PenningTrap::PenningTrap (unsigned int i, double B_0 = \fC\fBT\fP\fP, std::function< double(double)> V_0 = \fC[](double \fBt\fP) { return 25\&. * \fBV\fP / 1000\&.; }\fP, double d = \fC500\&.\fP, double t = \fC0\&.\fP)"
.PP
Constructor for the \fBPenningTrap\fP class\&.
.PP
\fBParameters\fP
.RS 4
\fIi\fP The number of particles to generate
.br
\fIB_0\fP The magnetic field strength
.br
\fIV_0\fP The time dependent applied potential
.br
\fId\fP The characteristic dimension
.br
\fIt\fP The starting time
.RE
.PP
.PP
Definition at line \fB27\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "PenningTrap::PenningTrap (std::vector< \fBParticle\fP > particles, double B_0 = \fC\fBT\fP\fP, std::function< double(double)> V_0 = \fC[](double \fBt\fP) { return 25\&. * \fBV\fP / 1000\&.; }\fP, double d = \fC500\&.\fP, double t = \fC0\&.\fP)"
.PP
Constructor for the \fBPenningTrap\fP class\&.
.PP
\fBParameters\fP
.RS 4
\fIparticles\fP The starting particles
.br
\fIB_0\fP The magnetic field strength
.br
\fIV_0\fP The time dependent applied potential
.br
\fId\fP The characteristic dimension
.br
\fIt\fP The starting time
.RE
.PP
.PP
Definition at line \fB39\fP of file \fBPenningTrap\&.cpp\fP\&.
.SH "Member Function Documentation"
.PP
.SS "void PenningTrap::add_particle (\fBParticle\fP particle)"
@@ -101,63 +192,262 @@ Definition at line \fB20\fP of file \fBPenningTrap\&.cpp\fP\&.
.PP
Add a particle to the system\&.
.PP
Definition at line \fB27\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "void PenningTrap::evolve_forward_euler (double dt)"
\fBParameters\fP
.RS 4
\fIparticle\fP The particle to add to the Penning trap
.RE
.PP
.PP
Definition at line \fB82\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "void PenningTrap::evolve_forward_euler (double dt, bool particle_interaction = \fCtrue\fP)"
.PP
Go forward one timestep using the forward Euler method\&.
.PP
Definition at line \fB167\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "void PenningTrap::evolve_RK4 (double dt)"
\fBParameters\fP
.RS 4
\fIdt\fP The step length
.br
\fIparticle_interaction\fP Turn particle interactions on/off
.RE
.PP
.PP
Definition at line \fB186\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "void PenningTrap::evolve_RK4 (double dt, bool particle_interaction = \fCtrue\fP)"
.PP
Go forward one timestep using the RK4 method\&.
.PP
Definition at line \fB104\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "arma::vec PenningTrap::external_B_field (arma::vec r)"
\fBParameters\fP
.RS 4
\fIdt\fP The step length
.br
\fIparticle_interaction\fP Turn particle interactions on/off
.RE
.PP
.PP
Definition at line \fB151\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBvec_3d\fP PenningTrap::external_B_field (\fBvec_3d\fP r)"
.PP
Calculate B at point r\&.
.PP
Definition at line \fB43\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "arma::vec PenningTrap::external_E_field (arma::vec r)"
\fBParameters\fP
.RS 4
\fIr\fP The position where we want to calculate the B field
.RE
.PP
\fBReturns\fP
.RS 4
vec_3d
.RE
.PP
.PP
Definition at line \fB95\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBvec_3d\fP PenningTrap::external_E_field (\fBvec_3d\fP r)"
.PP
Calculate E at point r\&.
.PP
Definition at line \fB32\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "arma::vec PenningTrap::force_on_particle (int i, int j)"
\fBParameters\fP
.RS 4
\fIr\fP The position where we want to calculate the E field
.RE
.PP
\fBReturns\fP
.RS 4
vec_3d
.RE
.PP
.PP
Calculate the force between 2 particles\&. Calculate the force exhibited on particle p_i from particle p_j\&.
.PP
Definition at line \fB50\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "double PenningTrap::get_d ()"
Definition at line \fB87\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBvec_3d\fP PenningTrap::force_on_particle (unsigned int i, unsigned int j)"
.PP
Definition at line \fB188\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "arma::vec PenningTrap::get_particle (int i)"
Calculate the force between 2 particles\&. Calculate the force exhibited on particle p_i from particle p_j\&.
.PP
\fBParameters\fP
.RS 4
\fIi\fP The index of particle p_i
.br
\fIj\fP The index of particle p_j
.RE
.PP
\fBReturns\fP
.RS 4
vec_3d
.RE
.PP
.PP
Definition at line \fB183\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "arma::vec PenningTrap::total_force (int i)"
Definition at line \fB100\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "double PenningTrap::fraction_of_particles_left (double time, unsigned int steps, std::string method = \fC'rk4'\fP, bool particle_interaction = \fCtrue\fP)"
.PP
calculate the total force on a particle\&.
Simulate and calculate what fraction of particles are still left inside the Penning trap after the simulation\&.
.PP
\fBParameters\fP
.RS 4
\fItime\fP The time to simulate in microseconds
.br
\fIsteps\fP The amount of steps for the whole simulation
.br
\fImethod\fP The method to use when moving forward a timestep
.br
\fIparticle_interaction\fP Turn particle interactions on/off
.RE
.PP
\fBReturns\fP
.RS 4
double
.RE
.PP
Definition at line \fB99\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "arma::vec PenningTrap::total_force_external (int i)"
.PP
Calculate the total external force on a particle\&. Calculate the total amount of force that E and B exhibits on particle p_i\&.
.PP
Definition at line \fB65\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "arma::vec PenningTrap::total_force_particles (int i)"
Definition at line \fB266\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBvec_3d\fP PenningTrap::r_func (unsigned int i, unsigned int j, double dt)\fC [private]\fP"
.PP
Calculate the total force on a particle from other particles\&.
Helper for evolve_RK4 when calculating $k_{r,i,j}$ values\&. Something
.PP
Definition at line \fB80\fP of file \fBPenningTrap\&.cpp\fP\&.
\fBParameters\fP
.RS 4
\fIi\fP Index i for $k_{r,i,j}$
.br
\fIj\fP Index j for $k_{r,i,j}$
.br
\fIdt\fP the step length (delta time)
.RE
.PP
\fBReturns\fP
.RS 4
vec_3d
.RE
.PP
.PP
Definition at line \fB64\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBsim_arr\fP PenningTrap::simulate (double time, unsigned int steps, std::string method = \fC'rk4'\fP, bool particle_interaction = \fCtrue\fP)"
.PP
Simulate the particle system inside the Penning trap over a certain amount of time\&.
.PP
\fBParameters\fP
.RS 4
\fItime\fP The time to simulate in microseconds
.br
\fIsteps\fP The amount of steps for the whole simulation
.br
\fImethod\fP The method to use when moving forward a timestep
.br
\fIparticle_interaction\fP Turn particle interactions on/off
.RE
.PP
.PP
Definition at line \fB211\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBvec_3d\fP PenningTrap::total_force (unsigned int i)"
.PP
calculate the total force on a particle p_i\&.
.PP
\fBParameters\fP
.RS 4
\fIi\fP The index of particle p_i
.RE
.PP
\fBReturns\fP
.RS 4
vec_3d
.RE
.PP
.PP
Definition at line \fB146\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBvec_3d\fP PenningTrap::total_force_external (unsigned int i)"
.PP
Calculate the total external force on a particle\&. Calculate the total amount of force that E and B exhibits on particle p_i\&.
.PP
\fBParameters\fP
.RS 4
\fIi\fP The index of particle p_i
.RE
.PP
\fBReturns\fP
.RS 4
vec_3d
.RE
.PP
.PP
Definition at line \fB114\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBvec_3d\fP PenningTrap::total_force_particles (unsigned int i)"
.PP
Calculate the total force on a particle p_i from other particles\&.
.PP
\fBParameters\fP
.RS 4
\fIi\fP The index of particle p_i
.RE
.PP
\fBReturns\fP
.RS 4
vec_3d
.RE
.PP
.PP
Definition at line \fB129\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "\fBvec_3d\fP PenningTrap::v_func (unsigned int i, unsigned int j, double dt)\fC [private]\fP"
.PP
Helper for evolve_RK4 when calculating $k_{v,i,j}$ values\&. Something
.PP
\fBParameters\fP
.RS 4
\fIi\fP Index i for $k_{v,i,j}$
.br
\fIj\fP Index j for $k_{v,i,j}$
.br
\fIdt\fP the step length (delta time)
.RE
.PP
\fBReturns\fP
.RS 4
vec_3d
.RE
.PP
.PP
Definition at line \fB46\fP of file \fBPenningTrap\&.cpp\fP\&.
.SS "void PenningTrap::write_simulation_to_dir (std::string path, double time, unsigned int steps, std::string method = \fC'rk4'\fP, bool particle_interaction = \fCtrue\fP)"
.PP
Simulate and write the displacement of all particles to files\&.
.PP
\fBParameters\fP
.RS 4
\fIpath\fP The directory to save the data
.br
\fItime\fP The time to simulate in microseconds
.br
\fIsteps\fP The amount of steps for the whole simulation
.br
\fImethod\fP The method to use when moving forward a timestep
.br
\fIparticle_interaction\fP Turn particle interactions on/off
.RE
.PP
.PP
Definition at line \fB240\fP of file \fBPenningTrap\&.cpp\fP\&.
.SH "Member Data Documentation"
.PP
.SS "double PenningTrap::B_0\fC [private]\fP"
@@ -165,25 +455,39 @@ Definition at line \fB80\fP of file \fBPenningTrap\&.cpp\fP\&.
.PP
Magnetic field strength\&.
.PP
Definition at line \fB31\fP of file \fBPenningTrap\&.hpp\fP\&.
Definition at line \fB32\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "double PenningTrap::d\fC [private]\fP"
.PP
Characteristic dimension\&.
.PP
Definition at line \fB33\fP of file \fBPenningTrap\&.hpp\fP\&.
Definition at line \fB34\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "\fBsim_arr\fP PenningTrap::k_r\fC [private]\fP"
A 2D vector containing all $k_{i,j}$ where $j$ is the index of a particle
.PP
Definition at line \fB39\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "\fBsim_arr\fP PenningTrap::k_v\fC [private]\fP"
A 2D vector containing all $k_{i,j}$ where $j$ is the index of a particle
.PP
Definition at line \fB37\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "std::vector<\fBParticle\fP> PenningTrap::particles\fC [private]\fP"
.PP
The particles in the Penning trap\&.
.PP
Definition at line \fB34\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "double PenningTrap::V_0\fC [private]\fP"
Definition at line \fB36\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "double PenningTrap::t\fC [private]\fP"
.PP
Current time\&.
.PP
Definition at line \fB35\fP of file \fBPenningTrap\&.hpp\fP\&.
.SS "std::function<double(double)> PenningTrap::V_0\fC [private]\fP"
.PP
Applied potential\&.
.PP
Definition at line \fB32\fP of file \fBPenningTrap\&.hpp\fP\&.
Definition at line \fB33\fP of file \fBPenningTrap\&.hpp\fP\&.
.SH "Author"
.PP