Hello,
I am solving a nonlinear MPC problem with CasADi. I use opti stack to formulate the problem. Part of the script is presented below. There is a "if_else" constraints in the problem, which determines whether the constraint exist or not. I use a "flag" variable to apply it. However, when I run the code, it shows the 'Infeasible_Problem_Detected'. If I remove the constraints, the rest part of the code works and give the solution. I am not sure whether the constraint is implemented correctly of not. Could someone give some suggestion? Thank you very much.
------------------------
from casadi import *
opti = casadi.Opti()
X = opti.variable(2, 4)
for i in range(4):
flag = if_else(X[0, i] >= 15, 1, 0)
opti.subject_to(X[1, i] * flag ->= 2.5 * flag)