TE:
You should look at the syntax for EMP. Basically, dPrice is a vector that is equal to the vector of duals for the demand equation. This is described in the info file with this line:
put ‘dualVar dPrice demand’;
When you write dPrice(‘chicago’) then some of the components of dPrice (dprice(‘new-york’) and dPrice(‘topeka’)) do not appear in the EMP model and the matching gets messed up. You can instead write the objective as a weighted sum of duals:
Parameter w(j) weight of the duals / new-york 0.001, chicago 1.0, topeka 0.001 /;
*Parameter w(j) weight of the duals / new-york 0.000, chicago 1.0, topeka 0.000 /;
zOutDef … zOut =e= sum(j, w(j)*dPrice(j));
This works as long as all weights are nonzero. So the line commented out above with some zero weight gives the same error since the corresponding dPrice variables disappear from the model.
Good luck
Arne
\
Arne Stolbjerg Drud
ARKI Consulting & Development A/S
Bagsvaerdvej 246A, DK-2880 Bagsvaerd, Denmark
Phone: (+45) 44 49 03 23, Fax: (+45) 44 49 03 33, email: adrud@arki.dk
From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of TE
Sent: Monday, May 21, 2012 3:23 PM
To: gamsworld@googlegroups.com
Subject: Re: Minimizng the Lagrange multiplier (marginal values)
I followed your advise and I did
zOutDef … zOut =e= dPrice(‘chicago’);
but I get the following problem:
IN EQUATION demand(new-york)
AND VARIABLE dPrice(chicago)
1 e. r r o r (s): dualVAR pair has different domains
1 e r. r o r (s): dualVar pair of different size
do you know the possible reason?
Thanks again
On Thursday, May 17, 2012 3:37:42 PM UTC+1, Steven Dirkse wrote:
All the usual GAMS algebra can be used here, so you could say simply
zOutDef … zOut =e= dPrice(‘chicago’);
On Thu, May 17, 2012 at 9:14 AM, TE wrote:
Thanks Steven. It definitely helped a lot.
Do you mind if I ask how to make only one of dPrice minimized instead of the
summation over all of them? I mean how to indicate that the dPrice is only
for the first demand equation?
Thanks,
On Wednesday, May 16, 2012 10:05:09 PM UTC+1, Steven Dirkse wrote:
On Wed, May 16, 2012 at 7:56 AM,
Thanks Steven,
It helps alot. Just some notes please:
- is “Solve transport using lp minimizing z ;” necessary? I mean why we
need to solve it for the first time? Does it automatically beng handled
in
EMP?
The “solve using EMP” results in the creation and solution of an MPEC
(Math Program with Equilibrium Constraints) model. This MPEC model
creation does not depend on the solution of the inner LP, but MPEC
models can be difficult to solve. I didn’t get a solution on my first
try without the LP solve, so I put that in there to give a feasible
start point for the equilibrium constraints.
- what does ‘min z * cost supply demand’ exactly mean in emp info? What
is
the role of * there?
The JAMS & EMP documentation will say more than I can here and can be
found at http://www.gams.com/dd/docs/solvers/emp.pdf. Briefly, the
“min z * cost supply demand” is there to say what variables and
equations belong to the inner problem, while what remains belongs in
the outer problem. In this case, all the constraints but the one
defining the outer objective belong to the inner problem. The “*”
says that all variables not otherwise assigned belong to this inner
problem.
HTH,
Steve
–
“gamsworld” group.
To view this discussion on the web visit
https://groups.google.com/d/msg/gamsworld/-/-PrjtauHbPcJ.
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.
–
Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com
–
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/vS6KXc8-xi8J.
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.
–
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.