Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Hybrid Optimization Techniques' topicStudent Support Forum > General > "Hybrid Optimization Techniques"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
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: ,

Subject (listing for 'Hybrid Optimization Techniques')
Author Date Posted
Hybrid Optimization Techniques Shannon Bowl... 10/31/10 10:35am
Re: Hybrid Optimization Techniques Forum Modera... 10/31/10 4:18pm
Re: Re: Hybrid Optimization Techniques yehuda ben-s... 11/01/10 11:35am
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic