<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-7"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 7/06/2011 7:55 AM, Dimitris Dellis wrote:
    <blockquote cite="mid:4DED4CE2.40305@gmail.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-7">
      <font size="-1"><font face="Helvetica, Arial, sans-serif">Hi
          gmx_developers.<br>
          <br>
          In manual (v4.5) p. 100 ewald_rtol parameter is referred as 
          "The
          ewald_rtol parameter is the relative strength of the
          electrostatic
          interaction at the cut-off"<br>
          According to this (and some older posts in lists), beta
          parameter is
          obtained by solving equation <br>
          ewald_rtol = erfc( beta * r_c) / r_c     [1]<br>
          In gmxlib/ewald_utils.c, function calc_ewaldcoeff()  (versions
          3.3.4 -
          4.5.4) beta is obtained by solving eq. <br>
          ewald_rtol = erfc( beta * r_c)             [2]<br>
          (division by r_c omitted ).<br>
          These 2 expressions give the same beta only if r_c=1.<br>
        </font></font></blockquote>
    <br>
    Yep - though the division by r_c in [1] is erroneous. Apologies - I
    was probably one of the posters to whom you refer :-)<br>
    <br>
    If ewald_rol is the "relative strength of the electrostatic
    interaction at the cut-off" then we have<br>
    <br>
    <tt>ewald_rtol = V_Ewald(r_c) / V_normal(r_c)</tt><br>
    <br>
    so<br>
    <br>
    <tt>ewald_rtol = [erfc(beta * r_c ) / r_c ] / [1 / r_c]<br>
                 = erfc(beta * r_c )</tt><br>
    <br>
    In order to determine beta, one could equally well define the .mdp
    parameter ewald_maxv to satisfy<br>
    <br>
    <tt>ewald_maxv = erfc(beta * r_c) / r_c</tt><br>
    <br>
    or even have beta as an .mdp parameter. All that is necessary is
    that some algorithm exists to uniquely define beta, perhaps as a
    function of r_c - it doesn't matter what it is.<br>
    <br>
    <blockquote cite="mid:4DED4CE2.40305@gmail.com" type="cite"><font
        size="-1"><font face="Helvetica, Arial, sans-serif">
          I tried to investigate convergence of real/recip. sums as
          function of
          beta. For certain (beta, r_c), I calculate ewald_rtol using
          [1], put
          this ewald_rtol to mdp.<br>
          In md.log the reported beta is not the same with the one that
          was used
          to calculate ewald_rtol (not only last few digits deviation),
          except if
          r_c=1.<br>
          If I calculate ewald_rtol using [2] and give this value in
          mdp, mdrun
          reports the expected beta.<br>
        </font></font></blockquote>
    <br>
    Yep.<br>
    <br>
    <blockquote cite="mid:4DED4CE2.40305@gmail.com" type="cite"><font
        size="-1"><font face="Helvetica, Arial, sans-serif">
          In almost all systems this doesn't affect results since
          real/recip.
          sums converge for values of beta slightly different (few %)
          than the
          supposed beta,<br>
          and typical rcoulomb is close to 1.<br>
          This might affect results in some cases that exhibit difficult
          (if not
          impossible) real/recip. sums convergence, that for various
          reasons
          require large cut-offs.<br>
          <br>
          Is this a bug ?<br>
        </font></font></blockquote>
    <br>
    I think only in the sense that incomplete documentation leads to
    incomplete understanding. Even if the original coder intended
    ewald_rtol to have the sense of ewald_maxv, the resulting code
    serves the purpose in a slightly different way. You can see in
    src/mdlib/tables.c that ewaldcoeff is used in the erfc(ewaldcoeff *
    r)/r sense, as expected.<br>
    <br>
    Assuming nobody corrects me, I'll stick a comment in the code and a
    clarifying sentence in the manual.<br>
    <br>
    Mark<br>
  </body>
</html>