*** Error at line 171: division by zero (0) Topic is solved

Problems with modeling
Post Reply
ersuhaib786
User
User
Posts: 10
Joined: 3 years ago

*** Error at line 171: division by zero (0)

Post by ersuhaib786 »

hello everyone, i need little help and guidance regarding my GAMS code. i am getting the following error (*** Error at line 171: division by zero (0).
I am attaching .gms file for your reference. pls provide your your valuable suggestions and comments. Thank you.
Last edited by ersuhaib786 1 year ago, edited 1 time in total.
User avatar
bussieck
Moderator
Moderator
Posts: 1037
Joined: 7 years ago

Re: *** Error at line 171: division by zero (0)

Post by bussieck »

The listing files helps you. The error is "**** Exec Error at line 171: division by zero (0)". Line 171 in the lst file is "171 C(t)=[Dreq(t)]+[[sum(i,(lambda(i)/theta(i)))]/[sum(i,(1/theta(i)))]];". Here you sum over all i and eventually divide by theta(i). If you look at your data of theta, there is no i19 and since GAMS is a sparse system, data not there is assumed to be 0.

-Michael
ersuhaib786
User
User
Posts: 10
Joined: 3 years ago

Re: *** Error at line 171: division by zero (0)

Post by ersuhaib786 »

Thank you @bussieck.
Post Reply