You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Formula for off-diagonal Hessian elements in /src/bin/findif/fd_geoms_freq_0.cc has inverse sing:
3-point - off-diagonal
O(1/h^2): new-way: [f(1,1)+f(-1,-1)+2f(0,0) -f(1,0) -f(-1,0) -f(0,1) -f(0,-1)]/(2h^2)
Implementation is the same.
But off-diagonal elements of the Hessian matrix (cross-derivatives) is:
[f(1,0) + f(-1,0) - f(1,1) - f(0,0)] + [f(0,1) + f(0,-1) - f(-1,-1) - f(0,0)]/(2h^2)
with a negative sign at f(0,0).
Does it mean that off-diagonal Hessian elements are calculated and stored with an opposite sign? or it is an issue?
The text was updated successfully, but these errors were encountered:
The 3-point coded formula is correct. I confirmed it analytically and with the 5-point formula for the analytic function f(x,y) = x y^2 at point (2,3). Off-diagonal second derivative is +6.
Formula for off-diagonal Hessian elements in /src/bin/findif/fd_geoms_freq_0.cc has inverse sing:
3-point - off-diagonal
O(1/h^2): new-way: [f(1,1)+f(-1,-1)+2f(0,0) -f(1,0) -f(-1,0) -f(0,1) -f(0,-1)]/(2h^2)
Implementation is the same.
But off-diagonal elements of the Hessian matrix (cross-derivatives) is:
[f(1,0) + f(-1,0) - f(1,1) - f(0,0)] + [f(0,1) + f(0,-1) - f(-1,-1) - f(0,0)]/(2h^2)
with a negative sign at f(0,0).
Does it mean that off-diagonal Hessian elements are calculated and stored with an opposite sign? or it is an issue?
The text was updated successfully, but these errors were encountered: