Hello. I have done a bit of serching on the the internet for a solution which has typically worked but after searching I am turning to the community.
I am trying to calculate derivatives for a functional form of a physical interation, hydrogen bonding. I have it programmed in Fortran but I would like to double check my results. The function depends on the the angles and distances between atoms. I am calculating these angles from the cartesian coordinates of the atoms using
Theta = Arccos(Dot[X,Y)] / Norm*Norm)
where X and Y are the coordinate vectors.
I have a defined function, Fgeom, which depends on 5 variables. Each of the these variables are caluculated with other functions from the angle formual above. This works when I solve the equation for the values of the h bonding and I get a number that is verified by my code and another program. This lets me know I have programmed the correct form for the function.
I read in the values of the coordinates using the form
FGeom[Angle1,Angle2,Angle3,Angle4,Angle5]/. x -> 1.0 /. y -> 2.0 etc...
The problem occurs when I try to find the derivative. I use the expression
D[FGeom[Angle1,Angle2,Angle3,Angle4,Angle5], x ]./x->1.0, ./ y -> 1.0 etc.
Mathematica evaluates the expression but rather than give me a single number for the value of the derivaitve it gives me something like this
0.000013795*(0.545679 + 0.0548247*Abs[-0.724238])
I have tried useing N[ ] to force numerical evaluation. Has anyone encountered this before??/
Cheers and thanks in advance