major bug found in DNEB method
Posted: Mon Feb 09, 2009 4:43 am
I just noticed a bug in the dneb portion of neb.F
Line 244 reads:
f_dneb = f_spring_perp-vproj(f_spring_perp,f_perp)
This is the line that makes the dneb force normal to the real perpendicular force.
According to equation (14) of Sheppard et al. (2008), this equation should be:
f_dneb = f_spring_perp - (f_spring_perp*f_perp_unit) f_perp_unit
where f_perp_unit is a unit vector in the direction of f_perp
The function vproj, however, returns the following:
vproj=v2*SUM(v1*v2)/SQRT(SUM(v2*v2))
which returns
f_perp_unit * (f_spring_perp*f_perp)
This *should* return
f_perp_unit * (f_spring_perp*f_perp_unit)
so the code should be
vproj=v2*SUM(v1*v2)/(SUM(v2*v2))
This bug has caused numerous calculations to unexpectedly "blow up". I already made the fix in my compilation and will see if it solves the divergence issues I've been having.
Line 244 reads:
f_dneb = f_spring_perp-vproj(f_spring_perp,f_perp)
This is the line that makes the dneb force normal to the real perpendicular force.
According to equation (14) of Sheppard et al. (2008), this equation should be:
f_dneb = f_spring_perp - (f_spring_perp*f_perp_unit) f_perp_unit
where f_perp_unit is a unit vector in the direction of f_perp
The function vproj, however, returns the following:
vproj=v2*SUM(v1*v2)/SQRT(SUM(v2*v2))
which returns
f_perp_unit * (f_spring_perp*f_perp)
This *should* return
f_perp_unit * (f_spring_perp*f_perp_unit)
so the code should be
vproj=v2*SUM(v1*v2)/(SUM(v2*v2))
This bug has caused numerous calculations to unexpectedly "blow up". I already made the fix in my compilation and will see if it solves the divergence issues I've been having.