# with abs3 object from gekko import GEKKO # define new GEKKO model m = GEKKO() # parameter x = m.Param(-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))