# Specific Domains

**URL:** https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=230

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

**Page:** 231

---

## [Solving nonconvex problems using Gurobi](https://discourse.julialang.org/t/solving-nonconvex-problems-using-gurobi/91283)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 1\
**Last updated:** [December 5, 2022, 10:39pm UTC](https://discourse.julialang.org/t/solving-nonconvex-problems-using-gurobi/91283 "2022-12-05T22:39:47Z")

</div>

I just wanted to confirm if this is the right way to solve a nonconvex problem with bilinear terms (continuous times continuous variables) using Gurobi. I assumed to define a nonlinear constraint or objective, I should b…

---

## [What is the 3D plotter package closest to the rgl R package?](https://discourse.julialang.org/t/what-is-the-3d-plotter-package-closest-to-the-rgl-r-package/79816)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 9\
**Last updated:** [December 5, 2022, 10:32pm UTC](https://discourse.julialang.org/t/what-is-the-3d-plotter-package-closest-to-the-rgl-r-package/79816 "2022-12-05T22:32:15Z")

</div>

Hello, I took a look at the available 3D plotter package in Julia but at first glance they look complicated to me (maybe I mislooked). I’m looking for a package similar to the rgl R package, that is, you just have to en…

---

## [Evaluate a nonlinear expression at a point](https://discourse.julialang.org/t/evaluate-a-nonlinear-expression-at-a-point/91279)

<div class="topic-metadata">

**Author:** [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Replies:** 4\
**Last updated:** [December 5, 2022, 10:04pm UTC](https://discourse.julialang.org/t/evaluate-a-nonlinear-expression-at-a-point/91279 "2022-12-05T22:04:22Z")

</div>

I have a model with many nonlinear expressions and I would like to evaluate these to test my model. For example I have something like this using JuMP m = Model() @variable(m,x) @NLexpression(m,T,x^2) #What is T(x=2)…

---

## [Setting size (resolution) of makie plot when plotting?](https://discourse.julialang.org/t/setting-size-resolution-of-makie-plot-when-plotting/91148)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 6\
**Last updated:** [December 5, 2022, 3:24pm UTC](https://discourse.julialang.org/t/setting-size-resolution-of-makie-plot-when-plotting/91148 "2022-12-05T15:24:50Z")

</div>

I want to change the size of a plot I am making in Makie. I try: graphplot(mygraph,resolution=(500,500)) but get an error: ERROR: setting resolution for scene via plot attribute not supported anymore Is there some ot…

---

## [Bug In Detecting Changed Constant in Objective Function](https://discourse.julialang.org/t/bug-in-detecting-changed-constant-in-objective-function/91235)

<div class="topic-metadata">

**Author:** [@elipivo](https://discourse.julialang.org/u/elipivo)\
**Replies:** 3\
**Last updated:** [December 5, 2022, 2:55pm UTC](https://discourse.julialang.org/t/bug-in-detecting-changed-constant-in-objective-function/91235 "2022-12-05T14:55:16Z")

</div>

I’m experiencing a bug where it appears the constant in the objective function doesn’t get updated using Gurobi, here is a quick example: model = Model(() -\> Gurobi.Optimizer(env)) @variable(model, x\[1:2\]) @constraint(m…

---

## [Characteristic Functions --\> pdf using fft?](https://discourse.julialang.org/t/characteristic-functions-pdf-using-fft/91060)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 11\
**Last updated:** [December 5, 2022, 1:16pm UTC](https://discourse.julialang.org/t/characteristic-functions-pdf-using-fft/91060 "2022-12-05T13:16:04Z")

</div>

I have to work on a problem that requires me to use characteristic functions to represent random variables, as these particular rv’s have no close form distribution. The last time I did something remotely similar was at …

---

## [Is Julia Optimization fit for me?](https://discourse.julialang.org/t/is-julia-optimization-fit-for-me/90114)

<div class="topic-metadata">

**Author:** [@dhathri](https://discourse.julialang.org/u/dhathri)\
**Replies:** 6\
**Last updated:** [December 5, 2022, 4:51am UTC](https://discourse.julialang.org/t/is-julia-optimization-fit-for-me/90114 "2022-12-05T04:51:44Z")

</div>

Hello, I am new to Julia but not to optimization. I have implemented a large direct collocation constrained optimization NLP problem in MATLAB, it works but is a bit slow for my taste (takes about 5 minutes on average). …

---

## [Automatic differentiation and optimization with respect to callback times](https://discourse.julialang.org/t/automatic-differentiation-and-optimization-with-respect-to-callback-times/91024)

<div class="topic-metadata">

**Author:** [@pbryde](https://discourse.julialang.org/u/pbryde)\
**Replies:** 2\
**Last updated:** [December 5, 2022, 4:30am UTC](https://discourse.julialang.org/t/automatic-differentiation-and-optimization-with-respect-to-callback-times/91024 "2022-12-05T04:30:50Z")

</div>

From the Training Neural Networks in Hybrid Differential Equations example, I know that SciMLSensitivity is compatible with PresetTimeCallback. I was wondering whether it is possible to compute derivatives (and then opti…

---

## [Preconditioners quite slow in PDE system with DifferentialEquations.jl](https://discourse.julialang.org/t/preconditioners-quite-slow-in-pde-system-with-differentialequations-jl/74926)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 6\
**Last updated:** [December 4, 2022, 9:55pm UTC](https://discourse.julialang.org/t/preconditioners-quite-slow-in-pde-system-with-differentialequations-jl/74926 "2022-12-04T21:55:18Z")

</div>

Hi everyone, I am using DifferentialEquations.jl to solve 2 couple non-linear PDEs used to model a two-phase flow in a porous media: \\begin{align} \\frac{\\partial \\phi}{\\partial t} = \\nabla \\cdot \[\\phi^n(\\nabla P + u\_z)…

---

## [L0 norm in JuMp?](https://discourse.julialang.org/t/l0-norm-in-jump/91222)

<div class="topic-metadata">

**Author:** [@Gaulex](https://discourse.julialang.org/u/Gaulex)\
**Replies:** 4\
**Last updated:** [December 4, 2022, 9:05pm UTC](https://discourse.julialang.org/t/l0-norm-in-jump/91222 "2022-12-04T21:05:23Z")

</div>

Hello, I would like to minimize the L0-norm of a vector (i.e. the number of non-zero element) using JuMp, but I really struggle to achieve it. I tried to define a function to represent the L0-norm: count\_nonzero(x) = s…

---

## [How to create a valid \`FeatureCollection\` I can interface with \`GeoJSON\`?](https://discourse.julialang.org/t/how-to-create-a-valid-featurecollection-i-can-interface-with-geojson/91197)

<div class="topic-metadata">

**Author:** [@ctrebbau](https://discourse.julialang.org/u/ctrebbau)\
**Replies:** 7\
**Last updated:** [December 4, 2022, 8:11pm UTC](https://discourse.julialang.org/t/how-to-create-a-valid-featurecollection-i-can-interface-with-geojson/91197 "2022-12-04T20:11:00Z")

</div>

using GeoJSON EPS = 5 MAD\_BOUNDS = (40.2257307, 40.6072783, -3.9536568, -3.4525022) grid = Dict("Lat" =\> range(MAD\_BOUNDS\[1\], MAD\_BOUNDS\[2\], EPS), "Lng" =\> range(MAD\_BOUNDS\[3\], MAD\_BOUNDS\[4\], EPS), …

---

## [Errors using JuMP with Ipopt or HiGHS: UndefVarError: libipopt not defined and UndefVarError: libhighs not defined](https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 4\
**Last updated:** [December 4, 2022, 7:48pm UTC](https://discourse.julialang.org/t/errors-using-jump-with-ipopt-or-highs-undefvarerror-libipopt-not-defined-and-undefvarerror-libhighs-not-defined/78539 "2022-12-04T19:48:00Z")

</div>

I have Ipopt, OSQPand HiGHS installed. In Jupiter, when running the following script, n = size(Sigma,1) # Sigma is a 30x30 covariance matrix m = Model(Ipopt.Optimizer) @variable(m, w\[1:n\]) @objective(m, Min, w' …

---

## [Cannot convert QuadExpr - error in Julia v1.7 but not v.1.8 with PSDCone()](https://discourse.julialang.org/t/cannot-convert-quadexpr-error-in-julia-v1-7-but-not-v-1-8-with-psdcone/91202)

<div class="topic-metadata">

**Author:** [@malmassa](https://discourse.julialang.org/u/malmassa)\
**Replies:** 1\
**Last updated:** [December 4, 2022, 7:40pm UTC](https://discourse.julialang.org/t/cannot-convert-quadexpr-error-in-julia-v1-7-but-not-v-1-8-with-psdcone/91202 "2022-12-04T19:40:05Z")

</div>

Hi all, I teach a course on convex optimization and use Julia/JuMP (along with Matlab/CVX) to introduce students to implementation aspects – however, I am not a super-user of Julia/JuMP and may be missing something obvi…

---

## [JuMP, GLPK integer decision variable value tolerance](https://discourse.julialang.org/t/jump-glpk-integer-decision-variable-value-tolerance/91218)

<div class="topic-metadata">

**Author:** [@Gokhan\_Kof](https://discourse.julialang.org/u/Gokhan_Kof)\
**Replies:** 2\
**Last updated:** [December 4, 2022, 7:32pm UTC](https://discourse.julialang.org/t/jump-glpk-integer-decision-variable-value-tolerance/91218 "2022-12-04T19:32:56Z")

</div>

Hi, I was using GLPK within JuMP to solve an integer linear program. The value of the decision variables are close to integer values. I can just round them if they are within an accepted tolerance. However, GLPK optimi…

---

## [Integral of a function inside non-rectangular domain](https://discourse.julialang.org/t/integral-of-a-function-inside-non-rectangular-domain/72132)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 16\
**Last updated:** [December 3, 2022, 8:27pm UTC](https://discourse.julialang.org/t/integral-of-a-function-inside-non-rectangular-domain/72132 "2022-12-03T20:27:26Z")

</div>

I want to integrate some function f(x,y) inside a non-rectangular domain, say a disk defined by x² + y² ≤ 1. Is there a package for doing this? I actually tried to define g(x,y) = f(x,y) \* (x^2+y^2 ≤1). Then g(x,y) is…

---

## [Problem with HamiltonianProblem in Differential](https://discourse.julialang.org/t/problem-with-hamiltonianproblem-in-differential/91161)

<div class="topic-metadata">

**Author:** [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Replies:** 2\
**Last updated:** [December 3, 2022, 9:58am UTC](https://discourse.julialang.org/t/problem-with-hamiltonianproblem-in-differential/91161 "2022-12-03T09:58:48Z")

</div>

Hi there! Im playing around with some easy physics problems. Here I tried to simulate a simple pendulum. I wanted to solve it via the HamiltonianProblem functionality from DifferentialEquations.jl. Im not sure what’s t…

---

## [PID with Mass Spring Dramper using ModelingToolkit.jl](https://discourse.julialang.org/t/pid-with-mass-spring-dramper-using-modelingtoolkit-jl/59063)

<div class="topic-metadata">

**Author:** [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Replies:** 12\
**Last updated:** [December 3, 2022, 7:51am UTC](https://discourse.julialang.org/t/pid-with-mass-spring-dramper-using-modelingtoolkit-jl/59063 "2022-12-03T07:51:16Z")

</div>

I’m attempting to using ModelingToolkit (for the first time) to solve a simple PID controller with mass/spring/damper. The PID output is y which I’m converting directly to a force driving the position x of the mass m wi…

---

## [PyTorch 2.0](https://discourse.julialang.org/t/pytorch-2-0/91169)

<div class="topic-metadata">

**Author:** [@davide445](https://discourse.julialang.org/u/davide445)\
**Replies:** 0\
**Last updated:** [December 3, 2022, 7:36am UTC](https://discourse.julialang.org/t/pytorch-2-0/91169 "2022-12-03T07:36:55Z")

</div>

I get notified about the new release Not an expert just talking with specialists and finding my way getting to know Flux a bit for my simulation experiments, wanted to know the opinion of other forumeers if this PyT r…

---

## [DiffEq skips over event in the first \`solve\` but works after \`reinit!\`](https://discourse.julialang.org/t/diffeq-skips-over-event-in-the-first-solve-but-works-after-reinit/90935)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 16\
**Last updated:** [December 3, 2022, 3:42am UTC](https://discourse.julialang.org/t/diffeq-skips-over-event-in-the-first-solve-but-works-after-reinit/90935 "2022-12-03T03:42:06Z")

</div>

The code below simulates a series resistor and inductor supplied by an AC source through a diode. The diode turns off when the current is \<=0 and turns back on when the voltage across the diode is \>=1. Skipping over eve…

---

## [Monomials with variable of a model](https://discourse.julialang.org/t/monomials-with-variable-of-a-model/91048)

<div class="topic-metadata">

**Author:** [@irezvyakova](https://discourse.julialang.org/u/irezvyakova)\
**Replies:** 3\
**Last updated:** [December 3, 2022, 3:13am UTC](https://discourse.julialang.org/t/monomials-with-variable-of-a-model/91048 "2022-12-03T03:13:38Z")

</div>

Does there exist a nice way to use a certain variable of a model (say, model = Model(COSMO.Optimizer) @variable(model, u) @variable(model, t) ) to get a vector of monomials of \[u,t\] up to certain degree (say, 10) wi…

---

## [Optimization taking too long](https://discourse.julialang.org/t/optimization-taking-too-long/91159)

<div class="topic-metadata">

**Author:** [@mb96](https://discourse.julialang.org/u/mb96)\
**Replies:** 5\
**Last updated:** [December 3, 2022, 3:00am UTC](https://discourse.julialang.org/t/optimization-taking-too-long/91159 "2022-12-03T03:00:27Z")

</div>

Hi everyone, I am solving an optimization problem with a lot of variables through JuMP with Ipopt solver. The convergence time is extremely sensitive to one of my constraints: for example if I use a linear functional f…

---

## [Symbolics.jl: How to preevaluate a computationally expensive expression in build\_function()](https://discourse.julialang.org/t/symbolics-jl-how-to-preevaluate-a-computationally-expensive-expression-in-build-function/91147)

<div class="topic-metadata">

**Author:** [@davidschlegel](https://discourse.julialang.org/u/davidschlegel)\
**Replies:** 6\
**Last updated:** [December 2, 2022, 6:23pm UTC](https://discourse.julialang.org/t/symbolics-jl-how-to-preevaluate-a-computationally-expensive-expression-in-build-function/91147 "2022-12-02T18:23:30Z")

</div>

I like the build\_function() method of Symbolics.jl which basically bakes symbolic expressions into compiled code. However, it does so by compiling the full expression which might be numerically highly inefficient. Supp…

---

## [Solving wave PDE with ModelingToolkit.jl and method of lines](https://discourse.julialang.org/t/solving-wave-pde-with-modelingtoolkit-jl-and-method-of-lines/90750)

<div class="topic-metadata">

**Author:** [@fabiopierella](https://discourse.julialang.org/u/fabiopierella)\
**Replies:** 21\
**Last updated:** [December 2, 2022, 3:13pm UTC](https://discourse.julialang.org/t/solving-wave-pde-with-modelingtoolkit-jl-and-method-of-lines/90750 "2022-12-02T15:13:09Z")

</div>

Hi everyone, I am trying to reproduce a standing wave in a 2D fluid domain. I am having troubles to go past the discretization step with the ModelingToolkit.jl - hereafter you find a detailed description of the problem …

---

## [MethodError: no method matching translate! in Turing with SMC](https://discourse.julialang.org/t/methoderror-no-method-matching-translate-in-turing-with-smc/91115)

<div class="topic-metadata">

**Author:** [@jtraffic](https://discourse.julialang.org/u/jtraffic)\
**Replies:** 0\
**Last updated:** [December 1, 2022, 9:25pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-translate-in-turing-with-smc/91115 "2022-12-01T21:25:50Z")

</div>

Here is my full code, based on a Turing tutorial. using Turing, Turing.RandomMeasures using LinearAlgebra, Distributions using Plots, Random, CSV, DataFrames share\_1 = rand(Uniform(), 100) share\_2 = 1 .- share\_1 shar…

---

## [Out of memory error in Juniper.jl](https://discourse.julialang.org/t/out-of-memory-error-in-juniper-jl/91094)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 7\
**Last updated:** [December 2, 2022, 10:19am UTC](https://discourse.julialang.org/t/out-of-memory-error-in-juniper-jl/91094 "2022-12-02T10:19:02Z")

</div>

Unfortunately I cannot practically create a MWE for this issue. I build a rather large MINLP model, it has 33,331 variables (2,218 binary), 157,260 constraints, 7,818 non linear constraints. When optimising, after 10 min…

---

## [How to create sample random numbers from a custom distribution?](https://discourse.julialang.org/t/how-to-create-sample-random-numbers-from-a-custom-distribution/90744)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 12\
**Last updated:** [December 2, 2022, 9:59am UTC](https://discourse.julialang.org/t/how-to-create-sample-random-numbers-from-a-custom-distribution/90744 "2022-12-02T09:59:01Z")

</div>

I want to create a series of random numbers from a custom distribution. Suppose I have a data set named iris: julia\> using RDatasets julia\> iris = dataset("datasets", "iris"); Now I want to generate 100 random numbers…

---

## [Stochastic PDE with conservative noise](https://discourse.julialang.org/t/stochastic-pde-with-conservative-noise/90316)

<div class="topic-metadata">

**Author:** [@LuDc](https://discourse.julialang.org/u/LuDc)\
**Replies:** 6\
**Last updated:** [December 2, 2022, 9:55am UTC](https://discourse.julialang.org/t/stochastic-pde-with-conservative-noise/90316 "2022-12-02T09:55:29Z")

</div>

I am trying to simulate a simple stochastic pde using the DifferentialEquations package, the equation I want to simulate is a simple conservation equation with conservative noise in 2 dimensions, i.e. \\partial\_t \\rho = …

---

## [Add a vertical line to an AoG plot](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [December 2, 2022, 4:54am UTC](https://discourse.julialang.org/t/add-a-vertical-line-to-an-aog-plot/91123 "2022-12-02T04:54:01Z")

</div>

In ggplot2, I can add a vertical line like this. How to do it in AoG? ggplot(df, aes(x=x, y=y)) + geom\_point() + geom\_vline(xintercept=10)

---

## [Null gradients with GANs](https://discourse.julialang.org/t/null-gradients-with-gans/91099)

<div class="topic-metadata">

**Author:** [@LucasMSpereira](https://discourse.julialang.org/u/LucasMSpereira)\
**Replies:** 1\
**Last updated:** [December 2, 2022, 12:41am UTC](https://discourse.julialang.org/t/null-gradients-with-gans/91099 "2022-12-02T00:41:10Z")

</div>

When trying to replicate a paper that uses GANs with unconventional loss calculations, I’m having problems with null gradients. The basic steps are the following: genOutput = gen(genInput) MSE(genOut, label) MAE(genOut…

---

## [Pkg.instantiate() error with multiple workers on 1 machine](https://discourse.julialang.org/t/pkg-instantiate-error-with-multiple-workers-on-1-machine/91022)

<div class="topic-metadata">

**Author:** [@jocklawrie](https://discourse.julialang.org/u/jocklawrie)\
**Replies:** 1\
**Last updated:** [December 1, 2022, 10:18pm UTC](https://discourse.julialang.org/t/pkg-instantiate-error-with-multiple-workers-on-1-machine/91022 "2022-12-01T22:18:53Z")

</div>

Hi there, This may well be user error, but thought I’d report it anyway in case there’s more to it. I’m running a simulation over multiple workers on the same machine. I get an error (see the image below) that indicate…

[Previous page](https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=229)

[Next page](https://discourse.julialang.org/c/domain/10.md?no_subcategories=false&page=231)
