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.
Problem with error 66. Topic is solved

 User
 Posts: 2
 Joined: 4 months ago
Problem with error 66.
 Attachments

 Sorgo 1.gms
 (5.74 KiB) Downloaded 18 times
Re: Problem with error 66.
Hi
Your equation AreaMax is not correct:
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:
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.
Cheers
Renger
Your equation AreaMax is not correct:
Code: Select all
AreaMax(i).. AreaMax.up(i)=e=u2(i)*1.5 ;
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;
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
/ ;
Renger

 User
 Posts: 2
 Joined: 4 months ago
Re: Problem with error 66.
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.
Brian.