# Optimization (Mathematical)

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

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

**Page:** 29

---

## [Marginal water value while using SDDP.jl](https://discourse.julialang.org/t/marginal-water-value-while-using-sddp-jl/112169)

<div class="topic-metadata">

**Author:** [@Sorooshsa](https://discourse.julialang.org/u/Sorooshsa)\
**Replies:** 7\
**Last updated:** [April 2, 2024, 12:24am UTC](https://discourse.julialang.org/t/marginal-water-value-while-using-sddp-jl/112169 "2024-04-02T00:24:54Z")

</div>

I have a multi-stage stochastic hydro-electric scheduling problem that SDDP.jl models and solves. The model includes a set of constraints related to water level control. So now I’d like to determine the reservoirs’ mar…

---

## [Constrained Optimization of a "taxation" curve not working Optimization.jl / Ipopt](https://discourse.julialang.org/t/constrained-optimization-of-a-taxation-curve-not-working-optimization-jl-ipopt/112317)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 11\
**Last updated:** [March 30, 2024, 6:08pm UTC](https://discourse.julialang.org/t/constrained-optimization-of-a-taxation-curve-not-working-optimization-jl-ipopt/112317 "2024-03-30T18:08:34Z")

</div>

I was having some discussions online on Mastodon, and advocating that we could simplify our tax code to a flat tax + UBI and that this is kind of “near optimal” in some sense. I wrote up a notebook about it… GitHub - dl…

---

## [Accessing children nodes in the SDDP package](https://discourse.julialang.org/t/accessing-children-nodes-in-the-sddp-package/112140)

<div class="topic-metadata">

**Author:** [@heiwie](https://discourse.julialang.org/u/heiwie)\
**Replies:** 8\
**Last updated:** [March 28, 2024, 5:22pm UTC](https://discourse.julialang.org/t/accessing-children-nodes-in-the-sddp-package/112140 "2024-03-28T17:22:37Z")

</div>

I have an optimization problem where one of the constraints is a convex non-linear constraint on the following form: Here w, eta and x are decision variables. All variables with an m index are variables corresponding …

---

## [Trying to use the new optimization algorithm: Sophia](https://discourse.julialang.org/t/trying-to-use-the-new-optimization-algorithm-sophia/110259)

<div class="topic-metadata">

**Author:** [@KianH](https://discourse.julialang.org/u/KianH)\
**Replies:** 12\
**Last updated:** [March 28, 2024, 9:47am UTC](https://discourse.julialang.org/t/trying-to-use-the-new-optimization-algorithm-sophia/110259 "2024-03-28T09:47:13Z")

</div>

I am trying to use the new optimization algorithm in Optimization.jl called Sophia, which is the first algorithm that shows up in the link below. However, I seem to get an error message that Sophia is an undefined var…

---

## [Least square with multi-value function](https://discourse.julialang.org/t/least-square-with-multi-value-function/47943)

<div class="topic-metadata">

**Author:** [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Replies:** 3\
**Last updated:** [March 28, 2024, 4:33am UTC](https://discourse.julialang.org/t/least-square-with-multi-value-function/47943 "2024-03-28T04:33:46Z")

</div>

I have a model which takes 3 independent variables, 4 parameters and returns 2 values. I am trying to fit the parameters to a certain dataset. LsqFit does not seem to like multivalues function but maybe I am not using …

---

## [Poor time performance in modifying parameters of JuMP models when using Gurobi](https://discourse.julialang.org/t/poor-time-performance-in-modifying-parameters-of-jump-models-when-using-gurobi/106982)

<div class="topic-metadata">

**Author:** [@NataponW](https://discourse.julialang.org/u/NataponW)\
**Replies:** 11\
**Last updated:** [March 27, 2024, 2:44pm UTC](https://discourse.julialang.org/t/poor-time-performance-in-modifying-parameters-of-jump-models-when-using-gurobi/106982 "2024-03-27T14:44:19Z")

</div>

Hello, I have a large LP model that I want to iteratively solve over changing parameters. Up until now, using set\_normalized\_rhs and set\_normalized\_coefficient works very well when HiGHS is an optimizer. However, when I…

---

## [Implementing a squarewave: Can't take remainder of InfiniteOpt.GeneralVariableRef](https://discourse.julialang.org/t/implementing-a-squarewave-cant-take-remainder-of-infiniteopt-generalvariableref/111955)

<div class="topic-metadata">

**Author:** [@lpz18](https://discourse.julialang.org/u/lpz18)\
**Replies:** 1\
**Last updated:** [March 27, 2024, 1:50am UTC](https://discourse.julialang.org/t/implementing-a-squarewave-cant-take-remainder-of-infiniteopt-generalvariableref/111955 "2024-03-27T01:50:25Z")

</div>

I have a squarewave implemented like so: function sqw(t; period::Float64=1, duty::Float64=0.5) return t % period \< duty\*period ? 1.0 : 0.0 end I am running an InfiniteOpt.jl optimization where I pass in sqw as a param…

---

## [How to speed up model generation in JuMP?](https://discourse.julialang.org/t/how-to-speed-up-model-generation-in-jump/112050)

<div class="topic-metadata">

**Author:** [@SantoshSharma](https://discourse.julialang.org/u/SantoshSharma)\
**Replies:** 7\
**Last updated:** [March 26, 2024, 8:59pm UTC](https://discourse.julialang.org/t/how-to-speed-up-model-generation-in-jump/112050 "2024-03-26T20:59:56Z")

</div>

I have a large-scale scenarios-based optimization model that takes a long time to solve on JuMP and Julia using the Gurobi solver. While solving the constructed model using Gurobi (as it uses all available cores) is quic…

---

## [CPLEX - Setting branching priority](https://discourse.julialang.org/t/cplex-setting-branching-priority/11644)

<div class="topic-metadata">

**Author:** [@Lefteris\_Manousakis](https://discourse.julialang.org/u/Lefteris_Manousakis)\
**Replies:** 9\
**Last updated:** [March 26, 2024, 7:41pm UTC](https://discourse.julialang.org/t/cplex-setting-branching-priority/11644 "2024-03-26T19:41:37Z")

</div>

Hi all! I have been trying to set branching priority (in CPLEX) for a set of my variables (z) but I cannot do it. I tried using the linear indices and the internal model, but I get a method not found error. Source cod…

---

## [Questionable Zygote gradients for quantum optimal control problem](https://discourse.julialang.org/t/questionable-zygote-gradients-for-quantum-optimal-control-problem/112060)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 6\
**Last updated:** [March 26, 2024, 6:06pm UTC](https://discourse.julialang.org/t/questionable-zygote-gradients-for-quantum-optimal-control-problem/112060 "2024-03-26T18:06:32Z")

</div>

I’m testing out a gradient-based optimization of some (quantum) dynamical system using AD over a simulation with OrdinaryDiffEq. The “quantum” here really just means that the dynamical state is complex-valued, not real-v…

---

## [Change value of a constant in the objective function](https://discourse.julialang.org/t/change-value-of-a-constant-in-the-objective-function/112082)

<div class="topic-metadata">

**Author:** [@pedroripper](https://discourse.julialang.org/u/pedroripper)\
**Replies:** 2\
**Last updated:** [March 26, 2024, 12:37am UTC](https://discourse.julialang.org/t/change-value-of-a-constant-in-the-objective-function/112082 "2024-03-26T00:37:38Z")

</div>

Greetings, I have a JuMP model that is being instantiated at some point of my code. I will be running optimize!(model) several times and, for each, I would like to change the value of the coefficient given as a paramet…

---

## [Matrix Dimension mismatch](https://discourse.julialang.org/t/matrix-dimension-mismatch/112073)

<div class="topic-metadata">

**Author:** [@Sharara](https://discourse.julialang.org/u/Sharara)\
**Replies:** 3\
**Last updated:** [March 25, 2024, 11:23am UTC](https://discourse.julialang.org/t/matrix-dimension-mismatch/112073 "2024-03-25T11:23:34Z")

</div>

Hi I checked all similar topics but, I think they did not match my case, I faced mismatch matrix size several times, for different conditions, (while I am sure the matrices and sizes are true and because I am trying t…

---

## [Problem installing CPLEX.jl with CPLEX 22.1.1 on Mac OS](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967)

<div class="topic-metadata">

**Author:** [@mposs](https://discourse.julialang.org/u/mposs)\
**Replies:** 12\
**Last updated:** [March 25, 2024, 7:20am UTC](https://discourse.julialang.org/t/problem-installing-cplex-jl-with-cplex-22-1-1-on-mac-os/111967 "2024-03-25T07:20:23Z")

</div>

Hello I just installed CPLEX 22.1.1 poss@Mac-de-Michael x86-64\_osx % pwd /Applications/CPLEX\_Studio\_Community2211/cplex/bin/x86-64\_osx In configured CPLEX\_STUDIO\_BINARIES as requested: julia\> ENV\["CPLEX\_STUDIO\_BINARI…

---

## [Optimize Monte Carlo Simulation](https://discourse.julialang.org/t/optimize-monte-carlo-simulation/112032)

<div class="topic-metadata">

**Author:** [@Fourier](https://discourse.julialang.org/u/Fourier)\
**Replies:** 4\
**Last updated:** [March 24, 2024, 3:15pm UTC](https://discourse.julialang.org/t/optimize-monte-carlo-simulation/112032 "2024-03-24T15:15:23Z")

</div>

I have a monte carlo simulation that runs in an external program that I can call using julia. I would like to optiize the simulation result with respect to parameters in the simulation input. The values I get out of it,…

---

## [Any Way to Track Variable Conversion When Writing JuMP Models to File?](https://discourse.julialang.org/t/any-way-to-track-variable-conversion-when-writing-jump-models-to-file/111996)

<div class="topic-metadata">

**Author:** [@rbassett3](https://discourse.julialang.org/u/rbassett3)\
**Replies:** 4\
**Last updated:** [March 24, 2024, 3:50am UTC](https://discourse.julialang.org/t/any-way-to-track-variable-conversion-when-writing-jump-models-to-file/111996 "2024-03-24T03:50:04Z")

</div>

I’ve created a JuMP model, which I wrote to conic benchmark format (cbf) and then solved with a solver that has a cbf input mechanism but isn’t a solver utilized in JuMP. I now have the solution to the cbf format as per…

---

## [DimensionMismatch error in creating semidefinite constraint in JuMP.jl](https://discourse.julialang.org/t/dimensionmismatch-error-in-creating-semidefinite-constraint-in-jump-jl/111969)

<div class="topic-metadata">

**Author:** [@Shuvomoy\_Das\_Gupta](https://discourse.julialang.org/u/Shuvomoy_Das_Gupta)\
**Replies:** 2\
**Last updated:** [March 23, 2024, 8:46pm UTC](https://discourse.julialang.org/t/dimensionmismatch-error-in-creating-semidefinite-constraint-in-jump-jl/111969 "2024-03-23T20:46:19Z")

</div>

Dear all, I have encountered a somewhat unintuitive error in creating the following semidefinte constraint in JuMP.jl. Sample code is as follows: # Create a JuMP model model = Model(optimizer\_with\_attributes(Mosek.Opt…

---

## [How to check the dimension names before eliminating some dimensions of a polyhedron?](https://discourse.julialang.org/t/how-to-check-the-dimension-names-before-eliminating-some-dimensions-of-a-polyhedron/111864)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 3\
**Last updated:** [March 22, 2024, 8:12am UTC](https://discourse.julialang.org/t/how-to-check-the-dimension-names-before-eliminating-some-dimensions-of-a-polyhedron/111864 "2024-03-22T08:12:38Z")

</div>

using Polyhedra using JuMP using CDDLib poly = Model() @variable(poly, -1 \<= x \<= 1) @variable(poly, -1 \<= y \<= 1) P = polyhedron(poly, CDDLib.Library(:exact)) P\_y = eliminate(P, \[1\]) How can I make sure the index \[1\] …

---

## [Julia frameworks for large-scale nonlinear least-squares optimization for computer vision](https://discourse.julialang.org/t/julia-frameworks-for-large-scale-nonlinear-least-squares-optimization-for-computer-vision/49344)

<div class="topic-metadata">

**Author:** [@masoug](https://discourse.julialang.org/u/masoug)\
**Replies:** 3\
**Last updated:** [March 21, 2024, 10:42am UTC](https://discourse.julialang.org/t/julia-frameworks-for-large-scale-nonlinear-least-squares-optimization-for-computer-vision/49344 "2024-03-21T10:42:44Z")

</div>

Hi, Julia newcomer here :slight\_smile: I’m working on learning both Julia and computer vision by implementing common vision algorithms like camera calibration in the Julia language. I’m at a point right now where I’m lo…

---

## [Using RecursiveArrayTools.ArrayPartition to keep track of control parameters](https://discourse.julialang.org/t/using-recursivearraytools-arraypartition-to-keep-track-of-control-parameters/111906)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 1\
**Last updated:** [March 20, 2024, 11:57pm UTC](https://discourse.julialang.org/t/using-recursivearraytools-arraypartition-to-keep-track-of-control-parameters/111906 "2024-03-20T23:57:36Z")

</div>

I’m making some plans for the QuantumControl package to extend from optimizing arbitrary time-continuous control fields to control fields that are described analytically by a handful of scalar control parameters. Withou…

---

## [JuMP reduced\_cost questions](https://discourse.julialang.org/t/jump-reduced-cost-questions/111484)

<div class="topic-metadata">

**Author:** [@Ken\_Lin](https://discourse.julialang.org/u/Ken_Lin)\
**Replies:** 10\
**Last updated:** [March 20, 2024, 2:31pm UTC](https://discourse.julialang.org/t/jump-reduced-cost-questions/111484 "2024-03-20T14:31:20Z")

</div>

Hi, can anyone please help me with some questions on reduced\_cost in JuMP? Thank you! toym = Model(() -\> Gurobi.Optimizer(GRB\_ENV)) @variable(toym, 0 \<= toyx\[1:4\] \<= 1) @constraint(toym, toyx\[1\]+toyx\[2\] \<= 1) @constrain…

---

## [Constraint using a constant - Broadcast Syntax Error](https://discourse.julialang.org/t/constraint-using-a-constant-broadcast-syntax-error/111855)

<div class="topic-metadata">

**Author:** [@IgorESMelo](https://discourse.julialang.org/u/IgorESMelo)\
**Replies:** 1\
**Last updated:** [March 20, 2024, 3:59am UTC](https://discourse.julialang.org/t/constraint-using-a-constant-broadcast-syntax-error/111855 "2024-03-20T03:59:24Z")

</div>

Hello everyone, I have some doubts about how to create constraints using a constant value. For example, let’s take the code below. using JuMP, Gurobi function solve() #Decision variables @variable(model, x\[…

---

## [Gurobi convex optimization](https://discourse.julialang.org/t/gurobi-convex-optimization/111850)

<div class="topic-metadata">

**Author:** [@tardis438](https://discourse.julialang.org/u/tardis438)\
**Replies:** 2\
**Last updated:** [March 20, 2024, 2:35am UTC](https://discourse.julialang.org/t/gurobi-convex-optimization/111850 "2024-03-20T02:35:14Z")

</div>

I am using Gurobi and JuMP to solve a fairly simple convex optimization problem but I am a newbie and don’t know the right syntax. I want to solve (N is a fixed and known integer (eg 100)) \\min \\sum\_{i=1}^{N} (-log x\[i…

---

## [How to pass the domain of a variable to a function in a general manner?](https://discourse.julialang.org/t/how-to-pass-the-domain-of-a-variable-to-a-function-in-a-general-manner/111824)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 4\
**Last updated:** [March 20, 2024, 2:17am UTC](https://discourse.julialang.org/t/how-to-pass-the-domain-of-a-variable-to-a-function-in-a-general-manner/111824 "2024-03-20T02:17:19Z")

</div>

I plan to implement some certain algorithm that is designed for a class of some type of optimization problems with one of whose decision variables x required to be in the domain F\_x\\subseteq \\mathbb{R}\_+^n. I decide to …

---

## [Solving nonlinear constrained optimization problem](https://discourse.julialang.org/t/solving-nonlinear-constrained-optimization-problem/111255)

<div class="topic-metadata">

**Author:** [@rtapia](https://discourse.julialang.org/u/rtapia)\
**Replies:** 35\
**Last updated:** [March 18, 2024, 5:32pm UTC](https://discourse.julialang.org/t/solving-nonlinear-constrained-optimization-problem/111255 "2024-03-18T17:32:29Z")

</div>

Hello, I am trying to solve the following nonconvex problem in Julia using Optim.jl: min x’Px s.t: 1 -x’\*x \<=0 where P is a positive definite matrix. I have defined the following using JuMP, Optim n = 1500; A = 10…

---

## [Multiplication of matrix expression and variables leads to stack overflow and matmul error](https://discourse.julialang.org/t/multiplication-of-matrix-expression-and-variables-leads-to-stack-overflow-and-matmul-error/111760)

<div class="topic-metadata">

**Author:** [@Rahul\_Narwar](https://discourse.julialang.org/u/Rahul_Narwar)\
**Replies:** 2\
**Last updated:** [March 18, 2024, 12:00pm UTC](https://discourse.julialang.org/t/multiplication-of-matrix-expression-and-variables-leads-to-stack-overflow-and-matmul-error/111760 "2024-03-18T12:00:10Z")

</div>

I have an optimal orbital transfer problem: h = 2 n = 6 m = 3 model = Model(NLopt.Optimizer) set\_optimizer\_attribute(model, "algorithm", :AUGLAG) local\_optimizer = NLopt.Opt(:LD\_LBFGS, n\*(h+1) + m\*h) local\_optimizer.xt…

---

## [Creating variables using JuMP](https://discourse.julialang.org/t/creating-variables-using-jump/111562)

<div class="topic-metadata">

**Author:** [@heiwie](https://discourse.julialang.org/u/heiwie)\
**Replies:** 3\
**Last updated:** [March 18, 2024, 9:40am UTC](https://discourse.julialang.org/t/creating-variables-using-jump/111562 "2024-03-18T09:40:35Z")

</div>

I am trying to define variables corresponding to nodes in a lattice consisting of one root node and two other time steps with two nodes each. I have defined a 2D list with all the nodes which I want to use for the indexi…

---

## [An error occurred when I \`add JuMPeR\`](https://discourse.julialang.org/t/an-error-occurred-when-i-add-jumper/111726)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 4\
**Last updated:** [March 18, 2024, 3:48am UTC](https://discourse.julialang.org/t/an-error-occurred-when-i-add-jumper/111726 "2024-03-18T03:48:49Z")

</div>

I add JuMPeR after add JuMP, but it reported an error (P.S. JuMP is correctly installed): (myenv) pkg\> add JuMPeR Resolving package versions... Updating \`D:\\myenv\\Project.toml\` \[707a9f91\] + JuMPeR v0.6.0 Up…

---

## [Is there any overview of current solvers compatible with \`JuMP\`?](https://discourse.julialang.org/t/is-there-any-overview-of-current-solvers-compatible-with-jump/111720)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 4\
**Last updated:** [March 18, 2024, 3:47am UTC](https://discourse.julialang.org/t/is-there-any-overview-of-current-solvers-compatible-with-jump/111720 "2024-03-18T03:47:56Z")

</div>

The JuMP documentation enumerates several optional optimization solvers. I am curious if this represents the complete collection of optional solvers currently compatible with JuMP, and whether there exists a consolidated…

---

## [Gurobi and non linear](https://discourse.julialang.org/t/gurobi-and-non-linear/111665)

<div class="topic-metadata">

**Author:** [@Fabrizio](https://discourse.julialang.org/u/Fabrizio)\
**Replies:** 7\
**Last updated:** [March 17, 2024, 10:47pm UTC](https://discourse.julialang.org/t/gurobi-and-non-linear/111665 "2024-03-17T22:47:33Z")

</div>

Hi, the (python) inteface of Gurobi, since 9.0 ver, enables to consider non linear/non convex OF/cns. Notably square roots of variables in the form \\sum\_i \\sqrt(z\_i) \\leq k . This by means of the function that let y…

---

## [Creating nodes with the same variables/constraints in Plasmo](https://discourse.julialang.org/t/creating-nodes-with-the-same-variables-constraints-in-plasmo/111651)

<div class="topic-metadata">

**Author:** [@evrenmturan](https://discourse.julialang.org/u/evrenmturan)\
**Replies:** 1\
**Last updated:** [March 17, 2024, 8:26pm UTC](https://discourse.julialang.org/t/creating-nodes-with-the-same-variables-constraints-in-plasmo/111651 "2024-03-17T20:26:07Z")

</div>

I posted this on Slack, and was recommended to also post it here. I am setting up a problem in Plasmo, in which some nodes have (some of) the same variables & constraints as other nodes. So I wanted to write a function …

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

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