Shock in Loop cause domain errors

Problems with modeling
Post Reply
qli091
User
User
Posts: 4
Joined: 6 months ago

Shock in Loop cause domain errors

Post by qli091 » 6 months ago

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: 353
Joined: 2 years ago

Re: Shock in Loop cause domain errors

Post by Renger » 6 months ago

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: The lazy economist

qli091
User
User
Posts: 4
Joined: 6 months ago

Re: Shock in Loop cause domain errors

Post by qli091 » 6 months ago

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: 353
Joined: 2 years ago

Re: Shock in Loop cause domain errors

Post by Renger » 6 months ago

Hi Qiaomin

Two links that might be of help: Cheers
Renger
____________________________________
Enjoy modeling even more: The lazy economist

Post Reply