mc_lj_potential.adjust_displacement

mc_lj_potential.adjust_displacement(n_trials, n_accept, max_displacement)

Adjusts the maximum value allowed for a displacement move.

This function adjusts the maximum displacement to obtain a suitable acceptance of trial moves. That is, when the acceptance is too high, the maximum displacement is increased and when the acceptance is too low, the maximum displacement is decreased.

Parameters
  • n_trials (integer) – Number of trials that have been performed when the funtction is called.

  • n_accept (integer) – Number of current accepted trials when the function is called.

  • max_displacement (float) – Maximum displacement allowed for any step in the simulation.

Returns

  • n_trials (integer) – Number of trials. Updated to zero if maximum displacement is updated.

  • n_accept (integer) – Number of trials. Updated to zero if maximum displacement is updated.

  • max_displacemnt (float) – Maximum displacement allowed for any step in the simulation.