Error: Real number expected Topic is solved

Problems with syntax of GAMS
Post Reply
PeterBe
User
User
Posts: 66
Joined: 7 years ago

Error: Real number expected

Post by PeterBe »

Hi all,

I have a problem that I do not understand why it occurs. I specify the following options

Code: Select all

Option optcr =  option_relativeGap;
Option optca = option_absoluteGap;
Option Reslim = option_timeLimit;
and I get an error: Ral number expected

I read the parameters (option_relativeGap, option_absoluteGap, option_timeLimit) from a GDX file where they are displayed in a correct way.

Code: Select all

option_relativeGap
$LOAD option_relativeGap

option_absoluteGap
$LOAD option_absoluteGap

option_timeLimit
$LOAD option_timeLimit
The values are real numbers. Does anyone have a clue what the problem is? I would be quite thanful.
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Error: Real number expected

Post by Renger »

Hi

I assume that you use the options in your model file and not in a separate opt-file.
You should then write these options like:

mymodel.optcr = option_relativeGap;

where mymodel is the model name of the model you are trying to solve.


Hope this helps;
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
PeterBe
User
User
Posts: 66
Joined: 7 years ago

Re: Error: Real number expected

Post by PeterBe »

Thanks Renger for your help. This was indeed the problem.
Post Reply