# Optimization (Mathematical)

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

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

**Page:** 119

---

## [How to give information into a callback function](https://discourse.julialang.org/t/how-to-give-information-into-a-callback-function/12805)

<div class="topic-metadata">

**Author:** [@CDRPico](https://discourse.julialang.org/u/CDRPico)\
**Replies:** 2\
**Last updated:** [August 2, 2018, 6:40am UTC](https://discourse.julialang.org/t/how-to-give-information-into-a-callback-function/12805 "2018-08-02T06:40:50Z")

</div>

Hi everyone. I’m implementing a callback function for lazy constraints (Benders decomposition). I’m not sure if it is possible to give and recover information to the callback. The idea is to pass a global variable which…

---

## [Status and Tagging of JuMP 0.18 on Julia 0.7](https://discourse.julialang.org/t/status-and-tagging-of-jump-0-18-on-julia-0-7/12740)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 6\
**Last updated:** [August 1, 2018, 3:11pm UTC](https://discourse.julialang.org/t/status-and-tagging-of-jump-0-18-on-julia-0-7/12740 "2018-08-01T15:11:27Z")

</div>

I was glad to see that the PR was merged for updating JuMP 0.18 for Julia 0.7. I was wondering if there were any plans to tag this as 0.18.3, or if it was awaiting further updates (and if so, what needs updating).

---

## [DimensionMismatch ("A has dimensions (1, 0) but B has dimensions (5,)") How to eliminate this error?](https://discourse.julialang.org/t/dimensionmismatch-a-has-dimensions-1-0-but-b-has-dimensions-5-how-to-eliminate-this-error/12741)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 5\
**Last updated:** [July 31, 2018, 1:14pm UTC](https://discourse.julialang.org/t/dimensionmismatch-a-has-dimensions-1-0-but-b-has-dimensions-5-how-to-eliminate-this-error/12741 "2018-07-31T13:14:51Z")

</div>

DimensionMismatch (“A has dimensions (1, 0) but B has dimensions (5,)”) How to eliminate this error?

---

## [optimal feature subset selection](https://discourse.julialang.org/t/optimal-feature-subset-selection/12746)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 0\
**Last updated:** [July 30, 2018, 5:35pm UTC](https://discourse.julialang.org/t/optimal-feature-subset-selection/12746 "2018-07-30T17:35:29Z")

</div>

Is there a Julia package that implements an optimal feature subset selection algorithm, such as described here: Fast branch & bound algorithms for optimal feature selection - PubMed?

---

## [Weird bug: Printing a variable vs. not printing a variable give different results](https://discourse.julialang.org/t/weird-bug-printing-a-variable-vs-not-printing-a-variable-give-different-results/12728)

<div class="topic-metadata">

**Author:** [@CanLi1](https://discourse.julialang.org/u/CanLi1)\
**Replies:** 4\
**Last updated:** [July 30, 2018, 7:21am UTC](https://discourse.julialang.org/t/weird-bug-printing-a-variable-vs-not-printing-a-variable-give-different-results/12728 "2018-07-30T07:21:25Z")

</div>

Hi folks, I’m using Julia/JuMP and I recently encountered a weird bug. The whole package I’m writing is too big so I only include the code that this bug occurs. I have the following lines of code The code does not g…

---

## [Optim Consumes an Increasingly Large Amount of Memory (Until it Crashes)](https://discourse.julialang.org/t/optim-consumes-an-increasingly-large-amount-of-memory-until-it-crashes/12689)

<div class="topic-metadata">

**Author:** [@Juser](https://discourse.julialang.org/u/Juser)\
**Replies:** 6\
**Last updated:** [July 29, 2018, 7:19am UTC](https://discourse.julialang.org/t/optim-consumes-an-increasingly-large-amount-of-memory-until-it-crashes/12689 "2018-07-29T07:19:56Z")

</div>

I am using Optim using LBFGS for a statistical application (maximum likelihood), and I have encountered the issue that Optim consumes an increasingly large amount of memory until it runs out and crashes. The data set siz…

---

## [Default subsidiary algorithm in NLopt AUGLAG](https://discourse.julialang.org/t/default-subsidiary-algorithm-in-nlopt-auglag/12654)

<div class="topic-metadata">

**Author:** [@mrapo](https://discourse.julialang.org/u/mrapo)\
**Replies:** 2\
**Last updated:** [July 26, 2018, 6:51am UTC](https://discourse.julialang.org/t/default-subsidiary-algorithm-in-nlopt-auglag/12654 "2018-07-26T06:51:54Z")

</div>

I wan to use the NLopt’s Augmented Lagrangian algorithm in JuMP environment. In the documentation it is mentioned that the AUGLAG algorithm uses a subsidary algorithm for the optimization and that this local search algor…

---

## [Error in an optimization problem](https://discourse.julialang.org/t/error-in-an-optimization-problem/12609)

<div class="topic-metadata">

**Author:** [@muriloasouza](https://discourse.julialang.org/u/muriloasouza)\
**Replies:** 3\
**Last updated:** [July 24, 2018, 1:47pm UTC](https://discourse.julialang.org/t/error-in-an-optimization-problem/12609 "2018-07-24T13:47:00Z")

</div>

Hello there! I’m fairly new to Julia. I just made a problem to test and learn how to write the obj. function and restrictions. But i’m having some issues, if anyone can help me out, will be trully apreciated. Here’s my…

---

## [Callback information about parent in B&B tree](https://discourse.julialang.org/t/callback-information-about-parent-in-b-b-tree/12546)

<div class="topic-metadata">

**Author:** [@borelian](https://discourse.julialang.org/u/borelian)\
**Replies:** 4\
**Last updated:** [July 23, 2018, 12:48pm UTC](https://discourse.julialang.org/t/callback-information-about-parent-in-b-b-tree/12546 "2018-07-23T12:48:26Z")

</div>

Hi everyone. in the B&B tree, I need to recover the father of the current node. A solution is to store the father id when the solver branchs, using a branch callback. I see that JuMP doesn’t have branch callbacks. How …

---

## [Multiparametric programming](https://discourse.julialang.org/t/multiparametric-programming/1316)

<div class="topic-metadata">

**Author:** [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Replies:** 6\
**Last updated:** [July 23, 2018, 1:53am UTC](https://discourse.julialang.org/t/multiparametric-programming/1316 "2018-07-23T01:53:31Z")

</div>

Hi all, Has there been any work on multiparametric programming in Julia? I’m starting to look into it for my own research, and it would be nice to build on any existing work there might be. Googling around and looking i…

---

## [Resolve models in parallel within a loop](https://discourse.julialang.org/t/resolve-models-in-parallel-within-a-loop/12469)

<div class="topic-metadata">

**Author:** [@Ksun46](https://discourse.julialang.org/u/Ksun46)\
**Replies:** 12\
**Last updated:** [July 20, 2018, 2:38pm UTC](https://discourse.julialang.org/t/resolve-models-in-parallel-within-a-loop/12469 "2018-07-20T14:38:36Z")

</div>

Hi all, I am trying to implement an algorithm in JuMP. In each iteration, I will need to solve several models in parallel, update some data and then resolve these models in the next iteration with different objectives (c…

---

## [Optim box constrained optimization](https://discourse.julialang.org/t/optim-box-constrained-optimization/12463)

<div class="topic-metadata">

**Author:** [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Replies:** 6\
**Last updated:** [July 19, 2018, 7:19am UTC](https://discourse.julialang.org/t/optim-box-constrained-optimization/12463 "2018-07-19T07:19:26Z")

</div>

Here’s the example for box constrained optimization in the docs: using Optim f(x) = (1.0 - x\[1\])^2 + 100.0 \* (x\[2\] - x\[1\]^2)^2 function g!(G, x) G\[1\] = -2.0 \* (1.0 - x\[1\]) - 400.0 \* (x\[2\] - x\[1\]^2) \* x\[1\] G\[2\] …

---

## [JuMP: infeasibility ray when variable bounds are present](https://discourse.julialang.org/t/jump-infeasibility-ray-when-variable-bounds-are-present/12285)

<div class="topic-metadata">

**Author:** [@iaravena](https://discourse.julialang.org/u/iaravena)\
**Replies:** 2\
**Last updated:** [July 11, 2018, 6:14pm UTC](https://discourse.julialang.org/t/jump-infeasibility-ray-when-variable-bounds-are-present/12285 "2018-07-11T18:14:34Z")

</div>

Hi all, I am stuck in a riddle with JuMP for which there might be an easier solution. Assume you are given an infeasible JuMP model with variable bounds. How to get a infeasibility ray for the dual taking into account t…

---

## [Adaptive Sampling by](https://discourse.julialang.org/t/adaptive-sampling-by/12288)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 0\
**Last updated:** [July 10, 2018, 11:55am UTC](https://discourse.julialang.org/t/adaptive-sampling-by/12288 "2018-07-10T11:55:35Z")

</div>

Seen on Twitter. Is this really something new?

---

## [How to define a constraint from a string?](https://discourse.julialang.org/t/how-to-define-a-constraint-from-a-string/12157)

<div class="topic-metadata">

**Author:** [@Manny8888](https://discourse.julialang.org/u/Manny8888)\
**Replies:** 12\
**Last updated:** [July 10, 2018, 9:22am UTC](https://discourse.julialang.org/t/how-to-define-a-constraint-from-a-string/12157 "2018-07-10T09:22:04Z")

</div>

Hello, Trying to write a Kenken solver, I am using a text string to define the problem. The first lines of the string look like this: “”" 6 13 + A1 A2 B1 B2 180 \* C1 D1 D2 E1 9 + F1 F2 F3 2 = C2 “”" where the fi…

---

## [Newbie looking for help with Constraints in JuMP](https://discourse.julialang.org/t/newbie-looking-for-help-with-constraints-in-jump/12200)

<div class="topic-metadata">

**Author:** [@mkt](https://discourse.julialang.org/u/mkt)\
**Replies:** 2\
**Last updated:** [July 6, 2018, 12:42pm UTC](https://discourse.julialang.org/t/newbie-looking-for-help-with-constraints-in-jump/12200 "2018-07-06T12:42:29Z")

</div>

Hi all, I am trying to make a model of an energy market with storage but I’m having some problems using constraints. There are some variables that I want to fix but it doesn’t seem to be working. I’ve creating a simpler…

---

## [The best way to visualize optimization results in juMP](https://discourse.julialang.org/t/the-best-way-to-visualize-optimization-results-in-jump/12122)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 3\
**Last updated:** [July 4, 2018, 2:23pm UTC](https://discourse.julialang.org/t/the-best-way-to-visualize-optimization-results-in-jump/12122 "2018-07-04T14:23:49Z")

</div>

I have been working for some months in the optimization domain. I have a huge problem that can easily reach \>500k variables. These variables represent many different things over a time-slice. After getting the solution, …

---

## [Does JuMP convert SOCP into QCP automatically?](https://discourse.julialang.org/t/does-jump-convert-socp-into-qcp-automatically/12085)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 2\
**Last updated:** [July 3, 2018, 11:21pm UTC](https://discourse.julialang.org/t/does-jump-convert-socp-into-qcp-automatically/12085 "2018-07-03T23:21:18Z")

</div>

I’d like to know whether JuMP automatically converts SOCP into QCP. Also is one formulation any faster than the other? (I’m using Gurobi) (a) This constraint is in quadratic form resulting in QCP. x^2 + y^2 \<= z^2…

---

## [Optimizing an array of variables using JuMP (NLP)](https://discourse.julialang.org/t/optimizing-an-array-of-variables-using-jump-nlp/12104)

<div class="topic-metadata">

**Author:** [@rhuffman](https://discourse.julialang.org/u/rhuffman)\
**Replies:** 3\
**Last updated:** [July 3, 2018, 7:25pm UTC](https://discourse.julialang.org/t/optimizing-an-array-of-variables-using-jump-nlp/12104 "2018-07-03T19:25:27Z")

</div>

Hi all, I’m trying to formulate a nonlinear optimization problem with JuMP. Specifically, I’m looking to minimize the sum of the products of certain values in a matrix where one matrix is variable, and two additional ma…

---

## [JuMP - Get basis for integer solution](https://discourse.julialang.org/t/jump-get-basis-for-integer-solution/12138)

<div class="topic-metadata">

**Author:** [@mbesancon](https://discourse.julialang.org/u/mbesancon)\
**Replies:** 0\
**Last updated:** [July 3, 2018, 4:48pm UTC](https://discourse.julialang.org/t/jump-get-basis-for-integer-solution/12138 "2018-07-03T16:48:49Z")

</div>

I was wondering if there is a way to get the basis at a final node of a branch-and-bound procedure, so including the additional constraints from cuts and bounds. My goal is to compute a cone pointing from the feasible v…

---

## [Dual: "getdual()" is not working for Conic/Quadratic constraints](https://discourse.julialang.org/t/dual-getdual-is-not-working-for-conic-quadratic-constraints/11884)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 6\
**Last updated:** [June 30, 2018, 7:06pm UTC](https://discourse.julialang.org/t/dual-getdual-is-not-working-for-conic-quadratic-constraints/11884 "2018-06-30T19:06:00Z")

</div>

How can I get dual values for Conic/Quadratic constraints? getdual() function works fine for LPs, however it doesn’t work for QP or SOCP. Below is a sample code. using JuMP, Gurobi m = Model(solver=GurobiSolver()) @va…

---

## [BoundsError when re-solving a model](https://discourse.julialang.org/t/boundserror-when-re-solving-a-model/12050)

<div class="topic-metadata">

**Author:** [@varun7rs](https://discourse.julialang.org/u/varun7rs)\
**Replies:** 6\
**Last updated:** [June 30, 2018, 5:51pm UTC](https://discourse.julialang.org/t/boundserror-when-re-solving-a-model/12050 "2018-06-30T17:51:12Z")

</div>

I’ve implemented a neighbourhood search technique wherein I deepcopy the original model, hot-start it and then solve it repeatedly. While the first iteration went smooth, during the second iteration however, I get this e…

---

## [How to solve two symbolic nonlinear equations in Julia?](https://discourse.julialang.org/t/how-to-solve-two-symbolic-nonlinear-equations-in-julia/11916)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 27\
**Last updated:** [June 27, 2018, 11:54am UTC](https://discourse.julialang.org/t/how-to-solve-two-symbolic-nonlinear-equations-in-julia/11916 "2018-06-27T11:54:22Z")

</div>

Sorry if that seems an easy question but I searched for a simple answer in many packages without success. I have two equations like this: 𝐹\_1: 𝑥^2+𝑥𝑦+\\sin⁡(𝑦)=3 𝐹\_2: 𝑥^3−4𝑥+\\sin⁡(2𝑦)=0 and I need to solve them symboli…

---

## [Float64 and binary variables in constraints](https://discourse.julialang.org/t/float64-and-binary-variables-in-constraints/11961)

<div class="topic-metadata">

**Author:** [@mm0063](https://discourse.julialang.org/u/mm0063)\
**Replies:** 2\
**Last updated:** [June 27, 2018, 8:20am UTC](https://discourse.julialang.org/t/float64-and-binary-variables-in-constraints/11961 "2018-06-27T08:20:46Z")

</div>

Hi all, My problem formulation consists of float64 parameters and variables and binary variables: using JuMP using Mosek M = 1000.0; @variable(m, y\_connect2\[t in ts, cg in cgs, lt in lts\], Bin) @variable(m, x\_conne…

---

## [Help debugging \`nlopt failure: -1\` errors](https://discourse.julialang.org/t/help-debugging-nlopt-failure-1-errors/11907)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 10\
**Last updated:** [June 26, 2018, 1:36pm UTC](https://discourse.julialang.org/t/help-debugging-nlopt-failure-1-errors/11907 "2018-06-26T13:36:05Z")

</div>

Any tips on debugging nlopt failure: -1 errors? There is no information in the error message to understand what happened. Sometimes I have found that this occurs because I am computing something wrong in the gradient. Bu…

---

## [Modifying NLobjective in JuMP?](https://discourse.julialang.org/t/modifying-nlobjective-in-jump/11942)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 1\
**Last updated:** [June 25, 2018, 8:55pm UTC](https://discourse.julialang.org/t/modifying-nlobjective-in-jump/11942 "2018-06-25T20:55:43Z")

</div>

I have a nonlinear optimization problem setup in JuMP that I just solved. Now I want to modify the objective. If I just call @NLobjective with the new objective, will I get a hot-start in the next call to solve?

---

## [Post Processing JuMP results - Transforming JuMP variables](https://discourse.julialang.org/t/post-processing-jump-results-transforming-jump-variables/11041)

<div class="topic-metadata">

**Author:** [@tfk17lstm](https://discourse.julialang.org/u/tfk17lstm)\
**Replies:** 6\
**Last updated:** [June 25, 2018, 8:16pm UTC](https://discourse.julialang.org/t/post-processing-jump-results-transforming-jump-variables/11041 "2018-06-25T20:16:07Z")

</div>

Hi guys! I have finished my implementation of my unit commitment problem and I would like to know if there is any possibility of including this kind of plot in my final results: Extracted from: Unit commitment - YAL…

---

## [How to compare JuMP variables?](https://discourse.julialang.org/t/how-to-compare-jump-variables/11882)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 8\
**Last updated:** [June 25, 2018, 9:06am UTC](https://discourse.julialang.org/t/how-to-compare-jump-variables/11882 "2018-06-25T09:06:54Z")

</div>

I have a LP problem with many variables that represent different things. One of my variables can assume negatives or positives values, according to the timeslice. Inside an expression(@expression) I would like to accumul…

---

## [Optim.optimize() uses excessive memory with autodiff?](https://discourse.julialang.org/t/optim-optimize-uses-excessive-memory-with-autodiff/11872)

<div class="topic-metadata">

**Author:** [@tyleransom](https://discourse.julialang.org/u/tyleransom)\
**Replies:** 11\
**Last updated:** [June 22, 2018, 3:17pm UTC](https://discourse.julialang.org/t/optim-optimize-uses-excessive-memory-with-autodiff/11872 "2018-06-22T15:17:01Z")

</div>

I’m using Optim.optimize() to estimate a likelihood-type model. Having read that autodiff is a great feature, I have implemented it. I have three questions that I’m hoping someone can shed more light on. For reference, …

---

## [Depth First Search in Julia](https://discourse.julialang.org/t/depth-first-search-in-julia/11860)

<div class="topic-metadata">

**Author:** [@ksh](https://discourse.julialang.org/u/ksh)\
**Replies:** 3\
**Last updated:** [June 22, 2018, 1:10am UTC](https://discourse.julialang.org/t/depth-first-search-in-julia/11860 "2018-06-22T01:10:58Z")

</div>

Hi, does anyone have a working depth first search (recursive) code in Julia? I would rather not use the existing lightgraphs.jl or graphs.jl.

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

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