I was trying to solve a very simple QP problem, however encountered infeasible issues. Below I attached the code.
The interesting thing is if I change the objective function from minimize (x’Hx+p*x) to minimize (norm(x)), the problem can be solved. Any idea of this?
clear all
close all
clc
H=[2.27348224441650,-0.00117286389833350,-0.00109341693417775,0.000525651695935969,-0.00291951592982850,-0.00802439502739480,-0.0114214153882029,-0.0114620136996767,-0.00845190795382778;...
-0.00117286389833388,3.56239456159405,0.0398547487807126,0.0328171924298543,0.0299758081507038,0.0123217494092350,-0.00901074350081043,-0.0237237606826626,-0.0270802505403330;...
-0.00109341693417792,0.0398547487807124,7.42913142321275,0.162937514595914,0.134548945141430,0.118326196608746,0.0580454993729156,-0.0119697594207837,-0.0606306755382558;...
0.000525651695935912,0.0328171924298543,0.162937514595915,19.0293416281818,0.532185506903310,0.439743884792902,0.383377020153317,0.195216554687546,-0.0208466825418427;...
-0.00291951592982837,0.0299758081507038,0.134548945141430,0.532185506903311,53.8299706380636,1.63992819461429,1.35532735815322,1.17852804655466,0.606728898544638;...
-0.00802439502739478,0.0123217494092349,0.118326196608746,0.439743884792902,1.63992819461430,158.231850886465,4.96315081082055,4.10207209308923,3.56397502386629;...
-0.0114214153882030,-0.00901074350081046,0.0580454993729158,0.383377020153317,1.35532735815321,4.96315081082053,471.437462980860,14.9327956461337,12.3422822781181;...
-0.0114620136996768,-0.0237237606826627,-0.0119697594207840,0.195216554687545,1.17852804655466,4.10207209308921,14.9327956461338,1411.05417821418,44.8416329206889;...
-0.00845190795382779,-0.0270802505403330,-0.0606306755382552,-0.0208466825418400,0.606728898544646,3.56397502386630,12.3422822781181,44.8416329206888,4229.90381247754];
p=[-0.305793573917451,1.91905584131655,3.19068549918678,4.37515748927000,4.70401769642371,3.96622856939228,2.49644394347549,0.890028616139999,-0.315944243461946];
A=[0.435600000000000,0,0,0,0,0,0,0,0;...
-0.259036070725624,0.435600000000000,0,0,0,0,0,0,0;...
-0.305463292084454,-0.259036070725624,0.435600000000000,0,0,0,0,0,0;...
-0.217756731595858,-0.305463292084454,-0.259036070725624,0.435600000000000,0,0,0,0,0;...
-0.137485208103031,-0.217756731595858,-0.305463292084454,-0.259036070725624,0.435600000000000,0,0,0,0;...
-0.0854903739189647,-0.137485208103031,-0.217756731595858,-0.305463292084454,-0.259036070725624,0.435600000000000,0,0,0;...
-0.0545735124757641,-0.0854903739189647,-0.137485208103031,-0.217756731595858,-0.305463292084454,-0.259036070725624,0.435600000000000,0,0;...
-0.0360507198086653,-0.0545735124757641,-0.0854903739189647,-0.137485208103031,-0.217756731595858,-0.305463292084454,-0.259036070725624,0.435600000000000,0;...
-0.0244407393687872,-0.0360507198086653,-0.0545735124757641,-0.0854903739189646,-0.137485208103031,-0.217756731595858,-0.305463292084454,-0.259036070725624,0.435600000000000];
b=[-44.4556031581127;-38.4931452767985;-25.0186511927410;-14.5856920501390;-7.92139179179135;-3.83162376690024;-1.27144478051163;0.392968382581787;1.51075798786650];
cvx_begin
variable x(9)
minimize (x'*H*x+p*x)
%minimize (norm(x))
subject to
A*x<=b
cvx_end