CVX an Open Source MATLAB- Based Optimization Tool By Amila Tharaperiya Gamage Winter 2012 1
About CVX CVX is an open source MATLAB-based modeling tool. The optimization problem has to be a convex optimization problem. E.g., ◦ linear programs (LPs) ◦ quadratic programs (QPs) ◦ entropy maximization, etc CVX is not for large scale problems. CVX: http://cvxr.com/cvx/ 2
About CVX Core solvers used in CVX: ◦ SeDuMi (http://sedumi.ie.lehigh.edu/ ) ◦ SDPT3 (http://www.math.nus.edu.sg/~mattohkc/sdpt3.html) Both are open-source interior-point solvers based on MATLAB. CVX converts the problem into a format accepted by those solvers and call them to solve the problem. 3
Disciplined Convex Programming (DCP) DCP is a methodology for constructing convex optimization problems in a suitable format for CVX. DCP imposes a set of rules. Problems has to be written such that those rules are satisfied. Otherwise, problem will be rejected, even when the problem is convex. 4
Functions Convexity or concavity has to be followed from some DCP rules. ◦ Write the functions in terms of CVX recognized functions. Valid compositions of functions must be used (refer to CVX user guide for details) Product of variables is not convex. However, geometric mean of variables is a concave function. ◦ geo_mean([ x 1 , x 2 , x 3 ])= ( x 1 x 2 x 3 ) 1/3 User guide: http://web.cvxr.com/cvx/cvx_usrguide.pdf 5
Constraints Equality == :Both left- and right-hand sides should be affine functions of the optimization variables. Less-than <= :Expression in left-hand side should be convex, and the right-hand expression should be concave. Constraints are imposed elementwise for arrays and matrices. affine: f(ax + (1 − a)y)= af (x) + (1 − a )f(y) 6
What are the problems CVX could not handle well? Log(x), exp(x), log(exp x 1 +· · ·+exp x n ) CVX uses successive approximation method for solving these problems, and the results may not be accurate. Solution: try to convert the problem to some other form if possible 7
Some Useful Conversions Use Max sqrt( x 1 x 2 ) instead of Max log( x 1 )+log( x 2 ) Max log(1+xy/(x+y)) subject to x,y>0 : xy/(x+y) >= t Max log(1+t) Max 1+t Subject to Subject to sqrt[(x-t)(y-t)] >= t sqrt[(x-t)(y-t)] >= t x,y,t>0 x,y,t>0 : : 8
CVX commands cvx_optval: provide the optimum value of the objective function cvx_slvtol: the tolerance level achieved by the solver cvx_slvitr: the number of iterations taken by the solver cvx_precision: modify the tolerances of the solver 9
System Model for Demo Relay-1 Destination-1 FAP Macrocell network Destination-2 Relay-2 Macrocell user 10
Thank you 11
Recommend
More recommend