# Optimization (Mathematical)

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

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

**Page:** 40

---

## [Autodiff of vector inputs with Enzyme.jl (and possibly Optimization.jl)](https://discourse.julialang.org/t/autodiff-of-vector-inputs-with-enzyme-jl-and-possibly-optimization-jl/101485)

<div class="topic-metadata">

**Author:** [@told](https://discourse.julialang.org/u/told)\
**Replies:** 9\
**Last updated:** [August 16, 2023, 8:54am UTC](https://discourse.julialang.org/t/autodiff-of-vector-inputs-with-enzyme-jl-and-possibly-optimization-jl/101485 "2023-08-16T08:54:03Z")

</div>

So we started a new huge project for which we aim to use Optimization.jl with Enzyme.jl as AD backend. We came up with some early prototypes and plugged that into Optimization.jl, unfortunately not very succesful (It se…

---

## [NLopt optimizer just return the initial value](https://discourse.julialang.org/t/nlopt-optimizer-just-return-the-initial-value/102820)

<div class="topic-metadata">

**Author:** [@MKY](https://discourse.julialang.org/u/MKY)\
**Replies:** 3\
**Last updated:** [August 16, 2023, 2:25am UTC](https://discourse.julialang.org/t/nlopt-optimizer-just-return-the-initial-value/102820 "2023-08-16T02:25:19Z")

</div>

opt = Opt(:LD\_SLSQP,4) opt.lower\_bounds = \[0,0,0,0\] opt.ftol\_abs = 1e-20 opt.min\_objective = risk\_budget\_objective equality\_constraint!(opt,weights -\> total\_weight\_constraint(x)) (optf,optx,ret) = optimize(opt,\[0.25,0.25…

---

## [Bizarre d(variable) syntax encountered when reading model written in .mdl file](https://discourse.julialang.org/t/bizarre-d-variable-syntax-encountered-when-reading-model-written-in-mdl-file/102645)

<div class="topic-metadata">

**Author:** [@ajcost](https://discourse.julialang.org/u/ajcost)\
**Replies:** 5\
**Last updated:** [August 15, 2023, 8:45pm UTC](https://discourse.julialang.org/t/bizarre-d-variable-syntax-encountered-when-reading-model-written-in-mdl-file/102645 "2023-08-15T20:45:16Z")

</div>

I was wondering if anyone had familiarity with something called MoDeL language. It seems to be some AML type optimization language. I found bizarre syntax in which constraints are written with d(variable). Meaning “chang…

---

## [Understanding an Enzyme Warning Message](https://discourse.julialang.org/t/understanding-an-enzyme-warning-message/102825)

<div class="topic-metadata">

**Author:** [@nina](https://discourse.julialang.org/u/nina)\
**Replies:** 1\
**Last updated:** [August 15, 2023, 7:38pm UTC](https://discourse.julialang.org/t/understanding-an-enzyme-warning-message/102825 "2023-08-15T19:38:18Z")

</div>

When training a UDE with many parameters (\>100) I get an Enzyme warning if I do not select the AD algorithm a-priori. This warning appears not once, but several times during the optimization process. While I can obviousl…

---

## [AMPL to Julia](https://discourse.julialang.org/t/ampl-to-julia/102800)

<div class="topic-metadata">

**Author:** [@Julianewbie](https://discourse.julialang.org/u/Julianewbie)\
**Replies:** 3\
**Last updated:** [August 15, 2023, 10:30am UTC](https://discourse.julialang.org/t/ampl-to-julia/102800 "2023-08-15T10:30:30Z")

</div>

Hello, I am trying to convert an AMPL file to Julia and I dont know how to get started I have the following expressions that I need help with so I can use them as a reference to get started, the second one should be a f…

---

## [Model building problem](https://discourse.julialang.org/t/model-building-problem/102783)

<div class="topic-metadata">

**Author:** [@jack\_lee](https://discourse.julialang.org/u/jack_lee)\
**Replies:** 13\
**Last updated:** [August 15, 2023, 7:27am UTC](https://discourse.julialang.org/t/model-building-problem/102783 "2023-08-15T07:27:32Z")

</div>

The target of a survey is set as business people and college students, requirements: The total number is 600,and student is not less than 250; the way of survey includes questionnaire and phone, the number is questionn…

---

## [Creating a PSDCone Constraint in COSMO](https://discourse.julialang.org/t/creating-a-psdcone-constraint-in-cosmo/102749)

<div class="topic-metadata">

**Author:** [@fimiller](https://discourse.julialang.org/u/fimiller)\
**Replies:** 7\
**Last updated:** [August 14, 2023, 8:29pm UTC](https://discourse.julialang.org/t/creating-a-psdcone-constraint-in-cosmo/102749 "2023-08-14T20:29:28Z")

</div>

Due to memory limitation issues, I am unable to use JuMP to create variables and the model I would like to use. As such, I am trying to use COSMO directly. I am trying to create a PSDCone constraint of the form (A - dia…

---

## [Sqrt of QuadExpr](https://discourse.julialang.org/t/sqrt-of-quadexpr/102797)

<div class="topic-metadata">

**Author:** [@i9e1](https://discourse.julialang.org/u/i9e1)\
**Replies:** 2\
**Last updated:** [August 14, 2023, 7:45pm UTC](https://discourse.julialang.org/t/sqrt-of-quadexpr/102797 "2023-08-14T19:45:21Z")

</div>

Hi there, Do you think sqrt of special cases of QuadExpr is useful or dangerous? Currrently the user gets a warning when using the unsupported nonlinear operator sqrt and has to do manual reformulation (where possible)…

---

## [Extreme ray values unbounded LP JuMP](https://discourse.julialang.org/t/extreme-ray-values-unbounded-lp-jump/102686)

<div class="topic-metadata">

**Author:** [@bcoulier](https://discourse.julialang.org/u/bcoulier)\
**Replies:** 5\
**Last updated:** [August 11, 2023, 12:56pm UTC](https://discourse.julialang.org/t/extreme-ray-values-unbounded-lp-jump/102686 "2023-08-11T12:56:39Z")

</div>

I’m currently dealing with an LP problem where the solution to the primal turns out to be infeasible, leading to an unbounded dual. In order to create a feasibility cut, I’m aiming to acquire the extreme ray values from …

---

## [How to set JuMP.jl timeout?](https://discourse.julialang.org/t/how-to-set-jump-jl-timeout/102701)

<div class="topic-metadata">

**Author:** [@peng](https://discourse.julialang.org/u/peng)\
**Replies:** 2\
**Last updated:** [August 11, 2023, 6:15am UTC](https://discourse.julialang.org/t/how-to-set-jump-jl-timeout/102701 "2023-08-11T06:15:33Z")

</div>

Does anybody know how to set timeout for JuMP.jl? I used JuMP for some optimization problems, but sometime it falls in long time computation. I hope the calculation time is explicitly limited even though a exception is …

---

## [InexactError in Callback](https://discourse.julialang.org/t/inexacterror-in-callback/102648)

<div class="topic-metadata">

**Author:** [@jack\_lee](https://discourse.julialang.org/u/jack_lee)\
**Replies:** 2\
**Last updated:** [August 10, 2023, 8:49pm UTC](https://discourse.julialang.org/t/inexacterror-in-callback/102648 "2023-08-10T20:49:23Z")

</div>

When I learn the user-cut callback function ,I rewrite the code below: function user\_cut() Random.seed!(13) N = 30 capacity = 10 weights,values = rand(N),rand(N) model = Model(GLPK.Optimizer) @va…

---

## [Summing exponential expressions in NLP](https://discourse.julialang.org/t/summing-exponential-expressions-in-nlp/102640)

<div class="topic-metadata">

**Author:** [@lgo](https://discourse.julialang.org/u/lgo)\
**Replies:** 1\
**Last updated:** [August 9, 2023, 3:43pm UTC](https://discourse.julialang.org/t/summing-exponential-expressions-in-nlp/102640 "2023-08-09T15:43:17Z")

</div>

I have the NLP below that I want to solve with JuMP. The problem transforms the original time-series x\_t into a new time-series x'\_t with a different integral but the same shape and extremes. The objective function minim…

---

## [Matrix assignment problem: performance advice?](https://discourse.julialang.org/t/matrix-assignment-problem-performance-advice/102601)

<div class="topic-metadata">

**Author:** [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Replies:** 10\
**Last updated:** [August 9, 2023, 9:09am UTC](https://discourse.julialang.org/t/matrix-assignment-problem-performance-advice/102601 "2023-08-09T09:09:39Z")

</div>

I have an assignment problem with the following aims: there are nstudents, each of whom belongs to one of several different graduate programs. Each program has multiple students in it. (For a sense of scale, in our cas…

---

## [Nonlinear JuMP - vector of expressions+differences between @NL and no @NL](https://discourse.julialang.org/t/nonlinear-jump-vector-of-expressions-differences-between-nl-and-no-nl/102405)

<div class="topic-metadata">

**Author:** [@blob](https://discourse.julialang.org/u/blob)\
**Replies:** 10\
**Last updated:** [August 7, 2023, 8:19pm UTC](https://discourse.julialang.org/t/nonlinear-jump-vector-of-expressions-differences-between-nl-and-no-nl/102405 "2023-08-07T20:19:00Z")

</div>

Following JuliaCon, I wanted to try out the nonlinear version of JuMP, especially the option of having vectors instead of a list of expressions. In the process I managed to Make the nonlinear version work without the @…

---

## [Convex.jl vs. optimization.jl](https://discourse.julialang.org/t/convex-jl-vs-optimization-jl/102429)

<div class="topic-metadata">

**Author:** [@tapyu](https://discourse.julialang.org/u/tapyu)\
**Replies:** 9\
**Last updated:** [August 6, 2023, 2:19am UTC](https://discourse.julialang.org/t/convex-jl-vs-optimization-jl/102429 "2023-08-06T02:19:58Z")

</div>

I am a little unsure about the difference between these packages. How to know whether I should use optimization.jl or convex.jl? I am pretty used to disciplined convex programming (convex.jl covers it nicely), but Idk wh…

---

## [Minimisation of operator norm—solution does not match evaluated value \[Convex.jl\]](https://discourse.julialang.org/t/minimisation-of-operator-norm-solution-does-not-match-evaluated-value-convex-jl/102319)

<div class="topic-metadata">

**Author:** [@not-fred](https://discourse.julialang.org/u/not-fred)\
**Replies:** 7\
**Last updated:** [August 3, 2023, 3:08pm UTC](https://discourse.julialang.org/t/minimisation-of-operator-norm-solution-does-not-match-evaluated-value-convex-jl/102319 "2023-08-03T15:08:22Z")

</div>

I’m using Convex.jl to minimize the operator norm of a matrix (minimize opnorm(J,Inf)), but the solution (problem.optval) does not match the evaluated value after performing the optimisation (opnorm(evaluate(J,Inf))). A…

---

## [Convex.jl constraints not enforced](https://discourse.julialang.org/t/convex-jl-constraints-not-enforced/102439)

<div class="topic-metadata">

**Author:** [@UgeB](https://discourse.julialang.org/u/UgeB)\
**Replies:** 2\
**Last updated:** [August 3, 2023, 12:35pm UTC](https://discourse.julialang.org/t/convex-jl-constraints-not-enforced/102439 "2023-08-03T12:35:39Z")

</div>

Hi, I am using Convex.jl to solve a simple least squares optimization problem with some monotonicity constraints on my variable \\phi. The least squares objective is minimized to zero which should not be the case as my …

---

## [Modeling constraints with CPLEXCP.jl](https://discourse.julialang.org/t/modeling-constraints-with-cplexcp-jl/102360)

<div class="topic-metadata">

**Author:** [@Matheus\_Diogenes\_And](https://discourse.julialang.org/u/Matheus_Diogenes_And)\
**Replies:** 3\
**Last updated:** [August 2, 2023, 9:17pm UTC](https://discourse.julialang.org/t/modeling-constraints-with-cplexcp-jl/102360 "2023-08-02T21:17:47Z")

</div>

Hello everyone. I am trying to model some constraints through constraint programming, by using CPLEXCP.jl. But I am having some issues with regards to translating the constraints into functions available by the library.…

---

## [Potential bug with setting variable bounds with a NamedArray](https://discourse.julialang.org/t/potential-bug-with-setting-variable-bounds-with-a-namedarray/102359)

<div class="topic-metadata">

**Author:** [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Replies:** 3\
**Last updated:** [August 1, 2023, 10:19pm UTC](https://discourse.julialang.org/t/potential-bug-with-setting-variable-bounds-with-a-namedarray/102359 "2023-08-01T22:19:58Z")

</div>

Hello, I think I’ve found a small bug in JuMP (or NamedArrays) when setting bounds using a NamedArray using JuMP using NamedArrays S = \[:a,:b\] X = NamedArray(\[1, 2\],S) m = Model() @variable(m,Y\[S\]) set\_upper\_bound.(Y…

---

## [JuMP Read model from file: ERROR: LoadError: UndefVarError](https://discourse.julialang.org/t/jump-read-model-from-file-error-loaderror-undefvarerror/102368)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 1\
**Last updated:** [August 1, 2023, 9:50pm UTC](https://discourse.julialang.org/t/jump-read-model-from-file-error-loaderror-undefvarerror/102368 "2023-08-01T21:50:24Z")

</div>

I use JuMP to solve a simple MILP read in from the input file test.mps. After solving the model, JuMP generates an undefined variable error when I try to access the value of a variable in the MILP. test.mps: NAME ROWS …

---

## [JuMP COPT does not solve LP relaxation of MILP with SOS1 constraints](https://discourse.julialang.org/t/jump-copt-does-not-solve-lp-relaxation-of-milp-with-sos1-constraints/102373)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 1\
**Last updated:** [August 1, 2023, 9:47pm UTC](https://discourse.julialang.org/t/jump-copt-does-not-solve-lp-relaxation-of-milp-with-sos1-constraints/102373 "2023-08-01T21:47:48Z")

</div>

When I use COPT through JuMP to solve the LP relaxation of a MILP with SOS1 constraints, the MILP rather than its LP relaxation is solved. If the SOS1 constraints are removed, then COPT solves the LP relaxation. Output: …

---

## [Modeling Objective Function with CPLEXCP.jl](https://discourse.julialang.org/t/modeling-objective-function-with-cplexcp-jl/102336)

<div class="topic-metadata">

**Author:** [@Matheus\_Diogenes\_And](https://discourse.julialang.org/u/Matheus_Diogenes_And)\
**Replies:** 2\
**Last updated:** [August 1, 2023, 12:07pm UTC](https://discourse.julialang.org/t/modeling-objective-function-with-cplexcp-jl/102336 "2023-08-01T12:07:33Z")

</div>

Hello everyone. I am trying to use the CPLEXCP.jl. However, I am having some issues when using this library. Follows the code I am executing. This is the link of the github project. using CPLEXCP using MathOptInterface…

---

## [Stuck with infeasibility certificates in JuMP.jl](https://discourse.julialang.org/t/stuck-with-infeasibility-certificates-in-jump-jl/102210)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 1\
**Last updated:** [July 31, 2023, 11:08pm UTC](https://discourse.julialang.org/t/stuck-with-infeasibility-certificates-in-jump-jl/102210 "2023-07-31T23:08:16Z")

</div>

I’m trying to work with infeasibility certificates and different solvers. MWE using GLPK: using JuMP import HiGHS, Gurobi, GLPK model = JuMP.Model(() -\> GLPK.Optimizer(; want\_infeasibility\_certificates = true)) @varia…

---

## [Unsupported expression in JuMP](https://discourse.julialang.org/t/unsupported-expression-in-jump/102206)

<div class="topic-metadata">

**Author:** [@jack\_lee](https://discourse.julialang.org/u/jack_lee)\
**Replies:** 1\
**Last updated:** [July 31, 2023, 11:03pm UTC](https://discourse.julialang.org/t/unsupported-expression-in-jump/102206 "2023-07-31T23:03:46Z")

</div>

Given a list of sample points ,I want to find a target point which satisfy: the total distance to each points is minimum the largest distance to the target point is minimum function optimize\_factory\_13(xx,yy) mode…

---

## [Optim does not optimize in several minutes and it takes 10 seconds for scipy](https://discourse.julialang.org/t/optim-does-not-optimize-in-several-minutes-and-it-takes-10-seconds-for-scipy/101756)

<div class="topic-metadata">

**Author:** [@kunzaatko](https://discourse.julialang.org/u/kunzaatko)\
**Replies:** 1\
**Last updated:** [July 31, 2023, 4:46pm UTC](https://discourse.julialang.org/t/optim-does-not-optimize-in-several-minutes-and-it-takes-10-seconds-for-scipy/101756 "2023-07-31T16:46:35Z")

</div>

I am optimizing cross correlation of two arrays taken over there transfer function intersection. My function looks like this: otf\_lr\_1 = otf(tf, fft\_lr\_1, Δxy) # does not change with Δϕ fxs = fftfreq(size(fft\_lr\_2, 1), …

---

## [JuMPeR and Grisu](https://discourse.julialang.org/t/jumper-and-grisu/102258)

<div class="topic-metadata">

**Author:** [@edwinmeriaux](https://discourse.julialang.org/u/edwinmeriaux)\
**Replies:** 8\
**Last updated:** [July 31, 2023, 12:57pm UTC](https://discourse.julialang.org/t/jumper-and-grisu/102258 "2023-07-31T12:57:40Z")

</div>

Hello! I am very new to Julia and I just downloaded it today! I’m trying to use JuMPeR for robust optimization cases. But JuMPeR requires Grisu which i understand it no longer used. So I found the work around but it doe…

---

## [How does JuMP export function like set\_lower\_bound()?](https://discourse.julialang.org/t/how-does-jump-export-function-like-set-lower-bound/102216)

<div class="topic-metadata">

**Author:** [@shawn\_T](https://discourse.julialang.org/u/shawn_T)\
**Replies:** 2\
**Last updated:** [July 28, 2023, 10:18pm UTC](https://discourse.julialang.org/t/how-does-jump-export-function-like-set-lower-bound/102216 "2023-07-28T22:18:26Z")

</div>

Hi all, I am learning how JuMP package enables the use of functions like set\_lower\_bound(), these functions are defined in JuMP and could be called by the user from REPL. But from the file where set\_lower\_bound() is de…

---

## [Creating a variable inside a macro with specified name](https://discourse.julialang.org/t/creating-a-variable-inside-a-macro-with-specified-name/102187)

<div class="topic-metadata">

**Author:** [@shawn\_T](https://discourse.julialang.org/u/shawn_T)\
**Replies:** 7\
**Last updated:** [July 28, 2023, 5:44pm UTC](https://discourse.julialang.org/t/creating-a-variable-inside-a-macro-with-specified-name/102187 "2023-07-28T17:44:50Z")

</div>

Hi all, I am trying to create a variable inside a Julia macro, then return the variable to the REPL, the variable should also have the name I specified from the macro input argument. I have two tests, the first test fun…

---

## [Memory Problem with JuMP and pmap](https://discourse.julialang.org/t/memory-problem-with-jump-and-pmap/102153)

<div class="topic-metadata">

**Author:** [@Mkloster](https://discourse.julialang.org/u/Mkloster)\
**Replies:** 2\
**Last updated:** [July 27, 2023, 1:40pm UTC](https://discourse.julialang.org/t/memory-problem-with-jump-and-pmap/102153 "2023-07-27T13:40:06Z")

</div>

Hallo, i want to solve some JuMP models in parallel. For this i tryed using pmap from the Distributed libarary. Here you can see a simple example: using JuMP, SCIP using Distributed addprocs(4) @everywhere begin …

---

## [Clarabel optimization brings different result from other optimizers](https://discourse.julialang.org/t/clarabel-optimization-brings-different-result-from-other-optimizers/101349)

<div class="topic-metadata">

**Author:** [@thiagoselias](https://discourse.julialang.org/u/thiagoselias)\
**Replies:** 5\
**Last updated:** [July 27, 2023, 1:16pm UTC](https://discourse.julialang.org/t/clarabel-optimization-brings-different-result-from-other-optimizers/101349 "2023-07-27T13:16:48Z")

</div>

Because Clarabel gives different results from other optimizers, since the same implementation was used, only changing the name of the solver in JuMP? \*\*-------------------------------------------------------------\*\* \*\* …

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

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