Error: rPower: FUNC DOMAIN: x**y,x=0,y<0

Hi all,

I’ve got an error in equation

utility(ii,t).. u=e=(1/(1-1/gamma))*sum(a,S(a)*(beta**(ord(a)-1))*([c(ii,a,t+(ord(a)-1))**(1-1/rho)+alpha*l(ii,a,t+(ord(a)-1))**(1-1/rho)]**(1/(1-1/rho)))**(1-1/gamma));

I have already defined the lower bound

c.lo(ii,a,t)=0.01

and

l.lo(ii,a,t)=0

If I remove ord(a)-1, there is no error, but I need to include ord(a)-1 in the model.

Thanks,
Fabio

Hi,

What is your error exactly? From a first look I would say that ther should be a problem with your variables c(ii,a,t+(ord(a)-1)) and l(ii,a,t+(ord(a)-1)) beause they are defined in the sets (ii,a,t). So for example when t reaches its last element, the variable c(ii,a,t+(ord(a)-1)) should not exist. You could probably fix this problem if you replace you equation with the following:

utility(ii,t)$(ord(t) le card(a)-1).. u=e=(1/(1-1/gamma))*sum(a,S(a)*(beta**(ord(a)-1))*([c(ii,a,t+(ord(a)-1))**(1-1/rho)+alpha*l(ii,a,t+(ord(a)-1))**(1-1/rho)]**(1/(1-1/rho)))**(1-1/gamma));

Best,
Petros

Hi Petros,

I did that and it worked.

Thanks,
Fabio