We have a complex optimization problem which includes several quadratic terms with integer and continous varibles (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 = *50
hly2 = *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 varibles.
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.
Any comments, suggestions and help very welcome and appreciated.
Sorry for taking so long, but we fixed the issue.
Actually we found out that the python crash is or was due to a bug in Gurobi. Following a request we filed with them the bug was removed.
If Gurobi 6.0.3. or above is used the error is not there anymore.