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

Problems with modeling
Post Reply
frds17
User
User
Posts: 22
Joined: 4 years ago

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

Post by frds17 »

Hi all,

I've got an error in equation

Code: Select all

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

Code: Select all

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

Code: Select all

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
petros.p
User
User
Posts: 10
Joined: 4 years ago

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

Post by petros.p »

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:

Code: Select all

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
frds17
User
User
Posts: 22
Joined: 4 years ago

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

Post by frds17 »

Hi Petros,

I did that and it worked.

Thanks,
Fabio
Post Reply