- Notifications
You must be signed in to change notification settings - Fork122
A Julia package for disciplined convex programming
License
jump-dev/Convex.jl
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Convex.jl is aJulia package forDisciplined Convex Programming (DCP).
Convex.jl can solve linear programs, mixed-integer linear programs, andDCP-compliant convex programs using a variety of solvers, includingMosek,Gurobi,ECOS,SCS, andGLPK, throughMathOptInterface.
Convex.jl also supports optimization with complex variables and coefficients.
For usage questions, please contact us viaDiscourse.
If you have a reproducible example of a bug, please open aGitHub issue.
Install Convex using the Julia package manager:
import PkgPkg.add("Convex")
# Let us first make the Convex.jl module availableusing Convex, SCS# Generate random problem datam=4; n=5A=randn(m, n); b=randn(m,1)# Create a (column vector) variable of size n x 1.x=Variable(n)# The problem is to minimize ||Ax - b||^2 subject to 0 <= x <= 1# This can be done by: minimize(objective, constraints)problem=minimize(sumsquares(A* x- b), [x>=0, x<=1])# Solve the problem by calling solve!solve!(problem, SCS.Optimizer)# Check the status of the problemproblem.status# Get the optimal valueproblem.optval
Convex.jl contains an experimental JuMP solver. This solver reformulates anonlinear JuMP model into a conic program using DCP. Note that it currentlysupports only a limited subset of scalar nonlinear programs, such as thoseinvolvinglog andexp.
julia>using JuMP, Convex, Clarabeljulia> model=Model(()-> Convex.Optimizer(Clarabel.Optimizer));julia>set_silent(model)julia>@variable(model, x>=1);julia>@variable(model, t);julia>@constraint(model, t>=exp(x))t-exp(x)≥0julia>@objective(model, Min, t);julia>optimize!(model)julia>value(x),value(t)(0.9999999919393833,2.7182818073461403)
A number of examples can be foundhere.Thebasic usage notebookgives a simple tutorial on problems that can be solved using Convex.jl.
If you use Convex.jl for published work, we encourage you to cite the softwareusing the following BibTeX citation:
@article{convexjl,title ={Convex Optimization in {J}ulia},author ={Udell, Madeleine and Mohan, Karanveer and Zeng, David and Hong, Jenny and Diamond, Steven and Boyd, Stephen},year ={2014},journal ={SC14 Workshop on High Performance Technical Computing in Dynamic Languages},archivePrefix ="arXiv",eprint ={1410.4821},primaryClass ="math-oc",}
About
A Julia package for disciplined convex programming
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.