I'm trying to solve an optimization problem with GEKKO using python, I'm trying to develop some mathematical function with log and sqrt and I figure out that I should use gekko operator instead of using numpy or math function. I wanted to know how to implement log base 2 instead of log or log10 using gekko.
gk = GEKKO()
gk.log(...) # work
gk.sqrt(...) # work
gk.log2(...) # does not work!
Error :
AttributeError: 'GEKKO' object has no attribute 'log2'
Instead you can change the log base using the rule:
log2(x) = gk.log(x)/gk.log(2)
You can't expect for it to have all of the log bases implemented.