Created an attachment (id=1394)
12 Jul 2011 build.
The vary command does not update the initial guess when the initial guess is set using a variable and the optimizer is inside a for loop that changes the guess each for loop pass. This issue does NOT occur with the differential corrector and is a bug related to the Vary command and optimizer interaction.
In the attached scripts, the initial guess should change each pass through the loop. If you look at the reports, the guess is correct for the DC version but not for the VF13ad version. I wrote an fmincon version but can't run because of a MATLAB issue.