# Optimization (Mathematical)

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

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

**Page:** 45

---

## [Callbacks - Accessing Gurobi specific functionality](https://discourse.julialang.org/t/callbacks-accessing-gurobi-specific-functionality/98560)

<div class="topic-metadata">

**Author:** [@Sokar](https://discourse.julialang.org/u/Sokar)\
**Replies:** 2\
**Last updated:** [May 10, 2023, 5:20am UTC](https://discourse.julialang.org/t/callbacks-accessing-gurobi-specific-functionality/98560 "2023-05-10T05:20:21Z")

</div>

Hi everyone. Working on my master thesis project, I have run into some problems using JuMP and Gurobi. I need to use Gurobi specific callback functionality, but as far as I can tell, this requires me to construct my mod…

---

## [@NLconstraint and String Name](https://discourse.julialang.org/t/nlconstraint-and-string-name/98550)

<div class="topic-metadata">

**Author:** [@Mirsad\_Cosovic](https://discourse.julialang.org/u/Mirsad_Cosovic)\
**Replies:** 4\
**Last updated:** [May 9, 2023, 8:59pm UTC](https://discourse.julialang.org/t/nlconstraint-and-string-name/98550 "2023-05-09T20:59:38Z")

</div>

Can the string be included to represent the constraint name in non-linear constraints using @NLconstraint, akin to @constraint’s base\_name functionality?

---

## [Parallelization of Genetic Algorithm (Evolutionaty.jl) with Distributed.jl and Gurobi](https://discourse.julialang.org/t/parallelization-of-genetic-algorithm-evolutionaty-jl-with-distributed-jl-and-gurobi/98389)

<div class="topic-metadata">

**Author:** [@umbe](https://discourse.julialang.org/u/umbe)\
**Replies:** 4\
**Last updated:** [May 9, 2023, 3:53pm UTC](https://discourse.julialang.org/t/parallelization-of-genetic-algorithm-evolutionaty-jl-with-distributed-jl-and-gurobi/98389 "2023-05-09T15:53:32Z")

</div>

Hello to everyone, I’m trying to solve an nested optimization problem that is structured in the following way: Master Problem: heuristic solver (genetic algorithm with Evolutionary.jl) for nonlinear black box problem S…

---

## [Can I name new JuMP constraints in a function using an argument?](https://discourse.julialang.org/t/can-i-name-new-jump-constraints-in-a-function-using-an-argument/95640)

<div class="topic-metadata">

**Author:** [@sallyrobson](https://discourse.julialang.org/u/sallyrobson)\
**Replies:** 2\
**Last updated:** [May 9, 2023, 1:30pm UTC](https://discourse.julialang.org/t/can-i-name-new-jump-constraints-in-a-function-using-an-argument/95640 "2023-05-09T13:30:09Z")

</div>

I’m trying to define a function that would add a JuMP constraint to a model, and I would like to set the name of the constraint using an argument from the function. When I have tried to do this in the past it just sets t…

---

## [JuMP: How to see output of particular variable and indicies?](https://discourse.julialang.org/t/jump-how-to-see-output-of-particular-variable-and-indicies/98505)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 5\
**Last updated:** [May 9, 2023, 9:22am UTC](https://discourse.julialang.org/t/jump-how-to-see-output-of-particular-variable-and-indicies/98505 "2023-05-09T09:22:49Z")

</div>

Hi there Is it possible to ask JuMp to just show some particular indicies of varaiables? For instance let’s say we have a binary variable @variable(model, x\[i = 2:3, j = 1:2:30, \["A", "B",..."Z"\]\] \>= 0, Bin) and aft…

---

## [Out of memory when constructing large sparse SDP in JuMP](https://discourse.julialang.org/t/out-of-memory-when-constructing-large-sparse-sdp-in-jump/98332)

<div class="topic-metadata">

**Author:** [@mattgiamou](https://discourse.julialang.org/u/mattgiamou)\
**Replies:** 2\
**Last updated:** [May 9, 2023, 8:17am UTC](https://discourse.julialang.org/t/out-of-memory-when-constructing-large-sparse-sdp-in-jump/98332 "2023-05-09T08:17:29Z")

</div>

I need to solve large but very sparse SDPs with COSMO.jl. The following code runs out of memory while constructing the linear matrix inequality (i.e., the PSD constraint): using JuMP, COSMO using LinearAlgebra using Spa…

---

## [Pi (Π) operation in the objective function JuMP](https://discourse.julialang.org/t/pi-operation-in-the-objective-function-jump/97509)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 19\
**Last updated:** [May 8, 2023, 11:55pm UTC](https://discourse.julialang.org/t/pi-operation-in-the-objective-function-jump/97509 "2023-05-08T23:55:42Z")

</div>

I want to solve a quadratic programming problem with JuMP. I don’t know if Ipopt can solve it or not. I’m using HiGHS (Although I prefer Ipopt if it’s possible). Here is the model: \\eqalign{ & \\max z = \\prod\\limits\_{…

---

## [Using literal 1.0 in JuMP @constraint throws an error](https://discourse.julialang.org/t/using-literal-1-0-in-jump-constraint-throws-an-error/98496)

<div class="topic-metadata">

**Author:** [@gmsowers](https://discourse.julialang.org/u/gmsowers)\
**Replies:** 2\
**Last updated:** [May 8, 2023, 9:58pm UTC](https://discourse.julialang.org/t/using-literal-1-0-in-jump-constraint-throws-an-error/98496 "2023-05-08T21:58:00Z")

</div>

The following code throws an error: using JuMP m = Model() @variable(m, x) y = Vector{Any}(undef, 2) y\[1\] = @variable(m, base\_name=“y1”) y\[2\] = 1.0 @constraint(m, sum(\[x \* yi for yi in y\]) == 1.0) ERROR: MethodError:…

---

## [Help with GAMS.jl "unrecognized operation" error](https://discourse.julialang.org/t/help-with-gams-jl-unrecognized-operation-error/98498)

<div class="topic-metadata">

**Author:** [@Huan\_Deng](https://discourse.julialang.org/u/Huan_Deng)\
**Replies:** 4\
**Last updated:** [May 8, 2023, 9:26pm UTC](https://discourse.julialang.org/t/help-with-gams-jl-unrecognized-operation-error/98498 "2023-05-08T21:26:56Z")

</div>

Hi, I am trying to use GAMS to solve a constrained optimization problem. My own problem is quite complicated, and I must use user-defined functions for both the objective and constraints. Below is a reproducible, simple…

---

## [Help with multi-objective, non-linear JuMP problem](https://discourse.julialang.org/t/help-with-multi-objective-non-linear-jump-problem/98487)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 4\
**Last updated:** [May 8, 2023, 9:13pm UTC](https://discourse.julialang.org/t/help-with-multi-objective-non-linear-jump-problem/98487 "2023-05-08T21:13:29Z")

</div>

This single objective version below works just fine: using JuMP using Ipopt S, L, U = 1000, 15, 40 N = 54 r = rand(54, 2) model = Model(Ipopt.Optimizer) @variable(model, s\[i=1:N\], start=14) @NLexpression…

---

## [SDDP.jl: Can it model nonconvex multistage SPs?](https://discourse.julialang.org/t/sddp-jl-can-it-model-nonconvex-multistage-sps/98370)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 4\
**Last updated:** [May 6, 2023, 2:54am UTC](https://discourse.julialang.org/t/sddp-jl-can-it-model-nonconvex-multistage-sps/98370 "2023-05-06T02:54:10Z")

</div>

As the title says, I want to know if the package SDDP.jl models nonconvex multistage stochastic programs? The documentation says it works for convex multistage SPs; however, to make sure I don’t reinvent the wheel, I jus…

---

## [Error code for GLPK and SigmoidalProgramming](https://discourse.julialang.org/t/error-code-for-glpk-and-sigmoidalprogramming/98043)

<div class="topic-metadata">

**Author:** [@meet.saiya](https://discourse.julialang.org/u/meet.saiya)\
**Replies:** 11\
**Last updated:** [May 5, 2023, 8:15pm UTC](https://discourse.julialang.org/t/error-code-for-glpk-and-sigmoidalprogramming/98043 "2023-05-05T20:15:01Z")

</div>

I’m trying to use Sigmoidal Programming to solve an optimization problem which is minimize (sum of concave functions) subject to linear constraints. When I input problem = LinearSP(fs, dfs, z, A, b) it seems to read and…

---

## [MathOptInterface not supported by solvers](https://discourse.julialang.org/t/mathoptinterface-not-supported-by-solvers/98376)

<div class="topic-metadata">

**Author:** [@Gianmarco\_Montillo](https://discourse.julialang.org/u/Gianmarco_Montillo)\
**Replies:** 3\
**Last updated:** [May 5, 2023, 12:29pm UTC](https://discourse.julialang.org/t/mathoptinterface-not-supported-by-solvers/98376 "2023-05-05T12:29:35Z")

</div>

I am trying to solve a model using constraints of type MOI, but every solver I try out, results in a error stating Constraints of type MathOptInterface.ScalarQuadraticFunction{Float64}-in-MathOptInterface.EqualTo{Float…

---

## [Callback function in IPOP for catching inner iterations](https://discourse.julialang.org/t/callback-function-in-ipop-for-catching-inner-iterations/98246)

<div class="topic-metadata">

**Author:** [@Annaquest](https://discourse.julialang.org/u/Annaquest)\
**Replies:** 1\
**Last updated:** [May 4, 2023, 9:02pm UTC](https://discourse.julialang.org/t/callback-function-in-ipop-for-catching-inner-iterations/98246 "2023-05-04T21:02:03Z")

</div>

Hi, I am currently using a callback function to get the number of inner iterations. Firstly, I have this: set\_optimizer\_attributes(model, “mu\_target” =\> μ, “mu\_init” =\> μ); Where μ is updated outside of IPOPT ( I hav…

---

## [Request help on PATHSolver.jl](https://discourse.julialang.org/t/request-help-on-pathsolver-jl/98335)

<div class="topic-metadata">

**Author:** [@Shailesh](https://discourse.julialang.org/u/Shailesh)\
**Replies:** 2\
**Last updated:** [May 4, 2023, 7:54pm UTC](https://discourse.julialang.org/t/request-help-on-pathsolver-jl/98335 "2023-05-04T19:54:39Z")

</div>

Hi, I wanted to solve complementarity problem using PATHSolver, and kept getting the error: “could not load library “./julia/datadeps/libpath50/libpath50.dylib” dlopen(.julia/datadeps/libpath50/libpath50.dylib, 0x0001…

---

## [Can't register a function to JuMP](https://discourse.julialang.org/t/cant-register-a-function-to-jump/98276)

<div class="topic-metadata">

**Author:** [@bdas123](https://discourse.julialang.org/u/bdas123)\
**Replies:** 1\
**Last updated:** [May 3, 2023, 9:33pm UTC](https://discourse.julialang.org/t/cant-register-a-function-to-jump/98276 "2023-05-03T21:33:25Z")

</div>

Hello, here is a reduced version of my actual code which replicates my problem. using JuMP using Ipopt; a0 = rand(81); b = 10 c = 11 d = zeros(b,c) function calculation\_2(a) for i in 1:b for j in 1:c …

---

## [Help optimizing a non-linear objective with JuMP](https://discourse.julialang.org/t/help-optimizing-a-non-linear-objective-with-jump/98270)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [May 3, 2023, 9:16pm UTC](https://discourse.julialang.org/t/help-optimizing-a-non-linear-objective-with-jump/98270 "2023-05-03T21:16:05Z")

</div>

Here is a very stripped down toy example that is roughly equivalent to my real problem (without any constraints): using JuMP using Ipopt N = 54 r = rand(N) R = rand() model = Model(Ipopt.Optimizer) @variable(mod…

---

## [Coefficients of combination of matrices](https://discourse.julialang.org/t/coefficients-of-combination-of-matrices/98241)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 6\
**Last updated:** [May 3, 2023, 2:27pm UTC](https://discourse.julialang.org/t/coefficients-of-combination-of-matrices/98241 "2023-05-03T14:27:09Z")

</div>

We have four tensors A, B, C, D of the same dimension (m \* n \* p, e.g. 1800 \* 25 \* 25). We need to find coefficients x1, x2, x3 such that: x1 \* A - x2 \* B - x3 \* C ≈ D given that x1 + x2 + x3 = 1 and 0\<= x1,x2,x3 \<=1 …

---

## [Variable in JuMP with arc index](https://discourse.julialang.org/t/variable-in-jump-with-arc-index/98179)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 2\
**Last updated:** [May 2, 2023, 7:54pm UTC](https://discourse.julialang.org/t/variable-in-jump-with-arc-index/98179 "2023-05-02T19:54:29Z")

</div>

Dear all I have defined the following variable: @variable(modelo, x\[(i,j) ∈ A, t ∈ T\] \>= 0) where A = \[ (1, 5) (1, 6) (1, 7) (2, 5) (2, 6) (2, 7) (3, 5) (3, 6) (3, 7) (4, 5) (4, 6) (4, 7) \]; T=1:12 Howev…

---

## [Convex.jl norm of multiple variables](https://discourse.julialang.org/t/convex-jl-norm-of-multiple-variables/98165)

<div class="topic-metadata">

**Author:** [@ajd](https://discourse.julialang.org/u/ajd)\
**Replies:** 5\
**Last updated:** [May 1, 2023, 10:09pm UTC](https://discourse.julialang.org/t/convex-jl-norm-of-multiple-variables/98165 "2023-05-01T22:09:44Z")

</div>

I would like to use Convex.jl to solve a problem along the lines of using Convex x = Variable(1) y = Variable(1) z = Variable(1) problem = minimize(x+y+z,norm(\[x,y,z\])\<=1) However, when I run this code, I get the error …

---

## [How to fix this error when I use JUMP to maximize a function?](https://discourse.julialang.org/t/how-to-fix-this-error-when-i-use-jump-to-maximize-a-function/98155)

<div class="topic-metadata">

**Author:** [@maoc](https://discourse.julialang.org/u/maoc)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 9:53am UTC](https://discourse.julialang.org/t/how-to-fix-this-error-when-i-use-jump-to-maximize-a-function/98155 "2023-05-01T09:53:57Z")

</div>

I’m trying to optimize a likelihood function a little different from the traditional ones. I’m going to call this likelihood function of mine “faux”. To show my problem, first see how well this example (I took this examp…

---

## [How to get the variables/constraint names using MathProgBase?](https://discourse.julialang.org/t/how-to-get-the-variables-constraint-names-using-mathprogbase/40511)

<div class="topic-metadata">

**Author:** [@sugyeong-jo](https://discourse.julialang.org/u/sugyeong-jo)\
**Replies:** 12\
**Last updated:** [April 29, 2023, 1:51pm UTC](https://discourse.julialang.org/t/how-to-get-the-variables-constraint-names-using-mathprogbase/40511 "2023-04-29T13:51:05Z")

</div>

Is there any method for getting the variables/constraint name not a just index from the MPS file format? I just want to make a dictionary for “variable name - index, constraint name - index” model = MathProgBase.Linear…

---

## [Last Call: Optimization Modeling session @ fall INFORMS](https://discourse.julialang.org/t/last-call-optimization-modeling-session-fall-informs/98053)

<div class="topic-metadata">

**Author:** [@4er](https://discourse.julialang.org/u/4er)\
**Replies:** 0\
**Last updated:** [April 28, 2023, 5:11pm UTC](https://discourse.julialang.org/t/last-call-optimization-modeling-session-fall-informs/98053 "2023-04-28T17:11:48Z")

</div>

LAST CALL! Optimization Modeling Software session INFORMS Annual Meeting, October 15-18, 2023 Deadline for speaker names: Tuesday, May 2 Deadline for abstracts: Tuesday, May 16 To participate in this session, you ne…

---

## [Using feasRelax in Julia with Gurobi and JuMP](https://discourse.julialang.org/t/using-feasrelax-in-julia-with-gurobi-and-jump/97935)

<div class="topic-metadata">

**Author:** [@umbe](https://discourse.julialang.org/u/umbe)\
**Replies:** 3\
**Last updated:** [April 28, 2023, 10:17am UTC](https://discourse.julialang.org/t/using-feasrelax-in-julia-with-gurobi-and-jump/97935 "2023-04-28T10:17:01Z")

</div>

Hello to everyone! I have an optimization problem that, according to some input data, can be unfeasible. I would like to check the termination status and, in case of infeasibility, try to solve it relaxing some constrai…

---

## [Naming constraints error](https://discourse.julialang.org/t/naming-constraints-error/97959)

<div class="topic-metadata">

**Author:** [@irene\_ub](https://discourse.julialang.org/u/irene_ub)\
**Replies:** 1\
**Last updated:** [April 26, 2023, 10:57pm UTC](https://discourse.julialang.org/t/naming-constraints-error/97959 "2023-04-26T22:57:36Z")

</div>

Hello, I have an optimization model, for which I’m trying to give names to its constraints so that I can write them to an lp file and find them easily. However, I’m having some trouble. The constraint specifically that…

---

## [COUENNE with Julia](https://discourse.julialang.org/t/couenne-with-julia/43216)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 47\
**Last updated:** [April 26, 2023, 10:43pm UTC](https://discourse.julialang.org/t/couenne-with-julia/43216 "2023-04-26T22:43:40Z")

</div>

hello there, I am trying to install and use Couenne on Windows 10 so I can use it in my Julia program, Does anyone has experience with installing solvers. It is my first time to do something like that. What I understand…

---

## [How to change all desion variables from binary to non-negative and vice versa?](https://discourse.julialang.org/t/how-to-change-all-desion-variables-from-binary-to-non-negative-and-vice-versa/97893)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 1\
**Last updated:** [April 25, 2023, 3:43pm UTC](https://discourse.julialang.org/t/how-to-change-all-desion-variables-from-binary-to-non-negative-and-vice-versa/97893 "2023-04-25T15:43:26Z")

</div>

Is it possible to define a model via cplex where all the variables are binary like @variable(model, a, Bin), and run this model, then without any manual modification change all varaibles to nonnegative and run it again? …

---

## [Using DiffEqBase.NLSolveTerminationCondition in NonlinearSolve.jl](https://discourse.julialang.org/t/using-diffeqbase-nlsolveterminationcondition-in-nonlinearsolve-jl/97873)

<div class="topic-metadata">

**Author:** [@psterzinger](https://discourse.julialang.org/u/psterzinger)\
**Replies:** 4\
**Last updated:** [April 25, 2023, 7:10am UTC](https://discourse.julialang.org/t/using-diffeqbase-nlsolveterminationcondition-in-nonlinearsolve-jl/97873 "2023-04-25T07:10:16Z")

</div>

I am trying to solve a system of three nonlinear equations and would like to use the termination conditions provided by DiffEqBase.NLSolveTerminationCondition (see the documentation of NonlinearSolve.jl. The function de…

---

## [Help with setting up a JuMP model to give an even 'spread' of samples](https://discourse.julialang.org/t/help-with-setting-up-a-jump-model-to-give-an-even-spread-of-samples/97718)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 3\
**Last updated:** [April 25, 2023, 1:05am UTC](https://discourse.julialang.org/t/help-with-setting-up-a-jump-model-to-give-an-even-spread-of-samples/97718 "2023-04-25T01:05:42Z")

</div>

Hi everyone, I’m trying to learn optimization alongside JuMP syntax, and as a toy problem, I’m trying an integer based problem, in which I have a variable y, with decision variables x (in \[0,1\]), and I want to be able t…

---

## [Nonlinear objective with both splatted variable and vector parameters](https://discourse.julialang.org/t/nonlinear-objective-with-both-splatted-variable-and-vector-parameters/97791)

<div class="topic-metadata">

**Author:** [@franckgaga](https://discourse.julialang.org/u/franckgaga)\
**Replies:** 7\
**Last updated:** [April 23, 2023, 7:43pm UTC](https://discourse.julialang.org/t/nonlinear-objective-with-both-splatted-variable-and-vector-parameters/97791 "2023-04-23T19:43:57Z")

</div>

Hi, I’m currently writing a model predictive control package. The JuMP package is really helpful, thanks for everything. For nonlinear programming, my decision variable is a vector so I need to rely on the splatting sy…

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

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