Problem with error 66. Topic is solved

Problems with syntax of GAMS
Post Reply
BrianLópez
User
User
Posts: 2
Joined: 5 years ago

Problem with error 66.

Post by BrianLópez »

Hello, mi name is Brian and I'm doing the following gams programming.

I've got only two errors, the error 66 in the solve statement and the error 256 in the display statement (I know error 256 is a consecuential error) so I hope you can help me. Thank you very much in advance. :D
Attachments
Sorgo 1.gms
(5.74 KiB) Downloaded 301 times
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Problem with error 66.

Post by Renger »

Hi

Your equation AreaMax is not correct:

Code: Select all

AreaMax(i)..             AreaMax.up(i)=e=u2(i)*1.5 ;
You define the equation by setting an upper limit for the equation itself. Upper and lower limits only make sense for variables.
Note that even if AreaMax would have been a variable (and the equation had a different name), setting a upper bound for a variable is not done in the equations but before the solve:

Code: Select all

AreaMax.up(i) = u2(i) *1.5;
Note furthermore, that it doesn't make sense to write .L and .LO in equations. (e.g., not Depcost.l(l)=e=..., but Depcost(l)=e=...)
Tipp to find an error like you had: Define your model by writing the model not as model /ALL/ but list every equation starting with the objective. Then comment all the equations out with the exception of the objective equation. Run the model: no error => uncomment the next equation and run the model until you run into the error.

Code: Select all


model sorgo /         
              ACult,
	      AreaMax,
*             ConsGreat,
*             ConsLow,
*             Production1,
*             Production2,
*             DepCapacity,
*             DepLimith1
*             SorghumDist
*             BioCarbProd
*             TotalCultCt
*             DepCost   
*             TransCost 
*             Sales     
*             Profit
             / ;
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
BrianLópez
User
User
Posts: 2
Joined: 5 years ago

Re: Problem with error 66.

Post by BrianLópez »

So much thanks to you, I felt a bit embarrassed because I don't know how to code properly since this is my first time. And I'm sorry for keeping you busy with this problem. Have a good day an take care.
-Brian.
behroozi.foroogh
User
User
Posts: 1
Joined: 4 years ago

Re: Problem with error 66.

Post by behroozi.foroogh »

hi, I'm foroogh and trying to model a two objective problem in GAMS. I want to use e-constraint method to solve my model but unfortunatly I couldn't solve the 66 error. please help me. thanks a million.
Model1.gms
(208.24 KiB) Downloaded 223 times
Post Reply