# Optimization (Mathematical)

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

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

**Page:** 51

---

## [MathOptInterface Documentation](https://discourse.julialang.org/t/mathoptinterface-documentation/93544)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 7\
**Last updated:** [January 26, 2023, 12:44am UTC](https://discourse.julialang.org/t/mathoptinterface-documentation/93544 "2023-01-26T00:44:04Z")

</div>

I get an error when I try the sample code model = Utilities.Model{Float64}() from this documentation: Standard form · MathOptInterface Should the documentation instead say model = MOI.Utilities.Model{Float64}() ? jul…

---

## [How to access the rule set of ChainRules.jl?](https://discourse.julialang.org/t/how-to-access-the-rule-set-of-chainrules-jl/93534)

<div class="topic-metadata">

**Author:** [@Jonas208](https://discourse.julialang.org/u/Jonas208)\
**Replies:** 2\
**Last updated:** [January 25, 2023, 8:24pm UTC](https://discourse.julialang.org/t/how-to-access-the-rule-set-of-chainrules-jl/93534 "2023-01-25T20:24:38Z")

</div>

I’m not quite sure if I chose the right domain. However, this question is about automatic differentiation. My plan is to overload all functions (for my own tracked real/array type) for which rules exist in ChainRules.jl…

---

## [Dynamic Variable and Constraint Scaling built on JuMP](https://discourse.julialang.org/t/dynamic-variable-and-constraint-scaling-built-on-jump/93463)

<div class="topic-metadata">

**Author:** [@max](https://discourse.julialang.org/u/max)\
**Replies:** 2\
**Last updated:** [January 25, 2023, 2:01pm UTC](https://discourse.julialang.org/t/dynamic-variable-and-constraint-scaling-built-on-jump/93463 "2023-01-25T14:01:48Z")

</div>

Hello all, I use JuMP and Gurobi to set up and solve optimization problems. I have from time to time the problem that the built optimization problems are badly scaled. To take a first step in improved matrix ranges I ha…

---

## [Add\_bridges](https://discourse.julialang.org/t/add-bridges/93478)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 7\
**Last updated:** [January 25, 2023, 3:49am UTC](https://discourse.julialang.org/t/add-bridges/93478 "2023-01-25T03:49:36Z")

</div>

What is the default value of add\_bridges when a JuMP model is created? Can this be checked via a JuMP call? For a JuMP model m, get\_optimizer\_attribute(m, MOI.add\_bridges()) doesn’t work.

---

## [Optimizing a physics experiment](https://discourse.julialang.org/t/optimizing-a-physics-experiment/93434)

<div class="topic-metadata">

**Author:** [@Yly](https://discourse.julialang.org/u/Yly)\
**Replies:** 4\
**Last updated:** [January 24, 2023, 1:41am UTC](https://discourse.julialang.org/t/optimizing-a-physics-experiment/93434 "2023-01-24T01:41:03Z")

</div>

I’m a member of an atomic physics lab, where a big part of our day to day work involves optimizing performance of a complicated machine with lots of “knobs”. We are currently not very sophisticated in how we perform the…

---

## [Which optimization package to use for constrained least squares?](https://discourse.julialang.org/t/which-optimization-package-to-use-for-constrained-least-squares/70710)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 5\
**Last updated:** [January 23, 2023, 6:04pm UTC](https://discourse.julialang.org/t/which-optimization-package-to-use-for-constrained-least-squares/70710 "2023-01-23T18:04:18Z")

</div>

I want to minimize (A\*x - b)^2 subject to x ∈ \[lower, upper\] and sum(x) \<= 1. With Optim.jl, I can easily solve this problem with the box constraints, but I don’t see a way to add the constraint on sum(x). Should I be …

---

## [Nonlinear constrained optimization without gradient](https://discourse.julialang.org/t/nonlinear-constrained-optimization-without-gradient/93396)

<div class="topic-metadata">

**Author:** [@fordonez](https://discourse.julialang.org/u/fordonez)\
**Replies:** 3\
**Last updated:** [January 23, 2023, 1:16pm UTC](https://discourse.julialang.org/t/nonlinear-constrained-optimization-without-gradient/93396 "2023-01-23T13:16:42Z")

</div>

Hi everyone. I’m trying to do constrained optimization like: \\min\_{x} f(x) s.t. c(x)\\le u\_x I would like to solve the problem only with the function and constraint. I tried with Optim and NLopt, and the examples I…

---

## [Frameworks, or libraries to use for feasibility problems?](https://discourse.julialang.org/t/frameworks-or-libraries-to-use-for-feasibility-problems/93114)

<div class="topic-metadata">

**Author:** [@rakshith95](https://discourse.julialang.org/u/rakshith95)\
**Replies:** 4\
**Last updated:** [January 23, 2023, 10:53am UTC](https://discourse.julialang.org/t/frameworks-or-libraries-to-use-for-feasibility-problems/93114 "2023-01-23T10:53:49Z")

</div>

Hello, I have a problem where I need to find the closest (min norm) point to my data which is feasible under some (non convex) polynomial constraints. What would be the best framework/ libraries to use for a problem lik…

---

## [KNITRO.jl. Could not load library .dylib](https://discourse.julialang.org/t/knitro-jl-could-not-load-library-dylib/93332)

<div class="topic-metadata">

**Author:** [@nkashaev](https://discourse.julialang.org/u/nkashaev)\
**Replies:** 9\
**Last updated:** [January 22, 2023, 8:51pm UTC](https://discourse.julialang.org/t/knitro-jl-could-not-load-library-dylib/93332 "2023-01-22T20:51:11Z")

</div>

Hi, When testing KNITRO, I got the following error: could not load library “” dlopen(.dylib, 0x0001): tried: ‘/Users/XXX/knitro-12.3.0-MacOS-64/lib/.dylib’ (no such file), ‘.dylib’ (no such file), ‘/System/Volumes/Pr…

---

## [Matrix Product NL expression](https://discourse.julialang.org/t/matrix-product-nl-expression/93345)

<div class="topic-metadata">

**Author:** [@apateonas](https://discourse.julialang.org/u/apateonas)\
**Replies:** 1\
**Last updated:** [January 22, 2023, 9:35am UTC](https://discourse.julialang.org/t/matrix-product-nl-expression/93345 "2023-01-22T09:35:32Z")

</div>

Hello, I am new to JuMP. I want to create the following non-linear expression: KdagK = @NLexpression(model, K' \* K) Here, K is a matrix of complex variables. What is the best way to do this? Thank you!

---

## [Frobenius Norm objective with JuMP](https://discourse.julialang.org/t/frobenius-norm-objective-with-jump/93338)

<div class="topic-metadata">

**Author:** [@apateonas](https://discourse.julialang.org/u/apateonas)\
**Replies:** 2\
**Last updated:** [January 22, 2023, 1:14am UTC](https://discourse.julialang.org/t/frobenius-norm-objective-with-jump/93338 "2023-01-22T01:14:47Z")

</div>

I am looking to use the frobenius norm of a matrix as an objective. Here is the setup: nkrauss = 4 model = Model(Ipopt.Optimizer) # Krauss operator variables nKelems = nkrauss \* dims^2 Kelems = \[@variable(model, set =…

---

## [JuMP solution is not correct: PiecewiseLinearOpt](https://discourse.julialang.org/t/jump-solution-is-not-correct-piecewiselinearopt/93321)

<div class="topic-metadata">

**Author:** [@salvaguerrero](https://discourse.julialang.org/u/salvaguerrero)\
**Replies:** 1\
**Last updated:** [January 22, 2023, 12:16am UTC](https://discourse.julialang.org/t/jump-solution-is-not-correct-piecewiselinearopt/93321 "2023-01-22T00:16:47Z")

</div>

Good morning, I’m working on a MILP model where a non-linear function is linearized using PiecewiseLinearOpt and Gurobi. The model is solved and the objective value reached is correct, but the constraints are not met. …

---

## [Trust-region constrained optimization](https://discourse.julialang.org/t/trust-region-constrained-optimization/93077)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 32\
**Last updated:** [January 21, 2023, 8:14pm UTC](https://discourse.julialang.org/t/trust-region-constrained-optimization/93077 "2023-01-21T20:14:33Z")

</div>

Hello, I was wondering if there exists a Julia package that implements a trust-region constrained optimization method. The packages I have seen so far are for unconstrained or bound-constrained problems. I am looking fo…

---

## [Incorrect Infeasibility Status While Using MIPVerify](https://discourse.julialang.org/t/incorrect-infeasibility-status-while-using-mipverify/93033)

<div class="topic-metadata">

**Author:** [@Ahmed\_Anwar](https://discourse.julialang.org/u/Ahmed_Anwar)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 12:26pm UTC](https://discourse.julialang.org/t/incorrect-infeasibility-status-while-using-mipverify/93033 "2023-01-20T12:26:12Z")

</div>

Hello Everyone, I am trying to use MIPVerify library for neural network verification against adversarial attacks. My goal is to replace the ReLU function by a trainable mask that depends on the input image. Therefore fo…

---

## [Almost but not quite univariate trend filtering / compressive sensing](https://discourse.julialang.org/t/almost-but-not-quite-univariate-trend-filtering-compressive-sensing/93237)

<div class="topic-metadata">

**Author:** [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Replies:** 3\
**Last updated:** [January 20, 2023, 12:49am UTC](https://discourse.julialang.org/t/almost-but-not-quite-univariate-trend-filtering-compressive-sensing/93237 "2023-01-20T00:49:21Z")

</div>

I need to minimize for x a convex (I think it is convex from plots I have made, but I don’t understand L1 very well) subproblem of the form ||y - Ax||² + λ²|Dx|\_1 where D is a first difference operator for piecewise co…

---

## [Error in example: Parameter Estimation on Highly Stiff Systems](https://discourse.julialang.org/t/error-in-example-parameter-estimation-on-highly-stiff-systems/93229)

<div class="topic-metadata">

**Author:** [@kaido975](https://discourse.julialang.org/u/kaido975)\
**Replies:** 0\
**Last updated:** [January 19, 2023, 7:48pm UTC](https://discourse.julialang.org/t/error-in-example-parameter-estimation-on-highly-stiff-systems/93229 "2023-01-19T19:48:41Z")

</div>

The example provided at Parameter Estimation on Highly Stiff Systems · SciMLSensitivity.jl, does not seem to be working with Optimization.jl but works fine with DiffEqFlux.sciml\_train. I am getting the following error wi…

---

## [Constraint declaration](https://discourse.julialang.org/t/constraint-declaration/92683)

<div class="topic-metadata">

**Author:** [@anonymus12](https://discourse.julialang.org/u/anonymus12)\
**Replies:** 8\
**Last updated:** [January 19, 2023, 4:51pm UTC](https://discourse.julialang.org/t/constraint-declaration/92683 "2023-01-19T16:51:33Z")

</div>

i want to build an MEXCLP using Julia/Jump in VS Code. Everything is working fine with the declaration except for this particular constraint. I tried this declaration: @constraint(model, c1, sum(x\[j\] for j in W\[i\]) \>=…

---

## [Question about applying a customized branch and bound in Julia and the JuMP package](https://discourse.julialang.org/t/question-about-applying-a-customized-branch-and-bound-in-julia-and-the-jump-package/93136)

<div class="topic-metadata">

**Author:** [@Alex\_ricci](https://discourse.julialang.org/u/Alex_ricci)\
**Replies:** 3\
**Last updated:** [January 19, 2023, 2:34am UTC](https://discourse.julialang.org/t/question-about-applying-a-customized-branch-and-bound-in-julia-and-the-jump-package/93136 "2023-01-19T02:34:08Z")

</div>

I am trying to develop a customised branch and bound algorithm in Julia with the JuMP package. The problem only has binary variables. What I do is relaxing the problem to its linear counterpart and getting the variable …

---

## [Stochastic (L-)BFGS](https://discourse.julialang.org/t/stochastic-l-bfgs/93138)

<div class="topic-metadata">

**Author:** [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Replies:** 1\
**Last updated:** [January 18, 2023, 4:33pm UTC](https://discourse.julialang.org/t/stochastic-l-bfgs/93138 "2023-01-18T16:33:26Z")

</div>

Anyone knows of a julia implementation of a stochastic (L-)BFGS variant, like e.g. described here or described here or implemented in pytorch here?

---

## ["x" Argument in Optimization.OptimizationProblem](https://discourse.julialang.org/t/x-argument-in-optimization-optimizationproblem/92971)

<div class="topic-metadata">

**Author:** [@jonlym](https://discourse.julialang.org/u/jonlym)\
**Replies:** 1\
**Last updated:** [January 16, 2023, 3:49am UTC](https://discourse.julialang.org/t/x-argument-in-optimization-optimizationproblem/92971 "2023-01-16T03:49:48Z")

</div>

The docs for Optimization.OptimizationProblem refer to u and u₀ but neither are included in the argument list. Should the second positional argument (i.e., x) be relabeled to u? If they’re not representing the same thing…

---

## [Gurobi- failed to precompile](https://discourse.julialang.org/t/gurobi-failed-to-precompile/44606)

<div class="topic-metadata">

**Author:** [@MJMB](https://discourse.julialang.org/u/MJMB)\
**Replies:** 9\
**Last updated:** [January 13, 2023, 4:47am UTC](https://discourse.julialang.org/t/gurobi-failed-to-precompile/44606 "2023-01-13T04:47:40Z")

</div>

Hello, I have problem with gurobi, i am using MacBook Pro and suddenly it show me error that it failed to precompile, i have tried to remove it and add it again but it doesn’t work. my license is valid and i am using G…

---

## [NLP is not solving in ubuntu OS whereas It is solving in Windows OS with all versions of package and Julia is same (Juniper optimzer with Ipopt and HiGHS)](https://discourse.julialang.org/t/nlp-is-not-solving-in-ubuntu-os-whereas-it-is-solving-in-windows-os-with-all-versions-of-package-and-julia-is-same-juniper-optimzer-with-ipopt-and-highs/92866)

<div class="topic-metadata">

**Author:** [@Balakumar\_A](https://discourse.julialang.org/u/Balakumar_A)\
**Replies:** 3\
**Last updated:** [January 12, 2023, 2:56pm UTC](https://discourse.julialang.org/t/nlp-is-not-solving-in-ubuntu-os-whereas-it-is-solving-in-windows-os-with-all-versions-of-package-and-julia-is-same-juniper-optimzer-with-ipopt-and-highs/92866 "2023-01-12T14:56:30Z")

</div>

I am trying to Solve a Non Linear model using Juniper with Ipopt and GiGHS. I am getting solution in my windows operating system, whereas Ubuntu OS is not giving any results immediately as it is saying NLP couldn’t solve…

---

## [Minimizing the distance between centers of multiple circles](https://discourse.julialang.org/t/minimizing-the-distance-between-centers-of-multiple-circles/92843)

<div class="topic-metadata">

**Author:** [@MadJoe](https://discourse.julialang.org/u/MadJoe)\
**Replies:** 5\
**Last updated:** [January 12, 2023, 5:47am UTC](https://discourse.julialang.org/t/minimizing-the-distance-between-centers-of-multiple-circles/92843 "2023-01-12T05:47:14Z")

</div>

Hello, I am new to optimization and Julia, and I need to minimize the distance between some circles that encircle multiple points in a 2-D plane by moving the centers of the circles. We know where all of the blue spots a…

---

## [Nested optimizations, vars traverse nesting](https://discourse.julialang.org/t/nested-optimizations-vars-traverse-nesting/91960)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 7\
**Last updated:** [January 12, 2023, 2:53am UTC](https://discourse.julialang.org/t/nested-optimizations-vars-traverse-nesting/91960 "2023-01-12T02:53:18Z")

</div>

Someone asked for my help with this, however it is outside my experience. I am told the outer maximization is a quadratic in αi and βi and the inner minimization is solvable by e.g gradient descent maximize( m…

---

## [How can I fix my code to run using JuMP](https://discourse.julialang.org/t/how-can-i-fix-my-code-to-run-using-jump/92573)

<div class="topic-metadata">

**Author:** [@lara](https://discourse.julialang.org/u/lara)\
**Replies:** 3\
**Last updated:** [January 11, 2023, 8:34pm UTC](https://discourse.julialang.org/t/how-can-i-fix-my-code-to-run-using-jump/92573 "2023-01-11T20:34:44Z")

</div>

Hey, guys. This is my first time working with both Julia and JuMP. I’m making lot of mistakes, but I finally got my code running fine. Using JuMP in my code would be a plus, so I’m trying to do that, but I am having pro…

---

## [Solve JuMP model with COSMO arbitrary precision](https://discourse.julialang.org/t/solve-jump-model-with-cosmo-arbitrary-precision/92807)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 1\
**Last updated:** [January 11, 2023, 8:30pm UTC](https://discourse.julialang.org/t/solve-jump-model-with-cosmo-arbitrary-precision/92807 "2023-01-11T20:30:02Z")

</div>

Afaik there is no support for arbitrary precision in JuMP, but is there a quick hack for COSMO?

---

## [Cannot Read LP file](https://discourse.julialang.org/t/cannot-read-lp-file/92787)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 2\
**Last updated:** [January 11, 2023, 5:11am UTC](https://discourse.julialang.org/t/cannot-read-lp-file/92787 "2023-01-11T05:11:16Z")

</div>

read\_from\_file throws an error when trying to read an LP file (min\_max\_overlap\_Gen8.lp, which is 1.6 MB and is comprised of 33,885 lines), representing a MILP. SCIP on the NEOS Server is able to read and solve the LP fil…

---

## [Meaning of warning: skipping PenaltyRelaxation](https://discourse.julialang.org/t/meaning-of-warning-skipping-penaltyrelaxation/92703)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 2\
**Last updated:** [January 9, 2023, 12:29pm UTC](https://discourse.julialang.org/t/meaning-of-warning-skipping-penaltyrelaxation/92703 "2023-01-09T12:29:25Z")

</div>

what is the meaning of the warning in the example here: julia\> map = relax\_with\_penalty!(model) ┌ Warning: Skipping PenaltyRelaxation for ConstraintIndex{MathOptInterface.VariableIndex,MathOptInterface.GreaterThan{Float…

---

## [Symmetry breaking: scheduling problems with job duration dependent on ressource allocation](https://discourse.julialang.org/t/symmetry-breaking-scheduling-problems-with-job-duration-dependent-on-ressource-allocation/92220)

<div class="topic-metadata">

**Author:** [@JNSDVD](https://discourse.julialang.org/u/JNSDVD)\
**Replies:** 5\
**Last updated:** [January 9, 2023, 9:51am UTC](https://discourse.julialang.org/t/symmetry-breaking-scheduling-problems-with-job-duration-dependent-on-ressource-allocation/92220 "2023-01-09T09:51:27Z")

</div>

Hey guys, I have been struggeling to speed up my optimization for quite a while now. Any help is highly appreciated! In contrast to most of the research, I deal with entities (=worker) and not with machines. But since …

---

## [JuMP model warm start using Ipopt](https://discourse.julialang.org/t/jump-model-warm-start-using-ipopt/92660)

<div class="topic-metadata">

**Author:** [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Replies:** 2\
**Last updated:** [January 9, 2023, 5:01am UTC](https://discourse.julialang.org/t/jump-model-warm-start-using-ipopt/92660 "2023-01-09T05:01:49Z")

</div>

I am solving a non-convex problem using Ipopt, and I want to warm start the same problem. That not only needs to set start variable value usingset\_start\_value, but also needs to set duals and multipliers. How can I acc…

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

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