# Optimization (Mathematical)

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

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

**Page:** 41

---

## [How to introduce an if sentence with optimization variables](https://discourse.julialang.org/t/how-to-introduce-an-if-sentence-with-optimization-variables/102130)

<div class="topic-metadata">

**Author:** [@PatrickeTownsend](https://discourse.julialang.org/u/PatrickeTownsend)\
**Replies:** 2\
**Last updated:** [July 27, 2023, 1:15pm UTC](https://discourse.julialang.org/t/how-to-introduce-an-if-sentence-with-optimization-variables/102130 "2023-07-27T13:15:45Z")

</div>

Hello again, For and electric propulsion system optimization, i’m trying to impose zero thrust during eclipse phases, I have this function created: function Step\_eclipse(j,r...,r\_par...) Re = 6378 if r\_par\[j\] +…

---

## [Help needed with AmplNLWriter](https://discourse.julialang.org/t/help-needed-with-amplnlwriter/102088)

<div class="topic-metadata">

**Author:** [@EmilyBrewer](https://discourse.julialang.org/u/EmilyBrewer)\
**Replies:** 2\
**Last updated:** [July 26, 2023, 2:32pm UTC](https://discourse.julialang.org/t/help-needed-with-amplnlwriter/102088 "2023-07-26T14:32:36Z")

</div>

Hello, I am trying to use “Bonmin” or “Couenne” from AmplNLWriter in Julia. My code is attached below. using JuMP, AmplNLWriter, Couenne\_jll #model = Model(() -\> AmplNLWriter.Optimizer("bonmin")) model = Model(() -\> …

---

## [Optimizing small systems of NonLinear equations with Optim.jl](https://discourse.julialang.org/t/optimizing-small-systems-of-nonlinear-equations-with-optim-jl/102068)

<div class="topic-metadata">

**Author:** [@The\_Mastermage](https://discourse.julialang.org/u/The_Mastermage)\
**Replies:** 2\
**Last updated:** [July 25, 2023, 6:19pm UTC](https://discourse.julialang.org/t/optimizing-small-systems-of-nonlinear-equations-with-optim-jl/102068 "2023-07-25T18:19:06Z")

</div>

Hello there I have a very small system of nonlinear equation and i do not quite understand how I can use this using Optim.jl. So far I have only figured out how to do one equation but I have a system (3 Equations): The …

---

## [Cbc solver log level not working](https://discourse.julialang.org/t/cbc-solver-log-level-not-working/102050)

<div class="topic-metadata">

**Author:** [@Josa9321](https://discourse.julialang.org/u/Josa9321)\
**Replies:** 1\
**Last updated:** [July 25, 2023, 12:07am UTC](https://discourse.julialang.org/t/cbc-solver-log-level-not-working/102050 "2023-07-25T00:07:32Z")

</div>

Hi, people. When I use Cbc solver, the log level continues to appear. using JuMP, Cbc model = Model(Cbc.Optimizer) set\_attribute(model, "logLevel", 0) @variable(model, x\[1:2\] \>= 0) @constraints model begin c1, x\[1…

---

## [Is LanguageServer.jl supposed to work with JuMP.jl?](https://discourse.julialang.org/t/is-languageserver-jl-supposed-to-work-with-jump-jl/102026)

<div class="topic-metadata">

**Author:** [@torgo](https://discourse.julialang.org/u/torgo)\
**Replies:** 1\
**Last updated:** [July 24, 2023, 3:59pm UTC](https://discourse.julialang.org/t/is-languageserver-jl-supposed-to-work-with-jump-jl/102026 "2023-07-24T15:59:00Z")

</div>

I get repeated Missing reference warnings in LanguageServer.jl when I use JuMP.jl models. For example: @variable(m, x \>= 0) The LS reports Missing reference: x. I can understand why LanguageServer.jl might have diffi…

---

## [JuMP developers' response to benchmarks by GAMS](https://discourse.julialang.org/t/jump-developers-response-to-benchmarks-by-gams/101920)

<div class="topic-metadata">

**Author:** [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Replies:** 5\
**Last updated:** [July 24, 2023, 2:19pm UTC](https://discourse.julialang.org/t/jump-developers-response-to-benchmarks-by-gams/101920 "2023-07-24T14:19:38Z")

</div>

---

## [Computing Irreducible Inconsistent Subsystem (IIS) to find infeasibility causes](https://discourse.julialang.org/t/computing-irreducible-inconsistent-subsystem-iis-to-find-infeasibility-causes/101864)

<div class="topic-metadata">

**Author:** [@Luiz\_Monteiro](https://discourse.julialang.org/u/Luiz_Monteiro)\
**Replies:** 2\
**Last updated:** [July 22, 2023, 10:11pm UTC](https://discourse.julialang.org/t/computing-irreducible-inconsistent-subsystem-iis-to-find-infeasibility-causes/101864 "2023-07-22T22:11:03Z")

</div>

Hi, I am trying to find infeasibility causes of a MIP model in JuMP with Gurobi solver using the comand: “compute\_conflict!(model1)”. The output result is copied below, but I dont know how to translate these result to i…

---

## [Derivation of powerflow equations with ideal transformer](https://discourse.julialang.org/t/derivation-of-powerflow-equations-with-ideal-transformer/101926)

<div class="topic-metadata">

**Author:** [@Anton\_Hinneck](https://discourse.julialang.org/u/Anton_Hinneck)\
**Replies:** 1\
**Last updated:** [July 22, 2023, 3:04pm UTC](https://discourse.julialang.org/t/derivation-of-powerflow-equations-with-ideal-transformer/101926 "2023-07-22T15:04:47Z")

</div>

Hi, I am looking for a citable source (book or article) deriving the power flow equations used in PowerModels.jl - including an ideal transformer as such: Mathematical Model · PowerModels (lanl-ansi.github.io) I woul…

---

## [Performance: Julia/JuMP vs. Python/Pyomo](https://discourse.julialang.org/t/performance-julia-jump-vs-python-pyomo/92044)

<div class="topic-metadata">

**Author:** [@Justine](https://discourse.julialang.org/u/Justine)\
**Replies:** 18\
**Last updated:** [July 9, 2023, 9:26pm UTC](https://discourse.julialang.org/t/performance-julia-jump-vs-python-pyomo/92044 "2023-07-09T21:26:06Z")

</div>

Dear all, I could use some good help from the experts here. I was about to translate an optimization model from Python/Pyomo to Julia/JuMP, expecting that Julia/JuMP would outperform Python’s Pyomo. However, model gener…

---

## [SLOW\_PROGRESS error and an unusual bug](https://discourse.julialang.org/t/slow-progress-error-and-an-unusual-bug/101700)

<div class="topic-metadata">

**Author:** [@selvi-aras](https://discourse.julialang.org/u/selvi-aras)\
**Replies:** 4\
**Last updated:** [July 20, 2023, 8:51pm UTC](https://discourse.julialang.org/t/slow-progress-error-and-an-unusual-bug/101700 "2023-07-20T20:51:31Z")

</div>

Dear JuMP Community, I have previously asked a question where Huber regression gave slow progress error in MOSEK. I am now facing similar (and even bigger) issues in logistic regression and I would like to understand if…

---

## [Equality constrain to NLopt](https://discourse.julialang.org/t/equality-constrain-to-nlopt/101852)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 2\
**Last updated:** [July 20, 2023, 8:44pm UTC](https://discourse.julialang.org/t/equality-constrain-to-nlopt/101852 "2023-07-20T20:44:54Z")

</div>

Hi, I am doing topology optimization. I have seen some tutorials. I want to add volume constrain to my model as below: v/v0=f which v is material volume and v0 is domain volume and f is volume fraction. could you plea…

---

## [JuMP raw expr input](https://discourse.julialang.org/t/jump-raw-expr-input/101795)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 1\
**Last updated:** [July 20, 2023, 2:15pm UTC](https://discourse.julialang.org/t/jump-raw-expr-input/101795 "2023-07-20T14:15:18Z")

</div>

Hi all, as far as I can see, raw Expr input is only supported for nonlinear expressions (Nonlinear Modeling · JuMP), is there some reason why it is not allowed for affine expressions?

---

## [Rolling Horizon Implementation](https://discourse.julialang.org/t/rolling-horizon-implementation/23048)

<div class="topic-metadata">

**Author:** [@Seanny123](https://discourse.julialang.org/u/Seanny123)\
**Replies:** 2\
**Last updated:** [July 20, 2023, 2:01pm UTC](https://discourse.julialang.org/t/rolling-horizon-implementation/23048 "2023-07-20T14:01:10Z")

</div>

I have an optimization problem with a long time period (96 steps). Reading some papers \[1\]\[2\], it seems a common way to reduce the optimization time of a Mixed Integer Linear Programming problem is to use something calle…

---

## [Gurobi Error 10003: Name too long](https://discourse.julialang.org/t/gurobi-error-10003-name-too-long/101752)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 3\
**Last updated:** [July 19, 2023, 2:43am UTC](https://discourse.julialang.org/t/gurobi-error-10003-name-too-long/101752 "2023-07-19T02:43:39Z")

</div>

So, I get the error that probably the variable (and likely constraints as well) have a name longer than 255 characters. I have some custom types that I use as indices of the variables. I am sure this is leading to the is…

---

## [Specifying variable dimension in JuMP](https://discourse.julialang.org/t/specifying-variable-dimension-in-jump/101716)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 17\
**Last updated:** [July 18, 2023, 1:20pm UTC](https://discourse.julialang.org/t/specifying-variable-dimension-in-jump/101716 "2023-07-18T13:20:32Z")

</div>

This might not be JuMP specific, but I’m trying to learn how to use JuMP for LPs. Do I need to specify the size of the variable x? It should be a 2-d vector. If so, how? My goal is to solve: $$\\max\_x cx $$ subject to …

---

## [LoadError: InexactError: Int64 caused by decimals](https://discourse.julialang.org/t/loaderror-inexacterror-int64-caused-by-decimals/101717)

<div class="topic-metadata">

**Author:** [@martina.gherardi](https://discourse.julialang.org/u/martina.gherardi)\
**Replies:** 4\
**Last updated:** [July 18, 2023, 10:53am UTC](https://discourse.julialang.org/t/loaderror-inexacterror-int64-caused-by-decimals/101717 "2023-07-18T10:53:35Z")

</div>

Hi, In order to print my output values for the integer variable γ, I wrote matrix\_gamma = zeros(Int, length(K), length(T)) for (i,k) in enumerate(K) for (j,t) in enumerate(T) matrix\_gamma\[i,j\] = value(γ\[k,t…

---

## [GCMMA using NLopt](https://discourse.julialang.org/t/gcmma-using-nlopt/101642)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 5\
**Last updated:** [July 15, 2023, 1:23am UTC](https://discourse.julialang.org/t/gcmma-using-nlopt/101642 "2023-07-15T01:23:20Z")

</div>

Hi All. I have a question can i use NLopt for GCMMA algorithm? also one other question can zygote has errors in calculating gradients? thank you

---

## [Q: Optimization.jl | Passing fixed parameters to an analytic derivative \[gradient\] for univariate \[multivariate\] optimization?](https://discourse.julialang.org/t/q-optimization-jl-passing-fixed-parameters-to-an-analytic-derivative-gradient-for-univariate-multivariate-optimization/101605)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 2\
**Last updated:** [July 14, 2023, 7:41pm UTC](https://discourse.julialang.org/t/q-optimization-jl-passing-fixed-parameters-to-an-analytic-derivative-gradient-for-univariate-multivariate-optimization/101605 "2023-07-14T19:41:12Z")

</div>

The Optimization.jl documentation states " Defining gradients can be done in two ways. One way is to manually provide a gradient definition in the OptimizationFunction constructor. However, the more convenient way to obt…

---

## [Deprected - Q: Optim.jl | Passing fixed parameters to an analytic derivative \[gradient\] for univariate \[multivariate\] optimization?](https://discourse.julialang.org/t/deprected-q-optim-jl-passing-fixed-parameters-to-an-analytic-derivative-gradient-for-univariate-multivariate-optimization/101551)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 0\
**Last updated:** [July 12, 2023, 9:28pm UTC](https://discourse.julialang.org/t/deprected-q-optim-jl-passing-fixed-parameters-to-an-analytic-derivative-gradient-for-univariate-multivariate-optimization/101551 "2023-07-12T21:28:33Z")

</div>

This question is deprecated and is replaced by Q: Optimization.jl | Passing fixed parameters to an analytic derivative \[gradient\] for univariate \[multivariate\] optimization? Hello, This question may be considered a con…

---

## [How can I get the maximum of an absolute value of an objective](https://discourse.julialang.org/t/how-can-i-get-the-maximum-of-an-absolute-value-of-an-objective/101356)

<div class="topic-metadata">

**Author:** [@That\_ind](https://discourse.julialang.org/u/That_ind)\
**Replies:** 9\
**Last updated:** [July 14, 2023, 4:30am UTC](https://discourse.julialang.org/t/how-can-i-get-the-maximum-of-an-absolute-value-of-an-objective/101356 "2023-07-14T04:30:40Z")

</div>

Hi, How can I get the maximum of an absolute value of an objective? Something like @objective(model, Max, abs(var\_ref)) But I got the following ERROR: LoadError: MethodError: no method matching abs(::AffExpr)

---

## [JuMP SCIP Error: no shadow price for LP](https://discourse.julialang.org/t/jump-scip-error-no-shadow-price-for-lp/101138)

<div class="topic-metadata">

**Author:** [@Stuart\_Rogers](https://discourse.julialang.org/u/Stuart_Rogers)\
**Replies:** 2\
**Last updated:** [July 13, 2023, 10:26pm UTC](https://discourse.julialang.org/t/jump-scip-error-no-shadow-price-for-lp/101138 "2023-07-13T22:26:56Z")

</div>

I get an error about a missing shadow price when I try to use SCIP to solve a simle LP in JuMP. I don’t get the error if I use HiGHS or COPT. I use Julia v1.9.1 and the following packages: pkg\> status Status ~/.julia/e…

---

## [Optim.jl NelderMead, how to avoid stucking situation?](https://discourse.julialang.org/t/optim-jl-neldermead-how-to-avoid-stucking-situation/101590)

<div class="topic-metadata">

**Author:** [@Zerosum](https://discourse.julialang.org/u/Zerosum)\
**Replies:** 1\
**Last updated:** [July 13, 2023, 9:34pm UTC](https://discourse.julialang.org/t/optim-jl-neldermead-how-to-avoid-stucking-situation/101590 "2023-07-13T21:34:00Z")

</div>

I think this is a question more related to optimization than Julia’s. I figured out that Optim.jl NelderMead algorithm doesn’t support fminbox. The out-of-boundary search is not a real problem because I can impose some …

---

## [Large memory usage in JuMP](https://discourse.julialang.org/t/large-memory-usage-in-jump/101491)

<div class="topic-metadata">

**Author:** [@leima0521](https://discourse.julialang.org/u/leima0521)\
**Replies:** 1\
**Last updated:** [July 12, 2023, 1:35am UTC](https://discourse.julialang.org/t/large-memory-usage-in-jump/101491 "2023-07-12T01:35:44Z")

</div>

Hi, I am using JuMP to run this optimization script. It uses almost 3G memory for this small test dataset. How can I figure out which part uses the most memory and how can I reduce the memory usage? I will use much larg…

---

## [JuMP devs expected reply to GAMS Comparative Analysis material](https://discourse.julialang.org/t/jump-devs-expected-reply-to-gams-comparative-analysis-material/101489)

<div class="topic-metadata">

**Author:** [@algunion](https://discourse.julialang.org/u/algunion)\
**Replies:** 2\
**Last updated:** [July 12, 2023, 1:12am UTC](https://discourse.julialang.org/t/jump-devs-expected-reply-to-gams-comparative-analysis-material/101489 "2023-07-12T01:12:10Z")

</div>

Continuing the discussion from Performance: Julia/JuMP vs. Python/Pyomo: I do not intend to start a topic that will lead to a great amount of popcorn being consumed. I noticed this tweet today and encountered the topic…

---

## [How to avoid global variables in JuMP](https://discourse.julialang.org/t/how-to-avoid-global-variables-in-jump/101488)

<div class="topic-metadata">

**Author:** [@leima0521](https://discourse.julialang.org/u/leima0521)\
**Replies:** 1\
**Last updated:** [July 11, 2023, 3:38pm UTC](https://discourse.julialang.org/t/how-to-avoid-global-variables-in-jump/101488 "2023-07-11T15:38:33Z")

</div>

I am reading the performance tips of JuMP. It says “The most important rule is to avoid global variables”, but I am not sure what it means in the JuMP context and how to implement it. In the example below, the value of …

---

## [JuMP: many small problems or one combined problem?](https://discourse.julialang.org/t/jump-many-small-problems-or-one-combined-problem/101415)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 4\
**Last updated:** [July 11, 2023, 1:29pm UTC](https://discourse.julialang.org/t/jump-many-small-problems-or-one-combined-problem/101415 "2023-07-11T13:29:12Z")

</div>

I am solving many independent assignment/matching problems using JuMP. Since the problems are independent, it is theoretically no different if I solve each of them separately or if I solve one big combined problem. Howev…

---

## [Is it possible to incorporate the relational algebra technique into JuMP in the future to expedite model generation?](https://discourse.julialang.org/t/is-it-possible-to-incorporate-the-relational-algebra-technique-into-jump-in-the-future-to-expedite-model-generation/101343)

<div class="topic-metadata">

**Author:** [@JackaChou](https://discourse.julialang.org/u/JackaChou)\
**Replies:** 5\
**Last updated:** [July 10, 2023, 8:27am UTC](https://discourse.julialang.org/t/is-it-possible-to-incorporate-the-relational-algebra-technique-into-jump-in-the-future-to-expedite-model-generation/101343 "2023-07-10T08:27:20Z")

</div>

Recently, I came across a post titled “Performance in Optimization Models: A Comparative Analysis of GAMS, Pyomo, GurobiPy, and JuMP” (source: GAMS Blog) where it was observed that the commercial software GAMS demonstrat…

---

## [Set fixed values in optimization](https://discourse.julialang.org/t/set-fixed-values-in-optimization/101337)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 5\
**Last updated:** [July 9, 2023, 8:25pm UTC](https://discourse.julialang.org/t/set-fixed-values-in-optimization/101337 "2023-07-09T20:25:15Z")

</div>

Hi, I am doing topology optimization using Nlopt. it seems that it incorrectly delete material under load line? do you know how can i silve this issue? also how can i set constant values in my domain. for example force t…

---

## [SOS Julia Newton Polytopes](https://discourse.julialang.org/t/sos-julia-newton-polytopes/101369)

<div class="topic-metadata">

**Author:** [@ilovemath](https://discourse.julialang.org/u/ilovemath)\
**Replies:** 0\
**Last updated:** [July 8, 2023, 9:08pm UTC](https://discourse.julialang.org/t/sos-julia-newton-polytopes/101369 "2023-07-08T21:08:58Z")

</div>

I am trying to investigate the details in which Newton polytope reduction is being incorporated in the sum of squares constraints for SumOfSquares/JuMP. Firstly, is the Newton polytope reduction being exploited automati…

---

## [JuMP Objective coefficient writing](https://discourse.julialang.org/t/jump-objective-coefficient-writing/101286)

<div class="topic-metadata">

**Author:** [@Luiz\_Monteiro](https://discourse.julialang.org/u/Luiz_Monteiro)\
**Replies:** 4\
**Last updated:** [July 8, 2023, 7:03pm UTC](https://discourse.julialang.org/t/jump-objective-coefficient-writing/101286 "2023-07-08T19:03:54Z")

</div>

Hi, I am trying to write an objective using index for each element of an expression, just like a simple constraint (example: i, h, k in @constraint(model1, con19B\[i in V0\_customer, h in Vstation, j in V0\_customer, k in …

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

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