Division by zero and evaluated to UNDF error

Post Reply
Irena
User
User
Posts: 1
Joined: 3 months ago

Division by zero and evaluated to UNDF error

Post by Irena » 3 months ago

Hi,
I encountered an error when I tried to use GAMS to solve my cge model. Specifically, it reports some ‘division by zero (0) error’ and ‘A constant in a nonlinear expression in equation evaluated to UNDF’. In the lst file, it reports ‘problem with the Jacobian evaluation’.
For example:

Code: Select all

eqKEFOC(a)..
(PEN(a)/WK)*(EN(a)**(1/sigmake(a)))=e=(deltaen(a)/(1-deltaen(a)))*(K(a)**(1/sigmake(a)));
It then reports:
*** Error at line 424: division by zero (0)
*** Error at line 424: A constant in a nonlinear expression in equation eqKEFOC evaluated to UNDF
**** Evaluation error(s) in equation "eqKEFOC(aWater)"
Problem in RHS evaluation
Problem in Jacobian evaluation of "K(aWater)"

It occurs probably because some intermediate input in the SAM is zero. I have tried possible ways to fix it, such as setting a lower bound for the zero endogenous variables, removing the variables from the denominator to the numerator and adding very small number like 0.0001. Sadly all these failed.

Does anyone have a better idea? Many thanks.

Post Reply