# Optimization (Mathematical)

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

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

**Page:** 26

---

## [Decision-dependent randomness in SDDP.jl](https://discourse.julialang.org/t/decision-dependent-randomness-in-sddp-jl/114625)

<div class="topic-metadata">

**Author:** [@mothmani](https://discourse.julialang.org/u/mothmani)\
**Replies:** 6\
**Last updated:** [May 26, 2024, 1:45pm UTC](https://discourse.julialang.org/t/decision-dependent-randomness-in-sddp-jl/114625 "2024-05-26T13:45:16Z")

</div>

Hi everyone, I’m quite new to Julia and SDDP and may ask a silly question. I’m trying to optimize the preventive replacement of some devices over several stages. I assume that know the lifetime distribution of the devi…

---

## [Nlopt forced stop](https://discourse.julialang.org/t/nlopt-forced-stop/114727)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 2\
**Last updated:** [May 26, 2024, 1:05am UTC](https://discourse.julialang.org/t/nlopt-forced-stop/114727 "2024-05-26T01:05:00Z")

</div>

Hi, I am using Nlopt for a gradient based optimization. It stopes after 4 iterations and returns forced stop and the output is not converged. Could you please tell me how can I find the problem which makes optimizer to f…

---

## [Computing variance of variables is very slow in JuMP](https://discourse.julialang.org/t/computing-variance-of-variables-is-very-slow-in-jump/114660)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 3\
**Last updated:** [May 25, 2024, 12:19am UTC](https://discourse.julialang.org/t/computing-variance-of-variables-is-very-slow-in-jump/114660 "2024-05-25T00:19:28Z")

</div>

Consider the small code snippet below using JuMP using Statistics model = Model() n = 1000 @variable(model, x\[1:n\], Bin) @time @objective(model, Min, var(x .\* rand(n))) The timing is 162.785950 seconds (93.08 k alloc…

---

## [How to stop a long-running optimization process in JuMP?](https://discourse.julialang.org/t/how-to-stop-a-long-running-optimization-process-in-jump/114656)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 6\
**Last updated:** [May 24, 2024, 2:31pm UTC](https://discourse.julialang.org/t/how-to-stop-a-long-running-optimization-process-in-jump/114656 "2024-05-24T14:31:46Z")

</div>

Some optimization problem can be quite time-consuming. I used JuMP in Jupyter notebook (VS Code) and Julia REPL. After optimize! is called, the optimization starts, and sometimes I want to interrupt it. However The sto…

---

## [What is the best way to modify existing or add new optimizer in Optim?](https://discourse.julialang.org/t/what-is-the-best-way-to-modify-existing-or-add-new-optimizer-in-optim/114553)

<div class="topic-metadata">

**Author:** [@PetrosStefanou](https://discourse.julialang.org/u/PetrosStefanou)\
**Replies:** 4\
**Last updated:** [May 24, 2024, 7:59am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-modify-existing-or-add-new-optimizer-in-optim/114553 "2024-05-24T07:59:24Z")

</div>

Hi everyone, I am wondering what would be the best way to modify an existing optimizer or add a totally new on in Optim. My interest is modify the update formula of the inverse Hessian approximation in BFGS algorithm. …

---

## [Custom L2Loss in DiffEqParamEstim.jl](https://discourse.julialang.org/t/custom-l2loss-in-diffeqparamestim-jl/114618)

<div class="topic-metadata">

**Author:** [@MarcoDellOro](https://discourse.julialang.org/u/MarcoDellOro)\
**Replies:** 2\
**Last updated:** [May 23, 2024, 12:19pm UTC](https://discourse.julialang.org/t/custom-l2loss-in-diffeqparamestim-jl/114618 "2024-05-23T12:19:38Z")

</div>

Hello everyone, I am very new to Julia, so I apologise if the question sounds super dumb to you guys. I am trying to implement a Moving Horizon Estimation algorithm for parameter estimation, which I did in Matlab CasAD…

---

## [Yearly comparison of Optimization Libraries](https://discourse.julialang.org/t/yearly-comparison-of-optimization-libraries/110165)

<div class="topic-metadata">

**Author:** [@bdas123](https://discourse.julialang.org/u/bdas123)\
**Replies:** 6\
**Last updated:** [May 23, 2024, 11:59am UTC](https://discourse.julialang.org/t/yearly-comparison-of-optimization-libraries/110165 "2024-05-23T11:59:46Z")

</div>

Hello! Does the Julia community have a yearly contest between different optimization libraries against hidden benchmark problems?

---

## [SumOfSquares Code only works for single constraint](https://discourse.julialang.org/t/sumofsquares-code-only-works-for-single-constraint/114001)

<div class="topic-metadata">

**Author:** [@geo](https://discourse.julialang.org/u/geo)\
**Replies:** 7\
**Last updated:** [May 22, 2024, 7:26am UTC](https://discourse.julialang.org/t/sumofsquares-code-only-works-for-single-constraint/114001 "2024-05-22T07:26:39Z")

</div>

Dear All, I am trying out SOS decomposition of a polynomial matrix on a bounded (rectangular) domain. I generate an SOS matrix as the product P’\*P and then multiply that by (1 - x\[i\]^2) for each of the variables that I …

---

## [NLopt for ODE parameter estimation: how to get verbose printed while using build\_loss\_objective](https://discourse.julialang.org/t/nlopt-for-ode-parameter-estimation-how-to-get-verbose-printed-while-using-build-loss-objective/114491)

<div class="topic-metadata">

**Author:** [@Piyush](https://discourse.julialang.org/u/Piyush)\
**Replies:** 4\
**Last updated:** [May 22, 2024, 5:16am UTC](https://discourse.julialang.org/t/nlopt-for-ode-parameter-estimation-how-to-get-verbose-printed-while-using-build-loss-objective/114491 "2024-05-22T05:16:15Z")

</div>

Hi, Is there a way to print the function value while using any NLopt algorithm for parameter estimation while using build\_loss\_objective function to build the cost function?

---

## [ANN: Convex.jl v0.16 is released](https://discourse.julialang.org/t/ann-convex-jl-v0-16-is-released/114536)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 1\
**Last updated:** [May 21, 2024, 11:56pm UTC](https://discourse.julialang.org/t/ann-convex-jl-v0-16-is-released/114536 "2024-05-21T23:56:32Z")

</div>

Dear all, We are pleased to announce the release of Convex.jl v0.16.0. This release of Convex involved a substantial internal rewrite of Convex.jl to integrate better with MathOptInterface. The result is a faster, simp…

---

## [JuMP+MAiNGO, no method matching +()](https://discourse.julialang.org/t/jump-maingo-no-method-matching/114514)

<div class="topic-metadata">

**Author:** [@blob](https://discourse.julialang.org/u/blob)\
**Replies:** 1\
**Last updated:** [May 21, 2024, 8:19pm UTC](https://discourse.julialang.org/t/jump-maingo-no-method-matching/114514 "2024-05-21T20:19:37Z")

</div>

I am using JuMP to solve a nonlinear optimization problem. If I use ipopt, the solver runs. If I use MAiNGO (GitHub - MAiNGO-github/MAiNGO.jl: A Julia Wrapper to use MAiNGO with JuMP) I get an error: Minimal (not)work…

---

## [Should @objective be replaced by @NLobjective in JuMP documentation?](https://discourse.julialang.org/t/should-objective-be-replaced-by-nlobjective-in-jump-documentation/113500)

<div class="topic-metadata">

**Author:** [@dnldlg](https://discourse.julialang.org/u/dnldlg)\
**Replies:** 2\
**Last updated:** [May 21, 2024, 3:45pm UTC](https://discourse.julialang.org/t/should-objective-be-replaced-by-nlobjective-in-jump-documentation/113500 "2024-05-21T15:45:49Z")

</div>

Hello, I’m currently reading the introductory section of the JuMP documentation and observed in the examples for the non-linear problems, that the macros @objective and @constraints are used. If I run these examples I g…

---

## [Gurobi does not display log](https://discourse.julialang.org/t/gurobi-does-not-display-log/114442)

<div class="topic-metadata">

**Author:** [@CaG21](https://discourse.julialang.org/u/CaG21)\
**Replies:** 7\
**Last updated:** [May 20, 2024, 5:20pm UTC](https://discourse.julialang.org/t/gurobi-does-not-display-log/114442 "2024-05-20T17:20:47Z")

</div>

I am using Convex.jl in conjuction with Gurobi in a Jupyter notebook to solve a convex programming problem. Everything works but Gurobi is not displaying its log to the console in “realtime”, but it displays everything a…

---

## [JuMP: Squared Frobenius norm objective](https://discourse.julialang.org/t/jump-squared-frobenius-norm-objective/114400)

<div class="topic-metadata">

**Author:** [@smallpondtom](https://discourse.julialang.org/u/smallpondtom)\
**Replies:** 5\
**Last updated:** [May 20, 2024, 1:32pm UTC](https://discourse.julialang.org/t/jump-squared-frobenius-norm-objective/114400 "2024-05-20T13:32:32Z")

</div>

Hi. I can’t seem to find a definitive answer so I’m posting here for help. What is the standard and latest way in JuMP to construct an objective function for a Frobenius norm? Say I have a (fictional) minimization of …

---

## [How to let the user specify the variable name?](https://discourse.julialang.org/t/how-to-let-the-user-specify-the-variable-name/114467)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 7\
**Last updated:** [May 20, 2024, 7:19am UTC](https://discourse.julialang.org/t/how-to-let-the-user-specify-the-variable-name/114467 "2024-05-20T07:19:18Z")

</div>

For example, I want the user to specify the variable name of the JuMP mode. How to do? using JuMP function fun(var::Symbol) model = Model() @variable(model, var\[1:3\]) end Thanks.

---

## [JuMP: Solver independent callback doesnt work for SCIP](https://discourse.julialang.org/t/jump-solver-independent-callback-doesnt-work-for-scip/108490)

<div class="topic-metadata">

**Author:** [@sandyspiers](https://discourse.julialang.org/u/sandyspiers)\
**Replies:** 4\
**Last updated:** [May 18, 2024, 10:36am UTC](https://discourse.julialang.org/t/jump-solver-independent-callback-doesnt-work-for-scip/108490 "2024-05-18T10:36:32Z")

</div>

The docs state that JuMP’s solver-independent callback feature supports SCIP. However, if I replace the lazy constraint example (which uses GLPK) with SCIP, I get the following error julia\> using JuMP julia\> import SC…

---

## [Failed optimization with function](https://discourse.julialang.org/t/failed-optimization-with-function/114290)

<div class="topic-metadata">

**Author:** [@nouha941](https://discourse.julialang.org/u/nouha941)\
**Replies:** 4\
**Last updated:** [May 15, 2024, 4:49pm UTC](https://discourse.julialang.org/t/failed-optimization-with-function/114290 "2024-05-15T16:49:53Z")

</div>

Hello everyone, I have a problem with optimizing my function. I keep getting an error. Could you please help me? function optimize\_Cs(Q\_e, PT501, PT401, P\_HP, R\_m, R\_p, Qp, Pe) #calcul initial de Cs Pe = (( ((Q\_…

---

## [Optim: MethodError: no method matching zero](https://discourse.julialang.org/t/optim-methoderror-no-method-matching-zero/45139)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 4\
**Last updated:** [May 8, 2024, 9:24am UTC](https://discourse.julialang.org/t/optim-methoderror-no-method-matching-zero/45139 "2024-05-08T09:24:59Z")

</div>

When I do optimization calculations with the Optim package, an error occurred. The type of A1,A2,A3,A4 is ::Array{Complex{Float64},2}. I don’t know how to solve it. Is there a way to make optimize() support this type?Or…

---

## [Random Orthogonal Matrices](https://discourse.julialang.org/t/random-orthogonal-matrices/9779)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 15\
**Last updated:** [May 14, 2024, 1:48pm UTC](https://discourse.julialang.org/t/random-orthogonal-matrices/9779 "2024-05-14T13:48:29Z")

</div>

dear julia experts—has anyone already written a random orthogonal matrix generator for square matrices? Is the right way to do this generating a random normal matrix first and then running a Gram-Schmidt orthogonalizati…

---

## [NonLinear Optimization fails with JuMP (infeasible?)](https://discourse.julialang.org/t/nonlinear-optimization-fails-with-jump-infeasible/114190)

<div class="topic-metadata">

**Author:** [@nouha941](https://discourse.julialang.org/u/nouha941)\
**Replies:** 11\
**Last updated:** [May 14, 2024, 8:16am UTC](https://discourse.julialang.org/t/nonlinear-optimization-fails-with-jump-infeasible/114190 "2024-05-14T08:16:22Z")

</div>

Hello everyone, I’m currently focused on minimizing the specific consumption of a desalination unit. I’ve formulated an equation that incorporates the various hydraulic and pressure parameters of the system under investi…

---

## [Semidefinite constraints, fp roundoff errors, and normalization](https://discourse.julialang.org/t/semidefinite-constraints-fp-roundoff-errors-and-normalization/114092)

<div class="topic-metadata">

**Author:** [@Johan-Gronqvist](https://discourse.julialang.org/u/Johan-Gronqvist)\
**Replies:** 2\
**Last updated:** [May 12, 2024, 10:03pm UTC](https://discourse.julialang.org/t/semidefinite-constraints-fp-roundoff-errors-and-normalization/114092 "2024-05-12T22:03:14Z")

</div>

I am using JuMP with semidefinite constraints, and when my matrix elements become large, roundoff errors also become large, in absolute terms. JuMP warns when the matrix has absolute asymmetries in the range 1e-10 to 1e…

---

## [How to get evaluation number in optimization using NLopt](https://discourse.julialang.org/t/how-to-get-evaluation-number-in-optimization-using-nlopt/114020)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 7\
**Last updated:** [May 8, 2024, 10:40pm UTC](https://discourse.julialang.org/t/how-to-get-evaluation-number-in-optimization-using-nlopt/114020 "2024-05-08T22:40:05Z")

</div>

Hi, I am using Nlopt to do the optimization. in this case i have defined a function for optimization. inside this function the optimizer reads another functions to calculate the objective and gradients. I also want to ge…

---

## [How to get HSL up and running with Ipopt](https://discourse.julialang.org/t/how-to-get-hsl-up-and-running-with-ipopt/114138)

<div class="topic-metadata">

**Author:** [@heiwie](https://discourse.julialang.org/u/heiwie)\
**Replies:** 6\
**Last updated:** [May 11, 2024, 4:12pm UTC](https://discourse.julialang.org/t/how-to-get-hsl-up-and-running-with-ipopt/114138 "2024-05-11T16:12:50Z")

</div>

Hello, I have recently received an academic license for HSL, and so I wish to try this linear solver out for Ipopt in order to see if there is an increase in performance of my model. Based on this source: GitHub - jump-…

---

## [Gurobi lazy constraint issue](https://discourse.julialang.org/t/gurobi-lazy-constraint-issue/113969)

<div class="topic-metadata">

**Author:** [@marouane-f](https://discourse.julialang.org/u/marouane-f)\
**Replies:** 15\
**Last updated:** [May 11, 2024, 12:21am UTC](https://discourse.julialang.org/t/gurobi-lazy-constraint-issue/113969 "2024-05-11T00:21:34Z")

</div>

Hi, I’m implementing a MIP cut generation algorithm on JuMP+Gurobi using MOI.LazyConstraintCallback. Theoretically, the algorithm is correct. However, running tests on a large batch of instances and cross-checking with…

---

## [How to use define interpolations in JuMP](https://discourse.julialang.org/t/how-to-use-define-interpolations-in-jump/114126)

<div class="topic-metadata">

**Author:** [@Longblackcoffee](https://discourse.julialang.org/u/Longblackcoffee)\
**Replies:** 2\
**Last updated:** [May 11, 2024, 12:19am UTC](https://discourse.julialang.org/t/how-to-use-define-interpolations-in-jump/114126 "2024-05-11T00:19:35Z")

</div>

Hi everyone, Is there a way to register a user-defined function, generated from the Interpolations.jl package, into a JuMP model? Whenever I do, I get a method error. Here’s a MWE: using JuMP, MadNLP using Interpolatio…

---

## [Binary variables in Ipopt](https://discourse.julialang.org/t/binary-variables-in-ipopt/114111)

<div class="topic-metadata">

**Author:** [@heiwie](https://discourse.julialang.org/u/heiwie)\
**Replies:** 2\
**Last updated:** [May 10, 2024, 9:25pm UTC](https://discourse.julialang.org/t/binary-variables-in-ipopt/114111 "2024-05-10T21:25:07Z")

</div>

I am using Ipopt in JuMP to solve a non-linear hydropower optimization problem. After realizing that there may be spillage in periods where the reservoir is half empty, I want to add a constraint which only allows spilla…

---

## [Optimization with integrals in both objective and the constraint](https://discourse.julialang.org/t/optimization-with-integrals-in-both-objective-and-the-constraint/113838)

<div class="topic-metadata">

**Author:** [@Ayesha](https://discourse.julialang.org/u/Ayesha)\
**Replies:** 9\
**Last updated:** [May 9, 2024, 11:54pm UTC](https://discourse.julialang.org/t/optimization-with-integrals-in-both-objective-and-the-constraint/113838 "2024-05-09T23:54:36Z")

</div>

I’m trying to optimize a function that has an integral in the objective. While I can perform unconstrained optimization, I’m unsure how to use the Julia optimizer. I am trying to do this to add a constraint later, which …

---

## [Dual ray from LP solved by dual algorithm](https://discourse.julialang.org/t/dual-ray-from-lp-solved-by-dual-algorithm/114068)

<div class="topic-metadata">

**Author:** [@ShGE](https://discourse.julialang.org/u/ShGE)\
**Replies:** 3\
**Last updated:** [May 9, 2024, 9:22pm UTC](https://discourse.julialang.org/t/dual-ray-from-lp-solved-by-dual-algorithm/114068 "2024-05-09T21:22:07Z")

</div>

Hello I solve an LP using CPLEX and fix the following parameters: set\_optimizer\_attribute(sub, "CPX\_PARAM\_REDUCE", 0) set\_optimizer\_attribute(sub, "CPX\_PARAM\_NUMERICALEMPHASIS", 1) # Emphasize numerical precis…

---

## [Solved to optimlity but status is infeasible](https://discourse.julialang.org/t/solved-to-optimlity-but-status-is-infeasible/114054)

<div class="topic-metadata">

**Author:** [@ShGE](https://discourse.julialang.org/u/ShGE)\
**Replies:** 4\
**Last updated:** [May 9, 2024, 7:59pm UTC](https://discourse.julialang.org/t/solved-to-optimlity-but-status-is-infeasible/114054 "2024-05-09T19:59:53Z")

</div>

Hello there println("=================================================") println(" Optimal Solution Status: ", termination\_status(sub)) println(" Optimal Value: ", objective\_value(sub)) println("========…

---

## [How to implement an objective function in Jump](https://discourse.julialang.org/t/how-to-implement-an-objective-function-in-jump/113422)

<div class="topic-metadata">

**Author:** [@Coral](https://discourse.julialang.org/u/Coral)\
**Replies:** 8\
**Last updated:** [May 9, 2024, 6:42pm UTC](https://discourse.julialang.org/t/how-to-implement-an-objective-function-in-jump/113422 "2024-05-09T18:42:48Z")

</div>

Hello everyone, I am implementing an optimization problem for a satellite that has to move from a radius 1 orbit to a radius 2 orbit. The objective of my optimization is to minimize the required deltaV. I am trying to d…

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

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