Problems implementing the power function
ユーザーの入力を待っています。Hello, I am currently trying to model the following context in Gurobi.
\(App_{pd}=0.5+0.5(1-S_{pd}^{-p})\)
The code of the constraints looks something like this.
help = Model.addVars(P, D, lb=0, ub=gu.GRB.INFINITY, vtype=gu.GRB.CONTINUOUS, name=“help”)
for p in P:
for d in D:
if d >= min(D):
Model.addLConstr(S[p, d] == gu.quicksum(y[p, t] for t in range(D[0], d + 1)), name=f'App_Sum_{p}_{d}')
Model.addGenConstrPow(S[p, d], help[p, d], -power,
name=f“power_cal_{p},{d}”)
Model.addLConstr(App[p, d] == base + (1 - base) * (1 - help[p, d]),
name=f'App_det_{p}_{d}')
Unfortunately, I always get this IIS:
no_treatment_1_-9: w[1,-9] = 0.0
treatment_1_-9: -1.0 x[1,1,-9] + -1.0 x[1,2,-9] + -1.0 x[1,3,-9] + -1.0 x[1,4,-9] + -1.0 x[1,5,-9] + -1. 0 x[1,6,-9] + -1.0 x[1,7,-9] + -1.0 x[1,8,-9] + -1.0 x[1,9,-9] + -1.0 x[1,10,-9] + -1.0 y[1,-9] + w[1,-9] = 0.0
App_Sum_1_-9: -1.0 y[1,-9] + S[1,-9] = 0.0
What could be the reason that the model becomes infeasible? Here w[.,.] is binary, as are x[.,.] and y[.,.]. App[.,.] is continuous and App[.,.] is an integer variable. Is the power function possibly not defined?
0
-
This is difficult to analyze. You need to provide more information.
Setting all variables to 0 in the "IIS" satisfies all constraints. So, this is not an IIS.
Your addGenConstrPow call does not look suspicious.
A Minimal Reproducible Example could help.0
サインインしてコメントを残してください。
コメント
1件のコメント