Shock in Loop cause domain errors

Problems with modeling
Post Reply
qli091
User
User
Posts: 8
Joined: 5 years ago

Shock in Loop cause domain errors

Post by qli091 »

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:

Code: Select all

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
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Shock in Loop cause domain errors

Post by Renger »

Hi Qiaomin
This question is hard to answer without seeing the complete code, so you might want to attach your code.
CHeers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
qli091
User
User
Posts: 8
Joined: 5 years ago

Re: Shock in Loop cause domain errors

Post by qli091 »

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
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Shock in Loop cause domain errors

Post by Renger »

Hi Qiaomin

Two links that might be of help: Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply