I am new with using GAMs. My model codes produces **FATAL ERROR** messages. GAMS software suggests I use this option, Conopt:Lspret=FALSE.

I have typed this line of code before my solver command but GAMS seems not to recognize this command.

How do I add the “Lspret=False” line to my codes?

Could someone help me please?

You have to use it using CONOPT options file. You can create this file externally or if you don’t want to carry multiple files around, you can add the following lines to your GAMS code (before solve statement)

$onecho > conopt.opt

lspret = false

$offecho

You have to tell GAMS to use options file. You can do it using the following (before solve statement after model declaration)

.optfile = 1;

Thank you very much Atharv, @abhosekar.

This is what I did, based on your advice, but i still get error messages

OPTION NLP = conopt3;

MODEL MCGEM1 My First /ALL/;

MCGEM1.HOLDFIXED=1;

$onecho > conopt.opt

lspret = FALSE

$offecho

.optfile = 1;

SOLVE MCGEM1 USING CNS;

This is the error messages

*** Error 409 in Z:\User\Desktop\Dave’s Library\GAMS\Paper 1\Model.gms[ERR:“Z:\User\Desktop\Dave’s Library\GAMS\Paper 1\Model.gms”,1199,1][LST:1200]

Unrecognizable item - skip to find a new statement

looking for a ‘;’ or a key word to get started again

— Model.gms(1201) 3 Mb 2 Errors

*** Error 257 in Z:\User\Desktop\Dave’s Library\GAMS\Paper 1\Model.gms[ERR:“Z:\User\Desktop\Dave’s Library\GAMS\Paper 1\Model.gms”,1201,23][LST:1205]

Solve statement not checked because of previous errors

— Model.gms(1247) 3 Mb 2 Errors

*** Status: Compilation error(s)[LST:1284]

— Job Model.gms Stop 06/25/21 09:50:28 elapsed 0:00:08.2

I have also tried to add ; on different lines but the errors still show.

I meant modelname.optfile

In your case, MCGEM1.optfile=1; (without <>)

WOW!

Thank you very much. This work!

However, I now have new error messages. Any advice on how to solve these?

Here are the messages

** Error in Square System: Pivot too small.

CONOPT time Total 0.002 seconds

of which: Function evaluations 0.001 = 50.0%

1st Derivative evaluations 0.000 = 0.0%

**** ERRORS/WARNINGS IN EQUATION EQ60(Agric,Serv)

1 error(s): Pivot too small.

**** ERRORS/WARNINGS IN VARIABLE QSji(Agric,Serv)

1 error(s): Pivot too small.

This means that some of your constraints are linearly dependent (or jacobian is singular) and there is no search direction for conopt to proceed.

Try changing initial point (or obtain it by fixing some variables and using CNS)

You can find more details in the GAMS documentation. https://www.gams.com/latest/docs/S_CONOPT.html#CONOPT_GAMS_CONOPT_TERMINATION_MESSAGES