[AMPL 2812] Lagrange Multipliers - Not being Correctly Retrieved from Solver

View: New views
1 Messages — Rating Filter:   Alert me  

[AMPL 2812] Lagrange Multipliers - Not being Correctly Retrieved from Solver

by Guilherme Freitas :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi everybody. When I run the code below, KNITRO finds 4 and 2 as
multipliers, but for some reason "display _con" shows 0 and 0 instead.
If I change KNITRO's algorithm from 1 to 2 or 3, then the right
multipliers appear in "display _con". Any ideas?

Best,

Guilherme

### BEGIN CODE #####

var x;
var y;

maximize
  obj: -( (x + 1)^2 +  (2*y + 1)^2 );

subject to
 ynonneg: -y <= 0;
 xnonneg: -x <= 0;


option show_stats 1;
option solver knitroampl;
option knitro_options "alg=1 outlev=6";

solve;

printf "\n Results: \n";
display _varname, _var;
printf "\n Constraints: Slacks and Multipliers: \n";
display _conname, _con, _con.slack;

##### END CODE ######

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---