Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Julia package for disciplined convex programming

License

NotificationsYou must be signed in to change notification settings

jump-dev/Convex.jl

Repository files navigation

CICoverage

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.

Getting help

For usage questions, please contact us viaDiscourse.

If you have a reproducible example of a bug, please open aGitHub issue.

Installation

Install Convex using the Julia package manager:

import PkgPkg.add("Convex")

Quick Example

# 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

Using with JuMP

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)

More Examples

A number of examples can be foundhere.Thebasic usage notebookgives a simple tutorial on problems that can be solved using Convex.jl.

Citing this package

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",}

[8]ページ先頭

©2009-2025 Movatter.jp