[SciPy-User] Optimize.fmin_cg INCREASES total forces after minimization

Jason Rennie jrennie@gmail....
Tue Sep 20 09:47:00 CDT 2011


Are you using a good objective/gradient checker?  Here a matlab one I wrote
in grad school; it's easy to convert to python.

http://qwone.com/~jason/matlab/checkgrad2.m

Jason

On Wed, Sep 14, 2011 at 12:26 PM, Patrick Holvey <pholvey@gmail.com> wrote:

> Patrick Holvey <pholvey <at> gmail.com> writes:
>
> >
> > Hi everyone,I've got the attached program which I've detailed in previous
> emails.  I'm working on debugging my gradients (which I think I have) but
> something weird is going on.  When you load the program (from
> autosimplewwwV5
> import *) into the interpreter and call TrueSystem.getforces() it returns
> the
> sum of the absolute values of the forces experienced by the atoms.  Ok, so
> when
> I run TrueSystem.relax() it runs the system through fmin_cg a number of
> times.
> Here, I'm not sure why it's only going through 5-7 iterations a run before
> quitting so I have it run multiple (50) times to get some relaxation going
> on.
> After running the relaxation, I call getforces() again, only to see that
> the
> forces have increased!  (from 625 to 640) Very curious.  I've attached both
> the
> full code and the test atom setup (a three atom system, 1 Si atom bonded to
> 2
> Oxygen atoms in an angle configuration).  As expected, initially, the
> forces
> indicate the Si atom wants to pull up from the O atoms and the O atoms want
> to
> move away from each other and down, away from the Si atom.  This is not
> what
> happens.  In fact, both of the oxygen atoms move towards each other
> compressing
> the O-Si-O angle, and only marginally lengthening the O-Si bond. This can
> be
> seen by calling TrueSystem.writetofile("Filename") which will output a .xyz
> of
> the current system configuration.Any help on this is greatly appreciated.
> Thanks so much.Patrick-- Patrick HolveyGraduate StudentDept. of Materials
> Science and EngineeringJohns Hopkins Universitypholvey1 <at> jhu.edu
> > Attachment (autosimplewwwV5.py): text/x-python, 26 KiB
> > Attachment (test-angle.xyz): chemical/x-pdb, 201 bytes
> >
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User <at> scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> >
>
> Please disregard this communique.  It appears that the derivation of the
> forces
> that I was using was flawed, so have to fix that before I can get back to
> debugging.  Back to the drawing board...
>
> Thanks!
>
> Patrick
>
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



-- 
Jason Rennie
Research Scientist
ITA Software by Google
+1 617-446-3651
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20110920/22e3f25d/attachment.html 


More information about the SciPy-User mailing list