<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"> has four variable coefficients:
a,b,c,d.</font>
<br>
<br><font size=2 face="sans-serif"> 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 & Technology Group<br>
<br>
e-mail: mpuetz@de.ibm.com<br>
mobile: + 49-(0)160-7120602<br>
fax: + 49-(0)6131-84-6660<br>
<br>
snailmail:<br>
IBM Deutschland GmbH<br>
Department B458<br>
Hechtsheimer Str. 2 / Building 12<br>
55131 Mainz<br>
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>
> Send gmx-developers mailing list submissions to<br>
> gmx-developers@gromacs.org<br>
> <br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
> http://www.gromacs.org/mailman/listinfo/gmx-developers<br>
> or, via email, send a message with subject or body 'help' to<br>
> gmx-developers-request@gromacs.org<br>
> <br>
> You can reach the person managing the list at<br>
> gmx-developers-owner@gromacs.org<br>
> <br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of gmx-developers digest..."<br>
> <br>
> <br>
> Today's Topics:<br>
> <br>
> 1. Cubic splines - again (Mathias PUETZ)<br>
> 2. Re: Cubic splines - again (David van der Spoel)<br>
> <br>
> <br>
> ----------------------------------------------------------------------<br>
> <br>
> Message: 1<br>
> Date: Mon, 21 Aug 2006 11:00:42 +0200<br>
> From: Mathias PUETZ <mpuetz@de.ibm.com><br>
> Subject: [gmx-developers] Cubic splines - again<br>
> To: gmx-developers@gromacs.org<br>
> Message-ID:<br>
> <OF81900FD8.CA620DB9-ONC12571D1.003013ED-C12571D1.003122B9@de.ibm.com><br>
> Content-Type: text/plain; charset="iso-8859-1"<br>
> <br>
> Hi,<br>
> <br>
> I also have a question about the cubic spline formula used for potentials
<br>
> and forces:<br>
> <br>
> As I understand it the spline formula employed by GROMACS enforces
that<br>
> potentials and their second derivates are continuous at the tables
sites,<br>
> but the first derivates, hence the forces computed from the tables,
are <br>
> not.<br>
> There is always a small discontinuity at the table sites for the first
<br>
> derivatives and therefore the forces.<br>
> I stumbled a across this when I used Eric's kernel tester for BlueGene
<br>
> optimizations.<br>
> <br>
> I guess my question is: Do you really want a spline formula that makes
the <br>
> forces discontinous ?<br>
> Wouldn't it actually make more sense to use a spline formulat that
forces <br>
> the potential and<br>
> its first derivate to be continuous ? What's the rationale behind
making <br>
> the second derivate<br>
> continuous anyway ?<br>
> <br>
> 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 & Technology Group<br>
> <br>
> e-mail: mpuetz@de.ibm.com<br>
> mobile: + 49-(0)160-7120602<br>
> fax: + 49-(0)6131-84-6660<br>
> <br>
> snailmail:<br>
> IBM Deutschland GmbH<br>
> Department B458<br>
> Hechtsheimer Str. 2 / Building 12<br>
> 55131 Mainz<br>
> Germany<br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: http://www.gromacs.org/pipermail/gmx-<br>
> developers/attachments/20060821/397d4f04/attachment-0001.html<br>
> <br>
> ------------------------------<br>
> <br>
> Message: 2<br>
> Date: Mon, 21 Aug 2006 14:40:43 +0200<br>
> From: David van der Spoel <spoel@xray.bmc.uu.se><br>
> Subject: Re: [gmx-developers] Cubic splines - again<br>
> To: Discussion list for GROMACS development<br>
> <gmx-developers@gromacs.org><br>
> Message-ID: <44E9A9CB.20202@xray.bmc.uu.se><br>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
> <br>
> Mathias PUETZ wrote:<br>
> > <br>
> > Hi,<br>
> > <br>
> > I also have a question about the cubic spline formula used for
<br>
> > potentials and forces:<br>
> > <br>
> > As I understand it the spline formula employed by GROMACS enforces
that<br>
> > potentials and their second derivates are continuous at the tables
sites,<br>
> > but the first derivates, hence the forces computed from the tables,
are <br>
> > not.<br>
> > There is always a small discontinuity at the table sites for
the first <br>
> > derivatives and therefore the forces.<br>
> > I stumbled a across this when I used Eric's kernel tester for
BlueGene <br>
> > optimizations.<br>
> > <br>
> > I guess my question is: Do you really want a spline formula that
makes <br>
> > the forces discontinous ?<br>
> > Wouldn't it actually make more sense to use a spline formulat
that <br>
> > forces the potential and<br>
> > its first derivate to be continuous ? What's the rationale behind
making <br>
> > the second derivate<br>
> > continuous anyway ?<br>
> <br>
> what makes you think the forces are not continuous?<br>
> <br>
> <br>
> > <br>
> > 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 & Technology Group<br>
> > <br>
> > e-mail: mpuetz@de.ibm.com<br>
> > mobile: + 49-(0)160-7120602<br>
> > fax: + 49-(0)6131-84-6660<br>
> > <br>
> > snailmail:<br>
> > IBM Deutschland GmbH<br>
> > Department B458<br>
> > Hechtsheimer Str. 2 / Building 12<br>
> > 55131 Mainz<br>
> > Germany<br>
> > <br>
> > <br>
> > ------------------------------------------------------------------------<br>
> > <br>
> > _______________________________________________<br>
> > gmx-developers mailing list<br>
> > gmx-developers@gromacs.org<br>
> > http://www.gromacs.org/mailman/listinfo/gmx-developers<br>
> > Please don't post (un)subscribe requests to the list. Use the
<br>
> > www interface or send it to gmx-developers-request@gromacs.org.<br>
> <br>
> <br>
> -- <br>
> David.<br>
> ________________________________________________________________________<br>
> David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,<br>
> Dept. of Cell and Molecular Biology, Uppsala University.<br>
> Husargatan 3, Box 596, 75124 Uppsala, Sweden<br>
> phone: 46 18 471 4205 fax: 46 18 511 755<br>
> spoel@xray.bmc.uu.se spoel@gromacs.org http://folding.bmc.uu.se<br>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>
> <br>
> <br>
> ------------------------------<br>
> <br>
> _______________________________________________<br>
> gmx-developers mailing list<br>
> gmx-developers@gromacs.org<br>
> http://www.gromacs.org/mailman/listinfo/gmx-developers<br>
> <br>
> <br>
> End of gmx-developers Digest, Vol 28, Issue 19<br>
> **********************************************<br>
</font></tt>