<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">the cubic spline function</font>
<br>
<br><font size=2 face="sans-serif">spline_i (x) = a+b(x - x_i) + c (x -
x_i)**2 + d (x - x_i)**3</font>
<br>
<br><font size=2 face="sans-serif">&nbsp;has four variable coefficients:
a,b,c,d.</font>
<br>
<br><font size=2 face="sans-serif">&nbsp;For each table segment i you have
four linear equations which determine the coefficients for the spline function
spline_i(x)</font>
<br>
<br><font size=2 face="sans-serif">v(x_i) = spline_i(x_i)</font>
<br><font size=2 face="sans-serif">v(x_i+1) = spline_i(x_i+1)</font>
<br><font size=2 face="sans-serif">v''(x_i) = spline_i''(x_i)</font>
<br><font size=2 face="sans-serif">v''(x_i+1) = spline_i''(x_i+1)</font>
<br>
<br><font size=2 face="sans-serif">solving these equations for a,b,c,d
gives exactly the spline formula you are using.</font>
<br>
<br><font size=2 face="sans-serif">Since you force v and v'' to be continous,
v' (the forces) cannot be continuous at x_i</font>
<br><font size=2 face="sans-serif">unless v(x) itself is a polynomial function
with a degree of less than 4, which it typically isn't.</font>
<br><font size=2 face="sans-serif">The error will be small in most cases,
but it is noticable if you print out the forces</font>
<br><font size=2 face="sans-serif">calculated by your spline formula and
the exact force function in the vicinity of the x_i</font>
<br>
<br><font size=2 face="sans-serif">I believe it would be more appropriate
to enforce</font>
<br><font size=2 face="sans-serif"><br>
v(x_i) = spline_i(x_i)</font>
<br><font size=2 face="sans-serif">v(x_i+1) = spline_i(x_i+1)</font>
<br><font size=2 face="sans-serif">v'(x_i) = spline_i'(x_i)</font>
<br><font size=2 face="sans-serif">v'(x_i+1) = spline_i'(x_i+1)</font>
<br>
<br><font size=2 face="sans-serif">which will give you slightly different
spline coefficients, but guarantees that both v(x) and v'(x)</font>
<br><font size=2 face="sans-serif">will be continuous at x_i.</font>
<br>
<br><font size=2 face="sans-serif">Viele Grüsse / Best regards,<br>
Dr. Mathias Pütz<br>
<br>
IT Specialist for Application Perfomance<br>
<br>
Deep Computing - Strategic Growth BusinessDeep <br>
IBM Systems &amp; Technology Group<br>
<br>
e-mail: &nbsp;mpuetz@de.ibm.com<br>
mobile: + 49-(0)160-7120602<br>
fax: &nbsp; &nbsp; &nbsp; &nbsp; + 49-(0)6131-84-6660<br>
<br>
snailmail:<br>
 &nbsp;IBM Deutschland GmbH<br>
 &nbsp;Department B458<br>
 &nbsp;Hechtsheimer Str. 2 / Building 12<br>
 &nbsp;55131 Mainz<br>
 &nbsp;Germany<br>
