Page 1 of 1

FUNC DOMAN error in a CGE model

Posted: Thu Jun 23, 2022 12:05 pm
by acr31
Hi all!

I am running a dynamic CGE model. Until time t=16, the model finds feasible solutions for each period. However, in time t = 16, it returns the following error:

Code: Select all

**** Exec Error at line 1112: rPower: FUNC DOMAIN: x**y, x < 0
**** Evaluation error(s) in equation "EQ7(agr,16)"
        Problem in RHS evaluation 
The equation associated with the error is:

Code: Select all

 EQ7(j,t)$KDCO(j)..
                 KDC(j,t) =e= B_KD(j)*SUM[k$KDO(k,j),beta_KD(k,j)*KD(k,j,t)
                            **(-rho_KD(j))]**(-1/rho_KD(j));
Where KDC is the industry j demand for composite capital, KD is the demand for type k capital by industry j, and rho_KD is the composite capital elasticity parameter, beta_KD is a share parameter, and B_KD is a scale parameter.

I understand the meaning of the error, and the fact that a variable x that is to the power of y has a negative value. In my specific case, it must be either beta_KD or KD. However, I have checked multiple times and there is no reason to believe those variables have a negative value. Therefore, I am in a bit of a dead end here. I guess my questions are:
- Has anyone else had the same issue where despite having the aforementioned error, there was no reason to believe the variable had a negative value? and
- Does anyone have an idea of something I might be missing here?

Thanks a lot in advance!

Re: FUNC DOMAN error in a CGE model

Posted: Thu Jun 23, 2022 9:29 pm
by ABakhsh8
Hi Acr31, Hope you're doing well. I was also facing the error in the CGE model and In my case, I found a great platform CodeProZone where the code was mentioned with proper procedure, I'll definitely recommend checking this out and getting your problem solved. Thanks :)