Shock in Loop cause domain errors

Dear GAMS friends,

My model runs smoothly before I give a shock from the 4th year. The error information is “** Domain error(s) in nonlinear functions. Check bounds on variables.” My shock is given as follows:

SET YR  YEAR /2012*2045/;
LOOP(YR$(ORD(YR) LE 4),  
IF(ORD(YR)=4,
TM('ANZ','KR',S)=0.4*TM('ANZ','KR',S);
TM('KR','ANZ',S)=0.4*TM('KR','ANZ',S);
TM('ANZ','JP',S)=0.4*TM('ANZ','JP',S);
TM('JP','ANZ',S)=0.4*TM('JP','ANZ',S);
);
OPTION RESLIM=10000;
SOLVE FDIHE_SIM1 MAXIMIZING U USING NLP;
);

I also tried with the $ selection method to insure the shock begins in the 4th year, but the same error occurs.
I also tried to move the shock to TM out of the Loop, i.e. as a shock to the basic model, no error occurs.

Many thanks,
Qiaomin

Hi Qiaomin
This question is hard to answer without seeing the complete code, so you might want to attach your code.
CHeers
Renger

Hi Renger,

I am in a process of runing a dynamic GAMS program. Problems come and go whenever I change something like bounds, scaling, or moving forward for the next year. Howevery, the problem “Domain errors in nonlinear functions” appears very frequently. I don’t quite understand what does this mean and what is the implied problem. If I know what’s going wrong, I may be able to fix the model myself.

Many thanks,
Qiaomin

Hi Qiaomin

Two links that might be of help:

Cheers
Renger