</font>
<br>
<br><tt><font size=2>gmx-developers-bounces@gromacs.org wrote on 08/22/2006
12:00:05 PM:<br>
<br>
&gt; Send gmx-developers mailing list submissions to<br>
&gt; &nbsp; &nbsp;gmx-developers@gromacs.org<br>
&gt; <br>
&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>
&gt; &nbsp; &nbsp;http://www.gromacs.org/mailman/listinfo/gmx-developers<br>
&gt; or, via email, send a message with subject or body 'help' to<br>
&gt; &nbsp; &nbsp;gmx-developers-request@gromacs.org<br>
&gt; <br>
&gt; You can reach the person managing the list at<br>
&gt; &nbsp; &nbsp;gmx-developers-owner@gromacs.org<br>
&gt; <br>
&gt; When replying, please edit your Subject line so it is more specific<br>
&gt; than &quot;Re: Contents of gmx-developers digest...&quot;<br>
&gt; <br>
&gt; <br>
&gt; Today's Topics:<br>
&gt; <br>
&gt; &nbsp; &nbsp;1. Cubic splines - again (Mathias PUETZ)<br>
&gt; &nbsp; &nbsp;2. Re: Cubic splines - again (David van der Spoel)<br>
&gt; <br>
&gt; <br>
&gt; ----------------------------------------------------------------------<br>
&gt; <br>
&gt; Message: 1<br>
&gt; Date: Mon, 21 Aug 2006 11:00:42 +0200<br>
&gt; From: Mathias PUETZ &lt;mpuetz@de.ibm.com&gt;<br>
&gt; Subject: [gmx-developers] Cubic splines - again<br>
&gt; To: gmx-developers@gromacs.org<br>
&gt; Message-ID:<br>
&gt; &nbsp; &nbsp;&lt;OF81900FD8.CA620DB9-ONC12571D1.003013ED-C12571D1.003122B9@de.ibm.com&gt;<br>
&gt; Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
&gt; <br>
&gt; Hi,<br>
&gt; <br>
&gt; I also have a question about the cubic spline formula used for potentials
<br>
&gt; and forces:<br>
&gt; <br>
&gt; As I understand it the spline formula employed by GROMACS enforces
that<br>
&gt; potentials and their second derivates are continuous at the tables
sites,<br>
&gt; but the first derivates, hence the forces computed from the tables,
are <br>
&gt; not.<br>
&gt; There is always a small discontinuity at the table sites for the first
<br>
&gt; derivatives and therefore the forces.<br>
&gt; I stumbled a across this when I used Eric's kernel tester for BlueGene
<br>
&gt; optimizations.<br>
&gt; <br>
&gt; I guess my question is: Do you really want a spline formula that makes
the <br>
&gt; forces discontinous ?<br>
&gt; Wouldn't it actually make more sense to use a spline formulat that
forces <br>
&gt; the potential and<br>
&gt; its first derivate to be continuous ? What's the rationale behind
making <br>
&gt; the second derivate<br>
&gt; continuous anyway ?<br>
&gt; <br>
&gt; Viele Grüsse / Best regards,<br>
&gt; Dr. Mathias Pütz<br>
&gt; <br>
&gt; IT Specialist for Application Perfomance<br>
&gt; <br>
&gt; Deep Computing - Strategic Growth BusinessDeep <br>
&gt; IBM Systems &amp; Technology Group<br>
&gt; <br>
&gt; e-mail: &nbsp;mpuetz@de.ibm.com<br>
&gt; mobile: + 49-(0)160-7120602<br>
&gt; fax: &nbsp; &nbsp; &nbsp; &nbsp; + 49-(0)6131-84-6660<br>
&gt; <br>
&gt; snailmail:<br>
&gt; &nbsp; IBM Deutschland GmbH<br>
&gt; &nbsp; Department B458<br>
&gt; &nbsp; Hechtsheimer Str. 2 / Building 12<br>
&gt; &nbsp; 55131 Mainz<br>
&gt; &nbsp; Germany<br>
&gt; -------------- next part --------------<br>
&gt; An HTML attachment was scrubbed...<br>
&gt; URL: http://www.gromacs.org/pipermail/gmx-<br>
&gt; developers/attachments/20060821/397d4f04/attachment-0001.html<br>
&gt; <br>
&gt; ------------------------------<br>
&gt; <br>
&gt; Message: 2<br>
&gt; Date: Mon, 21 Aug 2006 14:40:43 +0200<br>
&gt; From: David van der Spoel &lt;spoel@xray.bmc.uu.se&gt;<br>
&gt; Subject: Re: [gmx-developers] Cubic splines - again<br>
&gt; To: Discussion list for GROMACS development<br>
&gt; &nbsp; &nbsp;&lt;gmx-developers@gromacs.org&gt;<br>
&gt; Message-ID: &lt;44E9A9CB.20202@xray.bmc.uu.se&gt;<br>
&gt; Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
&gt; <br>
&gt; Mathias PUETZ wrote:<br>
&gt; &gt; <br>
&gt; &gt; Hi,<br>
&gt; &gt; <br>
&gt; &gt; I also have a question about the cubic spline formula used for
<br>
&gt; &gt; potentials and forces:<br>
&gt; &gt; <br>
&gt; &gt; As I understand it the spline formula employed by GROMACS enforces
that<br>
&gt; &gt; potentials and their second derivates are continuous at the tables
sites,<br>
&gt; &gt; but the first derivates, hence the forces computed from the tables,
are <br>
&gt; &gt; not.<br>
&gt; &gt; There is always a small discontinuity at the table sites for
the first <br>
&gt; &gt; derivatives and therefore the forces.<br>
&gt; &gt; I stumbled a across this when I used Eric's kernel tester for
BlueGene <br>
&gt; &gt; optimizations.<br>
&gt; &gt; <br>
&gt; &gt; I guess my question is: Do you really want a spline formula that
makes <br>
&gt; &gt; the forces discontinous ?<br>
&gt; &gt; Wouldn't it actually make more sense to use a spline formulat
that <br>
&gt; &gt; forces the potential and<br>
&gt; &gt; its first derivate to be continuous ? What's the rationale behind
making <br>
&gt; &gt; the second derivate<br>
&gt; &gt; continuous anyway ?<br>
&gt; <br>
&gt; what makes you think the forces are not continuous?<br>
&gt; <br>
&gt; <br>
&gt; &gt; <br>
&gt; &gt; Viele Grüsse / Best regards,<br>
&gt; &gt; Dr. Mathias Pütz<br>
&gt; &gt; <br>
&gt; &gt; IT Specialist for Application Perfomance<br>
&gt; &gt; <br>
&gt; &gt; Deep Computing - Strategic Growth BusinessDeep<br>
&gt; &gt; IBM Systems &amp; Technology Group<br>
&gt; &gt; <br>
&gt; &gt; e-mail: &nbsp;mpuetz@de.ibm.com<br>
&gt; &gt; mobile: + 49-(0)160-7120602<br>
&gt; &gt; fax: &nbsp; &nbsp; &nbsp; &nbsp; + 49-(0)6131-84-6660<br>
&gt; &gt; <br>
&gt; &gt; snailmail:<br>
&gt; &gt; &nbsp;IBM Deutschland GmbH<br>
&gt; &gt; &nbsp;Department B458<br>
&gt; &gt; &nbsp;Hechtsheimer Str. 2 / Building 12<br>
&gt; &gt; &nbsp;55131 Mainz<br>
&gt; &gt; &nbsp;Germany<br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; ------------------------------------------------------------------------<br>
&gt; &gt; <br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; gmx-developers mailing list<br>
&gt; &gt; gmx-developers@gromacs.org<br>
&gt; &gt; http://www.gromacs.org/mailman/listinfo/gmx-developers<br>
&gt; &gt; Please don't post (un)subscribe requests to the list. Use the
<br>
&gt; &gt; www interface or send it to gmx-developers-request@gromacs.org.<br>
&gt; <br>
&gt; <br>
&gt; -- <br>
&gt; David.<br>
&gt; ________________________________________________________________________<br>
&gt; David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,<br>
&gt; Dept. of Cell and Molecular Biology, Uppsala University.<br>
&gt; Husargatan 3, Box 596, &nbsp; &nbsp; 75124 Uppsala, Sweden<br>
&gt; phone: &nbsp; 46 18 471 4205 &nbsp; &nbsp; &nbsp;fax: 46 18 511 755<br>
&gt; spoel@xray.bmc.uu.se &nbsp; spoel@gromacs.org &nbsp; http://folding.bmc.uu.se<br>
&gt; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
&gt; <br>
&gt; <br>
&gt; ------------------------------<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; gmx-developers mailing list<br>
&gt; gmx-developers@gromacs.org<br>
&gt; http://www.gromacs.org/mailman/listinfo/gmx-developers<br>
&gt; <br>
&gt; <br>
&gt; End of gmx-developers Digest, Vol 28, Issue 19<br>
&gt; **********************************************<br>
</font></tt>