Penning Trap Simulation
Simulate particle behavior inside a Penning Trap
Loading...
Searching...
No Matches
main.cpp File Reference

The main program for this project. More...

#include <cmath>
#include <complex>
#include <fstream>
#include <omp.h>
#include <string>
#include <vector>
#include "PenningTrap.hpp"
#include "utils.hpp"

Go to the source code of this file.

Macros

#define PARTICLES   100
 
#define N   40000
 
#define CHARGE   1.
 
#define MASS   40.
 

Functions

vec_3d analytical_solution_particle_1 (double t)
 The analytical solution for particle p1.
 
void simulate_single_particle ()
 Simulate a single particle over the period of 50 \( \mu s \).
 
void simulate_two_particles ()
 Simulate 2 particles over the period of 50 \( \mu s \) with and without particle interactions.
 
void simulate_single_particle_with_different_steps ()
 Simulate a single particle over 50 \( \mu s \) using different amount of steps and different methods.
 
void simulate_100_particles ()
 Simulate 100 particles over 50 \( \mu s \).
 
void simulate_100_particles_with_time_potential ()
 Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.
 
int main ()
 

Variables

Particle p1 (CHARGE, MASS, vec_3d{20., 0., 20.}, vec_3d{0., 25., 0.})
 Particle 1.
 
Particle p2 (CHARGE, MASS, vec_3d{25., 25., 0.}, vec_3d{0., 40., 5.})
 Particle 2.
 

Detailed Description

The main program for this project.

Author
Cory Alexander Balaton (coryab)
Janita Ovidie Sandtrøen Willumsen (janitaws)
Version
0.1
Bug:
No known bugs

Definition in file main.cpp.

Macro Definition Documentation

◆ CHARGE

#define CHARGE   1.

Definition at line 25 of file main.cpp.

◆ MASS

#define MASS   40.

Definition at line 26 of file main.cpp.

◆ N

#define N   40000

Definition at line 24 of file main.cpp.

◆ PARTICLES

#define PARTICLES   100

Definition at line 23 of file main.cpp.

Function Documentation

◆ analytical_solution_particle_1()

vec_3d analytical_solution_particle_1 ( double  t)

The analytical solution for particle p1.

Parameters
tTime
Returns
vec_3d

Definition at line 38 of file main.cpp.

◆ main()

int main ( )

Definition at line 194 of file main.cpp.

◆ simulate_100_particles()

void simulate_100_particles ( )

Simulate 100 particles over 50 \( \mu s \).

Definition at line 131 of file main.cpp.

◆ simulate_100_particles_with_time_potential()

void simulate_100_particles_with_time_potential ( )

Simulate 100 particles over 500 \( \mu s \) using a time dependent potential.

The simulation sweeps over different frequencies in [0.2, 2.5] MHz.

Definition at line 146 of file main.cpp.

◆ simulate_single_particle()

void simulate_single_particle ( )

Simulate a single particle over the period of 50 \( \mu s \).

Definition at line 55 of file main.cpp.

◆ simulate_single_particle_with_different_steps()

void simulate_single_particle_with_different_steps ( )

Simulate a single particle over 50 \( \mu s \) using different amount of steps and different methods.

Definition at line 88 of file main.cpp.

◆ simulate_two_particles()

void simulate_two_particles ( )

Simulate 2 particles over the period of 50 \( \mu s \) with and without particle interactions.

Definition at line 70 of file main.cpp.