Hi,
I'm trying to define a conditional equality constraint in an optimization problem. The closest atom I could find for this purpose is the if_else atom. However, this requires an else, as long as I understand, whereas I don't need (must not!) to do anything if the condition is not satisfied. What I am doing is:
condition = cs.if_else(x[0] < k, x[1], NOTHING) # where x are state variables
# with the package do-mpc (python):
mpc.set_nl_cons(condition, soft_constraint=True)
mpc.set_nl_cons(-condition, soft_constraint=True)
What I am trying to reach is that the control variable is equal x[1] when x[0] < k, and is free otherwise. How do I reach this?
Thank you,
Giovanni