Hello all,
For a project I needed the gradient and the hessian matrix of the gravitational potential from HolmesFeatherstoneAttractionModel.
I realized that the gradient method returns -gradU instead of gradU. The acceleration method is correct as it returns gradient (-gradU), but this is very confusing when you don’t need the acceleration but the correct gradient. I computed the hessian matrix using DerivativeStructure and it turns out that the hessian method returns the opposite of the potential hessian matrix. I understand the choice to embed the - sign in the methods as the class is more likely used to compute the force and not directly the potential.
I would like to know if this comes from a design choice? If so, I think it would be great to update the javadoc to clarify it.
Cheers,
Romain