# Optimization (Mathematical)

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

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

**Page:** 62

---

## [Read LP files](https://discourse.julialang.org/t/read-lp-files/6877)

<div class="topic-metadata">

**Author:** [@Andrey\_Stroil](https://discourse.julialang.org/u/Andrey_Stroil)\
**Replies:** 8\
**Last updated:** [June 7, 2022, 6:47pm UTC](https://discourse.julialang.org/t/read-lp-files/6877 "2022-06-07T18:47:21Z")

</div>

Hello, I have a huge stochastic optimization model and JuMP is not fast enough to deal with it. I want to write the lp model in a file and then solve it. Does JuMP have a method like read\_LP(“file.lp”)? Or is there a be…

---

## [Unable to install JuMP 1.0 or 1.1 (Julia 1.7.3)](https://discourse.julialang.org/t/unable-to-install-jump-1-0-or-1-1-julia-1-7-3/82304)

<div class="topic-metadata">

**Author:** [@adow031](https://discourse.julialang.org/u/adow031)\
**Replies:** 3\
**Last updated:** [June 6, 2022, 2:13pm UTC](https://discourse.julialang.org/t/unable-to-install-jump-1-0-or-1-1-julia-1-7-3/82304 "2022-06-06T14:13:28Z")

</div>

On a clean install of Julia 1.7.3, I cannot install a version of JuMP greater than 0.22.3. If I use \] add JuMP Julia will install version 0.22.3. If I try to force it to install 1.0 or 1.1, e.g.: \] add JuMP@1.1.0 It g…

---

## [Linear Optimization with Quadratic Constraints: Efficient, arbitrary precision solver](https://discourse.julialang.org/t/linear-optimization-with-quadratic-constraints-efficient-arbitrary-precision-solver/82105)

<div class="topic-metadata">

**Author:** [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Replies:** 14\
**Last updated:** [June 6, 2022, 8:39am UTC](https://discourse.julialang.org/t/linear-optimization-with-quadratic-constraints-efficient-arbitrary-precision-solver/82105 "2022-06-06T08:39:17Z")

</div>

I want to solve a linear optimization problem with quadratic constraints of the form \\max\_{\\boldsymbol x} y \\text{ such that } f\_i(y \\boldsymbol x) \\leq 0 \\: \\forall \\: i = 1, \\dots, C and the f\_i are quadratic in the…

---

## [Sum for components with index smaller than another index in constraints](https://discourse.julialang.org/t/sum-for-components-with-index-smaller-than-another-index-in-constraints/82117)

<div class="topic-metadata">

**Author:** [@chenr86](https://discourse.julialang.org/u/chenr86)\
**Replies:** 2\
**Last updated:** [June 6, 2022, 1:14am UTC](https://discourse.julialang.org/t/sum-for-components-with-index-smaller-than-another-index-in-constraints/82117 "2022-06-06T01:14:41Z")

</div>

Hello, I want to achieve summation of components with index smaller than i in the expression, and used in constraint. That is to say, the components in level is related to each other, e.g. level\[2\] is the sum of level\[1…

---

## [Complementarity.jl supports equality constraints?](https://discourse.julialang.org/t/complementarity-jl-supports-equality-constraints/82214)

<div class="topic-metadata">

**Author:** [@vicentemunozlh](https://discourse.julialang.org/u/vicentemunozlh)\
**Replies:** 3\
**Last updated:** [June 4, 2022, 10:42pm UTC](https://discourse.julialang.org/t/complementarity-jl-supports-equality-constraints/82214 "2022-06-04T22:42:20Z")

</div>

Hello, I have been unable to finish my MCP model because I cant find the way to add a constraint that is an equality. When I try combining and adding that constraint as @constraint or @NLconstraint and the others with @m…

---

## [How to list all default parameters of optimizers](https://discourse.julialang.org/t/how-to-list-all-default-parameters-of-optimizers/82243)

<div class="topic-metadata">

**Author:** [@Tri](https://discourse.julialang.org/u/Tri)\
**Replies:** 1\
**Last updated:** [June 4, 2022, 9:02pm UTC](https://discourse.julialang.org/t/how-to-list-all-default-parameters-of-optimizers/82243 "2022-06-04T21:02:00Z")

</div>

I know that I can change a parameter of optimizer by doing using JuMP using Ipopt model = Model(Ipopt.Optimizer) set\_optimizer\_attribute(model, “print\_level”, 0) How can I list all available parameters and their d…

---

## [How to implement a conditional over an exogenous parameter in a non linear constraint in JuMP?](https://discourse.julialang.org/t/how-to-implement-a-conditional-over-an-exogenous-parameter-in-a-non-linear-constraint-in-jump/82177)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [June 3, 2022, 12:14pm UTC](https://discourse.julialang.org/t/how-to-implement-a-conditional-over-an-exogenous-parameter-in-a-non-linear-constraint-in-jump/82177 "2022-06-03T12:14:00Z")

</div>

I need to add a condition over an exogenous parameter. These seems not to work: @NLconstraint(m, myConstraint\[i in 1:N\], x\[i\] == (myExogenousParameter\[i\] == 0.0 ? 0.0 : expression\[i\]) ) I found then this that see…

---

## [Error Nonlinear expressions may contain only scalar expressions](https://discourse.julialang.org/t/error-nonlinear-expressions-may-contain-only-scalar-expressions/82124)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 1\
**Last updated:** [June 2, 2022, 12:53pm UTC](https://discourse.julialang.org/t/error-nonlinear-expressions-may-contain-only-scalar-expressions/82124 "2022-06-02T12:53:43Z")

</div>

countBM=6 model= Model() @variable(model,x\[ i in 1:30\]) BendMom=Array{Any}(undef,countBM) zz=@NLexpression(model,\[ i in 1:30\],x\[i\]+i) BendMom\[1\]=@NLexpression(model,zz+1) julia\> BendMom\[1\]=@NLexpression(model,zz+1…

---

## [JuMP broadcasting in @constraint involving expressions throws error](https://discourse.julialang.org/t/jump-broadcasting-in-constraint-involving-expressions-throws-error/82044)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 1\
**Last updated:** [June 1, 2022, 7:48pm UTC](https://discourse.julialang.org/t/jump-broadcasting-in-constraint-involving-expressions-throws-error/82044 "2022-06-01T19:48:46Z")

</div>

An example is given below. using JuMP model = JuMP.Model() @expression(model, x, zeros(AffExpr, 1, 4)) @expression(model, y, zeros(AffExpr, 2, 4)) @constraint(model, y .\>= x) # A: OK @constraint(model, x .\<= y) # B: …

---

## [Performance of keeping a model "reference"](https://discourse.julialang.org/t/performance-of-keeping-a-model-reference/81903)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 2\
**Last updated:** [June 1, 2022, 7:39am UTC](https://discourse.julialang.org/t/performance-of-keeping-a-model-reference/81903 "2022-06-01T07:39:23Z")

</div>

I have asked about the related idea behind my problem over here, but since no conclusion could be drawn, I’ve constructed a little test. That’s where things got weird - I am unsure why the result looks the way they do, a…

---

## [Is there a way to bring the range of a summation back from an array?](https://discourse.julialang.org/t/is-there-a-way-to-bring-the-range-of-a-summation-back-from-an-array/81937)

<div class="topic-metadata">

**Author:** [@vicentemunozlh](https://discourse.julialang.org/u/vicentemunozlh)\
**Replies:** 7\
**Last updated:** [May 31, 2022, 9:24pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-bring-the-range-of-a-summation-back-from-an-array/81937 "2022-05-31T21:24:10Z")

</div>

Hello, I am new to Julia and trying to model a relatively complicated optimization problem from other lenguage(GAMS). I am stuck in trying to apply a summation in a constraint and its depndence index to be in a range pr…

---

## [SCS Indirect Solver Parallelized?](https://discourse.julialang.org/t/scs-indirect-solver-parallelized/81687)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 5\
**Last updated:** [May 30, 2022, 9:36am UTC](https://discourse.julialang.org/t/scs-indirect-solver-parallelized/81687 "2022-05-30T09:36:09Z")

</div>

Is it possible to permit the SCS.jl indirect solver to parallelize its computations with multiple threads running on a multi-core CPU? I am trying to solve a very large LP. problem: variables n: 47251695, constraints m…

---

## [Adaptive mesh refinement in JuMP](https://discourse.julialang.org/t/adaptive-mesh-refinement-in-jump/81864)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 2\
**Last updated:** [May 30, 2022, 12:01am UTC](https://discourse.julialang.org/t/adaptive-mesh-refinement-in-jump/81864 "2022-05-30T00:01:30Z")

</div>

I have a non-linear programming problem similar to the space shuttle problem in the JuMP tutorial Optimal control for a Space Shuttle reentry trajectory · JuMP. I want to implement adaptive mesh refinement to ensure an a…

---

## [Arbitrary precision refinnements with Convex.jl & COSMO.jl](https://discourse.julialang.org/t/arbitrary-precision-refinnements-with-convex-jl-cosmo-jl/61806)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 9\
**Last updated:** [May 28, 2022, 7:16am UTC](https://discourse.julialang.org/t/arbitrary-precision-refinnements-with-convex-jl-cosmo-jl/61806 "2022-05-28T07:16:53Z")

</div>

Hi, I’m solving a problem through Convex.jl & COSMO.jl. I want to build a BigFloat version of the same problem to refine the solution, and i’d like to warm start it with the low-precision solution. For the dummy problem…

---

## [Read .lp file into JuMP model in direct mode](https://discourse.julialang.org/t/read-lp-file-into-jump-model-in-direct-mode/81803)

<div class="topic-metadata">

**Author:** [@MarioSouto](https://discourse.julialang.org/u/MarioSouto)\
**Replies:** 3\
**Last updated:** [May 28, 2022, 2:58am UTC](https://discourse.julialang.org/t/read-lp-file-into-jump-model-in-direct-mode/81803 "2022-05-28T02:58:34Z")

</div>

Is it possible to read a .lp file into a JuMP optimization model in direct mode? I’m not sure how to combine direct\_model and read\_from\_file to achieve this.

---

## [Using HSL library for IPOPT in PowerModels.jl](https://discourse.julialang.org/t/using-hsl-library-for-ipopt-in-powermodels-jl/81796)

<div class="topic-metadata">

**Author:** [@aaldik](https://discourse.julialang.org/u/aaldik)\
**Replies:** 4\
**Last updated:** [May 27, 2022, 10:26pm UTC](https://discourse.julialang.org/t/using-hsl-library-for-ipopt-in-powermodels-jl/81796 "2022-05-27T22:26:04Z")

</div>

Hello I would like to ask how to use the HSL library with the solver IPOPT that is used in the library PowerModels.jl.

---

## [Dynamic NL expression in julia](https://discourse.julialang.org/t/dynamic-nl-expression-in-julia/81658)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 2\
**Last updated:** [May 27, 2022, 10:42am UTC](https://discourse.julialang.org/t/dynamic-nl-expression-in-julia/81658 "2022-05-27T10:42:46Z")

</div>

Hi, I am using Juniper to solve MNILP and with array of nonlinear expression i am getting invalid model error. is there a way to generate nonlinear expression names in a loop like @variable(model,x) zz=0.0 for i in 1:5 …

---

## [Cannot multiply a quadratic expression by an aff. expression](https://discourse.julialang.org/t/cannot-multiply-a-quadratic-expression-by-an-aff-expression/81742)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 2\
**Last updated:** [May 27, 2022, 10:34am UTC](https://discourse.julialang.org/t/cannot-multiply-a-quadratic-expression-by-an-aff-expression/81742 "2022-05-27T10:34:16Z")

</div>

using Cbc,JuMP,LinearAlgebra, Juniper,Ipopt,HiGHS; optimizer = Juniper.Optimizer; nl\_solver = optimizer\_with\_attributes(Ipopt.Optimizer); mip\_solver = optimizer\_with\_attributes(HiGHS.Optimizer); mod2 = Model(optimizer\_…

---

## [Creating a tuple from combination of tuple and vectors](https://discourse.julialang.org/t/creating-a-tuple-from-combination-of-tuple-and-vectors/81705)

<div class="topic-metadata">

**Author:** [@joxane7887](https://discourse.julialang.org/u/joxane7887)\
**Replies:** 5\
**Last updated:** [May 27, 2022, 2:43am UTC](https://discourse.julialang.org/t/creating-a-tuple-from-combination-of-tuple-and-vectors/81705 "2022-05-27T02:43:49Z")

</div>

I’d like to combine three thing; a Vector{Tuple{Int64, Int64}}, Vector{Vector{Int64}}, and a Vector{Int64} under some condition to be able to create a new tuple; in other words; a Vector{Tuple{Int64, Int64, Int64}}. And …

---

## [JuMP creating a huge MPS file](https://discourse.julialang.org/t/jump-creating-a-huge-mps-file/81477)

<div class="topic-metadata">

**Author:** [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Replies:** 22\
**Last updated:** [May 26, 2022, 10:30pm UTC](https://discourse.julialang.org/t/jump-creating-a-huge-mps-file/81477 "2022-05-26T22:30:28Z")

</div>

Further to my question, here How to specify barrier method to use? - Specific Domains / Optimization (Mathematical) - JuliaLang, I have given an example of a case where it is taking too long to build the model or write a…

---

## [JuMP writeMPS does not finish writing LP model to file](https://discourse.julialang.org/t/jump-writemps-does-not-finish-writing-lp-model-to-file/81427)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 20\
**Last updated:** [May 25, 2022, 8:31pm UTC](https://discourse.julialang.org/t/jump-writemps-does-not-finish-writing-lp-model-to-file/81427 "2022-05-25T20:31:40Z")

</div>

I’m trying to save a large linear program model created with JuMP v0.18.5 in Julia v0.6.4 to a .mps file on disk using writeMPS, but the file maxes out quickly at 711MB and the Julia script trying to write the file event…

---

## [Dynamic expreesion name in JuMP](https://discourse.julialang.org/t/dynamic-expreesion-name-in-jump/80995)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 4\
**Last updated:** [May 25, 2022, 2:15pm UTC](https://discourse.julialang.org/t/dynamic-expreesion-name-in-jump/80995 "2022-05-25T14:15:11Z")

</div>

Hi All, is there a way to create dynamic expression name in Julia? like the code given below Julia 1.2 mod2=Model() @variable(mod2,x\[ i in 1:13\]) @variable(mod2,y\[ i in 1:13\]) @constraint(mod2, \[i in 1:13\], x\[i\]+y\[i\]\>=…

---

## [Specifying JuMP solvers for function-wrapped optimization models](https://discourse.julialang.org/t/specifying-jump-solvers-for-function-wrapped-optimization-models/81030)

<div class="topic-metadata">

**Author:** [@Tominapa](https://discourse.julialang.org/u/Tominapa)\
**Replies:** 2\
**Last updated:** [May 25, 2022, 4:06pm UTC](https://discourse.julialang.org/t/specifying-jump-solvers-for-function-wrapped-optimization-models/81030 "2022-05-25T16:06:54Z")

</div>

I am building a package based around a specific optimization problem, implemented in JuMP. My code builds an optimization model based on input data, with most everything automated behind the scenes for user-friendliness…

---

## [InexactError on write\_to\_file](https://discourse.julialang.org/t/inexacterror-on-write-to-file/81577)

<div class="topic-metadata">

**Author:** [@berkorbay](https://discourse.julialang.org/u/berkorbay)\
**Replies:** 4\
**Last updated:** [May 25, 2022, 6:10am UTC](https://discourse.julialang.org/t/inexacterror-on-write-to-file/81577 "2022-05-25T06:10:08Z")

</div>

Hi, I encountered a problem with writing model specs to an LP file. I was replicating the Diet Problem example on JuMP’s page. https://jump.dev/JuMP.jl/stable/tutorials/linear/diet/ Everything went fine until the end. …

---

## [Optimization computational time](https://discourse.julialang.org/t/optimization-computational-time/81558)

<div class="topic-metadata">

**Author:** [@O\_olalekan](https://discourse.julialang.org/u/O_olalekan)\
**Replies:** 2\
**Last updated:** [May 24, 2022, 11:50am UTC](https://discourse.julialang.org/t/optimization-computational-time/81558 "2022-05-24T11:50:31Z")

</div>

I read several materials on the computational time of optimization models. The MILP computational time has always been faster than the NLP formulation. I then stumbled on an article which got that the computational time …

---

## [Use add\_to\_expression!() for multi-dimension expressions](https://discourse.julialang.org/t/use-add-to-expression-for-multi-dimension-expressions/81532)

<div class="topic-metadata">

**Author:** [@xuqingyu](https://discourse.julialang.org/u/xuqingyu)\
**Replies:** 3\
**Last updated:** [May 23, 2022, 9:52pm UTC](https://discourse.julialang.org/t/use-add-to-expression-for-multi-dimension-expressions/81532 "2022-05-23T21:52:51Z")

</div>

Hi all, May I have your suggestions on how to use add\_to\_expression!() to add one multi-dimension expressions to another? Say I have an expression A with dimension (n x m), and an expression B with dimension (n x m). …

---

## [JuMP Termination\_status category](https://discourse.julialang.org/t/jump-termination-status-category/81524)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 1\
**Last updated:** [May 23, 2022, 5:29pm UTC](https://discourse.julialang.org/t/jump-termination-status-category/81524 "2022-05-23T17:29:00Z")

</div>

JuMP’s docs break termination status into 3 groups Solved, Solved to relaxed tolerances, limits, and problemantic. Is there a way to take a termination status and get which one of these groups it is in? I could write …

---

## [Define variables on each elemnts of a vector of vectors](https://discourse.julialang.org/t/define-variables-on-each-elemnts-of-a-vector-of-vectors/81495)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 2\
**Last updated:** [May 23, 2022, 9:42am UTC](https://discourse.julialang.org/t/define-variables-on-each-elemnts-of-a-vector-of-vectors/81495 "2022-05-23T09:42:54Z")

</div>

I’m trying to find a way to define a varible x\_ijk where i in I is an n-elemnts vector of vectors, j in J and k in K are both vectors. In my case, always the length of K is equal to the number of vectors in I . The que…

---

## [How to specify barrier method to use?](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290)

<div class="topic-metadata">

**Author:** [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Replies:** 6\
**Last updated:** [May 22, 2022, 11:39pm UTC](https://discourse.julialang.org/t/how-to-specify-barrier-method-to-use/81290 "2022-05-22T23:39:03Z")

</div>

I am trying to use the barrier method using Xpress solver, but I have not been able to find the right option/attribute anywhere. The Julia wrapper for Xpress doesn’t have much documentation. The official documentation st…

---

## [Change the constraints name iteratively to JUMP model](https://discourse.julialang.org/t/change-the-constraints-name-iteratively-to-jump-model/81359)

<div class="topic-metadata">

**Author:** [@ayodyas](https://discourse.julialang.org/u/ayodyas)\
**Replies:** 1\
**Last updated:** [May 22, 2022, 8:34pm UTC](https://discourse.julialang.org/t/change-the-constraints-name-iteratively-to-jump-model/81359 "2022-05-22T20:34:12Z")

</div>

I am new to JUMP model and Julia, I have created a JUMP model, with a constraint inside a while loop I wanted to change the constraint name in each iteration and optimize the model again for example: if i=1 @cons…

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

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