# Optimization (Mathematical)

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

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

**Page:** 20

---

## [How to approach my unconstrained optimization problem?](https://discourse.julialang.org/t/how-to-approach-my-unconstrained-optimization-problem/119919)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 4\
**Last updated:** [September 26, 2024, 6:36pm UTC](https://discourse.julialang.org/t/how-to-approach-my-unconstrained-optimization-problem/119919 "2024-09-26T18:36:32Z")

</div>

I’ve got an objective function to maximize. The domain is {\\mathbb{R}}^n, where n is about thirty. The codomain is a bounded subset of the nonnegative reals. The objective value is zero for most of the domain. The object…

---

## [Confusion with variable indices with JuMP/CPLEX](https://discourse.julialang.org/t/confusion-with-variable-indices-with-jump-cplex/119920)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 1\
**Last updated:** [September 26, 2024, 2:35pm UTC](https://discourse.julialang.org/t/confusion-with-variable-indices-with-jump-cplex/119920 "2024-09-26T14:35:15Z")

</div>

I try to set branching priorities on variables using CPXcopyorder(env, lp, cnt, indices, priority, direction). Particlularly I want to get the indices of the varialbes of the JuMP model in the CPLEX model. I tried: inde…

---

## [How to write a new gradient descent algorithm and benchmark against existing methods](https://discourse.julialang.org/t/how-to-write-a-new-gradient-descent-algorithm-and-benchmark-against-existing-methods/119869)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 4\
**Last updated:** [September 26, 2024, 11:06am UTC](https://discourse.julialang.org/t/how-to-write-a-new-gradient-descent-algorithm-and-benchmark-against-existing-methods/119869 "2024-09-26T11:06:07Z")

</div>

I have an idea for a new gradient descent algorithm. I just want to see if it does better or worse than a standard momentum methods. How would I go about making use of the existing benchmarking suites CUTEst.jl or Optim…

---

## [PowerModels active and reactive power demand](https://discourse.julialang.org/t/powermodels-active-and-reactive-power-demand/119787)

<div class="topic-metadata">

**Author:** [@Glon](https://discourse.julialang.org/u/Glon)\
**Replies:** 2\
**Last updated:** [September 24, 2024, 6:27am UTC](https://discourse.julialang.org/t/powermodels-active-and-reactive-power-demand/119787 "2024-09-24T06:27:14Z")

</div>

Hello all, I am new to Julia and I am trying to run an acopf problem, but having trouble on how to loop it for a whole day. I have the active and reactive power demand at each bus for every 30 minutes. Below is the code…

---

## [Considering water head in SDDP.jl](https://discourse.julialang.org/t/considering-water-head-in-sddp-jl/119779)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 1\
**Last updated:** [September 24, 2024, 3:34am UTC](https://discourse.julialang.org/t/considering-water-head-in-sddp-jl/119779 "2024-09-24T03:34:14Z")

</div>

Hi everyone, I’m using SDDP.jl to model hydropower production and want to include the effect of water head in the production constraint, which is typically formulated as P = release×water head×efficiency parameter. He…

---

## [Creating orthogonality constraints in JuMP](https://discourse.julialang.org/t/creating-orthogonality-constraints-in-jump/47462)

<div class="topic-metadata">

**Author:** [@jbmuir](https://discourse.julialang.org/u/jbmuir)\
**Replies:** 3\
**Last updated:** [September 24, 2024, 3:14am UTC](https://discourse.julialang.org/t/creating-orthogonality-constraints-in-jump/47462 "2024-09-24T03:14:26Z")

</div>

I’m trying to impose some orthogonality constraints for an optimal design problem in JuMP; since these are nonlinear vector constraints I believe that I have to use the @NLconstraint macro with splatting. I can’t quite f…

---

## [Help with gradient-based optimizers](https://discourse.julialang.org/t/help-with-gradient-based-optimizers/119376)

<div class="topic-metadata">

**Author:** [@jwalker](https://discourse.julialang.org/u/jwalker)\
**Replies:** 14\
**Last updated:** [September 21, 2024, 8:03pm UTC](https://discourse.julialang.org/t/help-with-gradient-based-optimizers/119376 "2024-09-21T20:03:11Z")

</div>

I’m using Optimization.jl and Optim.jl to solve an optimization problem for which I have gradient information (via AD). What I’ve found is that the methods that use the gradient information perform worse than the derivat…

---

## [Parameter estimation in biological network](https://discourse.julialang.org/t/parameter-estimation-in-biological-network/119630)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 7\
**Last updated:** [September 20, 2024, 6:55am UTC](https://discourse.julialang.org/t/parameter-estimation-in-biological-network/119630 "2024-09-20T06:55:37Z")

</div>

I am working on a large signaling pathway and trying to get a rough estimation of the baseline parameters. I have been trying to do the fitting with the Particle Swarm Optimization from Metaheuristics.jl but it does not …

---

## [Differentiating through a QP - order of constraints](https://discourse.julialang.org/t/differentiating-through-a-qp-order-of-constraints/119275)

<div class="topic-metadata">

**Author:** [@blob](https://discourse.julialang.org/u/blob)\
**Replies:** 3\
**Last updated:** [September 20, 2024, 6:04am UTC](https://discourse.julialang.org/t/differentiating-through-a-qp-order-of-constraints/119275 "2024-09-20T06:04:17Z")

</div>

This is a follow-up to this topic. I have a QP that I want to differentiate through using DiffOpt. In contrast to the example from the tutorial, I have two constraints: n = 2 # variable dimension m = 2; # no of inequal…

---

## [ERROR: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model](https://discourse.julialang.org/t/error-result-index-of-attribute-mathoptinterface-variableprimal-1-out-of-bounds-there-are-currently-0-solution-s-in-the-model/119586)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 2\
**Last updated:** [September 19, 2024, 9:03am UTC](https://discourse.julialang.org/t/error-result-index-of-attribute-mathoptinterface-variableprimal-1-out-of-bounds-there-are-currently-0-solution-s-in-the-model/119586 "2024-09-19T09:03:46Z")

</div>

ERROR: Result index of attribute MathOptInterface.VariablePrimal(1) out of bounds. There are currently 0 solution(s) in the model. I got this error when solving an MILP model using HiGHS. Do anyone know what it means? T…

---

## [Why does OSQP return NaN for convex QP](https://discourse.julialang.org/t/why-does-osqp-return-nan-for-convex-qp/119550)

<div class="topic-metadata">

**Author:** [@blob](https://discourse.julialang.org/u/blob)\
**Replies:** 2\
**Last updated:** [September 19, 2024, 2:33am UTC](https://discourse.julialang.org/t/why-does-osqp-return-nan-for-convex-qp/119550 "2024-09-19T02:33:16Z")

</div>

I have a convex QP: using JuMP, OSQP, Clarabel, Ipopt A = \[0.01; -0.01; 3.548942957597223e-5; -3.548942957597223e-5\] b = \[6.998225528521202; 3.0017744714787984; 6.999996851250971; 3.1487490290693643e-6\] solver = optimi…

---

## [Gurobi callback function not accessing / not loading](https://discourse.julialang.org/t/gurobi-callback-function-not-accessing-not-loading/119501)

<div class="topic-metadata">

**Author:** [@cskx](https://discourse.julialang.org/u/cskx)\
**Replies:** 6\
**Last updated:** [September 18, 2024, 10:57am UTC](https://discourse.julialang.org/t/gurobi-callback-function-not-accessing-not-loading/119501 "2024-09-18T10:57:58Z")

</div>

Hello, I would like to access the values during each iterations, then plot the objective function (maybe more info) against iterations, I wrote a callback function as below. I found that my cb\_where is never equal to GR…

---

## [Set options of \`Clarabel.jl\` via the \`Convex.jl\` interface](https://discourse.julialang.org/t/set-options-of-clarabel-jl-via-the-convex-jl-interface/119538)

<div class="topic-metadata">

**Author:** [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Replies:** 3\
**Last updated:** [September 18, 2024, 8:37am UTC](https://discourse.julialang.org/t/set-options-of-clarabel-jl-via-the-convex-jl-interface/119538 "2024-09-18T08:37:58Z")

</div>

For the ECOS.jl solver I can do the following: solve!(problem, # Parameters taken from default values for EiCOS Convex.MOI.OptimizerWithAttributes(ECOS.Optimizer, "b" =\> 0.99, …

---

## [Minimize discrete time objective](https://discourse.julialang.org/t/minimize-discrete-time-objective/118665)

<div class="topic-metadata">

**Author:** [@Kunsag](https://discourse.julialang.org/u/Kunsag)\
**Replies:** 3\
**Last updated:** [August 27, 2024, 4:43pm UTC](https://discourse.julialang.org/t/minimize-discrete-time-objective/118665 "2024-08-27T16:43:40Z")

</div>

Hi, I’m currently trying to model an optimization problem in which the aim is to find time-dependent optimal decisions. I was able to reduce my current question to a minimal example. \\text{minimize } t\\\\ \\text{s.t. } f…

---

## [Type unstable in NonlinearSolve.jl](https://discourse.julialang.org/t/type-unstable-in-nonlinearsolve-jl/119533)

<div class="topic-metadata">

**Author:** [@aaoo](https://discourse.julialang.org/u/aaoo)\
**Replies:** 3\
**Last updated:** [September 18, 2024, 2:45am UTC](https://discourse.julialang.org/t/type-unstable-in-nonlinearsolve-jl/119533 "2024-09-18T02:45:17Z")

</div>

I am using NonlinearSolve.jl to solve a system of nonlinear equations. The @code\_warntype macro gives Any type when I use NonlinearProblem, see code below. When I wrapped this code into a larger outer function, the type …

---

## [Nlsolver vs Matlab fsolve](https://discourse.julialang.org/t/nlsolver-vs-matlab-fsolve/119523)

<div class="topic-metadata">

**Author:** [@w17n2411](https://discourse.julialang.org/u/w17n2411)\
**Replies:** 6\
**Last updated:** [September 17, 2024, 9:03pm UTC](https://discourse.julialang.org/t/nlsolver-vs-matlab-fsolve/119523 "2024-09-17T21:03:37Z")

</div>

I have some code to solve a system of nonlinear equations given some state variables (both in Matlab and Julia). The solution is quite sensitive and I have to use homotopy to solve it for a variety of points in the state…

---

## [Registering Expressions as JuMP variables in a loop](https://discourse.julialang.org/t/registering-expressions-as-jump-variables-in-a-loop/119223)

<div class="topic-metadata">

**Author:** [@theplatters](https://discourse.julialang.org/u/theplatters)\
**Replies:** 3\
**Last updated:** [September 15, 2024, 4:41am UTC](https://discourse.julialang.org/t/registering-expressions-as-jump-variables-in-a-loop/119223 "2024-09-15T04:41:30Z")

</div>

Hey guys, I have a project, where I create a model like this m = @model begin @exogenous data @exogenous consumption production\[1:71\] := inv(I - data.Ω) \* consumtion prices\[1:71\] := @maxc c(production) constraints(c…

---

## [Algorithms for non-square rootfinding](https://discourse.julialang.org/t/algorithms-for-non-square-rootfinding/119370)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [September 13, 2024, 6:33pm UTC](https://discourse.julialang.org/t/algorithms-for-non-square-rootfinding/119370 "2024-09-13T18:33:13Z")

</div>

Consider a rootfinding problem f(x) = 0 in x \\in \\mathbb{R}^ n, where f is differentiable. Most texts I am familiar with assume that f: \\mathbb{R}^n \\to \\mathbb{R}^n, so implicitly the Jacobian J is square. But in e…

---

## [Discrete Non-Integer Design Variables in Evolutionary.jl](https://discourse.julialang.org/t/discrete-non-integer-design-variables-in-evolutionary-jl/119379)

<div class="topic-metadata">

**Author:** [@AkchurinDA](https://discourse.julialang.org/u/AkchurinDA)\
**Replies:** 0\
**Last updated:** [September 13, 2024, 4:49pm UTC](https://discourse.julialang.org/t/discrete-non-integer-design-variables-in-evolutionary-jl/119379 "2024-09-13T16:49:26Z")

</div>

Hi, Can I add discrete non-integer variable constraints such that my design variables are chosen from specified lists of available discrete values in Evolutionary.jl? I want something similar as in this MATLAB example:…

---

## [Convert SymPy.jl equation system to JuMP.jl Model](https://discourse.julialang.org/t/convert-sympy-jl-equation-system-to-jump-jl-model/119091)

<div class="topic-metadata">

**Author:** [@lufu](https://discourse.julialang.org/u/lufu)\
**Replies:** 5\
**Last updated:** [September 12, 2024, 11:07pm UTC](https://discourse.julialang.org/t/convert-sympy-jl-equation-system-to-jump-jl-model/119091 "2024-09-12T23:07:11Z")

</div>

Hello together, I am new to Julia and ran into a problem that I am stuck with for quite some while now. I want to convert equation systems from SymPy into JuMP Models. However, the symbolic variables and equations are …

---

## [Question about eachindex behavior in DenseAxisArray in JuMP](https://discourse.julialang.org/t/question-about-eachindex-behavior-in-denseaxisarray-in-jump/119333)

<div class="topic-metadata">

**Author:** [@guilhermebodin](https://discourse.julialang.org/u/guilhermebodin)\
**Replies:** 1\
**Last updated:** [September 12, 2024, 9:35pm UTC](https://discourse.julialang.org/t/question-about-eachindex-behavior-in-denseaxisarray-in-jump/119333 "2024-09-12T21:35:13Z")

</div>

This is more of a question of whether this is expected behavior or a corner case that should not work correctly anyway. When we run this code the access of indices through the use of eachindex in dense axis array is not…

---

## [Even Gurobi is too slow for my Minecraft problem](https://discourse.julialang.org/t/even-gurobi-is-too-slow-for-my-minecraft-problem/119231)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 10\
**Last updated:** [September 12, 2024, 10:28am UTC](https://discourse.julialang.org/t/even-gurobi-is-too-slow-for-my-minecraft-problem/119231 "2024-09-12T10:28:15Z")

</div>

Recently, I made a reactor designer for Minecraft Nuclearcraft. I even obtained a Gurobi license for it. Then, I tuned lots of parameters. I decided to tune up the cuts that happened a lot to be aggressive and I used the…

---

## [Save the optimization results while the optimization is running (Optim.jl)](https://discourse.julialang.org/t/save-the-optimization-results-while-the-optimization-is-running-optim-jl/119116)

<div class="topic-metadata">

**Author:** [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)\
**Replies:** 7\
**Last updated:** [September 11, 2024, 4:25pm UTC](https://discourse.julialang.org/t/save-the-optimization-results-while-the-optimization-is-running-optim-jl/119116 "2024-09-11T16:25:51Z")

</div>

Hi, I am running a minimization using Optim. Since it is very slow, I would like to save the results while running so that if I need to switch off the computer and brutally interrupt the minimization, I still have someth…

---

## [CALL FOR NOMINATIONS: 20th Annual "COIN-OR Cup"](https://discourse.julialang.org/t/call-for-nominations-20th-annual-coin-or-cup/119250)

<div class="topic-metadata">

**Author:** [@sshin23](https://discourse.julialang.org/u/sshin23)\
**Replies:** 0\
**Last updated:** [September 10, 2024, 1:09pm UTC](https://discourse.julialang.org/t/call-for-nominations-20th-annual-coin-or-cup/119250 "2024-09-10T13:09:37Z")

</div>

Hello Julia Commiunity, Nominations for the 20th Annual COIN-OR Cup Competition are now open! More details about the nomination can be found at the link below: The COIN-OR Cup recognizes and celebrates the best contri…

---

## [Any toy version of the DICE model for climate change available in Julia?](https://discourse.julialang.org/t/any-toy-version-of-the-dice-model-for-climate-change-available-in-julia/119134)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [September 9, 2024, 3:25am UTC](https://discourse.julialang.org/t/any-toy-version-of-the-dice-model-for-climate-change-available-in-julia/119134 "2024-09-09T03:25:55Z")

</div>

Does any “toy” (oversemplified) versions of the dice model model for assessing climate change optimal societal actions is available in Julia? Perhaps based on Jump/InfiniteOpt?

---

## [Hierarchical/compositional construction of large optimization models](https://discourse.julialang.org/t/hierarchical-compositional-construction-of-large-optimization-models/100303)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 9\
**Last updated:** [September 8, 2024, 10:48pm UTC](https://discourse.julialang.org/t/hierarchical-compositional-construction-of-large-optimization-models/100303 "2024-09-08T22:48:37Z")

</div>

Hi everyone. I have a broad question, rather than a question about any specific package or code block, so please let me know if its inappropriate and I’ll move/close it. I’m interested if the Julia/JuMP community has pu…

---

## [Cannot install gurobi](https://discourse.julialang.org/t/cannot-install-gurobi/119186)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 2\
**Last updated:** [September 8, 2024, 7:07am UTC](https://discourse.julialang.org/t/cannot-install-gurobi/119186 "2024-09-08T07:07:40Z")

</div>

After obtaining my gurobi license, I tried to download gurobi for Julia. However, this happened. It said that the source was too slow. - https://anaconda.org/Gurobi/gurobi/11.0.2/download/win-64/gurobi-11.0.2-py311\_0.t…

---

## [Method Error with no method matching zero(::Type{SDDP.State{VariableRef}})](https://discourse.julialang.org/t/method-error-with-no-method-matching-zero-type-sddp-state-variableref/119082)

<div class="topic-metadata">

**Author:** [@Millie](https://discourse.julialang.org/u/Millie)\
**Replies:** 2\
**Last updated:** [September 6, 2024, 9:27am UTC](https://discourse.julialang.org/t/method-error-with-no-method-matching-zero-type-sddp-state-variableref/119082 "2024-09-06T09:27:14Z")

</div>

Hi! I have a question about this one error with my code. I was trying to mimic the example in SDDP.jl objective status and include some integer variables. But I got the error: LoadError: MethodError: no method matching z…

---

## [Get gradient of user-defined nonlinear operator in JuMP](https://discourse.julialang.org/t/get-gradient-of-user-defined-nonlinear-operator-in-jump/118989)

<div class="topic-metadata">

**Author:** [@ertam98](https://discourse.julialang.org/u/ertam98)\
**Replies:** 3\
**Last updated:** [September 6, 2024, 12:11am UTC](https://discourse.julialang.org/t/get-gradient-of-user-defined-nonlinear-operator-in-jump/118989 "2024-09-06T00:11:02Z")

</div>

Hi, Is it possible to get the gradient from a user-defined nonlinear operator in JuMP? What I would like to do is pass a JuMP model around and be able to query the analytical gradient from the nonlinear operator. A MWE…

---

## [JuMP takes long time to load the problem/model](https://discourse.julialang.org/t/jump-takes-long-time-to-load-the-problem-model/118593)

<div class="topic-metadata">

**Author:** [@fstwn](https://discourse.julialang.org/u/fstwn)\
**Replies:** 23\
**Last updated:** [September 4, 2024, 11:07pm UTC](https://discourse.julialang.org/t/jump-takes-long-time-to-load-the-problem-model/118593 "2024-09-04T23:07:18Z")

</div>

Hi I use JuMP and CPLEX solver to solve the optimization problem in time-space network. I write this code to the JuMP with the data. I tried to model network design model in time-space network. using JuMP, CPLEX, DataFr…

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

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