Hi Steve,
Thank you for the very helpful information. Solving the MCP seems a great choice. I tried out but “NLP2MCP” is not an option for CONVERT for my GAMS distribution which is very old. And neos server does not take my large .gms file even after gzip. Is there a way to bypass the hurdle, say converting NLP to MCP manually?
Best,
Yang
On Wednesday, November 19, 2014 2:43:30 PM UTC-5, Steven Dirkse wrote:
Yang,
It seems you’re trying to construct a Lagrangian that incorporates the primal variable bounds. That can work but, as you are experiencing, you have to get duals for both lower and upper variable bounds. I typically leave the variable bounds out of the Lagrangian and keep them on the variables instead. It works great as long as you recall that dLdx is allowed to be positive if x=L and dLdx can be negative if x=U.
You can easily see exactly what the KKT conditions are for any GAMS LP or NLP by using the NLP2MCP mode of CONVERT. In this mode CONVERT creates a scalar MCP model for the KKT conditions of the original model. I’m attaching a working example, derived from circle in GAMSLIB. Essentially, we can solve the NLP using any NLP solver, then solve it again using CONVERT to produce the KKT conditions. This model also contains the levels and marginals at the current point. Solving the MCP, we see we’re already at the solution, which we expect if the NLP solver worked as it should and we generated the right KKT conditions. The interesting stuff I tacked onto the end of circle.gms is:
$onecho > convert.opt
NLP2MCP FOC.gms
dict dict.txt
$offecho
option nlp = convert;
m.optfile = 1;
solve m using nlp minimizing r;
execute ‘gams FOC’;
The dictionary file dict.txt will help you match up rows/cols of the original model with the scalar model FOC.gms. Hope this helps.
-Steve
On Wed, Nov 19, 2014 at 1:55 PM, Yang Shen wrote:
Hi Arne,
Thank you very much for the very useful information!
A lingering problem for me is to know how the Lagrange multipliers for the primal bound constraints go into the Lagrangian in order to independently and critically assess whether the KKT conditions are met at the optimal solutions derived for my optimization problem. Complementary slackness apparently holds as you described, and first and second order conditions remain to be assessed numerically.
For instance, for inactive bounds where q_i lies in between, I could retrieve the optimal value for ONE corresponding marginal from the .lst, but do not have the knowledge how the expression of the corresponding term in the Lagrangian looks like (and whether slack variables might be introduced when solving the problem with CONOPT but just not mentioned in the .lst file). Could you please help me out there?
Best,
Yang
On Wednesday, November 19, 2014 4:01:41 AM UTC-5, Arne Stolbjerg Drud wrote:
Hi Yang Shen
The answer is not related to the actual solver but is general:
If you have the bounds -0.85 =0, and t_i=0 after introducing slack variables. But the lst file contained no information about the slack variables. More importantly, there should be at least 2 marginal values for q_i-s_i=-0.85 and q_i+t_i=0.85.
So how was the primal bound actually written into the Lagrangian? Your help would be greatly appreciated.
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdi...@gams.com
http://www.gams.com
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.