# Optimization (Mathematical)

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

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

**Page:** 120

---

## [JuMP anonymous variables](https://discourse.julialang.org/t/jump-anonymous-variables/11831)

<div class="topic-metadata">

**Author:** [@ksh](https://discourse.julialang.org/u/ksh)\
**Replies:** 1\
**Last updated:** [June 20, 2018, 9:35pm UTC](https://discourse.julialang.org/t/jump-anonymous-variables/11831 "2018-06-20T21:35:56Z")

</div>

Hi, I’m trying to call anonymous variables based on the edges that exist in my tree-graph, but I’m getting the error with my first constraint stating that “t doesn’t exist.” I show only the relevant code below. t is a c…

---

## [Optim.jl ArgumentError: Value and slope at step length = 0 must be finite](https://discourse.julialang.org/t/optim-jl-argumenterror-value-and-slope-at-step-length-0-must-be-finite/11770)

<div class="topic-metadata">

**Author:** [@tlagos](https://discourse.julialang.org/u/tlagos)\
**Replies:** 7\
**Last updated:** [June 19, 2018, 9:10am UTC](https://discourse.julialang.org/t/optim-jl-argumenterror-value-and-slope-at-step-length-0-must-be-finite/11770 "2018-06-19T09:10:24Z")

</div>

Hello, I’m minimizing the analitic center of a set of inequalities (see problem 9.30 Convex Optimization Boyd and Vandenberghe). I generate a random instance as follows: n=8 m=7 A=rand(m,n) Then I create the necessar…

---

## [CPLEX - Accessing root node before and after cuts](https://discourse.julialang.org/t/cplex-accessing-root-node-before-and-after-cuts/11650)

<div class="topic-metadata">

**Author:** [@Lefteris\_Manousakis](https://discourse.julialang.org/u/Lefteris_Manousakis)\
**Replies:** 1\
**Last updated:** [June 13, 2018, 8:25pm UTC](https://discourse.julialang.org/t/cplex-accessing-root-node-before-and-after-cuts/11650 "2018-06-13T20:25:58Z")

</div>

Hi! Is there a way to access the value of the root node relaxation of cplex before and after applying the cuts? I would like to measure the effectiveness of cuts at root 0 and how much they can tighten the formulation. T…

---

## [Ipopt infeasibility on travis-ci](https://discourse.julialang.org/t/ipopt-infeasibility-on-travis-ci/11612)

<div class="topic-metadata">

**Author:** [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Replies:** 2\
**Last updated:** [June 13, 2018, 7:55am UTC](https://discourse.julialang.org/t/ipopt-infeasibility-on-travis-ci/11612 "2018-06-13T07:55:09Z")

</div>

Hi everyone. I’m trying to set up tests for a project on Travis which uses JuMP with the Ipopt solver (repo for the project is here). The build steps seem fine as far as I can tell and my tests can run (well, sometimes…

---

## [Solving a quadratic program inside a JuMP model solve](https://discourse.julialang.org/t/solving-a-quadratic-program-inside-a-jump-model-solve/10690)

<div class="topic-metadata">

**Author:** [@shoshievass](https://discourse.julialang.org/u/shoshievass)\
**Replies:** 14\
**Last updated:** [June 13, 2018, 3:06am UTC](https://discourse.julialang.org/t/solving-a-quadratic-program-inside-a-jump-model-solve/10690 "2018-06-13T03:06:37Z")

</div>

I’m trying to solve a two-step optimization problem (to fit a complex econometric model) that requires solving a \[fairly straight forward\] quadratic program (as a function of the parameters of the model) at every iterati…

---

## [Publication with Julia/JuMP/Spectra: Thanks Julia Ecosystem](https://discourse.julialang.org/t/publication-with-julia-jump-spectra-thanks-julia-ecosystem/2961)

<div class="topic-metadata">

**Author:** [@charlesll](https://discourse.julialang.org/u/charlesll)\
**Replies:** 3\
**Last updated:** [June 11, 2018, 11:03pm UTC](https://discourse.julialang.org/t/publication-with-julia-jump-spectra-thanks-julia-ecosystem/2961 "2018-06-11T23:03:38Z")

</div>

Dear Julia Opt community, I just wanted to share my enthusiasm about one of our new publication in Journal of Non Crystalline Solids (click here for a free version until 8th May or here for the standard Elsevier access)…

---

## [Creating a collection of ordered tuple](https://discourse.julialang.org/t/creating-a-collection-of-ordered-tuple/11507)

<div class="topic-metadata">

**Author:** [@Sharabh\_Shukla](https://discourse.julialang.org/u/Sharabh_Shukla)\
**Replies:** 1\
**Last updated:** [June 9, 2018, 9:46pm UTC](https://discourse.julialang.org/t/creating-a-collection-of-ordered-tuple/11507 "2018-06-09T21:46:53Z")

</div>

Hi All, I am relatively new to Julia, moving from GAMS and AMPL. I am building a JuMP mode, for Distribution Optimal power Flow. The grid is mostly radial, so I am thinking of creating a collection of order tuples (bra…

---

## [Right syntax @constraintref](https://discourse.julialang.org/t/right-syntax-constraintref/11529)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 3\
**Last updated:** [June 8, 2018, 12:38pm UTC](https://discourse.julialang.org/t/right-syntax-constraintref/11529 "2018-06-08T12:38:26Z")

</div>

I have read the documentation http://www.juliaopt.org/JuMP.jl/0.18/refexpr.html in order to get the right syntax to build a reference to a constraint. It’s like that: @constraintref constraintName\[1:3\] My constraint …

---

## [LP having unbouded and bounded variables](https://discourse.julialang.org/t/lp-having-unbouded-and-bounded-variables/11494)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 3\
**Last updated:** [June 8, 2018, 7:44am UTC](https://discourse.julialang.org/t/lp-having-unbouded-and-bounded-variables/11494 "2018-06-08T07:44:18Z")

</div>

I have been modelling a LP problem with ~ 50k variables. Some of them are bounded, the other ones can take any value, i.e., they are unbounded. I coded the objective function and constraints but at the end, I got this r…

---

## [Expression vs Constraint](https://discourse.julialang.org/t/expression-vs-constraint/11481)

<div class="topic-metadata">

**Author:** [@rawls238](https://discourse.julialang.org/u/rawls238)\
**Replies:** 3\
**Last updated:** [June 6, 2018, 6:56pm UTC](https://discourse.julialang.org/t/expression-vs-constraint/11481 "2018-06-06T18:56:54Z")

</div>

Hi, I’m new to using JuMP and still trying to figure out some of the quirks of JuMP. This may also arise from my ignorance of the underlying methods used by the solvers. I’m using the Ipopt solver and solving a non-line…

---

## [Model/variable copy error in JuMP 0.18](https://discourse.julialang.org/t/model-variable-copy-error-in-jump-0-18/11449)

<div class="topic-metadata">

**Author:** [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Replies:** 3\
**Last updated:** [June 6, 2018, 1:55pm UTC](https://discourse.julialang.org/t/model-variable-copy-error-in-jump-0-18/11449 "2018-06-06T13:55:24Z")

</div>

I created a simple model and tried to copy and modify. using JuMP, Clp m = Model(solver=ClpSolver()) set\_A = \[(1,2), (2,3)\] @variable(m, x\[(i,j) in set\_A\]\>=0) @objective(m, Max, sum(x\[(i,j)\] for (i,j) in set\_A) ) @cons…

---

## [How to add user-defined nonlinear functions as constraints with JuMP?](https://discourse.julialang.org/t/how-to-add-user-defined-nonlinear-functions-as-constraints-with-jump/11436)

<div class="topic-metadata">

**Author:** [@mrapo](https://discourse.julialang.org/u/mrapo)\
**Replies:** 3\
**Last updated:** [June 5, 2018, 8:24pm UTC](https://discourse.julialang.org/t/how-to-add-user-defined-nonlinear-functions-as-constraints-with-jump/11436 "2018-06-05T20:24:37Z")

</div>

Is it possible to add user-defined nonlinear functions as constraints in JuMP? I couldn’t find any documentation about a case like this nor any examples where someone would have done this. I mean something like this: J…

---

## [MultiJuMP AND CPLEX](https://discourse.julialang.org/t/multijump-and-cplex/11409)

<div class="topic-metadata">

**Author:** [@UserMorocco](https://discourse.julialang.org/u/UserMorocco)\
**Replies:** 3\
**Last updated:** [June 4, 2018, 1:35pm UTC](https://discourse.julialang.org/t/multijump-and-cplex/11409 "2018-06-04T13:35:59Z")

</div>

Hello, I have a problem with discrete and continous variable, I want to use CPLEX with MultiJuMP, but I get this error : ERROR: MethodError: no method matching NonlinearModel(::CPLEX.CplexSolver) Closest candidates ar…

---

## [Adding cuts to a MILP prior to the solving](https://discourse.julialang.org/t/adding-cuts-to-a-milp-prior-to-the-solving/11395)

<div class="topic-metadata">

**Author:** [@jdeboeck](https://discourse.julialang.org/u/jdeboeck)\
**Replies:** 3\
**Last updated:** [June 4, 2018, 1:25am UTC](https://discourse.julialang.org/t/adding-cuts-to-a-milp-prior-to-the-solving/11395 "2018-06-04T01:25:09Z")

</div>

I am solving a MILP with JuMP and have a set of valid cuts for the linear relaxation. I would like to add all these inequalities as a pool of possible cuts before launching the solving and the branching procedure. The ai…

---

## [Optimize() error: "Initial value and slope must be finite"](https://discourse.julialang.org/t/optimize-error-initial-value-and-slope-must-be-finite/11320)

<div class="topic-metadata">

**Author:** [@stst](https://discourse.julialang.org/u/stst)\
**Replies:** 5\
**Last updated:** [June 2, 2018, 10:25am UTC](https://discourse.julialang.org/t/optimize-error-initial-value-and-slope-must-be-finite/11320 "2018-06-02T10:25:37Z")

</div>

The MWE below (run with Julia 0.6.2 and Optim.jl 0.14.1) errors at an non-reproducible k with the error ERROR: Initial value and slope must be finite. Am I doing something wrong? using Optim srand(83092) n = 200 AtA = r…

---

## [Converting MultivariatePolynomials output as a function to be used in JuMP](https://discourse.julialang.org/t/converting-multivariatepolynomials-output-as-a-function-to-be-used-in-jump/11262)

<div class="topic-metadata">

**Author:** [@Ludo](https://discourse.julialang.org/u/Ludo)\
**Replies:** 7\
**Last updated:** [June 2, 2018, 9:09am UTC](https://discourse.julialang.org/t/converting-multivariatepolynomials-output-as-a-function-to-be-used-in-jump/11262 "2018-06-02T09:09:08Z")

</div>

The objective is to solve a large system of NL equations. Equations should be obtained via polynomial operations and passed on to JuMP as user-defined function. Below is the minuaturised code for eveluating polynomials’ …

---

## [Mixed integer non-linear problem + three objectives](https://discourse.julialang.org/t/mixed-integer-non-linear-problem-three-objectives/11140)

<div class="topic-metadata">

**Author:** [@UserMorocco](https://discourse.julialang.org/u/UserMorocco)\
**Replies:** 1\
**Last updated:** [May 26, 2018, 5:08pm UTC](https://discourse.julialang.org/t/mixed-integer-non-linear-problem-three-objectives/11140 "2018-05-26T17:08:55Z")

</div>

Hello everybody, I’m looking for a julia package to solve : mixed integer nonlinear problem with three objectives. thank you.

---

## [JuMP: vector variable to user defined NLobjective](https://discourse.julialang.org/t/jump-vector-variable-to-user-defined-nlobjective/11330)

<div class="topic-metadata">

**Author:** [@mrapo](https://discourse.julialang.org/u/mrapo)\
**Replies:** 1\
**Last updated:** [June 1, 2018, 10:53am UTC](https://discourse.julialang.org/t/jump-vector-variable-to-user-defined-nlobjective/11330 "2018-06-01T10:53:47Z")

</div>

I I’m trying to optimize an user defined function with JuMP. The variable is a vector of length 30. I’ve tried the following two ways to define the objective, but both of them throw an error. The first way I tried with…

---

## [f(t+1) in JuMP](https://discourse.julialang.org/t/f-t-1-in-jump/11241)

<div class="topic-metadata">

**Author:** [@Guito](https://discourse.julialang.org/u/Guito)\
**Replies:** 4\
**Last updated:** [June 1, 2018, 10:03am UTC](https://discourse.julialang.org/t/f-t-1-in-jump/11241 "2018-06-01T10:03:25Z")

</div>

Hi everyone! I am just starting with JuMP and I’m trying to solve a little battery optimization problem that I used to solve easy in GAMS. Though, I am really stuck in the SoC code because I don’t know how to write f(t+…

---

## [JuMP nonlinear optimization error: unrecogniced function](https://discourse.julialang.org/t/jump-nonlinear-optimization-error-unrecogniced-function/11328)

<div class="topic-metadata">

**Author:** [@mrapo](https://discourse.julialang.org/u/mrapo)\
**Replies:** 1\
**Last updated:** [June 1, 2018, 9:28am UTC](https://discourse.julialang.org/t/jump-nonlinear-optimization-error-unrecogniced-function/11328 "2018-06-01T09:28:42Z")

</div>

What does the following error mean when trying to optimize a nonlinear objective function f: ERROR: LoadError: Unrecognized function "f" used in nonlinear expression. This is how I tried to use the nonlinear features o…

---

## [JuMP.jl user-defined function has to return a scalar?](https://discourse.julialang.org/t/jump-jl-user-defined-function-has-to-return-a-scalar/11202)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 2\
**Last updated:** [May 31, 2018, 3:48pm UTC](https://discourse.julialang.org/t/jump-jl-user-defined-function-has-to-return-a-scalar/11202 "2018-05-31T15:48:15Z")

</div>

I have a question related to what was asked here some time ago. I want to use JuMP and need to differentiate through a function from the BasisMatrices.jl package and I am having trouble making that work. I don’t understa…

---

## [JuMP Dot Product/Norm/NLobjective](https://discourse.julialang.org/t/jump-dot-product-norm-nlobjective/11273)

<div class="topic-metadata">

**Author:** [@Paul\_McVay](https://discourse.julialang.org/u/Paul_McVay)\
**Replies:** 4\
**Last updated:** [May 31, 2018, 3:28pm UTC](https://discourse.julialang.org/t/jump-dot-product-norm-nlobjective/11273 "2018-05-31T15:28:10Z")

</div>

I’ve run into a number of issues with quadratic objectives in JuMP. A simple example is: m = Model(solver = CplexSolver()) @variable(m, w\[1:10\]) @expression(m, dotproduct, sum(w\[i\]\*w\[i\] for i = 1:10)) If I try to make …

---

## [Automatic Differentiation Slow (Slower than Finite-Differences)](https://discourse.julialang.org/t/automatic-differentiation-slow-slower-than-finite-differences/11209)

<div class="topic-metadata">

**Author:** [@Juser](https://discourse.julialang.org/u/Juser)\
**Replies:** 18\
**Last updated:** [May 31, 2018, 12:57pm UTC](https://discourse.julialang.org/t/automatic-differentiation-slow-slower-than-finite-differences/11209 "2018-05-31T12:57:12Z")

</div>

I am trying to implement a statistical estimator and am having issues with both ForwardDiff and ReverseDiff taking longer to compute gradients than would simple one-sided finite differencing. Below is a minimal example …

---

## [Converting GAMS script to JuMP: Marginal values](https://discourse.julialang.org/t/converting-gams-script-to-jump-marginal-values/11199)

<div class="topic-metadata">

**Author:** [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Replies:** 2\
**Last updated:** [May 29, 2018, 12:03pm UTC](https://discourse.julialang.org/t/converting-gams-script-to-jump-marginal-values/11199 "2018-05-29T12:03:07Z")

</div>

Hi all, Hopefully just a quick question here: I’m new to optimisation solvers in general so this may something I’ve missed. I’m converting a GAMS script into a JuMP solution (using Ipopt). After the optimisation step, …

---

## [Annoucement: Algencan.jl initial release](https://discourse.julialang.org/t/annoucement-algencan-jl-initial-release/11183)

<div class="topic-metadata">

**Author:** [@pjssilva](https://discourse.julialang.org/u/pjssilva)\
**Replies:** 6\
**Last updated:** [May 29, 2018, 12:00am UTC](https://discourse.julialang.org/t/annoucement-algencan-jl-initial-release/11183 "2018-05-29T00:00:15Z")

</div>

After a long period planning I have finished a first rough implementation of a interface between the Algencan solver for nonlinear optimization (general NLP with constraints) for JuMP / MathProgBase that I am naming Alge…

---

## [Linearize sum of piecewise linear constraints](https://discourse.julialang.org/t/linearize-sum-of-piecewise-linear-constraints/11176)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 0\
**Last updated:** [May 27, 2018, 2:54am UTC](https://discourse.julialang.org/t/linearize-sum-of-piecewise-linear-constraints/11176 "2018-05-27T02:54:46Z")

</div>

Cross posted here, but asking a variant on this forum. I want to write a sum of piecewise linear constraints as an LP and am hoping to compare my approach with how Convex.jl or JuMP does it. In particular, I believe th…

---

## [JuMP, start the optimization with a vector](https://discourse.julialang.org/t/jump-start-the-optimization-with-a-vector/10951)

<div class="topic-metadata">

**Author:** [@mrapo](https://discourse.julialang.org/u/mrapo)\
**Replies:** 8\
**Last updated:** [May 27, 2018, 4:00am UTC](https://discourse.julialang.org/t/jump-start-the-optimization-with-a-vector/10951 "2018-05-27T04:00:34Z")

</div>

I’m trying to minimize a function with JuMP. The variable of the objective function is a 30 element vector x and the optimization is supposed to start from a given vector x0. How can I give vector x0 as the start? If i …

---

## [Tutor/Teacher for help to solve LP problem with column generation (PSAT and condSAT)](https://discourse.julialang.org/t/tutor-teacher-for-help-to-solve-lp-problem-with-column-generation-psat-and-condsat/11156)

<div class="topic-metadata">

**Author:** [@Isabela\_Valonni](https://discourse.julialang.org/u/Isabela_Valonni)\
**Replies:** 1\
**Last updated:** [May 26, 2018, 3:36pm UTC](https://discourse.julialang.org/t/tutor-teacher-for-help-to-solve-lp-problem-with-column-generation-psat-and-condsat/11156 "2018-05-26T15:36:31Z")

</div>

I am from python, and I am trying to start with Julia. I would like to find someone as a teacher for help me with a specific problem of satisfiability called PSAT and CONSAT and code it in Julia using column generation. …

---

## [Modify equality constraints in JuMP](https://discourse.julialang.org/t/modify-equality-constraints-in-jump/10982)

<div class="topic-metadata">

**Author:** [@pierre-haessig](https://discourse.julialang.org/u/pierre-haessig)\
**Replies:** 2\
**Last updated:** [May 25, 2018, 4:12pm UTC](https://discourse.julialang.org/t/modify-equality-constraints-in-jump/10982 "2018-05-25T16:12:10Z")

</div>

Hello, In JuMP 0.18 documentation on Problem Modification, I read that JuMP does not currently support changing constraint coefficients. For less-than and greater-than constraints, the right-hand-side can be changed. …

---

## [How to obtain the coefficients of linear constraints in JuMP](https://discourse.julialang.org/t/how-to-obtain-the-coefficients-of-linear-constraints-in-jump/11117)

<div class="topic-metadata">

**Author:** [@CanLi1](https://discourse.julialang.org/u/CanLi1)\
**Replies:** 1\
**Last updated:** [May 24, 2018, 3:10am UTC](https://discourse.julialang.org/t/how-to-obtain-the-coefficients-of-linear-constraints-in-jump/11117 "2018-05-24T03:10:52Z")

</div>

Hi folks, I constructed a linear model in JuMP by loading an .lp file. lp = Model(solver=CPLEX.CplexSolver()) lp.internalModel = MathProgBase.LinearQuadraticModel(lp.solver) MathProgBase.loadproblem!(lp.internalModel…

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

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