Marginal Costs are different when constraints are set using x.lo and x.up

Solver related questions
Post Reply
bcdcav
User
User
Posts: 2
Joined: 2 weeks ago

Marginal Costs are different when constraints are set using x.lo and x.up

Post by bcdcav » 2 weeks ago

While minimizing a cost function with constraints specified as equations, I get 0 for all marginal values, but if I use x.lo and x.up (x is a variable) then I get a bunch of different marginal values. In both scenarios, optimized value stays the same and constraints are followed. Why is there a difference between marginal values? I attached the gams file which will return 0 for all marginal costs of x, but if you add the following 2 lines the marginal costs change completely.

Code: Select all

x.lo(i,dl)=MinGen(i);
x.up(i,dl)= MaxGen(i);
ED.gms
(2.25 KiB) Downloaded 8 times

User avatar
dirkse
Moderator
Moderator
Posts: 145
Joined: 4 years ago
Location: Fairfax, VA

Re: Marginal Costs are different when constraints are set using x.lo and x.up

Post by dirkse » 2 weeks ago

Why would you expect marginal costs to be unchanged?

If you add, remove, or alter constraints and bounds you can expect a change in level and/or marginal values.

-Steve

bcdcav
User
User
Posts: 2
Joined: 2 weeks ago

Re: Marginal Costs are different when constraints are set using x.lo and x.up

Post by bcdcav » 2 weeks ago

I totally understand that, but there is no change in constraints as I already have constraint equations on x. The difference occurs when I explicitly state x's bounds via x.lo and x.hi instead of using x(i,dl) =L= MaxGen(i) and x(i,dl) =G= MinGen(i,dl). However, the same marginal costs are displayed in tables for MinGen and MaxGen, so I believe this is more of a syntax problem rather than something about the solver.
dirkse wrote:
2 weeks ago
Why would you expect marginal costs to be unchanged?

If you add, remove, or alter constraints and bounds you can expect a change in level and/or marginal values.

-Steve

Post Reply