UNDEFINED REAL POWER

Frequently asked questions about GAMS

Moderator: aileen

Forum rules
Please ask questions in the other sub-forums
Locked
aileen
User
User
Posts: 121
Joined: 1 year ago

UNDEFINED REAL POWER

Post by aileen » 1 year ago

Why do I get the error:

Code: Select all

 **** ERRORS(S) IN EQUATION XXX(S,M)
1 INSTANCE OF - UNDEFINED REAL POWER (RETURNED  0.0E+00)

aileen
User
User
Posts: 121
Joined: 1 year ago

Re: UNDEFINED REAL POWER

Post by aileen » 1 year ago

Without seeing the definition of equation XXX, it is not possible to say what the problem is exactly, but I can speculate a bit. This type of message is often the result of raising a variable to a power less than one, and trying to evaluate this with a zero or negative argument. For example,

x**0.5 is not defined for x=-.1, and if x = 0, the derivative is not defined, so there is still going to be an evaluation error.

One common approach to fixing this is to place a bound on the variable in question (say x.lo = 1e-5) and make sure that none of these bounds are active at the solution to the model.

If you are raising an expression to a power, you can either add an equation to bound that expression, or set this expression to a new variable you introduce (via a new equation) and bound the new variable as above.

Locked