Page 1 of 1

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

Posted: Sun Apr 09, 2023 9:07 am
by mostafa137887
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);
Untitled.png
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.

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

Posted: Mon Apr 10, 2023 7:57 am
by bussieck
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

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

Posted: Mon Apr 10, 2023 10:44 am
by mostafa137887
bussieck wrote: 11 months 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.