I know that there is an option EvaluationMonitor for various numerical computation and plotting functions.
But I am curious, why a simple Print statement in the function to be minimized does not print. Consider this example:
Clear[x, y, z];
f[{x_, y_, z_}] := (Print[
"in function f called with these arguments: ", {x, y, z}];
1 + x^2 + y^2 + z^2);
FindMinimum[f[{x, y, z}], {{x, 1}, {y, 22}, {z, -3}}]
in function f called with these arguments: {x,y,z}
{1., {x -> 0., y -> 0., z -> 0.}}
The result is OK. But I would have expected the first print output to have been
in function f called with these arguments: {1,22,-3}
Did I get that completely wrong? Or is FindMinimum using some fancy Compiled feature defeating the Print statement?
Comments
Post a Comment