Lagrangian multiplier for constraints

Frequently asked questions about GAMS

Moderator: aileen

Forum rules
Please ask questions in the other sub-forums
Locked
aileen
User
User
Posts: 136
Joined: 4 years ago

Lagrangian multiplier for constraints

Post by aileen »

Is it possible to get the Lagrangian multiplier for the constraints from my solution?
aileen
User
User
Posts: 136
Joined: 4 years ago

Re: Lagrangian multiplier for constraints

Post by aileen »

The Lagrange multipliers, also known as marginals, can be accessed after a solve as follows.
Say the constraint of interest is called CON(j,k) and you want to set lamda(j,k) to the value of its marginal after the solve. Then anywhere after the solve statement, just write:

Code: Select all

lamda(j,k) = CON.M(j,k);
Locked