If-else logic statement

Hello,
there have been a few posts already on how to implement logical if-else statements for control constraints, and it seems like the common solution is to use the so called big-M method. To be sure this applies to my case, let me introduce my problem:


This is from the following paper:
http://arc.aiaa.org | DOI: 10.2514/1.G004155
Now the authors implemented this method using CVX and the ECOS solver. I have access to both packages. The only confusion is dealing with the logical if-else statement for the control variable w, that has two values based on wether Ts*(k-1) will be within the bounds of a prespecified burn period described by the cursive T with subscript p (burn period lasts from t0 to t1, and then from t2 to t3). This control constraint is based on the burn period and explains it changes. Ts is the discretization interval between to steps and is defined as (Final time-current time)/(N-1) where N is the total number of discretization points set.

Looking at the image, it appears that T_s(k-1) is input data, and not an optimization (CVX) variable or expression. If that is the case, then “logic” based on its value can be handled using normal MATLAB if-else, and doesn’t require Big M.

I don’t see how Big M would be implemented using ECOS, because ECOS doesn’t allow binary or integer variables.

If ECOS is used in the paper, there’s no reason why you couldn’t instead use Mosek, Gurobi, SeDuMi, or SDPT3.

1 Like

You are indeed correct. Both ECOS and SEDUMI accepted the if-else statement. The issue is that the solution is still infeasible. Interestingly ECOS actually goes through a couple of iterations before returning infeasibility, whilst SEDUMI only does one and returns infeasibility.

This means obviously that it isn’t necessarily the formulation of the CVX problem that is the issue, but it may very well be that the problem is not feasible. But I have a gripe that this isn’t the case, since I tested a code without the mentioned surrogate variables and control constraints, which worked.

All except for item 1 of https://yalmip.github.io/debugginginfeasible/ also applies to CVX.

As a general matter, it is possible that adding or changing constraints of a feasible model can make it infeasible.