# Optimization (Mathematical)

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

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

**Page:** 66

---

## [A problem with JuMP Tutorial-linear problem-cannery problem](https://discourse.julialang.org/t/a-problem-with-jump-tutorial-linear-problem-cannery-problem/78795)

<div class="topic-metadata">

**Author:** [@mahon](https://discourse.julialang.org/u/mahon)\
**Replies:** 15\
**Last updated:** [April 2, 2022, 4:26am UTC](https://discourse.julialang.org/t/a-problem-with-jump-tutorial-linear-problem-cannery-problem/78795 "2022-04-02T04:26:13Z")

</div>

when I code like this , it leads a error

---

## [JuMP optimize! used two much time and memory to solve a cplex model, do anyone knows why?](https://discourse.julialang.org/t/jump-optimize-used-two-much-time-and-memory-to-solve-a-cplex-model-do-anyone-knows-why/77966)

<div class="topic-metadata">

**Author:** [@yahengcui](https://discourse.julialang.org/u/yahengcui)\
**Replies:** 12\
**Last updated:** [April 1, 2022, 9:24pm UTC](https://discourse.julialang.org/t/jump-optimize-used-two-much-time-and-memory-to-solve-a-cplex-model-do-anyone-knows-why/77966 "2022-04-01T21:24:54Z")

</div>

I am solving cplex models using julia, while writing (in julia) the model (to .lp file) and solve the .lp file directly by cplex can be done in secs and mins, but when I want to solve the model directly in julia by using…

---

## [Issue using Convex with HiGHS for QP](https://discourse.julialang.org/t/issue-using-convex-with-highs-for-qp/78883)

<div class="topic-metadata">

**Author:** [@Graham\_Gill](https://discourse.julialang.org/u/Graham_Gill)\
**Replies:** 1\
**Last updated:** [April 1, 2022, 8:05pm UTC](https://discourse.julialang.org/t/issue-using-convex-with-highs-for-qp/78883 "2022-04-01T20:05:29Z")

</div>

I’ve been using HiGHS with Convex.jl lately for some MILPs and needed also to solve a simple continuous sum of squares minimisation. HiGHS can do this and HiGHS.jl should support this since https://github.com/jump-dev/Hi…

---

## [Malloc error with Model(Cbc.Optimizer) on v1.8.0-beta3 and M1](https://discourse.julialang.org/t/malloc-error-with-model-cbc-optimizer-on-v1-8-0-beta3-and-m1/78876)

<div class="topic-metadata">

**Author:** [@evad](https://discourse.julialang.org/u/evad)\
**Replies:** 2\
**Last updated:** [April 1, 2022, 7:48pm UTC](https://discourse.julialang.org/t/malloc-error-with-model-cbc-optimizer-on-v1-8-0-beta3-and-m1/78876 "2022-04-01T19:48:25Z")

</div>

I have the following error crashing julia 1.8.0-beta3 on M1 MacOS when using m=Model(Cbc.Optimizer): julia(17828,0x100220580) malloc: \*\*\* error for object 0xe00000000000000: pointer being freed was not allocated julia(1…

---

## [Comparison between Nonconvex.jl, JuMP and CasADi for large sparse nonlinear optimization](https://discourse.julialang.org/t/comparison-between-nonconvex-jl-jump-and-casadi-for-large-sparse-nonlinear-optimization/78825)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 8\
**Last updated:** [April 1, 2022, 3:05am UTC](https://discourse.julialang.org/t/comparison-between-nonconvex-jl-jump-and-casadi-for-large-sparse-nonlinear-optimization/78825 "2022-04-01T03:05:23Z")

</div>

I have an example which implements time-optimal control for Dubins vehicle. I have found that Nonconvex.jl is slower than JuMP. I think it is because Nonconvex.jl does not provide sparsity information to Ipopt. The nonze…

---

## [Defining constraint for renewable generation with availability factors](https://discourse.julialang.org/t/defining-constraint-for-renewable-generation-with-availability-factors/78147)

<div class="topic-metadata">

**Author:** [@mbah](https://discourse.julialang.org/u/mbah)\
**Replies:** 10\
**Last updated:** [March 31, 2022, 4:16am UTC](https://discourse.julialang.org/t/defining-constraint-for-renewable-generation-with-availability-factors/78147 "2022-03-31T04:16:11Z")

</div>

Hello, I am trying to code up a straightforward constraint for renewable generation (wind, solar etc…) without much success. As an example, the general formulation for a wind generation constraint is as follows: My…

---

## [Reading xpress problem from .lp file into Julia](https://discourse.julialang.org/t/reading-xpress-problem-from-lp-file-into-julia/78664)

<div class="topic-metadata">

**Author:** [@Marie](https://discourse.julialang.org/u/Marie)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 7:07pm UTC](https://discourse.julialang.org/t/reading-xpress-problem-from-lp-file-into-julia/78664 "2022-03-29T19:07:26Z")

</div>

I’m reading a problem from .lp into Julia. I’ve tried various xpress.optimizer params - the problem is infeasible. The reason is b/c the model isn’t read exactly as it’s defined in the .lp file - some constraints get mod…

---

## [JuMP Model Syntax](https://discourse.julialang.org/t/jump-model-syntax/78668)

<div class="topic-metadata">

**Author:** [@iAnkiit](https://discourse.julialang.org/u/iAnkiit)\
**Replies:** 1\
**Last updated:** [March 29, 2022, 1:50pm UTC](https://discourse.julialang.org/t/jump-model-syntax/78668 "2022-03-29T13:50:03Z")

</div>

Do we need to write expression with jump macros only ? like @variable, @constraint, @Objective Or we can write it as plain text like model = ax+by^2 If yes, can we write in combination Example : model = Model(Optimize…

---

## [Tutor for Julia](https://discourse.julialang.org/t/tutor-for-julia/78610)

<div class="topic-metadata">

**Author:** [@iAnkiit](https://discourse.julialang.org/u/iAnkiit)\
**Replies:** 4\
**Last updated:** [March 29, 2022, 1:22pm UTC](https://discourse.julialang.org/t/tutor-for-julia/78610 "2022-03-29T13:22:14Z")

</div>

I am learning Julia for my masters project work. There is a model written in Julia which I am referring. Though, I have cleared my basics in Julia, there is alot in JuMP , which I am unable to decode. I was thinking, if…

---

## [Optim.jl single iteration](https://discourse.julialang.org/t/optim-jl-single-iteration/78619)

<div class="topic-metadata">

**Author:** [@vmmhep](https://discourse.julialang.org/u/vmmhep)\
**Replies:** 4\
**Last updated:** [March 28, 2022, 5:57pm UTC](https://discourse.julialang.org/t/optim-jl-single-iteration/78619 "2022-03-28T17:57:01Z")

</div>

I can’t seem to find this anywhere and I’m sorry in advance if my trivial question is indeed elsewhere… I have a differentiable periodic function: function fitness(x::Vector) LV = ones(105) QV = ones(105,10) …

---

## [BilevelJump installation issue](https://discourse.julialang.org/t/bileveljump-installation-issue/78605)

<div class="topic-metadata">

**Author:** [@Fabrizio](https://discourse.julialang.org/u/Fabrizio)\
**Replies:** 4\
**Last updated:** [March 28, 2022, 10:43am UTC](https://discourse.julialang.org/t/bileveljump-installation-issue/78605 "2022-03-28T10:43:55Z")

</div>

Dear all, i am using Jump JuMP v0.22.1 https://github.com/jump-dev/JuMP.jl.git#master with MathOptInterface v0.10.5. Trying to installing BilevelJump give to me this issue: ERROR: Unsatisfiable requirements detected for…

---

## [Organize the output of a mathematical model](https://discourse.julialang.org/t/organize-the-output-of-a-mathematical-model/78378)

<div class="topic-metadata">

**Author:** [@haniaitizem](https://discourse.julialang.org/u/haniaitizem)\
**Replies:** 4\
**Last updated:** [March 26, 2022, 5:28pm UTC](https://discourse.julialang.org/t/organize-the-output-of-a-mathematical-model/78378 "2022-03-26T17:28:27Z")

</div>

Hello I have find a matrix q\[j,i,k\] at the end of my work, it represent the quantity of product k that should be ordered by client i from the plant j , I want to organize this output in a table in the row I find the plan…

---

## [Jump using \`max(x...)\` where x is a matrix?](https://discourse.julialang.org/t/jump-using-max-x-where-x-is-a-matrix/78451)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 6\
**Last updated:** [March 26, 2022, 4:35pm UTC](https://discourse.julialang.org/t/jump-using-max-x-where-x-is-a-matrix/78451 "2022-03-26T16:35:01Z")

</div>

I need to revive a previously asked question. I have a problem that involves evaluating the exp function over an array of variables and I want to avoid huge values by centering those variables before appplying exp. I get…

---

## [JuMP with user-defined non linear functions](https://discourse.julialang.org/t/jump-with-user-defined-non-linear-functions/78299)

<div class="topic-metadata">

**Author:** [@dkc94](https://discourse.julialang.org/u/dkc94)\
**Replies:** 3\
**Last updated:** [March 25, 2022, 12:43pm UTC](https://discourse.julialang.org/t/jump-with-user-defined-non-linear-functions/78299 "2022-03-25T12:43:10Z")

</div>

Hi everyone! I am new to Julia and I am trying to solve a highly non linear optimization problem. I am encountering a problem when registering the objective function and very little idea about what could be going on. He…

---

## [JuMP : optimize!(model)](https://discourse.julialang.org/t/jump-optimize-model/78445)

<div class="topic-metadata">

**Author:** [@iAnkiit](https://discourse.julialang.org/u/iAnkiit)\
**Replies:** 1\
**Last updated:** [March 25, 2022, 7:59am UTC](https://discourse.julialang.org/t/jump-optimize-model/78445 "2022-03-25T07:59:22Z")

</div>

Why do we need solvers , if we can solve model with : optimize!(model\_name) ? How optimize! works? What solvers actually does ? What if we don’t define solvers?

---

## [ANN: JuMP 1.0 is released](https://discourse.julialang.org/t/ann-jump-1-0-is-released/78425)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 5\
**Last updated:** [March 25, 2022, 2:53am UTC](https://discourse.julialang.org/t/ann-jump-1-0-is-released/78425 "2022-03-25T02:53:56Z")

</div>

Dear all, We are very pleased to announce the release of JuMP 1.0! You can read more about it here: JuMP 1.0.0 is released | JuMP A big thank you to all of the contributors over the last (nearly) 10 years! You can fin…

---

## [Equivalent of old syntax @constraintref](https://discourse.julialang.org/t/equivalent-of-old-syntax-constraintref/78315)

<div class="topic-metadata">

**Author:** [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Replies:** 2\
**Last updated:** [March 24, 2022, 5:39pm UTC](https://discourse.julialang.org/t/equivalent-of-old-syntax-constraintref/78315 "2022-03-24T17:39:43Z")

</div>

I came across @constraintref macro which was available in older versions of JuMP to generate constraints in a loop. This was removed in latest releases. How could I perform the same functionality in the latest version of…

---

## [Replace a JuMP variable by a number](https://discourse.julialang.org/t/replace-a-jump-variable-by-a-number/78158)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 5\
**Last updated:** [March 23, 2022, 4:58pm UTC](https://discourse.julialang.org/t/replace-a-jump-variable-by-a-number/78158 "2022-03-23T16:58:41Z")

</div>

I have a large optimization problem written in JuMP.jl and do not get the expected results. To debug my program, I want to replace the variables in constraints by their values found by an analytical calculation. That is,…

---

## [Trouble with sequential LP solve (JuMP, HiGHS)](https://discourse.julialang.org/t/trouble-with-sequential-lp-solve-jump-highs/78203)

<div class="topic-metadata">

**Author:** [@gleyland](https://discourse.julialang.org/u/gleyland)\
**Replies:** 4\
**Last updated:** [March 23, 2022, 5:29am UTC](https://discourse.julialang.org/t/trouble-with-sequential-lp-solve-jump-highs/78203 "2022-03-23T05:29:57Z")

</div>

Hi, I’m afraid this is going to be completely unreproduceable, but after a couple of days I’m starting to think that my problem might not be entirely my own mistakes. I’m using JuMP and HiGHS (or Gurobi) to solve seque…

---

## [Variable Length Optimization Algorithms?](https://discourse.julialang.org/t/variable-length-optimization-algorithms/78285)

<div class="topic-metadata">

**Author:** [@ParadaCarleton](https://discourse.julialang.org/u/ParadaCarleton)\
**Replies:** 3\
**Last updated:** [March 22, 2022, 8:02pm UTC](https://discourse.julialang.org/t/variable-length-optimization-algorithms/78285 "2022-03-22T20:02:49Z")

</div>

Are there any implementations of algorithms for variable-length optimization, where the number of parameters can vary? Examples can be found here (particle swarm based), here, here, and here (genetic algorithms). (If no…

---

## [Find which constrains are violated in an IPOPT JuMP model](https://discourse.julialang.org/t/find-which-constrains-are-violated-in-an-ipopt-jump-model/78228)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 2\
**Last updated:** [March 22, 2022, 8:35am UTC](https://discourse.julialang.org/t/find-which-constrains-are-violated-in-an-ipopt-jump-model/78228 "2022-03-22T08:35:31Z")

</div>

I have a model I’m trying to optimise which is returning “LOCALLY\_INFEASIBLE”. When using a linear solver like Gurobi at this point I’d compute conflicts, I appreciate this isn’t possible when working with a non-linear I…

---

## [MethodError: no method matching ^(::QuadExpr, ::Float64)](https://discourse.julialang.org/t/methoderror-no-method-matching-quadexpr-float64/78247)

<div class="topic-metadata">

**Author:** [@Eric.O](https://discourse.julialang.org/u/Eric.O)\
**Replies:** 4\
**Last updated:** [March 22, 2022, 3:37am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-quadexpr-float64/78247 "2022-03-22T03:37:42Z")

</div>

I am trying to run this code in Julia but I keep getting this error MethodError: no method matching ^(::QuadExpr, ::Float64) below is my code: I will be grateful if someone can help me correct this error. Thanks in adv…

---

## [Best Nonlinear Optimizer for a Continuous Convex Problem](https://discourse.julialang.org/t/best-nonlinear-optimizer-for-a-continuous-convex-problem/77771)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 44\
**Last updated:** [March 21, 2022, 2:38pm UTC](https://discourse.julialang.org/t/best-nonlinear-optimizer-for-a-continuous-convex-problem/77771 "2022-03-21T14:38:51Z")

</div>

Hi, I have a simple problem in which I want to \\max\_{x \\in \\mathbb{R}^{N}} f(x) \\text{s.t}\\hspace{5pt}x \\geq 0 where f(x) is continuous and globally concave. Which is the best solver for nonlinear, globally conca…

---

## [Right way to define a constraint](https://discourse.julialang.org/t/right-way-to-define-a-constraint/78116)

<div class="topic-metadata">

**Author:** [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Replies:** 2\
**Last updated:** [March 20, 2022, 11:54pm UTC](https://discourse.julialang.org/t/right-way-to-define-a-constraint/78116 "2022-03-20T23:54:36Z")

</div>

I am having difficulty in defining a constraint efficiently that is based on a matrix of decision variables. A MWE is given below but as you will see it creates a number of intermediate expressions, so it is not the best…

---

## [MathOptInterface: How to create a 2-dimensional variable?](https://discourse.julialang.org/t/mathoptinterface-how-to-create-a-2-dimensional-variable/78039)

<div class="topic-metadata">

**Author:** [@Timothy\_Yu](https://discourse.julialang.org/u/Timothy_Yu)\
**Replies:** 4\
**Last updated:** [March 18, 2022, 2:07am UTC](https://discourse.julialang.org/t/mathoptinterface-how-to-create-a-2-dimensional-variable/78039 "2022-03-18T02:07:33Z")

</div>

I am new to MOI and am looking for something equivalent to JuMP’s @variable(model, x\[P,M\] \>=0).

---

## [JuMP or Convex: stuck with very specific constraint, not sure if possible as originally intended](https://discourse.julialang.org/t/jump-or-convex-stuck-with-very-specific-constraint-not-sure-if-possible-as-originally-intended/77989)

<div class="topic-metadata">

**Author:** [@johnabs](https://discourse.julialang.org/u/johnabs)\
**Replies:** 5\
**Last updated:** [March 17, 2022, 4:38pm UTC](https://discourse.julialang.org/t/jump-or-convex-stuck-with-very-specific-constraint-not-sure-if-possible-as-originally-intended/77989 "2022-03-17T16:38:55Z")

</div>

Hi everyone, Let me start with a “visual” of my issue: imagine a binary matrix with some constraints on how the rows and columns can “interact” with each other. In my case, I need a constraint within each row that guara…

---

## [Using alternative array container types in JuMP](https://discourse.julialang.org/t/using-alternative-array-container-types-in-jump/77707)

<div class="topic-metadata">

**Author:** [@BSnelling](https://discourse.julialang.org/u/BSnelling)\
**Replies:** 5\
**Last updated:** [March 16, 2022, 8:03pm UTC](https://discourse.julialang.org/t/using-alternative-array-container-types-in-jump/77707 "2022-03-16T20:03:04Z")

</div>

I am trying to force the container type used by a JuMP model. My example uses KeyedArray but I’ve seen a similar error when specifying other types from outside JuMP (e.g. AxisArray). using JuMP, AxisKeys, GLPK vals = \[…

---

## [Juniper integer-objective fails on specific parameters](https://discourse.julialang.org/t/juniper-integer-objective-fails-on-specific-parameters/77940)

<div class="topic-metadata">

**Author:** [@ecyrb](https://discourse.julialang.org/u/ecyrb)\
**Replies:** 6\
**Last updated:** [March 16, 2022, 3:09pm UTC](https://discourse.julialang.org/t/juniper-integer-objective-fails-on-specific-parameters/77940 "2022-03-16T15:09:50Z")

</div>

Simple sum-of-squares toy example, succeeds with 5 variables, stack-trace with 6 variables. I know it’s sort of a silly example, but it feels to me like the behaviour should be consistent between problem\_size = 5 and 6.…

---

## [NLopt :FORCED\_STOP](https://discourse.julialang.org/t/nlopt-forced-stop/47747)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 2\
**Last updated:** [March 15, 2022, 8:57am UTC](https://discourse.julialang.org/t/nlopt-forced-stop/47747 "2022-03-15T08:57:19Z")

</div>

Hello, I am trying to get NLopt to work but it just stops immediately and gives :FORCED\_STOP. I tried the following but it looks like the algorithm isn’t even going into \_ff. Any thoughts? Thank you! function ff(x) …

---

## [Juniper behaviour: No incumbent when MIP feasible?](https://discourse.julialang.org/t/juniper-behaviour-no-incumbent-when-mip-feasible/77785)

<div class="topic-metadata">

**Author:** [@ecyrb](https://discourse.julialang.org/u/ecyrb)\
**Replies:** 3\
**Last updated:** [March 14, 2022, 3:41pm UTC](https://discourse.julialang.org/t/juniper-behaviour-no-incumbent-when-mip-feasible/77785 "2022-03-14T15:41:33Z")

</div>

I’m getting some unintuitive behaviour with Juniper (HiGHS & Ipopt). HiGHS is finding a solution that satisfies the constraints, but beyond that an incumbent solution won’t be reported and Juniper will time-out at an inf…

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

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