Page 1 of 1

EXECERROR, division by zero (0)

Posted: Thu Dec 13, 2018 8:09 pm
by delelayo08
Hello Gurus,

I humbly request assistance on how to correct the execution error at line 924 (Exec Error at line 924: division by zero (0)) in my GAMS file

Please find attached a copy of my GAMS file (.gms)


Thank you in anticipation for your prompt and favorable response

Re: EXECERROR, division by zero (0)

Posted: Fri Dec 14, 2018 9:04 am
by Fred
Hi,

line 920 reads as follows:

Code: Select all

  ZKMD(m,pd,t,ni)$tkp(t,pd)= capitalcost0(t)* (XCOMD(m,pd,t,ni)/capacity0(t))**capacity_exponent;
Since there is only one division in this line, the problem mst be caused by capacity0(t). Lookung at the code it turns out that set t has 7 elements

storage
sugar_milling
biochemical_Conversion
Thermochemical_Conversion
blending
crushing
pretreatment


parameter capacity0(t) has non-zero values for only 5 of the elements of t

storage,11446.215
biochemical_Conversion,123869.121
Thermochemical_Conversion,123869.121
crushing,56558.16
pretreatment,56558.16


In line 920 you try to carry out the division for all t that are in tkp(t,pd):

storage
sugar_milling
Thermochemical_Conversion


As you can see, there is no capacity0('sugar_milling') which means you try to divide by 0.

I hope this helps!

Best,
Fred

Re: EXECERROR, division by zero (0)

Posted: Fri Dec 14, 2018 11:53 am
by delelayo08
Thank you Dr. Fred.


Very very grateful.


Regards,

Moyo.