Page 1 of 1

x^y, where x<0 and y non-integer

Posted: Wed Nov 29, 2017 3:24 pm
by Loreno
this seems silly, but i cant get it done:

i want to simply calculate

x^y, but neighter the **operator nor the power() function is working, because x<0 and y is non-integer.

example:

(-0.1)^(1/5)

how can i do this in gams?

Re: x^y, where x<0 and y non-integer

Posted: Wed Nov 29, 2017 5:58 pm
by Fred
Loreno,

What you try to do is mathematically not defined.

Fred

Re: x^y, where x<0 and y non-integer

Posted: Thu Nov 30, 2017 10:11 am
by Loreno
oh, i guess its been to long, that i have been to math class:) the reason i thought that it works, is that google actually gave me a result.

solution: (yes mathematicly not the same, but what i logicly wanted to do anyways)

-(abs(x)**y)

Re: x^y, where x<0 and y non-integer

Posted: Fri Dec 01, 2017 6:50 am
by Fred
Hi Loreno,

The signPower function may be what you are looking for: https://www.gams.com/latest/docs/UG_Par ... =signpower

I hope this helps!

Best,
Fred