Skip to main content

Questions tagged [cvxpy]

CVXPY is a Python-embedded modeling language for convex optimization problems.

2 votes
1 answer
42 views

Penalize absolute value while keeping the problem DPP (CVXPY)

I am trying to implement the objective function max a . x + c . abs(x - g). where all elements of c are non-positive, ...
GabCaz's user avatar
  • 41
2 votes
1 answer
126 views

How to model the constraints of min and max in cvxpy

I have a continuous variable $x_{ij}\in[0,1]$ and I need to write the following constraint: $$M_i-m_i+1\leq C_i$$ where $M_i=\max\{j: x_{ij}>0\}$ and $m_i=\min\{j: x_{ij}>0\}$
zdm's user avatar
  • 403
1 vote
1 answer
112 views

Convex approximation of a constraint

I have a constraint given as $ \left|x_n+\beta x_{n+ 1}\right|-\varepsilon_{ky}\left|x_{n}\right|\leq0\hspace{1em}\forall n=1,2...,N $ I need to convert this into a convex form to implement in CVX. $...
Muhammad's user avatar
0 votes
1 answer
101 views

Convex approximation of an expression with fraction for CVX

I have the optimization problem $$\underset{\mathbf{x} \in \Bbb C^N}{\max} \left| \frac{\mathbf{x}a-b}{\mathbf{x}c+b} \right|^2$$ where $a$, $b$ and $c$ are some scalars. I want to solve this ...
Muhammad's user avatar
1 vote
0 answers
298 views

MOSEK via fusion vs API vs CVXPY

In Python, I would like to solve a collection of problems, that are all solvable via MOSEK's conic optimization solvers (ExpCone, SOCP, etc.) I have tried CVXPY. I get very robust and reliable results,...
independentvariable's user avatar
0 votes
1 answer
278 views

Convex approximation of an expression

I am trying to transform an expression given by $$ \operatorname{trace} \left( {\bf{X} } \right) + \left( \sum_{n=1}^N \mathcal{R}(x_n) \right) $$ into convex from where $\mathbf{x}$ is complex in ...
Muhammad's user avatar
5 votes
0 answers
553 views

How to write this objective in CVXPY for quasiconvex programming?

I have the following objective that I want to maximize: \begin{equation} \max_{U_T\in \mathbb{R}, x\in\mathbb{R}^T} J_\alpha(U_T) = \frac{\alpha}{\alpha-1}\log\left(\frac{\cosh(U_T)}{\cosh(\alpha U_T)^...
Uomond's user avatar
  • 86
2 votes
1 answer
247 views

Quadratic optimisation with $\ell_1$ constraints with CVXPY

Crossposted on Mathematics SE I seek to minimize a convex quadratic objective subject to linear and $\ell_1$-based equality constraints. When I turn to CVXPY, an error is raised indicating that it ...
jam123's user avatar
  • 21
1 vote
0 answers
88 views

Handling Variable Division in CVXPY for Calculating Annualized Rate of Change

I am working with a dataset that contains multiple entries for different IDs across various years. Some IDs might have a gap of years between entries. My goal is to solve an optimization problem using ...
user760900's user avatar
0 votes
0 answers
139 views

CVXPY stuck in Compilation step during solving linear program

I'm trying to solve a linear program with 869532 variables and 8869 constraints in CVXPY. The CVXPY gets stuck in the Compilation session right before passing the problem to the solver. Here's the ...
Mohammad Namakshenas's user avatar
0 votes
0 answers
68 views

How do I implement this convex problem in CVXPY?

I am looking to implement the following optimization problem in CVXPY. $$ \max _{x_t} x_t' \mu - \frac{\gamma}{2} x'_t \Sigma x_t - x'_t\Lambda \Delta x_t $$ where $\Delta x_t := x_t - x_{t-1}$ and $\...
Lydia's user avatar
  • 1
0 votes
1 answer
113 views

Simulating an integer quadratic knapsack problem

I am trying to simulate the following quadratic integer program using $\textsf{cvxpy}$: $$ \begin{array}{ll} \underset {x_1, \dots, x_K} {\text{minimize}} & \displaystyle\sum\limits_{i=1}^{K}\frac{...
UserX's user avatar
  • 103
0 votes
1 answer
155 views

Optimal blending of gasoline via LP

...
N_ote's user avatar
  • 11
2 votes
3 answers
287 views

How to represent the objective function of the Weapon Target Assignment problem in CVXPY?

I am trying to use CVXPY to analyse a problem and the objective function for this problem involves calculating a product and a sum as per the problem description below (taken from a draft paper I am ...
BRavos's user avatar
  • 29
2 votes
0 answers
77 views

How to rewrite a constraint with sum of convex and concave components to satisfy DCP rule?

suppose that decision variable is X with N dimensions, and one type of the constraint is ...
Allen Zhang's user avatar

15 30 50 per page