We have a complex optimization problem which includes several quadratic terms with integer and continous variables (using Anaconda Python / Pycharm with Gurobi 6.0.2). We applied the setPWLObj function to apprixmate the quadratic objective components. The code for this is as follows:
m.addConstr(l1[t] == 1/2.0 * (hsqrt[t]+hQ[t]))
m.addConstr(l2[t] == 1/2.0 * (hsqrt[t]-hQ[t]))
hlx1 = linspace(-10, 10, 50)
hlx2 = linspace(-10, 10, 50)
h1y1 = [0]*50
hly2 = [0]*50
for i in range(len(hlx1)):
h1y1[i] = hlx1[i] * hlx1[i] * 7.348 / 1000.0
hly2[i] = -hlx2[i] * hlx2[i] * 7.348 / 1000.0
m.setPWLObj(l1[t], hlx1, h1y1)
m.setPWLObj(l2[t], hlx2, hly2)
With l1 and l2 being continous variables.
The problem behaves inconsistently. Running it on a Mac mostly delivers the exit codes 138 and 139 (correspondent to Bus Error 10), sometimes the same problem a solution can be calculated. This is particularly the case when starting the optimization several times in a row. This appears to be random.
On Windows machines either Python crashes, or the exit code "-1073741819" is delivered. Further searches for this exit code did not really help us.