I have an optimization problem that I'm trying to solve using Gekko. When I'm setting initial values for the variables, with values of a possible solution, which satisfied the constrains, Gekko can't find a solution. How can I find the root cause?
I'm getting this error:
Error: Exception: Access Violation
At line 1341 of file MUMPS/src/dmumps_part2.F
Traceback: not available, compile with -ftrace=frame or -ftrace=full
Error: 'results.json' not found. Check above for additional error details
did not managed to solve
((1)*((d_t200_3_1-d_t100_3_1)))
Here is the optimization model I'm running
m = GEKKO(remote=False)
m.options.MAX_ITER=1000
m.options.IMODE=3
d_t200_3_0 = m.Var(540, name='d_t200_3_0')
d_t200_3_2 = m.Var(180, name='d_t200_3_2')
d_t200_3_1 = m.Var(360, name='d_t200_3_1')
d_t100_3_0 = m.Var(60, name='d_t100_3_0')
d_t100_3_2 = m.Var(20, name='d_t100_3_2')
d_t100_3_1 = m.Var(40, name='d_t100_3_1')
m.Equation(m.abs2(d_t100_3_0) >= 0.0)
m.Equation(200 > m.abs2(d_t100_3_0))
m.Equation(m.abs2(d_t100_3_2) >= 0.0)
m.Equation(200 > m.abs2(d_t100_3_2))
m.Equation(m.abs2(d_t100_3_1) >= 0.0)
m.Equation(200 > m.abs2(d_t100_3_1))
m.Equation(m.abs2(-1.0*m.abs2(d_t100_3_0) - -1.0*m.abs2(d_t100_3_2)) >= 0.0)
m.Equation(200 > m.abs2(-1.0*m.abs2(d_t100_3_0) - -1.0*m.abs2(d_t100_3_2)))
m.Equation(m.abs2(-1.0*m.abs2(d_t100_3_0) - -1.0*m.abs2(d_t100_3_1)) >= 0.0)
m.Equation(200 > m.abs2(-1.0*m.abs2(d_t100_3_0) - -1.0*m.abs2(d_t100_3_1)))
m.Equation(m.abs2(-1.0*m.abs2(d_t100_3_2) - -1.0*m.abs2(d_t100_3_1)) >= 0.0)
m.Equation(200 > m.abs2(-1.0*m.abs2(d_t100_3_2) - -1.0*m.abs2(d_t100_3_1)))
m.Equation(m.abs2(d_t200_3_0) >= 200.0)
m.Equation(600 > m.abs2(d_t200_3_0))
m.Equation(m.abs2(d_t200_3_2) >= 0.0)
m.Equation(200 > m.abs2(d_t200_3_2))
m.Equation(m.abs2(d_t200_3_1) >= 200.0)
m.Equation(400 > m.abs2(d_t200_3_1))
m.Equation(m.abs2(-1.0*m.abs2(d_t200_3_0) - -1.0*m.abs2(d_t200_3_2)) >= 200.0)
m.Equation(400 > m.abs2(-1.0*m.abs2(d_t200_3_0) - -1.0*m.abs2(d_t200_3_2)))
m.Equation(m.abs2(-1.0*m.abs2(d_t200_3_0) - -1.0*m.abs2(d_t200_3_1)) >= 0.0)
m.Equation(200 > m.abs2(-1.0*m.abs2(d_t200_3_0) - -1.0*m.abs2(d_t200_3_1)))
m.Equation(m.abs2(-1.0*m.abs2(d_t200_3_2) - -1.0*m.abs2(d_t200_3_1)) >= 0.0)
m.Equation(200 > m.abs2(-1.0*m.abs2(d_t200_3_2) - -1.0*m.abs2(d_t200_3_1)))
m.Obj(d_t200_3_2 - d_t100_3_2)
m.solve(debug =1, disp=True)
When solving this without initials values, I get a solution, but there is sometimes inconsistency, i.e. different solution for the same problem. Any hint why this could happen? I thought that there is some random initiation and the seed is changing, but according to the documentation the initial default values are 0.
Thanks!
Just to update that I didn't found the problem yet, but if looking on a subset of the optimization variables and corresponding constrains, I do able to get the optimization results. here is the subset:
d_t200_1_0 = m.Var(180, name='d_t200_1_0')
d_t200_1_2 = m.Var(180, name='d_t200_1_2')
d_t100_1_0 = m.Var(20, name='d_t100_1_0')
d_t100_1_2 = m.Var(20, name='d_t100_1_2')
m.Equation(m.abs2(d_t100_1_0) >= 0.0)
m.Equation(200 > m.abs2(d_t100_1_0))
m.Equation(m.abs2(d_t100_1_2) >= 0.0)
m.Equation(200 > m.abs2(d_t100_1_2))
m.Equation(m.abs2(-1.0*m.abs2(d_t100_1_0) - 1.0*m.abs2(d_t100_1_2)) >= 0.0)
m.Equation(200 > m.abs2(-1.0*m.abs2(d_t100_1_0) - 1.0*m.abs2(d_t100_1_2)))
m.Equation(m.abs2(d_t200_1_0) >= 0.0)
m.Equation(200 > m.abs2(d_t200_1_0))
m.Equation(m.abs2(d_t200_1_2) >= 0.0)
m.Equation(200 > m.abs2(d_t200_1_2))
m.Equation(m.abs2(-1.0*m.abs2(d_t200_1_0) - 1.0*m.abs2(d_t200_1_2)) >= 200.0)
m.Equation(400 > m.abs2(-1.0*m.abs2(d_t200_1_0) - 1.0*m.abs2(d_t200_1_2)))