Fix last update of RK4

This commit is contained in:
Cory Balaton 2023-10-17 17:31:56 +02:00
parent 5ed7cedfae
commit d7246b05b1
No known key found for this signature in database
GPG Key ID: 3E5FCEBFD80F432B

View File

@ -53,8 +53,8 @@ vec_3d PenningTrap::v_func(unsigned int i, unsigned int j, double dt)
case 2:
return dt * this->k_v[2][j];
case 3:
return (dt / 6.) * (this->k_v[0][j] + this->k_v[1][j] +
this->k_v[2][j] + this->k_v[3][j]);
return (dt / 6.) * (this->k_v[0][j] + 2.*this->k_v[1][j] +
2.*this->k_v[2][j] + this->k_v[3][j]);
default:
std::cout << "Not valid!" << std::endl;
abort();
@ -71,8 +71,8 @@ vec_3d PenningTrap::r_func(unsigned int i, unsigned int j, double dt)
case 2:
return dt * this->k_r[2][j];
case 3:
return (dt / 6.) * (this->k_r[0][j] + this->k_r[1][j] +
this->k_r[2][j] + this->k_r[3][j]);
return (dt / 6.) * (this->k_r[0][j] + 2.*this->k_r[1][j] +
2.*this->k_r[2][j] + this->k_r[3][j]);
default:
std::cout << "Not valid!" << std::endl;
abort();