cvxpy

I am getting the following error cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically: The objective is not DCP

I am getting the following error cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically: The objective is not DCP Question: I have been working in python trying to create a simple optimization utilizing CVXPY. I get the error: cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically: The objective is not DCP. Its following subexpressions are …

Total answers: 1

Look-up based objective function in Cvxpy

Look-up based objective function in Cvxpy Question: I’d like to define an objective function based on a lookup table. As an example, we have an integer programming problem (binary) where we can pick one or more actions from a set of actions. Our cvxpy.Variable is: element_vars = [1, 0, 0, 1] (p.s. element_vars is a …

Total answers: 1

How to properly install qpsolvers for Python on Windows?

How to properly install qpsolvers for Python on Windows? Question: I am trying to install qpsolvers using pip. The installation goes without errors, and the module imports properly afterwards. However, qpsolvers has no available solvers for it to use : import qpsolvers print(qpsolvers.available_solvers) returns []. Of course, trying to do anything results in an error: …

Total answers: 3

How to Access CVXPY Variables/Parameters After Declaration

How to Access CVXPY Variables/Parameters After Declaration Question: I’d like to standardize a few cvxpy problems and use them in many places in my codebase. Here is a cleaned example: from cvxpy import Variable, Parameter, Problem, Minimize def problem_builder(n, …) var = Variable(n) param = Parameter(n) costs = #Some complex convex function of var and …

Total answers: 2

Python constrained non-linear optimization

Python constrained non-linear optimization Question: What’s the recommended package for constrained non-linear optimization in python ? The specific problem I’m trying to solve is this: I have an unknown X (Nx1), I have M (Nx1) u vectors and M (NxN) s matrices. max [5th percentile of (ui_T*X), i in 1 to M] st 0<=X<=1 and …

Total answers: 4