INVGRADIENT Basically the opposite of gradient(), aka Inverse Gradient.
F_bar = INVGRADIENT(dFx,dFy) reverses GRADIENT(F), where unit spacing is assumed.
F_bar = INVGRADIENT(dFx,dFy,H), where H is scalar, uses H as the spacing between points.
F_bar = INVGRADIENT(dFx,dFy,Hx,Hy) is basically the same, except that both x- and y-spacings are specified. Obviously, the DC offset of the integrated function is arbitrary. Also,
INVGRADIENT is limited to 2-dimensions at the moment, ie no 3-dimensional matrices, or vectors. If dFx and dFy aren't self-consistent then no exact solution can be integrated. In this case% the optimal solution, in the least squares sense, will be found. So if you do F_bar = INVGRADIENT(dFx,dFy), F_bar will be found such that doing [dFx_ dFy_] = GRADIENT(F_bar) will give you dFx_ and dFy_ that are as close as possible to the original dFx and dFy.
April 5, 2005
If this doesn't work right, email firstname.lastname@example.org, w/o the nospam.