In non-inear optimization using knitro final values of positive variables are negative

This apened to me several time
I have an optimization problem with, let’s say 10 parameters, 11 positive variables, and the free variable (to be optimized).
During parameter scanning (changing combinatorially the values of some parameters) I somethimes obtain negative values for positive-defined variables.
I am using the NLP solve statement and knitro as solving algorithm.
A related question:
If I put nest solve statement inside a loop, does GAMS automatically reset all variable at the beginning of each solve?
(i.e. starting the optimization from scratch i mean). Is there something I should keep attention at when I repeat several time a solve statement, like re-inizializing variables?
If someone wants to suggest alternative and more robust optimization algorithms maybe even giving the possibility to perform convergence analysis, is welcome.
Thank you in advance, you are a very king community

Sandro


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/SkbLQ58Z2AkJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hi Sandro,

At first sight I would suggest to investigate on the model status at each iteration.
Negative values for positive variables kind of indicate that some combinations probably end up in (locally?) infeasible solutions.
You might want to keep track of your model status, that is, using something like

report(“status”, r) $(ord(r) eq count) = MYMODELNAME.modelstat;

after each solve statement. This will help verify whether the negative values correspond to possibly locally infeasible solutions.

For the second point, GAMS will probably try, at each solve statement, to initialise the problem with the current values of variables (i.e. the values obtained after the last solve statement). Using option bratio (check user manual for exact use of this option) allows you to get rid of any previously computed value for your variables.
Alternately, if you believe you know a good starting point, you may specify starting values at each iteration with a syntax of the type:

X.l = 5 ;
Y.l = 3 ;

(or even assigning more complex expression, depending on the current values of the parameters you are scanning).
Hope this helps
cheers
dax


Le mardi 11 septembre 2012 14:46:09 UTC+2, sandro a écrit :

This apened to me several time
I have an optimization problem with, let’s say 10 parameters, 11 positive variables, and the free variable (to be optimized).
During parameter scanning (changing combinatorially the values of some parameters) I somethimes obtain negative values for positive-defined variables.
I am using the NLP solve statement and knitro as solving algorithm.
A related question:
If I put nest solve statement inside a loop, does GAMS automatically reset all variable at the beginning of each solve?
(i.e. starting the optimization from scratch i mean). Is there something I should keep attention at when I repeat several time a solve statement, like re-inizializing variables?
If someone wants to suggest alternative and more robust optimization algorithms maybe even giving the possibility to perform convergence analysis, is welcome.
Thank you in advance, you are a very king community

Sandro


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/8knwUHJ8jy0J.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Il giorno mercoledì 12 settembre 2012 10:04:34 UTC+2, Dax ha scritto:

Hi Sandro,

At first sight I would suggest to investigate on the model status at each iteration.
Negative values for positive variables kind of indicate that some combinations probably end up in (locally?) infeasible solutions.
You might want to keep track of your model status, that is, using something like

report(“status”, r) $(ord(r) eq count) = MYMODELNAME.modelstat;

after each solve statement. This will help verify whether the negative values correspond to possibly locally infeasible solutions.

For the second point, GAMS will probably try, at each solve statement, to initialise the problem with the current values of variables (i.e. the values obtained after the last solve statement). Using option bratio (check user manual for exact use of this option) allows you to get rid of any previously computed value for your variables.
Alternately, if you believe you know a good starting point, you may specify starting values at each iteration with a syntax of the type:

X.l = 5 ;
Y.l = 3 ;

(or even assigning more complex expression, depending on the current values of the parameters you are scanning).
Hope this helps
cheers
dax


Dear Dax

Thank you very much for your reply.
I solved the ocasionally negative varieble values by constraining the range of such those variable.
The most important question was the second I posed. Indeed, optimized values are dependend on the permutational order of parameters! (in the context of parameter space analysis).
I guessed that the problem could be due to sime kind of “traces” retained from previous optimization cycles, but I didn’t expect that the algorithm could retain previous optimized
values as starting points. So f I well understood the mechanism, gams retain previous var.l values. I will try now to setup the option you mentioned and to check if this fix permutation-dependent errors.
Once again this community is amazing.
Thank you Dax


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/hYf_uuWybIIJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.