# Optimization (Mathematical)

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

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

**Page:** 103

---

## [Infeasibility](https://discourse.julialang.org/t/infeasibility/35456)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [March 3, 2020, 2:48pm UTC](https://discourse.julialang.org/t/infeasibility/35456 "2020-03-03T14:48:32Z")

</div>

Is there a way to get some more information about why a JuMP.Model is infeasible, like e.g. Gurobi has?

---

## [JuMP 0.20.1: Possible bug in CPLEX when using generic lazy callback](https://discourse.julialang.org/t/jump-0-20-1-possible-bug-in-cplex-when-using-generic-lazy-callback/35425)

<div class="topic-metadata">

**Author:** [@ryancorywright](https://discourse.julialang.org/u/ryancorywright)\
**Replies:** 1\
**Last updated:** [March 2, 2020, 7:29pm UTC](https://discourse.julialang.org/t/jump-0-20-1-possible-bug-in-cplex-when-using-generic-lazy-callback/35425 "2020-03-02T19:29:50Z")

</div>

Specs: JuMP version 0.20.1, MOI version 0.9.12, CPLEX version 12.10, CPLEX.jl version 0.6.3. When using JuMP and CPLEX to solve a problem via outer approximation (using a generic lazy callback), I’m getting the followin…

---

## [PowerModels in MAC OS](https://discourse.julialang.org/t/powermodels-in-mac-os/35384)

<div class="topic-metadata">

**Author:** [@faoh](https://discourse.julialang.org/u/faoh)\
**Replies:** 5\
**Last updated:** [March 2, 2020, 4:42pm UTC](https://discourse.julialang.org/t/powermodels-in-mac-os/35384 "2020-03-02T16:42:23Z")

</div>

When I try to use build\_model to see the optimization model, it shows ‘UndefVarError: build\_model not defined’. The code is pm = build\_model(“~/PowerModels.jl-master/test/data/matpower/case5\_tnep.m”, ACPPowerModel, Po…

---

## [@ode\_def macro leads to UndefRefError: access to undefined reference](https://discourse.julialang.org/t/ode-def-macro-leads-to-undefreferror-access-to-undefined-reference/35330)

<div class="topic-metadata">

**Author:** [@joergbuchwald](https://discourse.julialang.org/u/joergbuchwald)\
**Replies:** 7\
**Last updated:** [March 2, 2020, 12:55pm UTC](https://discourse.julialang.org/t/ode-def-macro-leads-to-undefreferror-access-to-undefined-reference/35330 "2020-03-02T12:55:39Z")

</div>

Hi, I tried to use the @ode\_def macro, but somehow got stuck in an UndefRefError: julia\> sir\_ode = @ode\_def SIRModel begin dS = -β\*S\*I dI = β\*S\*I-γ\*I dR = γ\*I end β γ ┌ Warni…

---

## [Help me with repeated index](https://discourse.julialang.org/t/help-me-with-repeated-index/35339)

<div class="topic-metadata">

**Author:** [@varun\_yaramasu](https://discourse.julialang.org/u/varun_yaramasu)\
**Replies:** 1\
**Last updated:** [February 29, 2020, 9:49pm UTC](https://discourse.julialang.org/t/help-me-with-repeated-index/35339 "2020-02-29T21:49:27Z")

</div>

using JuMP,SCS m=Model(with\_optimizer(SCS.Optimizer)) branch=\[1 2 0.1 3 4 0.1 4 5 0.2 4 6 0.3 5 6 0.1 \] If we want only the first column of the branch, what we have to do ? I…

---

## [Error in JuMP with nonlinear objective](https://discourse.julialang.org/t/error-in-jump-with-nonlinear-objective/35261)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 6\
**Last updated:** [February 28, 2020, 5:38pm UTC](https://discourse.julialang.org/t/error-in-jump-with-nonlinear-objective/35261 "2020-02-28T17:38:12Z")

</div>

Hello everyone, I am interested in the following optimization problem that I would like to solve with JuMP: \\begin{split} \\min\_{x \\in \\mathbb{R}^n} & (z^Tx)^2 - \\log(b^T x\[1:k\])\\\\ \\mbox{ subject to }& x\[1:k\] \\geq 0…

---

## [How can I use Optim/BFGS on functions I can't evaluate but whose gradients I can compute?](https://discourse.julialang.org/t/how-can-i-use-optim-bfgs-on-functions-i-cant-evaluate-but-whose-gradients-i-can-compute/35160)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 11\
**Last updated:** [February 28, 2020, 11:24am UTC](https://discourse.julialang.org/t/how-can-i-use-optim-bfgs-on-functions-i-cant-evaluate-but-whose-gradients-i-can-compute/35160 "2020-02-28T11:24:53Z")

</div>

Suppose I have function I want to maximize with Optim’s BFGS algorithm. While I can compute gradients for this function, I cannot compute its value (this is typical if e.g. a high-dimensional determinant is involved, sin…

---

## [Help me with indexing](https://discourse.julialang.org/t/help-me-with-indexing/35203)

<div class="topic-metadata">

**Author:** [@varun\_yaramasu](https://discourse.julialang.org/u/varun_yaramasu)\
**Replies:** 3\
**Last updated:** [February 28, 2020, 4:12am UTC](https://discourse.julialang.org/t/help-me-with-indexing/35203 "2020-02-28T04:12:15Z")

</div>

For example using JuMP,SCS m=Model(with\_optimizer(SCS.Optimizer)) branch=\[1 2 0.1 3 4 0.1 4 5 0.2 4 6 0.3 5 6 0.1 \] G=length(branch\[:,1\]) @variable(m,P\[branch\[1:G,1\], branch\[1…

---

## [Optimization giving wildly different answers depending on box constraints](https://discourse.julialang.org/t/optimization-giving-wildly-different-answers-depending-on-box-constraints/35244)

<div class="topic-metadata">

**Author:** [@lesshaste](https://discourse.julialang.org/u/lesshaste)\
**Replies:** 2\
**Last updated:** [February 27, 2020, 5:54pm UTC](https://discourse.julialang.org/t/optimization-giving-wildly-different-answers-depending-on-box-constraints/35244 "2020-02-27T17:54:08Z")

</div>

I am trying to fit a skew normal distribution to some data. I only have data from the left tail. My code is as follow: using Optim using Distributions using QuadGK unction T(h, a) return 1/(2\*π) \* quadgk(x -\> exp(-(…

---

## [Strange error when using Cbc for MILP =\> "This application has requested the Runtime to terminate it in an unusual way"](https://discourse.julialang.org/t/strange-error-when-using-cbc-for-milp-this-application-has-requested-the-runtime-to-terminate-it-in-an-unusual-way/3478)

<div class="topic-metadata">

**Author:** [@Jonathan\_Droxler](https://discourse.julialang.org/u/Jonathan_Droxler)\
**Replies:** 2\
**Last updated:** [February 27, 2020, 2:11pm UTC](https://discourse.julialang.org/t/strange-error-when-using-cbc-for-milp-this-application-has-requested-the-runtime-to-terminate-it-in-an-unusual-way/3478 "2020-02-27T14:11:04Z")

</div>

Dear all, Have got an error when using the Cbc solver for MILP problem (unit commitment for hydropower production). First, if I solve a problem with 3162 linear constraints 3628 variables : 1581 binary I got really …

---

## [Multiple Variable Types in JuMP Extensions](https://discourse.julialang.org/t/multiple-variable-types-in-jump-extensions/34948)

<div class="topic-metadata">

**Author:** [@pulsipher](https://discourse.julialang.org/u/pulsipher)\
**Replies:** 6\
**Last updated:** [February 26, 2020, 11:06pm UTC](https://discourse.julialang.org/t/multiple-variable-types-in-jump-extensions/34948 "2020-02-26T23:06:41Z")

</div>

With JuMP 0.21 I was wondering what the might be the recommended way to extend it to allow for mixed variable types? In other words, I am trying to figure out which functions I should extend to permit this behavior. For …

---

## [JuMP warning messages](https://discourse.julialang.org/t/jump-warning-messages/35143)

<div class="topic-metadata">

**Author:** [@bandaya](https://discourse.julialang.org/u/bandaya)\
**Replies:** 5\
**Last updated:** [February 26, 2020, 8:01pm UTC](https://discourse.julialang.org/t/jump-warning-messages/35143 "2020-02-26T20:01:24Z")

</div>

I get this warning message on some optimization problems. ┌ Warning: The addition operator has been used on JuMP expressions a large number of times. This warning is safe to ignore but may indicate that model generation…

---

## [Regression from JuMP 0.18 to 0.21](https://discourse.julialang.org/t/regression-from-jump-0-18-to-0-21/35175)

<div class="topic-metadata">

**Author:** [@Lukros](https://discourse.julialang.org/u/Lukros)\
**Replies:** 1\
**Last updated:** [February 26, 2020, 3:20pm UTC](https://discourse.julialang.org/t/regression-from-jump-0-18-to-0-21/35175 "2020-02-26T15:20:47Z")

</div>

Hello, I am updating some functions I coded on JuMP 0.18. There I made used of the next: solve(model, relaxation = true) In JuMP 0.21, I could not find a way to implement it using optimize!(model). Is there any gener…

---

## [\[MOI / JuMP\] Multiple Result Indexing Bug](https://discourse.julialang.org/t/moi-jump-multiple-result-indexing-bug/35140)

<div class="topic-metadata">

**Author:** [@pulsipher](https://discourse.julialang.org/u/pulsipher)\
**Replies:** 2\
**Last updated:** [February 25, 2020, 10:12pm UTC](https://discourse.julialang.org/t/moi-jump-multiple-result-indexing-bug/35140 "2020-02-25T22:12:12Z")

</div>

While developing tests for my JuMP extension in accordance with the newly supported multiple result indexing, I discovered that the same MOI attribute value is returned irrespective of the result index (returning the val…

---

## [Cbc with MILP too slow](https://discourse.julialang.org/t/cbc-with-milp-too-slow/35111)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 2\
**Last updated:** [February 25, 2020, 7:46pm UTC](https://discourse.julialang.org/t/cbc-with-milp-too-slow/35111 "2020-02-25T19:46:25Z")

</div>

I have launched a simulation of my MILP and almost 24 hours has been passed and the script is have not finished yet. I have wondering what is the real cause of this : the large amount of binary variables present in my…

---

## [Ipopt with MathProgBase returns Domain Error for log() function](https://discourse.julialang.org/t/ipopt-with-mathprogbase-returns-domain-error-for-log-function/35097)

<div class="topic-metadata">

**Author:** [@ykc](https://discourse.julialang.org/u/ykc)\
**Replies:** 8\
**Last updated:** [February 25, 2020, 7:25pm UTC](https://discourse.julialang.org/t/ipopt-with-mathprogbase-returns-domain-error-for-log-function/35097 "2020-02-25T19:25:14Z")

</div>

Hi all, I have been estimating a nonlinear model using the Ipopt solver through MathProgBase. The objective function takes sum(log.(x)) for a vector x at the end. From what I understand, if x is ever negative, Ipopt sh…

---

## [Declaration of variable JuMP works well on ATOM but does not work on VSCODE](https://discourse.julialang.org/t/declaration-of-variable-jump-works-well-on-atom-but-does-not-work-on-vscode/35058)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 3\
**Last updated:** [February 25, 2020, 3:05pm UTC](https://discourse.julialang.org/t/declaration-of-variable-jump-works-well-on-atom-but-does-not-work-on-vscode/35058 "2020-02-25T15:05:16Z")

</div>

I have been working in a huge optimization problem and I have tried to execute my script on VSCode to see if I could improve the simulation time. I have installed VSCode (OS Debian) and I simply have executed the same s…

---

## [\[JuMP\] Updating NLparameter of a model in a loop](https://discourse.julialang.org/t/jump-updating-nlparameter-of-a-model-in-a-loop/35081)

<div class="topic-metadata">

**Author:** [@migarstka](https://discourse.julialang.org/u/migarstka)\
**Replies:** 3\
**Last updated:** [February 25, 2020, 2:40pm UTC](https://discourse.julialang.org/t/jump-updating-nlparameter-of-a-model-in-a-loop/35081 "2020-02-25T14:40:18Z")

</div>

copied from JuMP Gitter channel I have a question about solving a nonlinear JuMP model in a loop while updating some nonlinear parameters of the obj function: using JuMP, Ipopt function setup\_model() model = JuMP.…

---

## [JuMP 0.21. How to stop the solver in callback?](https://discourse.julialang.org/t/jump-0-21-how-to-stop-the-solver-in-callback/35028)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 1\
**Last updated:** [February 25, 2020, 4:21am UTC](https://discourse.julialang.org/t/jump-0-21-how-to-stop-the-solver-in-callback/35028 "2020-02-25T04:21:20Z")

</div>

Dear community, in older JuMP versions, one was able to stop the solving process in a callback with JuMP.StopTheSolver. However, I did not find something similar in the documentation of the current release 0.21. Do have…

---

## [NLopt failed due to Forced Stop](https://discourse.julialang.org/t/nlopt-failed-due-to-forced-stop/34364)

<div class="topic-metadata">

**Author:** [@Fisheryu1234](https://discourse.julialang.org/u/Fisheryu1234)\
**Replies:** 3\
**Last updated:** [February 24, 2020, 11:47pm UTC](https://discourse.julialang.org/t/nlopt-failed-due-to-forced-stop/34364 "2020-02-24T23:47:06Z")

</div>

Hi, I encountered a rather complicated constrained maximum likelihood estimation The constraint is numerically solved from a large-scale nonlinear fixed-point problem given primitive parameters (12,800 equality constrai…

---

## [Error while installing NEOS.jl](https://discourse.julialang.org/t/error-while-installing-neos-jl/35041)

<div class="topic-metadata">

**Author:** [@Deb\_Midya](https://discourse.julialang.org/u/Deb_Midya)\
**Replies:** 3\
**Last updated:** [February 23, 2020, 5:09am UTC](https://discourse.julialang.org/t/error-while-installing-neos-jl/35041 "2020-02-23T05:09:03Z")

</div>

I’m using Julia-1.3.1 on Windows 64. To install NEOS.jl, I’ve used the followings: Julia\>import Pkg Julia\>Pkg.add(“NEOS.jl”) ERROR: The following package names could not be resolved: NOES.jl (not found in project, m…

---

## [\[Bug?\] JuMP.read\_from\_file+Cbc gives infeasible, just Cbc gives feasible](https://discourse.julialang.org/t/bug-jump-read-from-file-cbc-gives-infeasible-just-cbc-gives-feasible/34990)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 3\
**Last updated:** [February 22, 2020, 4:50am UTC](https://discourse.julialang.org/t/bug-jump-read-from-file-cbc-gives-infeasible-just-cbc-gives-feasible/34990 "2020-02-22T04:50:46Z")

</div>

I found the problem without using the read\_from\_file (i.e., it arose from a model built inside Julia, but the code to generate the model is long) in the corner case where the model is kinda empty but not really. The mode…

---

## [Programmaticly build expression for JuMP NLconstraint](https://discourse.julialang.org/t/programmaticly-build-expression-for-jump-nlconstraint/34950)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 2\
**Last updated:** [February 21, 2020, 1:28am UTC](https://discourse.julialang.org/t/programmaticly-build-expression-for-jump-nlconstraint/34950 "2020-02-21T01:28:06Z")

</div>

I’m trying to define a nonlinear constraint programmatically via expressions. Specifically, I have a function f that takes in arguments x (a JuMP Variable), i (the index of the variable), and p (some parameters). The rea…

---

## [StructuredOptimization.jl : parsing issue when adding constraints](https://discourse.julialang.org/t/structuredoptimization-jl-parsing-issue-when-adding-constraints/34411)

<div class="topic-metadata">

**Author:** [@rpetit](https://discourse.julialang.org/u/rpetit)\
**Replies:** 8\
**Last updated:** [February 21, 2020, 1:50pm UTC](https://discourse.julialang.org/t/structuredoptimization-jl-parsing-issue-when-adding-constraints/34411 "2020-02-21T13:50:49Z")

</div>

Hi, I’m trying to solve a modified LASSO where weights are constrained to be nonnegative, using StructuredOptimization.jl. The documentation suggests this should be possible using a code similar to the one below : usin…

---

## [Open Source Energy Optimization JuMP Model: REopt Lite](https://discourse.julialang.org/t/open-source-energy-optimization-jump-model-reopt-lite/34934)

<div class="topic-metadata">

**Author:** [@JosiahPohl](https://discourse.julialang.org/u/JosiahPohl)\
**Replies:** 1\
**Last updated:** [February 21, 2020, 11:05am UTC](https://discourse.julialang.org/t/open-source-energy-optimization-jump-model-reopt-lite/34934 "2020-02-21T11:05:47Z")

</div>

My team at the National Renewable Energy Laboratory (NREL) recently converted the optimization engine for the REopt Lite Web Tool from Mosel to JuMP and open-sourced the whole API. Would love for you to check it and feel…

---

## [@NLexpression with JuMP 0.21](https://discourse.julialang.org/t/nlexpression-with-jump-0-21/34859)

<div class="topic-metadata">

**Author:** [@amontoison](https://discourse.julialang.org/u/amontoison)\
**Replies:** 4\
**Last updated:** [February 20, 2020, 4:01pm UTC](https://discourse.julialang.org/t/nlexpression-with-jump-0-21/34859 "2020-02-20T16:01:58Z")

</div>

I tried to use an old JuMP model that was working with JuMP 0.18. But the behaviour of @NLexpression changed with JuMP 0.19 /0.20 / 0.21. Is it a bug or I need to modify how the expression is written? Thank you in adva…

---

## [Sigmoid function in optimization problem](https://discourse.julialang.org/t/sigmoid-function-in-optimization-problem/34868)

<div class="topic-metadata">

**Author:** [@GiuliaM](https://discourse.julialang.org/u/GiuliaM)\
**Replies:** 2\
**Last updated:** [February 20, 2020, 10:41am UTC](https://discourse.julialang.org/t/sigmoid-function-in-optimization-problem/34868 "2020-02-20T10:41:31Z")

</div>

Hi! I’m using Ipopt to solve a NL optimization problem. I need binary variables but I’m using a sigmoid to avoid transforming my problem into a MINLP. I made a MWE in which there are two variables (x1 and x2). The sig…

---

## [JuMP 0.21 is released](https://discourse.julialang.org/t/jump-0-21-is-released/34808)

<div class="topic-metadata">

**Author:** [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Replies:** 8\
**Last updated:** [February 19, 2020, 10:44pm UTC](https://discourse.julialang.org/t/jump-0-21-is-released/34808 "2020-02-19T22:44:24Z")

</div>

tl;dr: Callbacks are back! Lots of new features. with\_optimizer is deprecated. Reminder: The deadline to submit talk proposals for JuMP-dev 2020 is February 29th.

---

## [Potential bug related to initialization of a quadratic program](https://discourse.julialang.org/t/potential-bug-related-to-initialization-of-a-quadratic-program/34848)

<div class="topic-metadata">

**Author:** [@DR59](https://discourse.julialang.org/u/DR59)\
**Replies:** 8\
**Last updated:** [February 19, 2020, 8:52pm UTC](https://discourse.julialang.org/t/potential-bug-related-to-initialization-of-a-quadratic-program/34848 "2020-02-19T20:52:41Z")

</div>

Hi all, Consider the code below (a convex, quadratically constraint, quadratic program I pulled out of a hat). As it stands, it runs fine. However, if I comment out the for loop (i.e. I don’t manually set the starting v…

---

## [Stochastic programming UndefVarError](https://discourse.julialang.org/t/stochastic-programming-undefvarerror/34608)

<div class="topic-metadata">

**Author:** [@bandaya](https://discourse.julialang.org/u/bandaya)\
**Replies:** 4\
**Last updated:** [February 15, 2020, 6:09pm UTC](https://discourse.julialang.org/t/stochastic-programming-undefvarerror/34608 "2020-02-15T18:09:02Z")

</div>

Hi, I am looking at this package StochasticPrograms and I tried to run the farmer example given on the link below. I am getting an error message: “UndefVarError: @stochastic\_model not defined”. This line in the code ma…

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

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