# Optimization (Mathematical)

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

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

**Page:** 100

---

## [Statistics package](https://discourse.julialang.org/t/statistics-package/38530)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 4\
**Last updated:** [May 2, 2020, 6:02am UTC](https://discourse.julialang.org/t/statistics-package/38530 "2020-05-02T06:02:48Z")

</div>

Hello, Could you recommend me a package that I can use to find some statistics and how can I install it in Julia by ATOM Thank you

---

## [MINLP problem](https://discourse.julialang.org/t/minlp-problem/38566)

<div class="topic-metadata">

**Author:** [@GiuliaM](https://discourse.julialang.org/u/GiuliaM)\
**Replies:** 1\
**Last updated:** [May 1, 2020, 7:32pm UTC](https://discourse.julialang.org/t/minlp-problem/38566 "2020-05-01T19:32:51Z")

</div>

Hi everyone! I’m fairly new to Julia. I’m trying to solve a MINLP problem with Juniper. I have 4 continuous variables (x\[1:4\]) and a binary variable (xbin). I have the following relationship between x\[1\] and xbin: if …

---

## [Infeasibility on SCIP - Problem feasible in other solvers](https://discourse.julialang.org/t/infeasibility-on-scip-problem-feasible-in-other-solvers/38507)

<div class="topic-metadata">

**Author:** [@Diego](https://discourse.julialang.org/u/Diego)\
**Replies:** 7\
**Last updated:** [May 1, 2020, 6:35pm UTC](https://discourse.julialang.org/t/infeasibility-on-scip-problem-feasible-in-other-solvers/38507 "2020-05-01T18:35:48Z")

</div>

Dear Team, I have been trying SCIP but whatever I do it always returns an infeasibility. Other solvers I have tried do deliver a solution. The message I keep getting on an on for different problems is: violation: rig…

---

## [\[JuMP\] Container Functionality Feature Requests](https://discourse.julialang.org/t/jump-container-functionality-feature-requests/37771)

<div class="topic-metadata">

**Author:** [@pulsipher](https://discourse.julialang.org/u/pulsipher)\
**Replies:** 10\
**Last updated:** [May 1, 2020, 7:59am UTC](https://discourse.julialang.org/t/jump-container-functionality-feature-requests/37771 "2020-05-01T07:59:46Z")

</div>

I have been using with JuMP’s container types as I am developing my JuMP extension and have two observations that I think would make for 2 relatively simple additions. Observation 1: According to the extension of Base.k…

---

## [How to know the elapse time using GLPK solver](https://discourse.julialang.org/t/how-to-know-the-elapse-time-using-glpk-solver/38511)

<div class="topic-metadata">

**Author:** [@lausilvag](https://discourse.julialang.org/u/lausilvag)\
**Replies:** 1\
**Last updated:** [May 1, 2020, 12:21am UTC](https://discourse.julialang.org/t/how-to-know-the-elapse-time-using-glpk-solver/38511 "2020-05-01T00:21:58Z")

</div>

Hi! I am using the GLPK solver and in the output doesn’t appear the elapsed time: GLPK Simplex Optimizer, v4.64 0: obj = 0.000000000e+000 inf = 3.846e+001 (1) 3: obj = 1.144956706e+007 inf = 0.000e+000 (0) 13: …

---

## [Just wrote a package for playing with SAT solvers](https://discourse.julialang.org/t/just-wrote-a-package-for-playing-with-sat-solvers/37822)

<div class="topic-metadata">

**Author:** [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Replies:** 2\
**Last updated:** [April 28, 2020, 1:40pm UTC](https://discourse.julialang.org/t/just-wrote-a-package-for-playing-with-sat-solvers/37822 "2020-04-28T13:40:10Z")

</div>

Hi everyone, I just put a small package BEE.jl on github. If you want to play with SAT solvers, this might be helpful.

---

## [Tree limit JuMP 0.21](https://discourse.julialang.org/t/tree-limit-jump-0-21/38135)

<div class="topic-metadata">

**Author:** [@baprata](https://discourse.julialang.org/u/baprata)\
**Replies:** 2\
**Last updated:** [April 27, 2020, 8:43pm UTC](https://discourse.julialang.org/t/tree-limit-jump-0-21/38135 "2020-04-27T20:43:43Z")

</div>

I am modeling an optimization problem within Julia/Atom and CPLEX. I need to control the tree limit size. What is the syntax for the tree limit in JuMP 0.21? Thanks in advance, Bruno

---

## [Deactivating and reactivating JuMP constraints](https://discourse.julialang.org/t/deactivating-and-reactivating-jump-constraints/38315)

<div class="topic-metadata">

**Author:** [@Tomas\_Uribe](https://discourse.julialang.org/u/Tomas_Uribe)\
**Replies:** 1\
**Last updated:** [April 27, 2020, 7:33pm UTC](https://discourse.julialang.org/t/deactivating-and-reactivating-jump-constraints/38315 "2020-04-27T19:33:44Z")

</div>

Is there a way to deactivate and reactivate JuMP constraints that are tied to a model? I found delete(model, constraint), but once deleted, constraints can’t be added back again.

---

## [Lagrangian Function](https://discourse.julialang.org/t/lagrangian-function/38287)

<div class="topic-metadata">

**Author:** [@mayar](https://discourse.julialang.org/u/mayar)\
**Replies:** 18\
**Last updated:** [April 27, 2020, 1:04pm UTC](https://discourse.julialang.org/t/lagrangian-function/38287 "2020-04-27T13:04:43Z")

</div>

Hello everyone, I am trying to solve an optimization problem by using the lagrangian function, which package is best suited for this task specially because I need the equality constraint multipliers to be returned as th…

---

## [LoadError: UndefVarError: Penalty not defined](https://discourse.julialang.org/t/loaderror-undefvarerror-penalty-not-defined/38046)

<div class="topic-metadata">

**Author:** [@DKad](https://discourse.julialang.org/u/DKad)\
**Replies:** 16\
**Last updated:** [April 24, 2020, 9:58pm UTC](https://discourse.julialang.org/t/loaderror-undefvarerror-penalty-not-defined/38046 "2020-04-24T21:58:37Z")

</div>

Hello, I want to adapt parameters of a differential equation to available data on a computer with julia 1.4.1 on a linux system. julia 1.4.0 has the same problem. Running using DifferentialEquations using Plots is o.…

---

## [Get power flow equations from PowerModels?](https://discourse.julialang.org/t/get-power-flow-equations-from-powermodels/33673)

<div class="topic-metadata">

**Author:** [@timueh](https://discourse.julialang.org/u/timueh)\
**Replies:** 5\
**Last updated:** [April 24, 2020, 7:27pm UTC](https://discourse.julialang.org/t/get-power-flow-equations-from-powermodels/33673 "2020-04-24T19:27:07Z")

</div>

Is it possible to obtain the power flow equations in the form of f(x) = 0 from PowerModels.jl? Follow-up question, is it possible to get the system of nonlinear equations h(x) = 0 that make up a power flow problem, i.e.…

---

## [A question about the Matrix](https://discourse.julialang.org/t/a-question-about-the-matrix/38123)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 2\
**Last updated:** [April 24, 2020, 3:49am UTC](https://discourse.julialang.org/t/a-question-about-the-matrix/38123 "2020-04-24T03:49:48Z")

</div>

How do you define a matrix that doesn’t know how many rows and columns it has. thank you!

---

## [SIGKILL from Gurobi.jl?](https://discourse.julialang.org/t/sigkill-from-gurobi-jl/38099)

<div class="topic-metadata">

**Author:** [@mlhetland](https://discourse.julialang.org/u/mlhetland)\
**Replies:** 5\
**Last updated:** [April 23, 2020, 8:26pm UTC](https://discourse.julialang.org/t/sigkill-from-gurobi-jl/38099 "2020-04-23T20:26:30Z")

</div>

One of my JuMP models seem to be too much for Gurobi/Gurobi.jl – after a while, it kills Julia with SIGKILL. Other models of similar structure work just fine; I suspect the reason is that they are smaller, and that I’m r…

---

## [Finding the root of a minimize-maximize function](https://discourse.julialang.org/t/finding-the-root-of-a-minimize-maximize-function/38068)

<div class="topic-metadata">

**Author:** [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Replies:** 1\
**Last updated:** [April 23, 2020, 11:54am UTC](https://discourse.julialang.org/t/finding-the-root-of-a-minimize-maximize-function/38068 "2020-04-23T11:54:55Z")

</div>

Let f1(x,y)=-(1 - x)\* y + 1/2\* (1 - x - x^2 - x^3 - 2\* (1 - x)\* y) f2(x,y)=(1 - 2\*x)\*(1 + x + x^2) - 2\*(-1 + x)^2\*(1 + x)\*y We can define a minimize, maximize function like this using IntervalOptimization g(x) = minim…

---

## [JuMP returning incorrect value after deleting/adding anonymous variable and constraint](https://discourse.julialang.org/t/jump-returning-incorrect-value-after-deleting-adding-anonymous-variable-and-constraint/38036)

<div class="topic-metadata">

**Author:** [@cby](https://discourse.julialang.org/u/cby)\
**Replies:** 2\
**Last updated:** [April 23, 2020, 2:20am UTC](https://discourse.julialang.org/t/jump-returning-incorrect-value-after-deleting-adding-anonymous-variable-and-constraint/38036 "2020-04-23T02:20:12Z")

</div>

When I use an anonymous variable and constraint, optimize, delete and re-add them, then optimize again, I get two different solutions, the second of which is incorrect. However, the model is still printing correctly. Wha…

---

## [Visualization of nonlinear optimization algorithms for teaching](https://discourse.julialang.org/t/visualization-of-nonlinear-optimization-algorithms-for-teaching/37945)

<div class="topic-metadata">

**Author:** [@leclere](https://discourse.julialang.org/u/leclere)\
**Replies:** 3\
**Last updated:** [April 21, 2020, 8:10am UTC](https://discourse.julialang.org/t/visualization-of-nonlinear-optimization-algorithms-for-teaching/37945 "2020-04-21T08:10:51Z")

</div>

I am looking for example code / notebooks that help visualize algorithm iterations for teaching purposes. I am looking for standard nonlinear optimization stuff (like plotting contour lines of nonlinear function in R^2, …

---

## [A question about array](https://discourse.julialang.org/t/a-question-about-array/37828)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 1\
**Last updated:** [April 19, 2020, 2:32am UTC](https://discourse.julialang.org/t/a-question-about-array/37828 "2020-04-19T02:32:04Z")

</div>

a=\[7 -1 -1\] b=union(a) c=reshape(b,(:,3)) print(c) this is a simple code,but it is wrong,it shows: DimensionMismatch(“array size 2 must be divisible by the product of the new dimensions (Colon(), 3)”) why?thank you!

---

## [Cancelled: JuMP-dev 2020](https://discourse.julialang.org/t/cancelled-jump-dev-2020/37675)

<div class="topic-metadata">

**Author:** [@odow](https://discourse.julialang.org/u/odow)\
**Replies:** 0\
**Last updated:** [April 16, 2020, 12:31am UTC](https://discourse.julialang.org/t/cancelled-jump-dev-2020/37675 "2020-04-16T00:31:39Z")

</div>

First, we hope that everyone is safe in these uncertain times. Our first priority will always be the health and well-being of the JuMP community. Therefore, we regret to announce that we have decided to cancel JuMP-dev …

---

## [A question about my code](https://discourse.julialang.org/t/a-question-about-my-code/37611)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 4\
**Last updated:** [April 15, 2020, 6:24am UTC](https://discourse.julialang.org/t/a-question-about-my-code/37611 "2020-04-15T06:24:07Z")

</div>

is that right? but Error when entering data it shows Obj(\[10 1 -1;2 6 1\],\[10 1 -1;2 6 1\],20,\[-2; -11\]) ERROR: UndefVarError: X not defined Stacktrace: \[1\] macro expansion at C:\\Users\\dell.juliapro\\JuliaPro\_v1.3.…

---

## [How to solve this problem with T](https://discourse.julialang.org/t/how-to-solve-this-problem-with-t/37585)

<div class="topic-metadata">

**Author:** [@11129](https://discourse.julialang.org/u/11129)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 9:52pm UTC](https://discourse.julialang.org/t/how-to-solve-this-problem-with-t/37585 "2020-04-14T21:52:30Z")

</div>

Dear everyone, This is the same problem I cannot step over, I have tried to fix this problem the whole afternoon I cannot go to next step… What T is …

---

## [Fixing a variable](https://discourse.julialang.org/t/fixing-a-variable/37569)

<div class="topic-metadata">

**Author:** [@Smith](https://discourse.julialang.org/u/Smith)\
**Replies:** 2\
**Last updated:** [April 14, 2020, 4:17pm UTC](https://discourse.julialang.org/t/fixing-a-variable/37569 "2020-04-14T16:17:49Z")

</div>

Here it is mentioned fixing a variable is better than adding a constraint: Does JuMP.fix and setting bounds on variables work with vectors or loop is necessary? I have only managed it with a loop: for i = 15:25 JuMP.fi…

---

## [Complex admittance matrix in PowerModels.jl?](https://discourse.julialang.org/t/complex-admittance-matrix-in-powermodels-jl/36717)

<div class="topic-metadata">

**Author:** [@RibeiroRaul](https://discourse.julialang.org/u/RibeiroRaul)\
**Replies:** 2\
**Last updated:** [April 13, 2020, 2:51pm UTC](https://discourse.julialang.org/t/complex-admittance-matrix-in-powermodels-jl/36717 "2020-04-13T14:51:59Z")

</div>

Hi, Is there a function that retrieves the complex admittance matrix from a PowerModels dict. Even though there is a type AdmittanceMatrix, it seems that it only receives susceptance matrix from calc\_susceptance\_matrix…

---

## [Tangent Curves to Linear Functions (Wages and Cobb Douglas)](https://discourse.julialang.org/t/tangent-curves-to-linear-functions-wages-and-cobb-douglas/37377)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 0\
**Last updated:** [April 11, 2020, 3:18am UTC](https://discourse.julialang.org/t/tangent-curves-to-linear-functions-wages-and-cobb-douglas/37377 "2020-04-11T03:18:53Z")

</div>

using Gnuplot, Gaston, Convex, SCS L= 0:600 K=0:600 C=0:600 Q=0:8000 contour(K, L, (K,L)-\>.1\*K^.5\*L^1.5, xlabel="Leisure", ylabel="Consumption",labels=false) #same function as a contour graph for somereason, doesn't r…

---

## [Model Predictive Control (MPC) in Julia](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240)

<div class="topic-metadata">

**Author:** [@uwechsler](https://discourse.julialang.org/u/uwechsler)\
**Replies:** 24\
**Last updated:** [April 11, 2020, 3:04am UTC](https://discourse.julialang.org/t/model-predictive-control-mpc-in-julia/24240 "2020-04-11T03:04:16Z")

</div>

I am considering using Julia and JuMP for my Master Thesis in learning based robust economic Model Predictive Control. I hope to get some feedback from the community on what packages to use or on what functionalities are…

---

## [Parallel processing](https://discourse.julialang.org/t/parallel-processing/37319)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 7\
**Last updated:** [April 10, 2020, 3:19pm UTC](https://discourse.julialang.org/t/parallel-processing/37319 "2020-04-10T15:19:02Z")

</div>

I did some experiments with parallel processing, i.e. solving models in parallel. But the result is not what I expected: using Distributed import JuMP addprocs(4) function simple\_model(a, b) model = JuMP.Model() …

---

## [Nested Multivariate Regression](https://discourse.julialang.org/t/nested-multivariate-regression/36710)

<div class="topic-metadata">

**Author:** [@Humphrey\_Lee](https://discourse.julialang.org/u/Humphrey_Lee)\
**Replies:** 8\
**Last updated:** [April 10, 2020, 7:28am UTC](https://discourse.julialang.org/t/nested-multivariate-regression/36710 "2020-04-10T07:28:41Z")

</div>

Title: Nested Multivariate Regression Appreciate some guidance and sample codes. I’m new to Julia language, but have used Python and R a bit. This is a curve fitting / regression of data (csv) exercise. The equation to …

---

## [Array index which is an index of another array](https://discourse.julialang.org/t/array-index-which-is-an-index-of-another-array/37285)

<div class="topic-metadata">

**Author:** [@jakub1998](https://discourse.julialang.org/u/jakub1998)\
**Replies:** 1\
**Last updated:** [April 9, 2020, 4:13pm UTC](https://discourse.julialang.org/t/array-index-which-is-an-index-of-another-array/37285 "2020-04-09T16:13:27Z")

</div>

I have to solve a problem with permutations. The function takes vector a with n elements as a parameter. I declare b as @variable - there should be the permutation 1:n that gives the best result after finding t…

---

## [Scope of variables in optimisation](https://discourse.julialang.org/t/scope-of-variables-in-optimisation/37258)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 7\
**Last updated:** [April 9, 2020, 5:21pm UTC](https://discourse.julialang.org/t/scope-of-variables-in-optimisation/37258 "2020-04-09T17:21:29Z")

</div>

Hello, folks! I am new to JuMP, so my apologies if it sounds a naive question. I wrap an optimisation problem in a function and then run it by changing input data in a loop. I define the variables as global so that thes…

---

## [Estimating parameters of a function for curve fitting](https://discourse.julialang.org/t/estimating-parameters-of-a-function-for-curve-fitting/32404)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 11\
**Last updated:** [April 9, 2020, 8:37am UTC](https://discourse.julialang.org/t/estimating-parameters-of-a-function-for-curve-fitting/32404 "2020-04-09T08:37:36Z")

</div>

I have some data that has missing values. I am trying to fit a curve on this data, using Richard’s Model which is \\begin{aligned} I(t)=& \\frac{K}{\\left\[1+e^{-r a(t-\\tau)}\\right\] \\frac{1}{a}} \\end{aligned} where K is …

---

## [Best practice for large-scale models in JuMP?](https://discourse.julialang.org/t/best-practice-for-large-scale-models-in-jump/37256)

<div class="topic-metadata">

**Author:** [@olugovoy](https://discourse.julialang.org/u/olugovoy)\
**Replies:** 2\
**Last updated:** [April 9, 2020, 2:23am UTC](https://discourse.julialang.org/t/best-practice-for-large-scale-models-in-jump/37256 "2020-04-09T02:23:12Z")

</div>

Hi there, We are translating a large scale LP model from GAMS to Julia/JuMP. Large-scale means, there are a number of sets (regions, years, sub-annual time resolution - days and hours, technologies, etc.) and 2-5 dimen…

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

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