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
0
votes
0 answers

Double Summation of Matrices as Constraints in Convex Optimzation in CVX

I want to implement the following optimization problem from the following paper Randomized Gossip Algorithms, Page 10 Eq 53 The screenshot of the optimization problem. 1- In this problem, W, P, and P_{ij} are n-by-n matrices. I would appreciate if…
0
votes
0 answers

CVXR in R: What happens when no solution is found within the time limit?

In CVXR, it is currently only possible to set a time limit when using the GLPK solver. With CPLEX, for instance it is not yet possible. Are there plans to allow other solver options? Anyway, the current possible solution status are "optimal",…
Chicoscience
  • 975
  • 1
  • 8
  • 18
0
votes
1 answer

Relaxation of bilinear term in objective function - using CVXR and McCormick envelopes

I have an objective function with some constraints which I want to minimize. I want to use the R package CVXR and the McCormick envelopes. Let's check the code: library(CVXR) # if necessary x <- Variable(1) y <- Variable(1) w <-…
tueftla
  • 369
  • 1
  • 3
  • 16
0
votes
2 answers

Problems with DCP rules in CVXR

I am using the CVXR modelling package to solve a convex optimization problem. I know for sure that the problem is convex and that it follows the DCP rules, but if I check the DCP rules using CVXR it returns False. However, if I take the exact same…
0
votes
1 answer

Iterating of elements in array

I am trying to write a code of CPLEX OPL on an example of (from control systems) a typical MPC (Model Predictive Control) problem. As described, here: With optimization variables: With following parameters: I have tried to write it but I am…
Luqman Saleem
  • 191
  • 10
0
votes
1 answer

why is Convex function <= Concave function a valid cvx constraint?

I am studying using CVX on MATLAB and encountering this problem that why is the following constraint: Convex function <= Concave function a valid CVX constraint?
Moer
  • 3
  • 1
0
votes
0 answers

how to convert or transform a norm square equation to a concave form?

so the objective function is similar to |h x theta x g|^2,where h is a nx1 complex row vector, theta is n x n complex matrix, g is a n x 1 column vector. If I want to maximize this, in cvx, maximize a convex function is not allowed. how can I…
0
votes
0 answers

Is there any MATLAB function similar to semidefinite() from Python cvxpy package?

import cvxpy from cvxpy import semidefinite semidefinite(12,'S') gives: Expression(AFFINE, UNKNOWN, (12, 12)) Is there any similar function in MATLAB (2021a)?
0
votes
0 answers

How to install gurobi for cvxpy?

I think the official instructions are here? https://support.gurobi.com/hc/en-us/articles/360044290292-How-do-I-install-Gurobi-for-Python- However running C:\Program Files (x86)\win64>python3.8 setup.py install gives running install running…
Hao S
  • 295
  • 1
  • 2
  • 15
0
votes
1 answer

Compressed sensing - Why does my convex solver fail when I give it *more* samples?

I'm trying to implement compressed sensing of an image using the cvx library for MATLAB. This is the same library used by Steve Brunton in his example here. My test image is Lenna. Here's my MATLAB script: close all; clear; clc % read in an…
Iotatron
  • 65
  • 7
0
votes
0 answers

Plot Optimal Decision variable and Corresponding Residuals

I have this matlab cvx setup for my problem to estimate least squares solution n = 100; A = randn(14,n); b = randn(14,1); cvx_begin variable x(n) minimize( norm( A*x-b ) cvx_end echo off As Cvx shows the optimal value after running i do not…
0
votes
1 answer

MATLAB Gurobi [in cvx] solver fails

When I was trying to solve a very simple bin packing problem, the Gurobi solver just won't work. I do try some very simple optimization problem with 1 inequality constraint with Gurobi and it works. But it always return NA for little complicated…
Ray Jio
  • 21
  • 2
0
votes
1 answer

Having troubles with CVX's DCP for R

I am facing the following challenge for which I don't seem to find a solution: Basically, I want to program some code for StoNED - Stochastic non-smooth envelopment of data. I started with this: # dim(G) is 35x15 # dim(X) is 5x15 # dim(y) is 5x1 #…
0
votes
1 answer

CVXR: Problem with solve() - Error in as.vector(data): no method for coercing this s4 class to a vector

I'm trying to minimize this function: \min_{\mu} \sum_{t=T}^T \| y_t - \mu_t \|2 + \lambda \sum{t=1}^{T-1} \|mu_{t+1}-\mu_{t}\|_2 where: y and mu are p*T matraxis. Everything compiles well until I use the solve() function. Here is what I coded…
J_GreNyu
  • 5
  • 3
0
votes
2 answers

CVXR: Error in as.vector(data): no method for coercing this S4 class to a vector

I'm trying to minimize the following problem with R: \min \sum_{t=1}^T \| y_t - \delta \|_2 where y_t for t = 1,...,T and \delta are vectors This is what I tried: deltaHat <- Variable(p) objective <- sum(col.norm(y - matrix(deltaHat, ncol=obs,…
J_GreNyu
  • 5
  • 3