Implement external_E_field

This commit is contained in:
Cory Balaton 2023-09-29 14:07:00 +02:00
parent bd53af7829
commit f1f1eecf07
No known key found for this signature in database
GPG Key ID: 3E5FCEBFD80F432B

View File

@ -36,7 +36,14 @@ void PenningTrap::add_particle(Particle particle)
arma::vec PenningTrap::external_E_field(arma::vec r) arma::vec PenningTrap::external_E_field(arma::vec r)
{ {
arma::vec::fixed<3> res;
double x = r(0), y = r(1), z = r(2);
double f = this->V_0/2*this->d*this->d;
res(0) = f*2*x;
res(1) = f*2*y;
res(2) = -f*4*z;
return res;
} }
arma::vec PenningTrap::external_B_field(arma::vec r) arma::vec PenningTrap::external_B_field(arma::vec r)