5 #include <utl/RK5ODEIntegrator.h>
11 using namespace galactic;
21 { fB0[0] = b0[0]; fB0[1] = b0[1]; fB0[2] = b0[2]; }
43 const Vector3 b0 = { 1, -1, 2 };
47 ODE chargeMotionODE(1, 1, b);
52 const double dxFirst = 0.1;
54 const Vector6 x0u0 = { 0, 0, 0, 1, 0, 0 };
55 const double accuracy = 1e-5;
59 for (
int i = 0; i < 30; ++i) {
63 Vector6& xu = it.
GetY();
65 sqrt(xu[3]*xu[3] + xu[4]*xu[4] + xu[5]*xu[5]);
72 for (
int j = 0; j < 6; ++j)
ConstantMagneticField(const Vector3 &b0)
void operator()(const Vector6 &, Vector3 &b)
int main(int argc, char *argv[])
AdaptiveRK5Iterator< DerivativeFunctor, VectorType > AdaptiveBegin(const double x, const double dx, const VectorType &y, const double accuracy=1e-5)