This is a package for solving semidefinite programming (SDP) problems.
Given symmetric matrices C, Ai and a vector b, the primal SDP problem is
and the dual SDP problem is
We can construct a semidefinite program using the method sdp, as follows:
i1 : P = sdp(matrix{{1,0},{0,2}}, matrix{{0,1},{1,0}}, matrix{{-1}}) o1 = SDP{A => 1 : (| 0 1 |)} | 1 0 | b => | -1 | C => | 1 0 | | 0 2 | o1 : SDP |
The semidefinite program can be solved numerically using the method optimize:
i2 : (X,y,Z) = optimize P; Executing CSDP Input file: /tmp/M2-2575-0/4.dat-s Output file: /tmp/M2-2575-0/5 Status: SDP solved, primal-dual feasible |
i3 : (X,y) o3 = (| .706989 -.5 |, | -1.41421 |) | -.5 .353612 | o3 : Sequence |
See Solver for a discussion of the available SDP solvers. The method refine can be used to improve the precision of the solution.
In small cases it is possible to solve the SDP symbolically, by forming the ideal of critical equations.
i4 : (I,X,y,Z) = criticalIdeal P; |
i5 : radical I 2 o5 = ideal (- 4x - y , - 2x - 1, - 2x - y , - y + 2) 2 0 1 0 0 0 o5 : Ideal of QQ[x , x , x , y ] 0 1 2 0 |