arrangement of LHS and RHS in equality equations (MCP)

Problems with modeling
Post Reply
Tatjana
User
User
Posts: 8
Joined: 5 years ago

arrangement of LHS and RHS in equality equations (MCP)

Post by Tatjana »

Dear all,

I'm working with MCP equations, so the arrangements of equations are important. To match an equation with a variable that has a lower bound, I need to set it up with a ≥ sign. So, like this:
eq_inequation var1**2 =g= 9
not as
eq_inequation .. 9 =l= var1**2

This is easy enough for me.
However, I am not sure how to arrange LHS and RHS when I am matching a free variable with an = equation.
If I want to connect a free variable var2 with an equation eq_example, how do I know if I write
eq_example .. var2*(1-var1) =e= var3
or if I write
eq_example .. var3 =e= var2*(1-var1)
?

I'd bet it has something to do with convex and concave models, but I didn't get very far in my understanding just by googeling. I'd be very thankful about suggestions how to look at this.
User avatar
dirkse
Moderator
Moderator
Posts: 215
Joined: 7 years ago
Location: Fairfax, VA

Re: arrangement of LHS and RHS in equality equations (MCP)

Post by dirkse »

Tatjana,

You are asking some good questions here, questions that get to the foundations of what an MCP model really is. Fundamentally, MCP is not about equations and inequalities. It is about function-variable pairs, and the relationships dictated by those pairs. I could say a lot here, but it wouldn't be as carefully or well done as the GAMS docs on this subject:

https://www.gams.com/latest/docs/UG_Mod ... Models_MCP

The GAMS equations are merely a vehicle used to define an MCP. This MCP is then solved and its solution is returned, again using the GAMS equation symbols as the vehicle.

As I write this, I am reminded of the move from the geocentric theory of the solar system (where the sun, moon, stars, and planets revolve around the earth in circular orbits) to the heliocentric system of planetary motion (where the planets revolve around the sun in elliptical orbits). To adequately describe what is really going on with planetary motion, it is necessary to embrace the latter system. Similarly, to understand what is really happening with MCP, one must embrace and use the ideas of functions and function-variable pairs.

When seen through this lens, your question is:

How do you know if you should write F(x) perp-to x free or -F(x) perp-to x free ?

Often, it does not matter which you use: the set of points that solve the MCP are the same in either case, and MCP solvers are often not sensitive to the choice. But in some cases, the PATH solver is sensitive to the sign used on the equation F. What to do in such a case? I advise to use the sign of F that allows the pair F.x to make sense when bounds are added to the variable x.

An example helps here. Suppose x is the activity level for production, and F(x) is the marginal revenue for a given activity level, and that marginal revenue is decreasing. Usually, we want zero marginal revenue, i.e. F(x) = 0. But what if we have a lower bound on the activity level (say, we signed a contract requiring at least L units to be produced)? If x > L, we want F(x) = 0. If x = L, then a zero marginal revenue is also OK. If marginal revenue is positive at L, we should produce more: it will increase our overall revenue. If marginal revenue is negative at L, we would like to produce less than L, since this would increase overall revenue. But the contract precludes this. To capture this case in MCP, we would write this as -F(x) perp-to x >= L. I would do this by using an =N= equation matched to a free variable. With this, I can easily add the lower bound x >= L (say, if a contract is signed) and or a bound x <= U (say, due to a technical or regulatory limit) and the model is doing the correct thing. There is also some computational evidence and "tribal knowledge" that suggests this way of orienting the function/equation F will be best computationally.

HTH,

-Steve
Tatjana
User
User
Posts: 8
Joined: 5 years ago

Re: arrangement of LHS and RHS in equality equations (MCP)

Post by Tatjana »

Hi Steve,

thank you so much for your answer. It really helped with the intuition behind it.

For everybody who stumbles across this matter in the future: I just found a chapter in the PATH solver that specifically names this problem: https://www.gams.com/latest/docs/S_PATH ... H_PITFALLS
The sentence "One rule of thumb is to check whether if you replace the "=e=" by "=g=", and then increase "x", is the inequality intuitively more likely to be satisfied. If so, you probably have it the right way round, if not, reorder." really helped me as a dumbed down version of Steve's explanation, while Steve's example helped me understanding the intuition behind this trick.
Although both remain a bit vague to me when there's no first order condition of an optimization problem behind the equation, but simply a definition, such as
var_anywhere = var_indoors + var_outdoors
- hopefully those are the kind of equations where the order simply doesn't matter...

MCP is like a microwave to me. Most of the time it's good enough to press some buttons, but for understanding its potential and pitfalls, it seems a lot more worthwhile to understand what's actually going on inside. I hope to get a better understanding little by little. You helped me get a little step closer again (:

Best,
Tatjana
Post Reply