cvxpy

How to manually set Initial Solution in CVXPY using CPLEX solver

痴心易碎 提交于 2021-02-11 15:44:00
问题 I am trying to solver the Unit Commitment problem (MIQP problem) by modelling the problem in CVXPY and using the CPLEX solver. I have been successful in getting everything to work with CVXPY using CPLEX. However, this was for a small system. Now I would like to do the same with a much larger system. Side Note: I have successfully solved the MIQP problem in MATLAB using CPLEX. For larger system in MATLAB, I have used an initial solution from a MILP formulation of the problem and limited the

DCP requirement violated when specifying constraing in cvxpy, perhaps need to rethink entire formulation of problem

余生颓废 提交于 2021-02-11 14:18:37
问题 This is a follow-up to an earlier specific question, but as I add more complexity to the problem formulation, I realize that I need to take a step back and consider whether cvxpy is the best tool for my problem. What I'm trying to solve: create the largest cluster of a category and company where the average values are above a particular threshold. The trick is that if we include particular categories for a company in the cluster, in order to add another company, that company also should have

Convex optimization problem does not follow DCP rules

时光总嘲笑我的痴心妄想 提交于 2021-02-10 19:55:51
问题 I am trying to solve the following optimization problem using cvxpy: x and delta_x are (1,N) row vectors. A is a (N,N) symmetric matrix and b is a scalar. I am trying to find a y, such that it minimizes the sum of squares of (y - delta_x) with the constraint (x+y).A.(x+y).T - b = 0. Below is my attempt to solve it. x = np.reshape(np.ravel(x_data.T), (1, -1)) delta_x = np.reshape(np.ravel(delta.T), (1, -1)) y = cp.Variable(delta_x.shape) objective = cp.Minimize(cp.sum_squares(y - delta_x))

Specifying complex constraints in cvxpy yields strict inequalities error

我的梦境 提交于 2021-01-29 08:11:30
问题 I am trying to recreate an integer linear optimization problem using cvxpy that I have outlined in Excel - . Note that this is a dummy example, the actual dataset will have thousands of variables. Please ignore the solution in cell K5 of the spreadsheet, as Excel Solver isn't able to provide integer solutions. Consider that the 9 variables are split into 3 buckets. Note my goal with constraints 1-3 is that either there are at least 2 out of 3 1's for a bucket of variables, or all of the

Initial Guess/Warm start in CVXPY: give a hint of the solution

血红的双手。 提交于 2020-06-22 12:54:53
问题 In this bit of code: import cvxpy as cvx # Examples: linear programming # Create two scalar optimization variables. x = cvx.Variable() y = cvx.Variable() # Create 4 constraints. constraints = [x >= 0, y >= 0, x + y >= 1, 2*x + y >= 1] # Form objective. obj = cvx.Minimize(x+y) # Form and solve problem. prob = cvx.Problem(obj, constraints) prob.solve(warm_start= True) # Returns the optimal value. print ("status:", prob.status) print ("optimal value", prob.value) print ("optimal var", x.value, y

Numeric issues during ellipsoid fitting using with SCS to perform SDPs?

我怕爱的太早我们不能终老 提交于 2020-06-16 17:46:38
问题 I've attempted to implement the Calafiore (2002) method of fitting ellipsoids to data using CVXPY as a wrapper to SCS to perform the semi-definite programming. When I run this implementation, I get decent agreement with the first ellipsoid of Section IVB (Fig 6a). However, I don't get numeric agreement with the second ellipsoid of that section (Fig 6b), although the results are visually close. Worse, when I try to fit a very well defined ellipse (the points below) I get an obviously poor fit

Numeric issues during ellipsoid fitting using with SCS to perform SDPs?

纵饮孤独 提交于 2020-06-16 17:46:10
问题 I've attempted to implement the Calafiore (2002) method of fitting ellipsoids to data using CVXPY as a wrapper to SCS to perform the semi-definite programming. When I run this implementation, I get decent agreement with the first ellipsoid of Section IVB (Fig 6a). However, I don't get numeric agreement with the second ellipsoid of that section (Fig 6b), although the results are visually close. Worse, when I try to fit a very well defined ellipse (the points below) I get an obviously poor fit

Unable to install cvxpy into virtualenv for AWS lambda

泪湿孤枕 提交于 2020-04-30 10:21:34
问题 I am trying to run the cvxpy package in an AWS lambda function. This package isn't in the SDK, so I've read that I'll have to compile the dependencies into a zip, and then upload the zip into the lambda function. I've done some research and tried out the links below, but when I try to pip install cvxpy I get error messages - I'm on a Windows box, but I know that AWS Lambda runs on Linux. Appreciate the help! http://i-systems.github.io/HSE545/machine%20learning%20all/cvxpy_install/CVXPY

Unable to install cvxpy into virtualenv for AWS lambda

做~自己de王妃 提交于 2020-04-30 10:21:21
问题 I am trying to run the cvxpy package in an AWS lambda function. This package isn't in the SDK, so I've read that I'll have to compile the dependencies into a zip, and then upload the zip into the lambda function. I've done some research and tried out the links below, but when I try to pip install cvxpy I get error messages - I'm on a Windows box, but I know that AWS Lambda runs on Linux. Appreciate the help! http://i-systems.github.io/HSE545/machine%20learning%20all/cvxpy_install/CVXPY