Hi,
I'm computing the maximum volume inscribed ellipsoid in a polyhedron, following the theory developed in Boyd & Vandenberghe "Convex Optimization"
. After computing the polyhedron, using cvx I have no problems, instead using the same structure of the polyhedron with YALMIP I obtain an ellipsoid out of the polyhedron that in my case is a triangle:
%-----------Polyhedron-----------------------------
x1=0:0.1:5;
y1=0.2*x1; y2=x1; y3=-1*x1+4;
figure
plot(x1,y1,x1,y2,x1,y3)
%---------------------------------------------------------
I am wondering if I am wrong in the description of the polyhedron using YALMIP. Following the code I use
%-------------------------- Code ------------------------------------------------------
A=[-1 1;1 1;0.2 -1]; b=[0;4;0]; % it's a triangle
P = sdpvar(n,n);
x = sdpvar(2,1);
F = [P>=0, A(1,:)*P*A(1,:)'+A(1,:)*x<=b(1),...
A(2,:)*P*A(2,:)'+A(2,:)*x <=b(2),...
A(3,:)*P*A(3,:)'+A(3,:)*x<=b(3)];
optimize(F,-logdet(P),sdpsettings('solver','sdpt3'));
noangles = 500;
angles = linspace( 0, 2 * pi, noangles );
ellipse_inner = value(P) * [ cos(angles) ; sin(angles) ] + value(x) * ones( 1, noangles );
%------------------------------------------------------------------------------------------------------
Thanks for your attention
Raffaele