Skip to content

Commit

Permalink
Detailed comments on integrator
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenin committed Jul 26, 2023
1 parent 990b1aa commit 73009f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/colvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1869,16 +1869,23 @@ void colvar::update_extended_Lagrangian()

// BAOA (GSD) integrator as formulated in https://doi.org/10.1021/acs.jctc.2c00585
// starting from x_t, f_t, v_(t-1/2)
// Variation: the velocity step is split in two to estimate the kinetic energy at time t
// so this is more of a "BBAOA" scheme: a rearranged BAOAB where the second B is deferred
// to the next time step for implementation reasons (waiting for the force calculation)

// [B] Eq. (10a) split into two half-steps
// This reduces to leapfrog when gamma = 0
// would reduce to leapfrog when gamma = 0 if this was the reported velocity
v_ext += 0.5 * dt * f_ext / ext_mass;

// Kinetic energy at t
kinetic_energy = 0.5 * ext_mass * v_ext * v_ext;

// Potential energy at t
potential_energy = 0.5 * ext_force_k * this->dist2(x_ext, x);

// Total energy will lag behind position by one timestep
// (current kinetic energy is not accessible before the next force calculation)

v_ext += 0.5 * dt * f_ext / ext_mass;
// Final v_ext lags behind x_ext by half a timestep

Expand Down

0 comments on commit 73009f0

Please sign in to comment.