from gekko import GEKKO m = GEKKO() x = m.Param(-1) # use abs to define a new variable y = m.abs(x) # use abs in an equation z = m.Var() m.Equation(z==m.abs(x)+1) # solve m.solve() print('x: ' + str(x.value)) print('y: ' + str(y.value)) print('z: ' + str(z.value))