# Can anyone help with an "infeasible" problem?

``````A=[1,0.1,0,0,0,0,0,0,0,0;
``````

0,1,1,0,0,0,0,0,0,0;
0,0,1,0.1,0,0,0,0,0,0;
0,0,0,1,0,0,0,0,0,0;
0,0,0,0,1,0.1,0,0,0,0;
0,0,0,0,0,1,1,0,0,0;
0,0,0,0,0,0,1,0.1,0,0;
0,0,0,0,0,0,0,1,0,0;
0,0,0,0,0,0,0,0,1,0.1;
0,0,0,0,0,0,0,0,0,1];
B=[0,0,0,0;
0,0,0,0;
0,0,0,0;
-4.116e-10,0,4.116e-10,0;
0,0,0,0;0,0,0,0;0,0,0,0;
0,-4.116e-10,0,4.116e-10;
0,0,0,0;
1.818e-07,1.818e-07,1.818e-07,1.818e-07];
C=[0;0;0;0;0;0;0;0;0;-1];
x0 = [120 -1 0 0 100 -2 0 0 500 -5]’;
xd = [0 0 0 0 0 0 0 0 0 0]’;
%
cvx_begin
cvx_solver
cvx_solver sedumi
variable x(10,500)
variable u(4,499)
% minimize( vec(u)’ * eye(4 * 500)*vec(u) )
minimize( vec(x)’ * eye(10 * 500)*vec(x) + vec(u)’ * eye(4 * 499) * vec(u) )
subject to
for i=1:499
x(:,i+1) == A * x(:,i) - B * u(:,i) + C;
end
x(:,500) == xd
x(:,1) == x0
x(9,: ) >= 0
0 <= u <= 2e6
cvx_end

I get weird solutions for this problem using sedumi solver in which u will be the same in each column. However, it would get infeasible solution using default solver.
This is a dynamic system with a linear state function X(t+1)=AX(t)+BU(t)+C. Trying to constrain the initial and final state X1 and X500, while minimizing the cost.
I have been trying to get it done in CVX for days…lol. Don’t know why. Can anyone have a look. Thanks in advance.

I believe your problem is infeasible (even if scaling is fixed). Why do you think or know that it should be feasible?

Inclusion of `x(:,500) == xd` or `x(9,: ) >= 0` (I am presuming that `X(9,: ) >= 0` is a typo, and is meant to be `x(9,: ) >= 0` ) is sufficient to make the problem infeasible. This is true even after removing the objective function, scaling B, and removing the upper bound of 2e6 on u.

Thanks for your reply. I think it’s feasible because this is a homework project and it was used before…

You are correct. That was a typo. I cannot remove any of the constraints if I want it still make sense.

Do you think I made mistake transferring the system dynamic model (the linear function) to a solvable model in CVX? I’ve posted the dynamic model:
X(t+1)=AX(t)+BU(t)+C; from t=1 to t=500
initial state, x0
final state, xd
inpput u, has constraints [0, 2e6]
state constrain x(9,: ) >= 0.

I don’t know if it’s proper to ask this question here. But this is my first time using CVX. Thanks again.

The fact that this problem was used before does not constitute a proof of feasibility.

You don’t seem to have a CVX issue. at least that I know of. As to whether the model makes any sense, or the input data, as you entered it is correct, I have no idea.

As it is your your homework project, I’ll let you figure out what to do.

Thanks for you timely reply. I think you have answered my concern. I’ll check my data.