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

Problems with syntax of GAMS
Post Reply
Loreno
User
User
Posts: 5
Joined: 7 months ago

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

Post by Loreno » 5 months ago

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?

Fred
Posts: 26
Joined: 1 year ago

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

Post by Fred » 5 months ago

Loreno,

What you try to do is mathematically not defined.

Fred

Loreno
User
User
Posts: 5
Joined: 7 months ago

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

Post by Loreno » 5 months ago

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)

Fred
Posts: 26
Joined: 1 year ago

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

Post by Fred » 5 months ago

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

Post Reply