# The status is failed, but the result is right?

I try to solve the following optimal problem. The solver I choose is SDPT3.

``````k=3;

x_0 = [-5; 0; 0; 0];
x_f = [-4.91948388760639;0.533567829585349;-0.0799118840423569;0.574089046936448];

A = [1,0.100000000000000,0.00399400359884309,0.000133213384749050;0,1,0.0797602159074517,0.00399400359884309;0,0,0.991013491902603,0.0997002698843146;0,0,-0.179460485791766,0.991013491902603]
B = [0.00899400359884309;0.179760215907452;-0.00898650809739695;-0.179460485791766];

cvx_begin

variable x(4, k);
variable u(k);

subject to

for i = 1:1:k
if (i == 1)
x(:,i) == A * x_0 + B * u(i);
else
x(:,i) == A * x(:,(i-1)) + B * u(i);
end
end

x(:,k) ==  x_f;

for i = 1:1:k
abs(u(i)) <= 1;
end

cvx_end
``````

After the solver runs, the status is failed. However, I print the optimization variable x, and I think the solver computed the right answer. I have tried some other solvers, like gurobi and sedumi. They both reported infeasible.

I tried to relax the constraints. I use `abs(x(:,k) - x_f) <= 0.001;` instead of `x(:,k) == x_f;` . The status was infeasible.

Why these solvers cannot correctly solve such a problem ?

What evidence do you have that SeDuMi and Gurobi are failing? How do you know your problem is feasible?