# Optimization (Mathematical)

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

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

**Page:** 83

---

## [Any optimization packages which implement diagonal Hessian updates?](https://discourse.julialang.org/t/any-optimization-packages-which-implement-diagonal-hessian-updates/58528)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 0\
**Last updated:** [April 3, 2021, 9:50pm UTC](https://discourse.julialang.org/t/any-optimization-packages-which-implement-diagonal-hessian-updates/58528 "2021-04-03T21:50:44Z")

</div>

Are there any Julia packages which do high-dimensional unconstrained optimization and support diagonal-only updates to the Hessian? Those that I know (Optim and OptimKit) have BFGS which updates the entire Hessian, but h…

---

## [\`ForwardDiff\` and \`LAPACK\` don't get along](https://discourse.julialang.org/t/forwarddiff-and-lapack-dont-get-along/58397)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 2\
**Last updated:** [April 2, 2021, 2:23pm UTC](https://discourse.julialang.org/t/forwarddiff-and-lapack-dont-get-along/58397 "2021-04-02T14:23:59Z")

</div>

ForwardDiff only works with pure julia code AFAIK, which means it won’t work with the external calls to BLAS or LAPACK. When I inadvertently combine them by using qr() it doesn’t work. The question is what to do about …

---

## [The "sum" in constraint](https://discourse.julialang.org/t/the-sum-in-constraint/58434)

<div class="topic-metadata">

**Author:** [@hxxx123](https://discourse.julialang.org/u/hxxx123)\
**Replies:** 2\
**Last updated:** [April 2, 2021, 1:50pm UTC](https://discourse.julialang.org/t/the-sum-in-constraint/58434 "2021-04-02T13:50:37Z")

</div>

I’m trying to add one constraint :sum of “t\[i,j\]x\[i,j\]\<=10". T is one "1111” metrix and x\[1:11,1:11\] are binary variables.Seems to be error.

---

## [VRP with JuMP](https://discourse.julialang.org/t/vrp-with-jump/58438)

<div class="topic-metadata">

**Author:** [@hxxx123](https://discourse.julialang.org/u/hxxx123)\
**Replies:** 1\
**Last updated:** [April 2, 2021, 11:22am UTC](https://discourse.julialang.org/t/vrp-with-jump/58438 "2021-04-02T11:22:28Z")

</div>

One VRP without time window: n customers who has n different loads need to be met at n locations,every vehicle have same capacity,which is m. we don’t need to consider serivce times.How to get minimum number of vehicle…

---

## [Non-convex optimization](https://discourse.julialang.org/t/non-convex-optimization/58227)

<div class="topic-metadata">

**Author:** [@optimist](https://discourse.julialang.org/u/optimist)\
**Replies:** 2\
**Last updated:** [April 1, 2021, 11:35pm UTC](https://discourse.julialang.org/t/non-convex-optimization/58227 "2021-04-01T23:35:36Z")

</div>

I am solving a non linear optimization using Ipopt. The problem is non-convex but Ipopt gives a good enough answer. The documentation on use of nonlinear parameters and non-linear expressions is somewhat thin. Suppose …

---

## [Robust heuristic for binding SOC without exact solution](https://discourse.julialang.org/t/robust-heuristic-for-binding-soc-without-exact-solution/58321)

<div class="topic-metadata">

**Author:** [@lgo](https://discourse.julialang.org/u/lgo)\
**Replies:** 1\
**Last updated:** [March 31, 2021, 8:56pm UTC](https://discourse.julialang.org/t/robust-heuristic-for-binding-soc-without-exact-solution/58321 "2021-03-31T20:56:21Z")

</div>

I’m solving a large number of LPs with a single second-order cone constraint. For each of these problems, I want to check, if the SOC is binding. To keep the run-time short, I do not want to obtain an exact solution or c…

---

## [Linearization](https://discourse.julialang.org/t/linearization/58167)

<div class="topic-metadata">

**Author:** [@user1200](https://discourse.julialang.org/u/user1200)\
**Replies:** 3\
**Last updated:** [March 30, 2021, 10:09pm UTC](https://discourse.julialang.org/t/linearization/58167 "2021-03-30T22:09:33Z")

</div>

Hi I have simple objective function (goal), solving with Ipopt for example: Min, sum (sin(data\[i\]\*x) for i=1:length(data) ) I was just curious if there is some way/wrap to achieve : maximize linearity of process to…

---

## [Convex.jl set some configurations e.g. maximum iteration number, etc](https://discourse.julialang.org/t/convex-jl-set-some-configurations-e-g-maximum-iteration-number-etc/57724)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 3\
**Last updated:** [March 27, 2021, 11:58pm UTC](https://discourse.julialang.org/t/convex-jl-set-some-configurations-e-g-maximum-iteration-number-etc/57724 "2021-03-27T23:58:56Z")

</div>

I would like to change some configurations of Convex.jl optimiser. I took a look at the documentation but I didn’t understand how to do it. Can anybody help me? Note that I’m mostly using Mosek.

---

## [Distributed Optimization | Working with multiple JuMP models](https://discourse.julialang.org/t/distributed-optimization-working-with-multiple-jump-models/58050)

<div class="topic-metadata">

**Author:** [@asavasci](https://discourse.julialang.org/u/asavasci)\
**Replies:** 1\
**Last updated:** [March 26, 2021, 10:55pm UTC](https://discourse.julialang.org/t/distributed-optimization-working-with-multiple-jump-models/58050 "2021-03-26T22:55:23Z")

</div>

Hi All, What is the best way to build a distributed optimization framework with JuMP? I have global variables associated with the central problem. I have local copies of the central variables associated with each subp…

---

## [Needs help on \[IPOPT + coinhsl\] installation](https://discourse.julialang.org/t/needs-help-on-ipopt-coinhsl-installation/40583)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 5\
**Last updated:** [March 26, 2021, 7:28pm UTC](https://discourse.julialang.org/t/needs-help-on-ipopt-coinhsl-installation/40583 "2021-03-26T19:28:37Z")

</div>

Hi, I would like to know a way to connect a linear solver other than MUMPS on Ipopt. m = Model(Ipopt.Optimizer) set\_optimizer\_attribute(m, "linear\_solver", "ma86") @variable(m, x \<= 5) @objective(m, Max, x) JuMP.optimiz…

---

## [Help with Performance in JuMP](https://discourse.julialang.org/t/help-with-performance-in-jump/57874)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 7\
**Last updated:** [March 25, 2021, 7:14pm UTC](https://discourse.julialang.org/t/help-with-performance-in-jump/57874 "2021-03-25T19:14:40Z")

</div>

Hi, I am trying to solve a maximization problem using Gurobi/JuMP and I would really appreciate it if you could help me speed things up. Some background on the problem, essentially I am trying to maximize the expectati…

---

## [How can I clear solver attributes in JuMP?](https://discourse.julialang.org/t/how-can-i-clear-solver-attributes-in-jump/57953)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 3\
**Last updated:** [March 25, 2021, 7:05pm UTC](https://discourse.julialang.org/t/how-can-i-clear-solver-attributes-in-jump/57953 "2021-03-25T19:05:34Z")

</div>

I need to solve a JuMP model sequentially using different solvers. Solver 1 has one set of attributes but I’m fine with the defaults for solver 2, at least for now. Unfortunately solver 2 complains about the options I se…

---

## [Error Handling JuMP and CPLEX](https://discourse.julialang.org/t/error-handling-jump-and-cplex/56360)

<div class="topic-metadata">

**Author:** [@Paul\_McVay](https://discourse.julialang.org/u/Paul_McVay)\
**Replies:** 25\
**Last updated:** [March 25, 2021, 5:56pm UTC](https://discourse.julialang.org/t/error-handling-jump-and-cplex/56360 "2021-03-25T17:56:30Z")

</div>

What is the ideal way to handle CPLEX errors in JuMP and Julia? For example, sometimes I run optimize!(m) and it prints CPLEX Error 1292: Invalid choice of optimization method. However, if I use a try/catch and catch the…

---

## [ComponentArrays.jl with NLopt.jl](https://discourse.julialang.org/t/componentarrays-jl-with-nlopt-jl/57482)

<div class="topic-metadata">

**Author:** [@avonmoll](https://discourse.julialang.org/u/avonmoll)\
**Replies:** 3\
**Last updated:** [March 24, 2021, 2:08pm UTC](https://discourse.julialang.org/t/componentarrays-jl-with-nlopt-jl/57482 "2021-03-24T14:08:38Z")

</div>

These two packages seem to be incompatible. Without fully understanding the internals of NLopt.jl it seems that the vector of optimization variables ends up getting cast as an Array{Float64,1}. This basic snippet works: …

---

## [Custom likelihood function optimization](https://discourse.julialang.org/t/custom-likelihood-function-optimization/57849)

<div class="topic-metadata">

**Author:** [@ocolluphid](https://discourse.julialang.org/u/ocolluphid)\
**Replies:** 2\
**Last updated:** [March 24, 2021, 7:46pm UTC](https://discourse.julialang.org/t/custom-likelihood-function-optimization/57849 "2021-03-24T19:46:36Z")

</div>

Hi, I’m having trouble with this likelihood maximization problem. My likelihood function “works” when I call it with some random parameters (i.e. it outputs a likelihood value) but when I pass it through the Optim.jl pa…

---

## [JuMP/CPLEX: problems with submitting heuristic solution](https://discourse.julialang.org/t/jump-cplex-problems-with-submitting-heuristic-solution/57807)

<div class="topic-metadata">

**Author:** [@Ryao](https://discourse.julialang.org/u/Ryao)\
**Replies:** 1\
**Last updated:** [March 23, 2021, 6:27pm UTC](https://discourse.julialang.org/t/jump-cplex-problems-with-submitting-heuristic-solution/57807 "2021-03-23T18:27:45Z")

</div>

Hi everyone, I try to submit a solution extracted from a second model to the main model while encountering such error, any idea? Is there a way to get the CPLEX.Optimizer object from a Model object? Regards, Ryao ER…

---

## [Quasi-newton nonlinear solver for sparse jacobian](https://discourse.julialang.org/t/quasi-newton-nonlinear-solver-for-sparse-jacobian/57672)

<div class="topic-metadata">

**Author:** [@RangeFu](https://discourse.julialang.org/u/RangeFu)\
**Replies:** 20\
**Last updated:** [March 23, 2021, 12:40pm UTC](https://discourse.julialang.org/t/quasi-newton-nonlinear-solver-for-sparse-jacobian/57672 "2021-03-23T12:40:14Z")

</div>

Hi community, I was wondering if there is a sparse-optimized quasi-newton solver in the Julia ecosystem. This question was motivated by the undocumented broyden solver in NLsolve.jl. This solver requires the inverse of …

---

## [Calculating the branch current](https://discourse.julialang.org/t/calculating-the-branch-current/57768)

<div class="topic-metadata">

**Author:** [@priod](https://discourse.julialang.org/u/priod)\
**Replies:** 3\
**Last updated:** [March 23, 2021, 11:32am UTC](https://discourse.julialang.org/t/calculating-the-branch-current/57768 "2021-03-23T11:32:55Z")

</div>

I need some help in calculating the branch current flows using the PowerModels package, and matpower casses.

---

## [Upper bound algorithm how can I translate my algorithm in julia code](https://discourse.julialang.org/t/upper-bound-algorithm-how-can-i-translate-my-algorithm-in-julia-code/57729)

<div class="topic-metadata">

**Author:** [@Yasmine\_123](https://discourse.julialang.org/u/Yasmine_123)\
**Replies:** 2\
**Last updated:** [March 23, 2021, 9:18am UTC](https://discourse.julialang.org/t/upper-bound-algorithm-how-can-i-translate-my-algorithm-in-julia-code/57729 "2021-03-23T09:18:51Z")

</div>

Hi everyone, I am a new user of julia. I should write an optimistic algorithm given the similarity parameters sij and the number of families r, partition the m product types into r families G1, …, Gr, each of size m/r,…

---

## [Efficient Nash Equilibria using JuMP](https://discourse.julialang.org/t/efficient-nash-equilibria-using-jump/57616)

<div class="topic-metadata">

**Author:** [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Replies:** 5\
**Last updated:** [March 21, 2021, 8:31pm UTC](https://discourse.julialang.org/t/efficient-nash-equilibria-using-jump/57616 "2021-03-21T20:31:19Z")

</div>

Previously I have been using LRSLib (which calls the C library lrsnash) for computing Nash equilibria of two-player simultaneous move zero-sum games. However, I wanted to implement a pure Julia implementation for the sak…

---

## [Is there a power flow formulation that considers branches power transfer limit in PowerModels.jl?](https://discourse.julialang.org/t/is-there-a-power-flow-formulation-that-considers-branches-power-transfer-limit-in-powermodels-jl/57548)

<div class="topic-metadata">

**Author:** [@RaulRib](https://discourse.julialang.org/u/RaulRib)\
**Replies:** 2\
**Last updated:** [March 19, 2021, 3:48pm UTC](https://discourse.julialang.org/t/is-there-a-power-flow-formulation-that-considers-branches-power-transfer-limit-in-powermodels-jl/57548 "2021-03-19T15:48:56Z")

</div>

Hello, I am working on a project where I investigate the behavior of power systems with congested lines.When running run\_ac\_pf or run\_dc\_pf, I notice that some branches resulting power flow exceed their limit. Searching…

---

## [Searching for a simple polynomial curve fitting example](https://discourse.julialang.org/t/searching-for-a-simple-polynomial-curve-fitting-example/5302)

<div class="topic-metadata">

**Author:** [@J\_T](https://discourse.julialang.org/u/J_T)\
**Replies:** 6\
**Last updated:** [March 19, 2021, 5:10am UTC](https://discourse.julialang.org/t/searching-for-a-simple-polynomial-curve-fitting-example/5302 "2021-03-19T05:10:51Z")

</div>

Im new to mathematical optimisation, so I’m looking for a simple example I can learn from … My (initial) problem looks like 1000 cartesian points in Float16 I want to find a polynomial p(x) (to be evaluated in Float16…

---

## [Hugely different solutions between JuMP/Ipopt and a commercial solver](https://discourse.julialang.org/t/hugely-different-solutions-between-jump-ipopt-and-a-commercial-solver/57218)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 4\
**Last updated:** [March 19, 2021, 12:34am UTC](https://discourse.julialang.org/t/hugely-different-solutions-between-jump-ipopt-and-a-commercial-solver/57218 "2021-03-19T00:34:34Z")

</div>

I am using a commom portfolio optimization problem (maximizing the Sharpe ratio) to improve my knowledge of non-linear optimization using JuMP and Ipopt. The objective is Max pmean' w / sqrt(w' pcov w) subject to bound a…

---

## [Is it time for a native Julia LP(Simplex) solver?](https://discourse.julialang.org/t/is-it-time-for-a-native-julia-lp-simplex-solver/21639)

<div class="topic-metadata">

**Author:** [@ndinsmore](https://discourse.julialang.org/u/ndinsmore)\
**Replies:** 44\
**Last updated:** [March 18, 2021, 8:58am UTC](https://discourse.julialang.org/t/is-it-time-for-a-native-julia-lp-simplex-solver/21639 "2021-03-18T08:58:57Z")

</div>

For the last few months, I have been coming up to speed on both Linear Programming with Jump.jl using Clp.jl, Cbc.jl, and GLPK.jl. I have made some minor PRs to a few of the projects in order to improve the capability t…

---

## [Passing objective function into JuMP](https://discourse.julialang.org/t/passing-objective-function-into-jump/57357)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 1\
**Last updated:** [March 17, 2021, 4:29am UTC](https://discourse.julialang.org/t/passing-objective-function-into-jump/57357 "2021-03-17T04:29:19Z")

</div>

I would like to use JuMP for nonlinear constrained optimization. Specifically I want to be able to pass my objective function into it from outside. How do I do that? What I tried is below. I am not sure if this is a JuM…

---

## [Invalid Gurobi license](https://discourse.julialang.org/t/invalid-gurobi-license/57324)

<div class="topic-metadata">

**Author:** [@Yaropro14](https://discourse.julialang.org/u/Yaropro14)\
**Replies:** 2\
**Last updated:** [March 16, 2021, 8:32pm UTC](https://discourse.julialang.org/t/invalid-gurobi-license/57324 "2021-03-16T20:32:13Z")

</div>

After ENV\[“GRB\_LICENSE\_FILE”\] = “/Library/gurobi911” ENV\[“GUROBI\_HOME”\] = “/Library/gurobi911/mac64/” import Pkg Pkg.rm(“Gurobi”) Pkg.add(“Gurobi”) Pkg.build(“Gurobi”) using Gurobi const GUROBI\_ENV = Gurobi.Env() …

---

## [Matrix shortest distance problem - Need suggestions to improve the performance](https://discourse.julialang.org/t/matrix-shortest-distance-problem-need-suggestions-to-improve-the-performance/57175)

<div class="topic-metadata">

**Author:** [@shanmukhan](https://discourse.julialang.org/u/shanmukhan)\
**Replies:** 27\
**Last updated:** [March 16, 2021, 3:25pm UTC](https://discourse.julialang.org/t/matrix-shortest-distance-problem-need-suggestions-to-improve-the-performance/57175 "2021-03-16T15:25:55Z")

</div>

Hello All, I am new to Julia and working on below code in Julia and similar one in Python, Java. But, Julia code is slower than Python and 10x slower than Java code. Can you please let me know how to optimize below code…

---

## [Automatic generation user-defined functions and NLexpression](https://discourse.julialang.org/t/automatic-generation-user-defined-functions-and-nlexpression/57216)

<div class="topic-metadata">

**Author:** [@GiuliaM](https://discourse.julialang.org/u/GiuliaM)\
**Replies:** 1\
**Last updated:** [March 15, 2021, 7:42pm UTC](https://discourse.julialang.org/t/automatic-generation-user-defined-functions-and-nlexpression/57216 "2021-03-15T19:42:25Z")

</div>

Hi everyone! I’m trying to create a non-linear expression for a non-linear problem. I need to automatically register some user-defined functions (in the MWE func1 and func2) and use them in the NLexpression. In partic…

---

## [Sorting a sparse axis array in JuMP](https://discourse.julialang.org/t/sorting-a-sparse-axis-array-in-jump/57167)

<div class="topic-metadata">

**Author:** [@priod](https://discourse.julialang.org/u/priod)\
**Replies:** 3\
**Last updated:** [March 15, 2021, 7:23am UTC](https://discourse.julialang.org/t/sorting-a-sparse-axis-array-in-jump/57167 "2021-03-15T07:23:41Z")

</div>

Hi, I am using the JuMP model, after the optimization process, I have a sparse axis array, I need to sort this array in the descending direction. How can I sort this? Thanking you in advance for the suggestions. The…

---

## [Getting Oriented](https://discourse.julialang.org/t/getting-oriented/56970)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 6\
**Last updated:** [March 12, 2021, 7:09pm UTC](https://discourse.julialang.org/t/getting-oriented/56970 "2021-03-12T19:09:11Z")

</div>

The introduction to the optimization topic in discourse refers to http://www.juliaopt.org/, but that site declares itself to be dead and obsolete, while referencing https://jump.dev/. But the latter does not appear to b…

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

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