| Author |
Comment/Response |
Forum Moderator
email me
 |
10/31/10 4:18pm
There was a change in 5.0 in how numeric routines process the first argument. While this enabled significant speedup, the first argument must be set up to handle undefined parameters. (Often the calculation issues warning messages and proceeds successfully, but not always.)
In
NMinimize[ "First Command", {x, y}...]
"First Command" is evaluated once before x and y have numerical values. A simple method is to put "First Command" in a separate function that is evaluated only when x and y have numerical values.
f[x_?NumericQ, y_?NumericQ] := "First Command"
NMinimize[ f[x,y], {x, y}...]
The "?" is shorthand for the PatternTest function.
URL: , |
|