Correct external_B_field

This commit is contained in:
Cory Balaton 2023-09-30 13:26:39 +02:00
parent eb989e0293
commit 8d193cf469
No known key found for this signature in database
GPG Key ID: 3E5FCEBFD80F432B

View File

@ -51,11 +51,10 @@ arma::vec PenningTrap::external_E_field(arma::vec r)
arma::vec PenningTrap::external_B_field(arma::vec r) arma::vec PenningTrap::external_B_field(arma::vec r)
{ {
double x = r(0), y = r(1);
arma::vec::fixed<3> res; arma::vec::fixed<3> res;
res(0) = y*this->B_0; res(0) = 0.;
res(1) = -x*this->B_0; res(1) = 0.;
res(2) = 0.; res(2) = this->B_0;
return res; return res;
} }