# Optimization (Mathematical)

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

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

**Page:** 22

---

## [How to return additional arguments when optimizing or finding a root](https://discourse.julialang.org/t/how-to-return-additional-arguments-when-optimizing-or-finding-a-root/117994)

<div class="topic-metadata">

**Author:** [@jovansam](https://discourse.julialang.org/u/jovansam)\
**Replies:** 6\
**Last updated:** [August 9, 2024, 4:12pm UTC](https://discourse.julialang.org/t/how-to-return-additional-arguments-when-optimizing-or-finding-a-root/117994 "2024-08-09T16:12:02Z")

</div>

Hi All, I am looking for some ideas about how others have often handled this issue. Often, I have to solve an optimization problem and then pass out return some additional arguments. In the MWE example below, y is the c…

---

## [Historical data - SDDP.jl](https://discourse.julialang.org/t/historical-data-sddp-jl/117207)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 6\
**Last updated:** [August 6, 2024, 11:42pm UTC](https://discourse.julialang.org/t/historical-data-sddp-jl/117207 "2024-08-06T23:42:24Z")

</div>

Hi everyone, I trained a big model using SDDP.jl. Then, I used historical data to simulate the policy multiple times. However, when I examine the results of different simulations with the same historical data, I notice …

---

## [Could not solve optimization problem with max/min in constraints](https://discourse.julialang.org/t/could-not-solve-optimization-problem-with-max-min-in-constraints/117839)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 5\
**Last updated:** [August 5, 2024, 10:35pm UTC](https://discourse.julialang.org/t/could-not-solve-optimization-problem-with-max-min-in-constraints/117839 "2024-08-05T22:35:50Z")

</div>

Hi, I wonder why JuMP could not solve the following optimization problem with max/min in the constraints. I would really appreciate it if you could show me how to solve this issue. using JuMP, Ipopt model = Model(Ipop…

---

## [Julia with Knitro](https://discourse.julialang.org/t/julia-with-knitro/81686)

<div class="topic-metadata">

**Author:** [@joyce\_azevedo](https://discourse.julialang.org/u/joyce_azevedo)\
**Replies:** 22\
**Last updated:** [August 5, 2024, 11:54am UTC](https://discourse.julialang.org/t/julia-with-knitro/81686 "2024-08-05T11:54:18Z")

</div>

Hey everyone! I’m trying to set a time limit and a gap in Julia using Knitro, but not having success: m = Model(KNITRO.Optimizer) set\_optimizer\_attribute(m, “maxtime\_cpu”, 3.6e+2) set\_optimizer\_attribute(m, “mip\_opt\_g…

---

## [Parallel Branch and Bound Priority Queue](https://discourse.julialang.org/t/parallel-branch-and-bound-priority-queue/117818)

<div class="topic-metadata">

**Author:** [@phK3](https://discourse.julialang.org/u/phK3)\
**Replies:** 1\
**Last updated:** [August 4, 2024, 7:41pm UTC](https://discourse.julialang.org/t/parallel-branch-and-bound-priority-queue/117818 "2024-08-04T19:41:58Z")

</div>

I’ve implemented code for a simple branch and bound procedure for maximizing a function in Julia (actually I’ve tweaked the code in NeuralPriorityOptimizer.jl). Currently the code runs on a single thread, but I’d like t…

---

## [Does gurobi support a different precision other than float64](https://discourse.julialang.org/t/does-gurobi-support-a-different-precision-other-than-float64/117658)

<div class="topic-metadata">

**Author:** [@Betristor](https://discourse.julialang.org/u/Betristor)\
**Replies:** 21\
**Last updated:** [August 4, 2024, 3:34am UTC](https://discourse.julialang.org/t/does-gurobi-support-a-different-precision-other-than-float64/117658 "2024-08-04T03:34:30Z")

</div>

I want to reduce my model memory consumption with JuMP and Gurobi as solver. With about 0.3 billion variables in the model, the memory consumption increases to 1.5 TB, which exceeds my machine’s physical limit. JuMP supp…

---

## [Ask user to provide points coordinates as two vectors or as a single vector of tuples?](https://discourse.julialang.org/t/ask-user-to-provide-points-coordinates-as-two-vectors-or-as-a-single-vector-of-tuples/117717)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 10\
**Last updated:** [August 2, 2024, 9:21pm UTC](https://discourse.julialang.org/t/ask-user-to-provide-points-coordinates-as-two-vectors-or-as-a-single-vector-of-tuples/117717 "2024-08-02T21:21:42Z")

</div>

When asking the user to provide coordinates of plan points for my package RingStarProblems.jl I initially thought the following was best: xycoordinates = tuple.(1:10, rand(1:10, 10)) somefunction(xycoordinates) However…

---

## [Finding the reason of infeasibility in CPLEX](https://discourse.julialang.org/t/finding-the-reason-of-infeasibility-in-cplex/117686)

<div class="topic-metadata">

**Author:** [@ArmanZar](https://discourse.julialang.org/u/ArmanZar)\
**Replies:** 2\
**Last updated:** [August 1, 2024, 8:08am UTC](https://discourse.julialang.org/t/finding-the-reason-of-infeasibility-in-cplex/117686 "2024-08-01T08:08:24Z")

</div>

Hi everyone, I have an optimization problem and I solved it using CPLEX solver in JuMP. At the end, it gives a solution but the termination status is infeasible. I know that in IPOPT there is function primal\_feasiblity\_…

---

## [Using Multi-start with local MINLP solvers in Julia](https://discourse.julialang.org/t/using-multi-start-with-local-minlp-solvers-in-julia/117634)

<div class="topic-metadata">

**Author:** [@Lunima](https://discourse.julialang.org/u/Lunima)\
**Replies:** 1\
**Last updated:** [July 31, 2024, 8:17am UTC](https://discourse.julialang.org/t/using-multi-start-with-local-minlp-solvers-in-julia/117634 "2024-07-31T08:17:37Z")

</div>

Hi everyone! When reading the Knitro documentation I saw it could use a multi-start method to solver non-convex MINLP to global optimality even though it is a local solver. Is it possible to implement such a method in …

---

## [How to speed up ipopt with HSL ma86 using parallel processing](https://discourse.julialang.org/t/how-to-speed-up-ipopt-with-hsl-ma86-using-parallel-processing/117567)

<div class="topic-metadata">

**Author:** [@Chi\_Jan](https://discourse.julialang.org/u/Chi_Jan)\
**Replies:** 7\
**Last updated:** [July 30, 2024, 2:42am UTC](https://discourse.julialang.org/t/how-to-speed-up-ipopt-with-hsl-ma86-using-parallel-processing/117567 "2024-07-30T02:42:18Z")

</div>

Hi community, I was previously using IPOPT with MUMPS (which is the default) to solve my problem, but the performance was a bit slow. I obtained an academic license for HSL and successfully downloaded and ran the code as…

---

## [Register array of symbolic functions](https://discourse.julialang.org/t/register-array-of-symbolic-functions/117602)

<div class="topic-metadata">

**Author:** [@Luca](https://discourse.julialang.org/u/Luca)\
**Replies:** 1\
**Last updated:** [July 30, 2024, 2:26am UTC](https://discourse.julialang.org/t/register-array-of-symbolic-functions/117602 "2024-07-30T02:26:13Z")

</div>

Dear all, I have the following issue with JuMP: I define an array of symbolic expression I want to use as constraint in a mathematical program. In particular, I have defined my function in the array gn and I want to wri…

---

## [MiniZinc doesn't update](https://discourse.julialang.org/t/minizinc-doesnt-update/117527)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 4\
**Last updated:** [July 26, 2024, 10:33pm UTC](https://discourse.julialang.org/t/minizinc-doesnt-update/117527 "2024-07-26T22:33:37Z")

</div>

MiniZinc doesn’t update from v0.2.1 to the latest, v0.3.11. Is v0.3.11 compiled with Google OR-Tools, so that CP-SAT may be used as a solver? (@v1.10) pkg\> status Status \`~/.julia/environments/v1.10/Project.toml\` \[074…

---

## [Trouble trying to serialize JuMP Models to .mps, .lp, .rew formats](https://discourse.julialang.org/t/trouble-trying-to-serialize-jump-models-to-mps-lp-rew-formats/117425)

<div class="topic-metadata">

**Author:** [@gangway](https://discourse.julialang.org/u/gangway)\
**Replies:** 3\
**Last updated:** [July 25, 2024, 8:21pm UTC](https://discourse.julialang.org/t/trouble-trying-to-serialize-jump-models-to-mps-lp-rew-formats/117425 "2024-07-25T20:21:17Z")

</div>

I am trying to serialize JuMP Models to .mps, .lp, .rew formats via write\_to\_file method. But I am facing the same error with all three conversion while the .nl conversion is successful: MathOptInterface.UnsupportedCon…

---

## [Formulation of Equations for Complementarity.jl](https://discourse.julialang.org/t/formulation-of-equations-for-complementarity-jl/117403)

<div class="topic-metadata">

**Author:** [@Alio0712](https://discourse.julialang.org/u/Alio0712)\
**Replies:** 9\
**Last updated:** [July 25, 2024, 12:52am UTC](https://discourse.julialang.org/t/formulation-of-equations-for-complementarity-jl/117403 "2024-07-25T00:52:02Z")

</div>

Dear community. I’m new to Julia and trying to code a Computable General Equilibrium Model. I have a question about Complementarity that I still can’t fully understand from going through various sources on the web. I kn…

---

## [How to test a Solver functionality availability](https://discourse.julialang.org/t/how-to-test-a-solver-functionality-availability/117266)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 2\
**Last updated:** [July 24, 2024, 9:41pm UTC](https://discourse.julialang.org/t/how-to-test-a-solver-functionality-availability/117266 "2024-07-24T21:41:46Z")

</div>

In JuMP, depending on the solver, there are some functionalities that are available, and some which are not, see for instance here. How should I test that before creating a Model(optimizer) ? As an example: if optimiz…

---

## [Test if an optimizer supports an attribute?](https://discourse.julialang.org/t/test-if-an-optimizer-supports-an-attribute/117444)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 3\
**Last updated:** [July 24, 2024, 9:38pm UTC](https://discourse.julialang.org/t/test-if-an-optimizer-supports-an-attribute/117444 "2024-07-24T21:38:28Z")

</div>

I am trying to test if an optimizer supports the attribute MOI.NumberOfThreads(): m = Model(optimizer) if MOI.supports(MOI.Utilities.CachingOptimizer(MOI.Utilities.Model{Float64}(), MOI.Utilities.AUTOMATIC), MOI…

---

## [\[Solved\] Problem installing the Gurobi package on a cluster](https://discourse.julialang.org/t/solved-problem-installing-the-gurobi-package-on-a-cluster/117385)

<div class="topic-metadata">

**Author:** [@Alex\_73](https://discourse.julialang.org/u/Alex_73)\
**Replies:** 3\
**Last updated:** [July 24, 2024, 12:51am UTC](https://discourse.julialang.org/t/solved-problem-installing-the-gurobi-package-on-a-cluster/117385 "2024-07-24T00:51:12Z")

</div>

Hello. I’m doing a postgraduate degree and I have access to a cluster that has julia/1.7.3, gurobi/10.0.0 and gurobi/11.0.1. Until now it was running gurobi/10.0.0 perfectly. However, in order to use the most recent ve…

---

## [Different objective state functions for different stages SDDP.jl](https://discourse.julialang.org/t/different-objective-state-functions-for-different-stages-sddp-jl/116812)

<div class="topic-metadata">

**Author:** [@tumpelopumpelo](https://discourse.julialang.org/u/tumpelopumpelo)\
**Replies:** 3\
**Last updated:** [July 22, 2024, 7:31am UTC](https://discourse.julialang.org/t/different-objective-state-functions-for-different-stages-sddp-jl/116812 "2024-07-22T07:31:17Z")

</div>

Hi, I am quite new to optimization with SDDP so may be a silly question. I am working on optimising a bidding strategy for a wind power producer in consecutive markets (day ahead, Intraday, ancillary) using SDDP, with u…

---

## [Question about when MiniZinc will return feasible solutions](https://discourse.julialang.org/t/question-about-when-minizinc-will-return-feasible-solutions/116595)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 12\
**Last updated:** [July 22, 2024, 6:06am UTC](https://discourse.julialang.org/t/question-about-when-minizinc-will-return-feasible-solutions/116595 "2024-07-22T06:06:17Z")

</div>

Hi all. I have a question about the following MiniZinc model. I am able to give a feasible solution with primal\_feasibility\_report but nothing is found by the solver. I’m aware of the silliness of the presented model, t…

---

## [Primal-Dual Hybrid Gradient for L1 regularization](https://discourse.julialang.org/t/primal-dual-hybrid-gradient-for-l1-regularization/117201)

<div class="topic-metadata">

**Author:** [@aris](https://discourse.julialang.org/u/aris)\
**Replies:** 23\
**Last updated:** [July 21, 2024, 5:34pm UTC](https://discourse.julialang.org/t/primal-dual-hybrid-gradient-for-l1-regularization/117201 "2024-07-21T17:34:33Z")

</div>

Greetings everyone, I was looking for a way to solve the following problem using julia: min\_{f\\geq0} \\; ||Kf-s||\_2^2 +\\alpha ||f||\_1 There’s this paper (section 2.2 specifically), where the authors use a Primal-D…

---

## [PowerModels.jl multinetwork for Security Constrained AC-OPF](https://discourse.julialang.org/t/powermodels-jl-multinetwork-for-security-constrained-ac-opf/113511)

<div class="topic-metadata">

**Author:** [@lcharles](https://discourse.julialang.org/u/lcharles)\
**Replies:** 4\
**Last updated:** [July 21, 2024, 4:52pm UTC](https://discourse.julialang.org/t/powermodels-jl-multinetwork-for-security-constrained-ac-opf/113511 "2024-07-21T16:52:10Z")

</div>

Hi, I’m currently working on a project in which I use the PowerModels package. In the first part of my project, I used the ‘solve\_opf’ function with the different models of quadratic relaxations implemented in the pack…

---

## [Trying to use \`GRBreadmodel\`](https://discourse.julialang.org/t/trying-to-use-grbreadmodel/117199)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 4\
**Last updated:** [July 21, 2024, 12:06pm UTC](https://discourse.julialang.org/t/trying-to-use-grbreadmodel/117199 "2024-07-21T12:06:55Z")

</div>

I’m trying something like using JuMP import Gurobi grb\_model = Gurobi.Optimizer() Gurobi.GRBreadmodel( grb\_model.env, "foo.lp", Ptr{Gurobi.GRBmodel}(pointer\_from\_objref(grb\_model)) ) model = direct\_model(g…

---

## [Constraint on count of variables \>0 in JuMP?](https://discourse.julialang.org/t/constraint-on-count-of-variables-0-in-jump/117072)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 3\
**Last updated:** [July 18, 2024, 11:46pm UTC](https://discourse.julialang.org/t/constraint-on-count-of-variables-0-in-jump/117072 "2024-07-18T23:46:06Z")

</div>

I have a model with a control variable as follows: @variable(model, 0 ≤ u\[1:(T+1)\] ≤ u\_max) I want to constrain the number of elements in u greater than 0 to be less than a threshold, u\_nonzero\_max. How can I do this …

---

## [Can only run Unit Tests with Gurobi locally because of Licence](https://discourse.julialang.org/t/can-only-run-unit-tests-with-gurobi-locally-because-of-licence/117169)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 1\
**Last updated:** [July 18, 2024, 7:10am UTC](https://discourse.julialang.org/t/can-only-run-unit-tests-with-gurobi-locally-because-of-licence/117169 "2024-07-18T07:10:10Z")

</div>

Dear Julia Discourse Optimization, I can not run Unit Tests (Test.jl) with Gurobi, because CI.yml file and GitHub action don’t have a valid Gurobi Licence. @test rspoptimize(pars, 1, optimizer\_with\_attributes(GLPK.Opt…

---

## [How to handle an optimizer which doesn't support an attribute of MathOptInterface?](https://discourse.julialang.org/t/how-to-handle-an-optimizer-which-doesnt-support-an-attribute-of-mathoptinterface/117133)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 2\
**Last updated:** [July 17, 2024, 9:59pm UTC](https://discourse.julialang.org/t/how-to-handle-an-optimizer-which-doesnt-support-an-attribute-of-mathoptinterface/117133 "2024-07-17T21:59:12Z")

</div>

Dear Julia Discourse’s optimization community, Because getting Node Count: MOI.get(m, MOI.NodeCount()) is not supported by GLPK.jl, at the end of my optimization model, I tried the following: nodecount = -1 try…

---

## [Can SCIP solve MINLP with trigonometric functions?](https://discourse.julialang.org/t/can-scip-solve-minlp-with-trigonometric-functions/116967)

<div class="topic-metadata">

**Author:** [@Lunima](https://discourse.julialang.org/u/Lunima)\
**Replies:** 5\
**Last updated:** [July 17, 2024, 3:07pm UTC](https://discourse.julialang.org/t/can-scip-solve-minlp-with-trigonometric-functions/116967 "2024-07-17T15:07:00Z")

</div>

Hi everyone! I’m trying out SCIP in JuMP (with SCIP.jl). In the FAQ in the documentation, when aswering the question “Which kind of MINLPs are supported by SCIP?” (SCIP Doxygen Documentation: Frequently Asked Questions …

---

## [Modular implementation of optimization problems with JuMP](https://discourse.julialang.org/t/modular-implementation-of-optimization-problems-with-jump/116261)

<div class="topic-metadata">

**Author:** [@pierre-haessig](https://discourse.julialang.org/u/pierre-haessig)\
**Replies:** 9\
**Last updated:** [July 17, 2024, 2:59pm UTC](https://discourse.julialang.org/t/modular-implementation-of-optimization-problems-with-jump/116261 "2024-07-17T14:59:31Z")

</div>

Hello, This is a follow-up of my question on the thread about dynamic JuMP variable names Using anonymous and or symbols to create dynamic variable names? - #3 by pierre-haessig. I’m sharing here a JuMP code design stu…

---

## [I cannot use the commands with\_optimizer() and getobjectivevalue() with JuMP, Gurobi](https://discourse.julialang.org/t/i-cannot-use-the-commands-with-optimizer-and-getobjectivevalue-with-jump-gurobi/83854)

<div class="topic-metadata">

**Author:** [@medardo](https://discourse.julialang.org/u/medardo)\
**Replies:** 9\
**Last updated:** [July 17, 2024, 8:21am UTC](https://discourse.julialang.org/t/i-cannot-use-the-commands-with-optimizer-and-getobjectivevalue-with-jump-gurobi/83854 "2024-07-17T08:21:29Z")

</div>

Hi, please somebody can help me? I cannot use this commands when I want to use JuMP and Gurobi: with\_optimizer() getobjectivevalue() I recived UndefVarError: … not defined

---

## [Lazy constraints are not supported by SCIP.jl while JuMP doesn't mention it](https://discourse.julialang.org/t/lazy-constraints-are-not-supported-by-scip-jl-while-jump-doesnt-mention-it/117110)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 2\
**Last updated:** [July 16, 2024, 10:11pm UTC](https://discourse.julialang.org/t/lazy-constraints-are-not-supported-by-scip-jl-while-jump-doesnt-mention-it/117110 "2024-07-16T22:11:04Z")

</div>

Dear Julia Discourse community, When running my Unit tests to make my package solver-agnostic: import RingStarProblems as RSP using Test @testset "RingStarProblems.jl" begin # Write your tests here. include("a…

---

## [Equation constraints not working in NLopt](https://discourse.julialang.org/t/equation-constraints-not-working-in-nlopt/116883)

<div class="topic-metadata">

**Author:** [@dannygold](https://discourse.julialang.org/u/dannygold)\
**Replies:** 5\
**Last updated:** [July 16, 2024, 5:46pm UTC](https://discourse.julialang.org/t/equation-constraints-not-working-in-nlopt/116883 "2024-07-16T17:46:09Z")

</div>

I’m trying to optimize a likelihood function of three parameters (call them a, b, and c) using the NLopt package. Currently, I have the following: opt = Opt(:LN\_COBYLA, length(θ₀)) function c(result::Vector, x::Vector…

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

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