from gekko import GEKKO # define new GEKKO model m = GEKKO() # variable x = m.Var(-0.5) # calculate y=abs(x) with abs3 y = m.abs3(x) # solve with APOPT (MINLP solver) m.solve() # print solution print('x: ' + str(x.value)) print('y: ' + str(y.value))