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

Problems with modeling
mostafa137887
User
Posts: 2
Joined: 1 month ago

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

Hi
I am coding a problem which is a piecewise linearization for gf^2 in equationd8. in this code that every thing is linear now i get this error: rPower: FUNC DOMAIN: x**y, x=0,y<0 in Equationd7.
fp(p,k,t)\$(ord(k) le card(k)-1)=-50+ord(k)*100/(card(k)-1);
Equationd7(p,t).. gf(p,t)=e=-50+sum(k\$(ord(k) le card(k)-1),100/(card(k)-1)*etha(p,k,t));
Equationd8(p,t).. gf2(p,t)=e=fp(p,'k01',t)**2 +sum(k\$(ord(k)<>card(k)),(fp(p,k+1,t)**2-fp(p,k,t)**2)*etha(p,k,t));
Equationd9(p,k,t)\$(ord(k)<>card(k)-2).. etha(p,k+1,t)=l=mu(p,k,t);
Equationd10(p,k,t)\$(ord(k)<>card(k)-2).. etha(p,k,t)=g=mu(p,k,t);
Equationd11(p,k,t)\$(ord(k)<>card(k)-1).. etha(p,k,t)=l=1;

where gf(p,t), gf2(p,t) and etha(p,k,t) are variables and mu(p,k,t) is binary variable.

I,d be thankful for help.
bussieck
Moderator
Posts: 970
Joined: 6 years ago

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

Replace x**2 by sqr(x). You can use ipower (i.e. sqr for i=2) rather than rpower which has restrictions of the operands.

-Michael
mostafa137887
User
Posts: 2
Joined: 1 month ago

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

bussieck wrote: 1 month ago Replace x**2 by sqr(x). You can use ipower (i.e. sqr for i=2) rather than rpower which has restrictions of the operands.

-Michael
thank u so much
it worked.