# Optimization (Mathematical)

**URL:** https://discourse.julialang.org/c/domain/opt/13.md?page=103

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 104

---

## [Determining the sign of a function over a given interval](https://discourse.julialang.org/t/determining-the-sign-of-a-function-over-a-given-interval/33231)

<div class="topic-metadata">

**Author:** [@ArjunNarayanan](https://discourse.julialang.org/u/ArjunNarayanan)\
**Replies:** 15\
**Last updated:** [February 15, 2020, 1:01am UTC](https://discourse.julialang.org/t/determining-the-sign-of-a-function-over-a-given-interval/33231 "2020-02-15T01:01:25Z")

</div>

I am interested in determining the bounds of a function f(x) over a given interval int. Specifically, I want to determine if f is uniformly positive/negative over int or contains at least one root. f is continuous and fi…

---

## [JuMP vs OpenMDAO](https://discourse.julialang.org/t/jump-vs-openmdao/34602)

<div class="topic-metadata">

**Author:** [@josemaria](https://discourse.julialang.org/u/josemaria)\
**Replies:** 1\
**Last updated:** [February 14, 2020, 4:51am UTC](https://discourse.julialang.org/t/jump-vs-openmdao/34602 "2020-02-14T04:51:27Z")

</div>

Does any of you have experience with both? How do they compare?

---

## [Gradient-based methods are not moving some parameters](https://discourse.julialang.org/t/gradient-based-methods-are-not-moving-some-parameters/34549)

<div class="topic-metadata">

**Author:** [@cosmia](https://discourse.julialang.org/u/cosmia)\
**Replies:** 3\
**Last updated:** [February 13, 2020, 4:16pm UTC](https://discourse.julialang.org/t/gradient-based-methods-are-not-moving-some-parameters/34549 "2020-02-13T16:16:34Z")

</div>

Hi all, I have a maximum likelihood estimator in which I need to integrate using a mixture of two normal distributions with zero mean. Without getting into much details, this entails estimating 3 parameters of the distri…

---

## [MethodError: no method matching Gurobi.Env(::Ptr{Nothing})](https://discourse.julialang.org/t/methoderror-no-method-matching-gurobi-env-ptr-nothing/34555)

<div class="topic-metadata">

**Author:** [@Ken\_Lin](https://discourse.julialang.org/u/Ken_Lin)\
**Replies:** 1\
**Last updated:** [February 13, 2020, 8:37am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-gurobi-env-ptr-nothing/34555 "2020-02-13T08:37:08Z")

</div>

Hello, I tried setting the Gurobi parameter “NonConvex” to 2 and I got the following error: “MethodError: no method matching Gurobi.Env(::Ptr{Nothing})”. My Julia Gurobi version is v0.7.5 and I am using Julia 1.3.1. I g…

---

## [Solving large(?) problem with Convex.jl and SCS](https://discourse.julialang.org/t/solving-large-problem-with-convex-jl-and-scs/30159)

<div class="topic-metadata">

**Author:** [@riccardomurri](https://discourse.julialang.org/u/riccardomurri)\
**Replies:** 13\
**Last updated:** [February 13, 2020, 6:37am UTC](https://discourse.julialang.org/t/solving-large-problem-with-convex-jl-and-scs/30159 "2020-02-13T06:37:33Z")

</div>

Hello! I am trying to port some MATLAB code (which uses YALMIP to call into SCS) over to Julia (using Convex.jl and SCS.jl for the purpose). The code builds sparse matrices A, C, D, sparse vector b and tries to solve…

---

## [Defining parameters in CPLEX](https://discourse.julialang.org/t/defining-parameters-in-cplex/34476)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 3\
**Last updated:** [February 11, 2020, 6:51pm UTC](https://discourse.julialang.org/t/defining-parameters-in-cplex/34476 "2020-02-11T18:51:42Z")

</div>

Hello dears users, I want to define the limit of CPU time, gap etc for CPLEX in a given integer problem. In JuMP version v0.19 I was used to define: model=Model(with\_optimizer(CPLEX.Optimizer,CPX\_PARAM\_TILIM=10800,CPX\_…

---

## [Obtaining Gap in integer programming](https://discourse.julialang.org/t/obtaining-gap-in-integer-programming/34377)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 9\
**Last updated:** [February 11, 2020, 2:58pm UTC](https://discourse.julialang.org/t/obtaining-gap-in-integer-programming/34377 "2020-02-11T14:58:30Z")

</div>

Hello dear, I have an interest to obtain the relative Gap in a optimization integer problem. I have consulted Reference · MathOptInterface and when I give the command RelativeGap(), nothing happens. The CPLEX and Juli…

---

## [Linear programming with Jump](https://discourse.julialang.org/t/linear-programming-with-jump/34192)

<div class="topic-metadata">

**Author:** [@bandaya](https://discourse.julialang.org/u/bandaya)\
**Replies:** 8\
**Last updated:** [February 10, 2020, 10:10pm UTC](https://discourse.julialang.org/t/linear-programming-with-jump/34192 "2020-02-10T22:10:50Z")

</div>

I am trying to write a linear programming problem problem in JuMP but I am getting error messages. I have given my code below, and I believe the issue is in definition of the constraint. Please can someone help to fix t…

---

## [Problems in obtaing of the Relative Gap](https://discourse.julialang.org/t/problems-in-obtaing-of-the-relative-gap/34433)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 1\
**Last updated:** [February 10, 2020, 9:47pm UTC](https://discourse.julialang.org/t/problems-in-obtaing-of-the-relative-gap/34433 "2020-02-10T21:47:14Z")

</div>

I have the following simple problem: using JuMP using CPLEX m = Model(with\_optimizer(CPLEX.Optimizer)) c = \[ 1; 2; 5\] A = \[-1 1 3; 1 3 -7\] b = \[-5; 10\] @variable(m, x\[1:3\] \>= 0) @objective(m, Max, sum( c\[i\]\*x…

---

## [Lazyconstraint not defined using GLPK solver callbacks](https://discourse.julialang.org/t/lazyconstraint-not-defined-using-glpk-solver-callbacks/34012)

<div class="topic-metadata">

**Author:** [@Espenol](https://discourse.julialang.org/u/Espenol)\
**Replies:** 4\
**Last updated:** [February 10, 2020, 1:51pm UTC](https://discourse.julialang.org/t/lazyconstraint-not-defined-using-glpk-solver-callbacks/34012 "2020-02-10T13:51:22Z")

</div>

Hello! Sorry about the newb question, but I have an issue setting lazy constraint. I follow the example here but don’t have access to licensed solvers so I use the GLPK solver instead of the Gurobi solver by applying th…

---

## [Calling Mosek on Convex.jl](https://discourse.julialang.org/t/calling-mosek-on-convex-jl/34378)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 3\
**Last updated:** [February 9, 2020, 4:09pm UTC](https://discourse.julialang.org/t/calling-mosek-on-convex-jl/34378 "2020-02-09T16:09:09Z")

</div>

I get the following error when trying to solve an SDP problem with Mosek using Convex, Mosek ... (problem formulation) solve!(problem, MosekSolver()) ERROR: UndefVarError: MosekSolver not defined

---

## [How to make Optim's optimize work for scalars](https://discourse.julialang.org/t/how-to-make-optims-optimize-work-for-scalars/34343)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 3\
**Last updated:** [February 8, 2020, 1:16pm UTC](https://discourse.julialang.org/t/how-to-make-optims-optimize-work-for-scalars/34343 "2020-02-08T13:16:30Z")

</div>

In the interest of user-friendliness, would anyone know a way to overload ‘optimize’ to work conveniently for scalar input without crashing? \[please note I am not asking for opinions as to how good/bad an idea it would …

---

## [JuMP: Hermitian matrix variable and complex numbers in model](https://discourse.julialang.org/t/jump-hermitian-matrix-variable-and-complex-numbers-in-model/34230)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 2\
**Last updated:** [February 6, 2020, 4:01pm UTC](https://discourse.julialang.org/t/jump-hermitian-matrix-variable-and-complex-numbers-in-model/34230 "2020-02-06T16:01:56Z")

</div>

I’ve been playing around with JuMP and trying to develop on my own OPF models and I’ve had some difficulty since JuMP doesn’t support complex numbers. Specially the SDP relaxation of the OPF has been tricky since I don’t…

---

## [Error installing Pajarito solver](https://discourse.julialang.org/t/error-installing-pajarito-solver/34223)

<div class="topic-metadata">

**Author:** [@biswajit216](https://discourse.julialang.org/u/biswajit216)\
**Replies:** 1\
**Last updated:** [February 5, 2020, 10:25pm UTC](https://discourse.julialang.org/t/error-installing-pajarito-solver/34223 "2020-02-05T22:25:36Z")

</div>

Hi, I was trying to add Pajarito package to my Julia but I was getting this error. My JuMP version is 0.20.1 pkg\> add Pajarito Resolving package versions… ERROR: Unsatisfiable requirements detected for package JuMP \[4…

---

## [The error of using GLPKMathProgInterface pkg](https://discourse.julialang.org/t/the-error-of-using-glpkmathproginterface-pkg/34142)

<div class="topic-metadata">

**Author:** [@mahsap58](https://discourse.julialang.org/u/mahsap58)\
**Replies:** 3\
**Last updated:** [February 5, 2020, 10:21pm UTC](https://discourse.julialang.org/t/the-error-of-using-glpkmathproginterface-pkg/34142 "2020-02-05T22:21:36Z")

</div>

i have faced to this error in using GLPKMathProgInterface pkg please help me to fix that. Failed to precompile GLPK \[60bf3e95-4087-53dc-ae20-288a0d20c6a6\]

---

## [How to check if a solver supports SOS2 constraints](https://discourse.julialang.org/t/how-to-check-if-a-solver-supports-sos2-constraints/34186)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 3\
**Last updated:** [February 5, 2020, 2:22pm UTC](https://discourse.julialang.org/t/how-to-check-if-a-solver-supports-sos2-constraints/34186 "2020-02-05T14:22:59Z")

</div>

I have a piece of code that adds SOS2 constraints to a model. If the solver supports it, I would like to use its interface, if not I would assemble the constraints myself. Is there a way to check if an optimizer suppor…

---

## [Warning for adding constraints: zero or small (\< 1e-13) coefficients, ignored](https://discourse.julialang.org/t/warning-for-adding-constraints-zero-or-small-1e-13-coefficients-ignored/34137)

<div class="topic-metadata">

**Author:** [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)\
**Replies:** 8\
**Last updated:** [February 4, 2020, 5:32pm UTC](https://discourse.julialang.org/t/warning-for-adding-constraints-zero-or-small-1e-13-coefficients-ignored/34137 "2020-02-04T17:32:31Z")

</div>

I asked this question and it seems no one wants to help me: I am just using Gurobi 9.0 which solves non convex problems as well. I get this error: Warning for adding constraints: zero or small (\< 1e-13) coefficients, ig…

---

## [JuMP precompiling error on an AWS EC2 Ubuntu server instance](https://discourse.julialang.org/t/jump-precompiling-error-on-an-aws-ec2-ubuntu-server-instance/33154)

<div class="topic-metadata">

**Author:** [@newstatement](https://discourse.julialang.org/u/newstatement)\
**Replies:** 15\
**Last updated:** [February 4, 2020, 11:12am UTC](https://discourse.julialang.org/t/jump-precompiling-error-on-an-aws-ec2-ubuntu-server-instance/33154 "2020-02-04T11:12:35Z")

</div>

I am trying to use an AWS EC2 instance (t2.micro with Ubuntu Server 18.04) to run an optimization model designed in JuMP. I’m using Julia v1.3.1 and when I try to load JuMP package a fail occurs at precompiling. Some one…

---

## [How to minimize a function of single integer variable?](https://discourse.julialang.org/t/how-to-minimize-a-function-of-single-integer-variable/34115)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 2\
**Last updated:** [February 3, 2020, 4:08pm UTC](https://discourse.julialang.org/t/how-to-minimize-a-function-of-single-integer-variable/34115 "2020-02-03T16:08:22Z")

</div>

Let’s suppose I have a function f(m): \\mathbb{N}\\rightarrow\\mathbb{R}. What method should I use to minimize it? The function is supposed to be smooth if we continue it from \\mathbb{N} to \[1,+\\infty). Also, it’s contin…

---

## [Jump code errors](https://discourse.julialang.org/t/jump-code-errors/34090)

<div class="topic-metadata">

**Author:** [@bandaya](https://discourse.julialang.org/u/bandaya)\
**Replies:** 2\
**Last updated:** [February 2, 2020, 9:23pm UTC](https://discourse.julialang.org/t/jump-code-errors/34090 "2020-02-02T21:23:52Z")

</div>

Hi, I am new to Julia and I am having problems in running simple examples of Jump. I have given links to two examples below: Manual · MathOptInterface https://nbviewer.jupyter.org/github/JuliaOpt/juliaopt-notebooks/bl…

---

## [How to use LBFGS to minimise the cost function for regularised logistic regression](https://discourse.julialang.org/t/how-to-use-lbfgs-to-minimise-the-cost-function-for-regularised-logistic-regression/34058)

<div class="topic-metadata">

**Author:** [@PyDataBlog](https://discourse.julialang.org/u/PyDataBlog)\
**Replies:** 7\
**Last updated:** [February 2, 2020, 11:12am UTC](https://discourse.julialang.org/t/how-to-use-lbfgs-to-minimise-the-cost-function-for-regularised-logistic-regression/34058 "2020-02-02T11:12:33Z")

</div>

I am currently stuck trying to utilize the Optim package in Julia in an attempt to minimize a cost function. The cost function is the cost function for an L2 regularised logistic regression. It is constructed as follows; …

---

## [\[JuMP\] Use ConstraintRef to add additional constraint](https://discourse.julialang.org/t/jump-use-constraintref-to-add-additional-constraint/34046)

<div class="topic-metadata">

**Author:** [@acauligi](https://discourse.julialang.org/u/acauligi)\
**Replies:** 1\
**Last updated:** [January 31, 2020, 8:09pm UTC](https://discourse.julialang.org/t/jump-use-constraintref-to-add-additional-constraint/34046 "2020-01-31T20:09:07Z")

</div>

Hi, I have an affine inequality constraint in a JuMP model (that was constructed off-line) and would like to add a new constraint using the expression from the ConstraintRef associated with the affine constraint. e.g.: …

---

## [\[Convex.jl\] Suppress warnings when printing problem tree](https://discourse.julialang.org/t/convex-jl-suppress-warnings-when-printing-problem-tree/34029)

<div class="topic-metadata">

**Author:** [@4aHxKzD](https://discourse.julialang.org/u/4aHxKzD)\
**Replies:** 2\
**Last updated:** [January 31, 2020, 3:22pm UTC](https://discourse.julialang.org/t/convex-jl-suppress-warnings-when-printing-problem-tree/34029 "2020-01-31T15:22:48Z")

</div>

Is there a way to suppress warnings such as Warning: Expression not DCP compliant. when printing the problem tree?

---

## [Use Sign Function in JuMP NLconstraint](https://discourse.julialang.org/t/use-sign-function-in-jump-nlconstraint/33973)

<div class="topic-metadata">

**Author:** [@cupcc](https://discourse.julialang.org/u/cupcc)\
**Replies:** 2\
**Last updated:** [January 30, 2020, 2:15pm UTC](https://discourse.julialang.org/t/use-sign-function-in-jump-nlconstraint/33973 "2020-01-30T14:15:06Z")

</div>

I’m currently trying to solve a problem in JuMP that has a nonlinear constraint that has the form y= (other expressions) + constant \* sign(x). This throws an error saying sign is not a recognized function. How do I fix …

---

## [Current status with callbacks](https://discourse.julialang.org/t/current-status-with-callbacks/29942)

<div class="topic-metadata">

**Author:** [@Lefteris\_Manousakis](https://discourse.julialang.org/u/Lefteris_Manousakis)\
**Replies:** 6\
**Last updated:** [January 27, 2020, 3:52pm UTC](https://discourse.julialang.org/t/current-status-with-callbacks/29942 "2020-01-27T15:52:00Z")

</div>

Hi everyone! I am using JuMP 0.19 and I tried to set up an information callback to retrieve the relaxation value of the root node. After a lot of searching I think I got the picture with the non solver independent callb…

---

## [The second edition of my book "Julia Programming for Operations Research"](https://discourse.julialang.org/t/the-second-edition-of-my-book-julia-programming-for-operations-research/21262)

<div class="topic-metadata">

**Author:** [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Replies:** 8\
**Last updated:** [January 26, 2020, 1:07am UTC](https://discourse.julialang.org/t/the-second-edition-of-my-book-julia-programming-for-operations-research/21262 "2020-01-26T01:07:55Z")

</div>

Dear friends, Long waited JuMP v0.19 is now released and I updated my book accordingly. Here is the second edition of my book “Julia Programming for Operations Research” available online. Ten free copies for discourse …

---

## [Gentler transformation from real to positive](https://discourse.julialang.org/t/gentler-transformation-from-real-to-positive/33695)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 15\
**Last updated:** [January 23, 2020, 7:54pm UTC](https://discourse.julialang.org/t/gentler-transformation-from-real-to-positive/33695 "2020-01-23T19:54:59Z")

</div>

I am solving an equilibrium of an economic model for prices p \> 0. I need to do this robustly for “wacky” parameter values when I am fitting the model to the data in an outer loop. I have coded up a market clearing resi…

---

## [MINLP optimization with user defined objective function](https://discourse.julialang.org/t/minlp-optimization-with-user-defined-objective-function/33627)

<div class="topic-metadata">

**Author:** [@martina](https://discourse.julialang.org/u/martina)\
**Replies:** 3\
**Last updated:** [January 21, 2020, 4:45pm UTC](https://discourse.julialang.org/t/minlp-optimization-with-user-defined-objective-function/33627 "2020-01-21T16:45:37Z")

</div>

Hello, I’m still very new with Julia, and I’m having troubles with my MINLP optimization problem that I used to solve with MATLAB. I can’t find a way to provide an user-defined objective function to the @NLobjective ma…

---

## [Nested index for a collection of JuMP variables?](https://discourse.julialang.org/t/nested-index-for-a-collection-of-jump-variables/33504)

<div class="topic-metadata">

**Author:** [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Replies:** 2\
**Last updated:** [January 21, 2020, 4:40pm UTC](https://discourse.julialang.org/t/nested-index-for-a-collection-of-jump-variables/33504 "2020-01-21T16:40:09Z")

</div>

I would like to build a two index JuMP variable that can be accessed like x\[i\]\[j\] rather than x\[i,j\] is there a way to acomplish this with the @variable macro?

---

## [Restoration phase failed](https://discourse.julialang.org/t/restoration-phase-failed/33590)

<div class="topic-metadata">

**Author:** [@GiuliaM](https://discourse.julialang.org/u/GiuliaM)\
**Replies:** 1\
**Last updated:** [January 20, 2020, 3:27pm UTC](https://discourse.julialang.org/t/restoration-phase-failed/33590 "2020-01-20T15:27:48Z")

</div>

Hi everyone! I try to optimize a nonlinear problem with Ipopt (v0.6.1) using JuMP (v0.20.1). When the algorithm terminates, the output message is: “EXIT: Restoration Failed! Restoration phase converged to a feasible …

[Previous page](https://discourse.julialang.org/c/domain/opt/13.md?page=102)

[Next page](https://discourse.julialang.org/c/domain/opt/13.md?page=104)
