Thanks.

On Friday, August 2, 2013 3:37:03 AM UTC-4, dax wrote:

“Positive variable” will not exculde zero from the possible range of values : actually it covers the range [ 0, +INF [

Therefore, putting a small lower bound is definitely a good idea.

In addition, I would recommend to provide a strictly positive starting value such as in :

variablename.L = 1.0 ;

but in any case, a good practice would be to try (whenever possible) to re-write the equation such that there is no variable denominator.

Hope this helps

cheers

dax

Le jeudi 1 aoÃ»t 2013 21:36:27 UTC+2, PowerChile a Ã©crit :

Dear James,

You can put a lower bound to the variable:

variablename.LO = epsilon;

with epsilon equal to a small value, for example 1e-6.

Cheers,

Pedro

On Thursday, August 1, 2013, Hawker wrote:

Hi,

In the equations section of my gams code I have an equation where a variable enters in the denominator. I am getting a divide by zero error even though I’ve specified that the variable is a positive value using the following code for it’s declaration:

POSITIVE VARIABLE variablename;

Does anyone know how to solve this problem? I’m thinking I may need to define an initial value for the variable (i.e. something greater than zero), but am not sure how to do this. Any suggestions would be appreciated.

James

PEDRO JAVIER RAMÃREZ TORREALBA

Ingeniero Civil ElÃ©ctrico PUC

MSc en IngenierÃa ElÃ©ctrica PUC

Londres, REINO UNIDO

Celular: +44-(0)75-8069-3119

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/groups/opt_out.