Questions tagged [cvx]

CVX is a Matlab-based modeling system for convex optimization. CVX turns Matlab into a modeling language, allowing constraints and objectives to be specified using standard Matlab expression syntax.

CVX is a Matlab-based modeling system for convex optimization. CVX turns Matlab into a modeling language, allowing constraints and objectives to be specified using standard Matlab expression syntax.

99 questions
1
vote
1 answer

Multiply two variables in an objective function using cvxr

I want to minimize the following objective function with some constraints And another user (I think it was G. Grothendieck) suggested to use the CVXR package of R. So I followed the instructions on A Gentle Introduction to CVXR to make my…
tueftla
  • 369
  • 1
  • 3
  • 16
1
vote
1 answer

Absolute value function not recognized as Disciplined Convex Program (CVXPY)

I am trying to run the following optimization using CVXPY: import cvxpy as cp import numpy as np weights_vec = cp.Variable(10) er_vec = cp.Parameter(10, value=np.random.randn(10)) prev_h_vec = cp.Parameter(10, value=np.ones(10)) tcost_vec =…
1
vote
0 answers

Issue when installing CVX in MATLAB 2021a with cvx_setup on MacOS, cvx/sedumi/.travis.yml is missing

I've just downloaded CVX 2.2 on my MacOS (10.14.5), unzipped CVX, started MATLAB 2021a, changed the directory to the CVX unpacked folder and ran the cvx_setup file for the installation. Installation seems successful, but I get this warning…
Barbab
  • 266
  • 1
  • 8
1
vote
0 answers

How to write inverse in CVX (Matlab)?

My attempt of cvx (Matlab) for n = 2: A = diag([3 2]); cvx_begin variable X(2,2) symmetric minimize (trace(A*inv(X)*A*X')) subject to X>0; cvx_end I have the following error: From my understanding, inverse cannot be used in cvx, is there any…
Lee
  • 169
  • 1
  • 9
1
vote
0 answers

How can I solve this optimization problem using MATLAB CVX?

I used the following code to solve this problem %System parameters: N = 2; K = 8; M = 4; C_l=4; H = [0.1185 0.2811; 0.3550 0.8224; 0.3260 0.9644; 0.5333 0.6083; 0.6871 0.2298; 0.2594 0.8361; 0.1309 0.2454; 0.4715 0.2111]; %(K,N) matrix A = [-1 1; 1…
1
vote
2 answers

“mexschurfun.mexmaci64” cannot be opened because the developer cannot be verified

I am trying to use CVX in MATLAB, but when I run a my code, I get this error: “mexschurfun.mexmaci64” cannot be opened because the developer cannot be verified. I have already tried changing my Mac security to "Allow anyway" for the…
Atd
  • 31
  • 4
1
vote
1 answer

mosek parameter settings in cvxpy

I am trying to set "mosek_param" settings, but, am getting errors. For instance, for the following case MSK_IPAR_INTPNT_SOLVE_FORM Controls whether the primal or the dual problem is solved. Default: "FREE" Accepted: "FREE", "PRIMAL",…
1
vote
0 answers

Sum inside cvx objective function

I have the following objective function: I am not sure how to write it in cvx. This is my try: cvx_begin sdp variable Q(T,n,N) %variable X_0T*Q(:,:,N) symmetric obj = trace(X_0T*Q(:,:,N)); for j = 1:N-1 obj= obj + trace(X_0T*Q(:,:,j))) …
Betelgeuse
  • 682
  • 2
  • 8
  • 27
1
vote
0 answers

Strongly convex problem has UNBOUNDED status using CVX

I am trying to minimize a function of the following type: f(x)=LogSumExp(Ax)+b'*x+||x||^2 Using CVX in MATLAB, CVX outputs "Status: Unbounded Optimal value (cvx_optval): -Inf" This is not reasonable given the fact it is a strongly convex function.…
1
vote
1 answer

Usign Mosek for CVXR

I have already installed 3 times Mosek. It is working in python but CVXR (r package) function installed_solvers() is not able to find MOSEK. I'm working on a MACos Mojave. I installed Mosek via conda comand, got an academic license, create a…
Alejandro Andrade
  • 2,196
  • 21
  • 40
1
vote
1 answer

Howto: CVXPY Matrix Inequality Constraints

I am trying to formulate an optimization problem in the following way: My optimization variable x is a n*n matrix. x should be PSD. It should be in the range 0<=x<=I. Meaning, it would be in the range from the all zeros square matrix to n…
QuestionEverything
  • 4,809
  • 7
  • 42
  • 61
1
vote
1 answer

How do I resolve the “Inner matrix dimensions must agree” error?

This is my code in CVX: load('C') r=C(:,4); t=C(:,5); n = size(C,1); N = 100; for i=1:n eta(i,1) = randn()/2; end cvx_begin variable x(n,1) maximize r'*x - t'*x subject to ones(n,1)'*x == N x >= zeros(n,1) …
Kristada673
  • 3,512
  • 6
  • 39
  • 93
1
vote
0 answers

How to install CVX in Python, along with chompack in windows 64 bit?

Can anyone please give me the links to download the links to install CVX in Phyton, along with chompack? I tried several version but never able to install chompack. I get error message like "failed building wheel CVXOPT" while installing chompack.…
Creator
  • 139
  • 1
  • 3
  • 15
1
vote
0 answers

cvx return error with function definition not as script definition

I have a very odd error with cvx/matlab. I'd like to solve SDP problem to get dual variable. Here is my code. addpath() cvx_setup cvx_begin variable r(n); variable R(n,n) symmetric; dual variable alpha; dual variable…
Jaeyoon Yoo
  • 171
  • 1
  • 2
  • 9
1
vote
1 answer

Accuracy of CVX solvers

I have read in the CVX manual that CVX solvers can efficiency solve some optimization problems to an arbitrary accuracy. I do not understand what arbitrary accuracy means? What it depends on? How we can control it? Any ideas/hints on where to read…
Noor
  • 125
  • 2