Hello OpenBabel Developers,

While testing numerical OOP derivatives I found a bug in

forcefield.cpp

on line 3741 in function
double OBForceField::VectorOOPDerivative(double *pos_i, double *pos_j, double 
*pos_k, double *pos_l,
double *force_i, double *force_j, double *force_k, double *force_l)

LINE 3844       

VectorSelfMultiply(force_i, (sin_theta/length_ji));
====================================================

should be replaced by

VectorDivide(force_i, (sin_theta * length_ji), force_i);
========================================================

the function to be calculated is given on line 3838 
/* i = ((bn + (((-ji + jk * cos_theta) * sin_dl) / sin_theta)) / length_ji) / 
sin_theta; */ 

substituting X for (bn + (((-ji + jk * cos_theta) * sin_dl) / sin_theta))
i = ( x / length_ji ) / sin_theta
i = x / (length_ji * sin_theta)

the same goes for line 3851

VectorSelfMultiply(force_k, (sin_theta/length_ji));
====================================================

should be replaced by

VectorDivide(force_k, (sin_theta * length_jk), force_k);
========================================================

it should fix problems related with OOP calculations

Gerd



------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to