# Specific Domains

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

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

**Page:** 60

---

## [ModelingToolkit -- if statements?](https://discourse.julialang.org/t/modelingtoolkit-if-statements/125609)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [February 6, 2025, 11:02am UTC](https://discourse.julialang.org/t/modelingtoolkit-if-statements/125609 "2025-02-06T11:02:32Z")

</div>

Silly question… I need to create a function that I call within an MTK model (computing friction force), and the friction depends on the direction of the velocity… two very different expressions if v\> 0, or whether v \<= 0…

---

## [Lux.jl QuickStart: why \`Lux.apply\` returns the state?](https://discourse.julialang.org/t/lux-jl-quickstart-why-lux-apply-returns-the-state/125607)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 1\
**Last updated:** [February 6, 2025, 9:55am UTC](https://discourse.julialang.org/t/lux-jl-quickstart-why-lux-apply-returns-the-state/125607 "2025-02-06T09:55:10Z")

</div>

In the QuickStart section of Lux.jl documentation, there is the line y, st = Lux.apply(model, x, ps, st) Why does Lux.apply return not only y but also st? How can inference computations change the neural network state?…

---

## [BoundaryValueDiffEq: How to restart to exploit initial guess?](https://discourse.julialang.org/t/boundaryvaluediffeq-how-to-restart-to-exploit-initial-guess/125552)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 7\
**Last updated:** [February 6, 2025, 7:46am UTC](https://discourse.julialang.org/t/boundaryvaluediffeq-how-to-restart-to-exploit-initial-guess/125552 "2025-02-06T07:46:36Z")

</div>

My boundary value problem has a parameter that renders the problem easy or hard. Is there a way to restart the solve function for the hard problem by specifying the solution of the easy problem as initial guess? Below …

---

## [Trouble with Optimization.jl errors](https://discourse.julialang.org/t/trouble-with-optimization-jl-errors/125410)

<div class="topic-metadata">

**Author:** [@Bill\_Holmes](https://discourse.julialang.org/u/Bill_Holmes)\
**Replies:** 2\
**Last updated:** [February 6, 2025, 3:46am UTC](https://discourse.julialang.org/t/trouble-with-optimization-jl-errors/125410 "2025-02-06T03:46:24Z")

</div>

Hello all. I’m running into an issue with Optimization.jl when trying to estimate parameters of ODEs. The specific issue is that some optimizers work while others don’t. Furthermore, different optimizers throw different …

---

## [Agents.jl: Interactive plotting - agent traits controllable on a slider](https://discourse.julialang.org/t/agents-jl-interactive-plotting-agent-traits-controllable-on-a-slider/92735)

<div class="topic-metadata">

**Author:** [@sea\_slug](https://discourse.julialang.org/u/sea_slug)\
**Replies:** 7\
**Last updated:** [February 6, 2025, 2:34am UTC](https://discourse.julialang.org/t/agents-jl-interactive-plotting-agent-traits-controllable-on-a-slider/92735 "2025-02-06T02:34:49Z")

</div>

I want to generate an interactive plot for the wolf-sheep model. I want to make it so that agent traits can be controlled on an interactive slider, for example: the initial number of sheep (n\_sheep) vary between 1 and 2…

---

## [Best practices of simple multithreading in Agents.jl](https://discourse.julialang.org/t/best-practices-of-simple-multithreading-in-agents-jl/125580)

<div class="topic-metadata">

**Author:** [@kockahonza](https://discourse.julialang.org/u/kockahonza)\
**Replies:** 2\
**Last updated:** [February 5, 2025, 8:47pm UTC](https://discourse.julialang.org/t/best-practices-of-simple-multithreading-in-agents-jl/125580 "2025-02-05T20:47:20Z")

</div>

Hi! I’m a still relatively new julia user and a completely fresh Agents.jl user. For a bit of background, I’m working on a pretty simple model where the agents are independent and hence I was hoping to parallelize the c…

---

## [Solving 2D PDE similar to advection-diffusion on unstructured mesh with Trixi](https://discourse.julialang.org/t/solving-2d-pde-similar-to-advection-diffusion-on-unstructured-mesh-with-trixi/125462)

<div class="topic-metadata">

**Author:** [@Liris](https://discourse.julialang.org/u/Liris)\
**Replies:** 6\
**Last updated:** [February 5, 2025, 5:41pm UTC](https://discourse.julialang.org/t/solving-2d-pde-similar-to-advection-diffusion-on-unstructured-mesh-with-trixi/125462 "2025-02-05T17:41:52Z")

</div>

Dear all, I am trying to solve the following equation: \\frac{\\partial \\phi}{\\partial t} + \\nabla\\cdot(\\phi \\boldsymbol{u}) - \\frac{\\partial}{\\partial z} \\left\[\\mathcal{F} \\phi(1-\\phi)\\right\] = \\nabla \\cdot (\\mathcal{D}…

---

## [Makie force update, refresh, or redraw of figure or screen](https://discourse.julialang.org/t/makie-force-update-refresh-or-redraw-of-figure-or-screen/125586)

<div class="topic-metadata">

**Author:** [@bjarthur](https://discourse.julialang.org/u/bjarthur)\
**Replies:** 0\
**Last updated:** [February 5, 2025, 4:56pm UTC](https://discourse.julialang.org/t/makie-force-update-refresh-or-redraw-of-figure-or-screen/125586 "2025-02-05T16:56:42Z")

</div>

i programmatically update the text of a Label and it is not reliably shown. simple cases work fine, and i’m having trouble coming up with an MWE that shows this bad behavior, but the structure of my production code is s…

---

## [What does Yao.Measure do with argument operator?](https://discourse.julialang.org/t/what-does-yao-measure-do-with-argument-operator/125546)

<div class="topic-metadata">

**Author:** [@yao\_novice](https://discourse.julialang.org/u/yao_novice)\
**Replies:** 2\
**Last updated:** [February 5, 2025, 6:49am UTC](https://discourse.julialang.org/t/what-does-yao-measure-do-with-argument-operator/125546 "2025-02-05T06:49:46Z")

</div>

I experiment with Yao.jl and I am puzzled with the ‘Measure’-blocks ‘operator’ argument. I assumed that the input state would end up with an eigenstate of the operator-matrix - but this seems not to be true. Here is my …

---

## [How to use Pardiso with single-precision matrices](https://discourse.julialang.org/t/how-to-use-pardiso-with-single-precision-matrices/125520)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 5\
**Last updated:** [February 4, 2025, 9:06pm UTC](https://discourse.julialang.org/t/how-to-use-pardiso-with-single-precision-matrices/125520 "2025-02-04T21:06:44Z")

</div>

I would like to ask if it is possible to run Pardiso from the LinearSolve library using single precision matrices. I am running using SparseArrays, LinearSolve, MKL, Pardiso prob = LinearProblem(A, b) sol = LinearSolve.…

---

## [Best practice for constraints with initial condition "exception"](https://discourse.julialang.org/t/best-practice-for-constraints-with-initial-condition-exception/125522)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [February 4, 2025, 7:42pm UTC](https://discourse.julialang.org/t/best-practice-for-constraints-with-initial-condition-exception/125522 "2025-02-04T19:42:02Z")

</div>

While translating the DICE model from GAMS code to JuMP I come up with situations where I have different constraints for initial values and following ones. This for exampe works: @constraint(m, mres0, RES0\[1\] == res00)…

---

## [Computing ODE sensitivities with sparse Jacobians in solver](https://discourse.julialang.org/t/computing-ode-sensitivities-with-sparse-jacobians-in-solver/125536)

<div class="topic-metadata">

**Author:** [@Neodym](https://discourse.julialang.org/u/Neodym)\
**Replies:** 3\
**Last updated:** [February 4, 2025, 6:31pm UTC](https://discourse.julialang.org/t/computing-ode-sensitivities-with-sparse-jacobians-in-solver/125536 "2025-02-04T18:31:17Z")

</div>

Hey there, I’m trying to compute the derivatives of a function involving an ODE solution. This works if I use dense Jacobians in the ODE solver. However, the Jacobian is actually sparse (PDE discretization, stiff) and …

---

## [Resuming a run by writing and reading back LP file](https://discourse.julialang.org/t/resuming-a-run-by-writing-and-reading-back-lp-file/125449)

<div class="topic-metadata">

**Author:** [@saikrishna-nadella](https://discourse.julialang.org/u/saikrishna-nadella)\
**Replies:** 5\
**Last updated:** [February 4, 2025, 6:10pm UTC](https://discourse.julialang.org/t/resuming-a-run-by-writing-and-reading-back-lp-file/125449 "2025-02-04T18:10:26Z")

</div>

I am implementing bender’s decomposition using JuMP in Julia. Feasibility cuts are added to the master problem continuously until the subproblem is feasible for the candidate solution of master problem. The run takes too…

---

## [Order of initial values for set\_start\_value in JuMP/Ipopt models](https://discourse.julialang.org/t/order-of-initial-values-for-set-start-value-in-jump-ipopt-models/125511)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 2\
**Last updated:** [February 4, 2025, 12:55am UTC](https://discourse.julialang.org/t/order-of-initial-values-for-set-start-value-in-jump-ipopt-models/125511 "2025-02-04T00:55:35Z")

</div>

I am optimizing a model in Jump with IPOPT. The model has T x 6 variables: a1\_t, a2\_t...a6\_t with t = 1...T When defining initial values using the function, set\_start\_value.(all\_variables(model), initial\_values) The ex…

---

## [Forwarding a macro that returns a variable?](https://discourse.julialang.org/t/forwarding-a-macro-that-returns-a-variable/125508)

<div class="topic-metadata">

**Author:** [@brunompacheco](https://discourse.julialang.org/u/brunompacheco)\
**Replies:** 5\
**Last updated:** [February 4, 2025, 12:19am UTC](https://discourse.julialang.org/t/forwarding-a-macro-that-returns-a-variable/125508 "2025-02-04T00:19:42Z")

</div>

I am trying to forward the @variable macro from JuMP, so that instead of passing a model to it, I pass my custom struct that has a model as a field. I was able to do it when the new macro is declared locally: using JuMP…

---

## [Approximate implicit function on real line](https://discourse.julialang.org/t/approximate-implicit-function-on-real-line/125421)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [February 3, 2025, 2:31pm UTC](https://discourse.julialang.org/t/approximate-implicit-function-on-real-line/125421 "2025-02-03T14:31:38Z")

</div>

I have a family of functions y(x) defined implicitly by x = \\log\\left(\\sum\_{i=1}^N \\exp(a\_i + y b\_i) \\right) where 0 \< b\_1 \< \\dots \< b\_N can be assumed. It is easy to find the solution numerically (eg with Newton’s m…

---

## [Restrictions when adding a binary variable - Local Infeasibility (Ipopt, Juniper)](https://discourse.julialang.org/t/restrictions-when-adding-a-binary-variable-local-infeasibility-ipopt-juniper/121870)

<div class="topic-metadata">

**Author:** [@fynnhoffmann54](https://discourse.julialang.org/u/fynnhoffmann54)\
**Replies:** 15\
**Last updated:** [January 23, 2025, 8:27am UTC](https://discourse.julialang.org/t/restrictions-when-adding-a-binary-variable-local-infeasibility-ipopt-juniper/121870 "2025-01-23T08:27:21Z")

</div>

Hello, I am trying to model a nonlinear optimization problem involving binary variables and continuous variables. Specifically, I cannot understand why a binary variable “z\_sys\_to\_HP(s)” makes the model unusable. My mo…

---

## [How to Use Native FP4 and FP8 for Computation in the Julia Environment with CUDA.jl](https://discourse.julialang.org/t/how-to-use-native-fp4-and-fp8-for-computation-in-the-julia-environment-with-cuda-jl/125475)

<div class="topic-metadata">

**Author:** [@ajsagit](https://discourse.julialang.org/u/ajsagit)\
**Replies:** 0\
**Last updated:** [February 2, 2025, 3:15pm UTC](https://discourse.julialang.org/t/how-to-use-native-fp4-and-fp8-for-computation-in-the-julia-environment-with-cuda-jl/125475 "2025-02-02T15:15:47Z")

</div>

How to Use Native FP4 and FP8 for Computation in the Julia Environment with CUDA.jl TIA

---

## [Why the Floating-Point Calculation Efficiency of CUDA.jl Does Not Reach the Official Theoretical Value](https://discourse.julialang.org/t/why-the-floating-point-calculation-efficiency-of-cuda-jl-does-not-reach-the-official-theoretical-value/125474)

<div class="topic-metadata">

**Author:** [@ajsagit](https://discourse.julialang.org/u/ajsagit)\
**Replies:** 1\
**Last updated:** [February 2, 2025, 3:55pm UTC](https://discourse.julialang.org/t/why-the-floating-point-calculation-efficiency-of-cuda-jl-does-not-reach-the-official-theoretical-value/125474 "2025-02-02T15:55:10Z")

</div>

using CUDA using BenchmarkTools using Printf function benchmark\_floating\_point(T::Type, size=2048) aligned\_size = div(size, 8) \* 8 A = CUDA.rand(T, (aligned\_size, aligned\_size)) B = CUDA.rand(T, (aligned\_siz…

---

## [Writing points to vtk with WriteVTK.jl](https://discourse.julialang.org/t/writing-points-to-vtk-with-writevtk-jl/50635)

<div class="topic-metadata">

**Author:** [@O\_Julia](https://discourse.julialang.org/u/O_Julia)\
**Replies:** 3\
**Last updated:** [February 2, 2025, 10:22am UTC](https://discourse.julialang.org/t/writing-points-to-vtk-with-writevtk-jl/50635 "2025-02-02T10:22:47Z")

</div>

Hi, I am trying to export a set of points with corresponding value at each point using WriteVTK.jl. More precisely, I am trying to convert following codes given here. from evtk.hl import pointsToVTK import numpy as n…

---

## [\`Zygote.gradient\` is 54000 TIMES slower than \`jax.gradient\`](https://discourse.julialang.org/t/zygote-gradient-is-54000-times-slower-than-jax-gradient/125396)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 80\
**Last updated:** [February 1, 2025, 9:25pm UTC](https://discourse.julialang.org/t/zygote-gradient-is-54000-times-slower-than-jax-gradient/125396 "2025-02-01T21:25:46Z")

</div>

I’m almost unable to compute ant gradients (EDIT 9 hrs later: meant to say “any gradients”, but got gradients for ants) in Zygote. I initially attempted to optimize my model using around a million parameters, but it got …

---

## [Creating Parametric ReLU in Flux](https://discourse.julialang.org/t/creating-parametric-relu-in-flux/10987)

<div class="topic-metadata">

**Author:** [@Azamat](https://discourse.julialang.org/u/Azamat)\
**Replies:** 8\
**Last updated:** [February 1, 2025, 6:19pm UTC](https://discourse.julialang.org/t/creating-parametric-relu-in-flux/10987 "2025-02-01T18:19:48Z")

</div>

I would like to create Parametric ReLU (PReLU), an activation function, that is described in \[1502.01852\] Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification I know I should use u…

---

## [Removing bounds checking for HPC - \`--check-bounds=unsafe\`?](https://discourse.julialang.org/t/removing-bounds-checking-for-hpc-check-bounds-unsafe/124897)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 51\
**Last updated:** [February 1, 2025, 4:05pm UTC](https://discourse.julialang.org/t/removing-bounds-checking-for-hpc-check-bounds-unsafe/124897 "2025-02-01T16:05:26Z")

</div>

One of Julia’s main purposes is to enable high-performance computing at scale - it’s on the front page (Ecosystem → Parallel Computing at The Julia Programming Language)! However, apparently --check-bounds=no is becoming…

---

## [How to develop code in Vulkan using Julia?](https://discourse.julialang.org/t/how-to-develop-code-in-vulkan-using-julia/125456)

<div class="topic-metadata">

**Author:** [@mj2984](https://discourse.julialang.org/u/mj2984)\
**Replies:** 1\
**Last updated:** [February 1, 2025, 2:33pm UTC](https://discourse.julialang.org/t/how-to-develop-code-in-vulkan-using-julia/125456 "2025-02-01T14:33:52Z")

</div>

I am looking to see if it is possible to generate SPIR-V code from Julia that can be used in Vulkan (Compute). Or something that can transform Julia code to Vulkan for compute purposes. The intention is to write a code …

---

## [3D volume plot is blank with Plots.jl + GR.jl](https://discourse.julialang.org/t/3d-volume-plot-is-blank-with-plots-jl-gr-jl/125444)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 1\
**Last updated:** [February 1, 2025, 9:16am UTC](https://discourse.julialang.org/t/3d-volume-plot-is-blank-with-plots-jl-gr-jl/125444 "2025-02-01T09:16:13Z")

</div>

The backend is GR. Thanks. julia\> using Plots julia\> heatmap(rand(10,10,10)) julia\> versioninfo() Julia Version 1.10.8 Commit 4c16ff44be (2025-01-22 10:06 UTC) Build Info: Official https://julialang.org/ release Pla…

---

## [Model building is slow when adding a large number of constraints, but the model necessitates a certain type of refrencing of constraints](https://discourse.julialang.org/t/model-building-is-slow-when-adding-a-large-number-of-constraints-but-the-model-necessitates-a-certain-type-of-refrencing-of-constraints/125424)

<div class="topic-metadata">

**Author:** [@MarkusGabl](https://discourse.julialang.org/u/MarkusGabl)\
**Replies:** 4\
**Last updated:** [February 1, 2025, 4:55am UTC](https://discourse.julialang.org/t/model-building-is-slow-when-adding-a-large-number-of-constraints-but-the-model-necessitates-a-certain-type-of-refrencing-of-constraints/125424 "2025-02-01T04:55:42Z")

</div>

Hi there JuMP-Crew Given a symmetric matrix Q and the all ones matrix E and a set of vectors v\_1,…,v\_n called “Vertex\_Set” and a set of two-tuples of these vectors (or rather their indices) called “Inclusion\_Set”, I wa…

---

## [Solving MCP with PathSolver with indexing](https://discourse.julialang.org/t/solving-mcp-with-pathsolver-with-indexing/124488)

<div class="topic-metadata">

**Author:** [@jmc](https://discourse.julialang.org/u/jmc)\
**Replies:** 31\
**Last updated:** [January 31, 2025, 7:23pm UTC](https://discourse.julialang.org/t/solving-mcp-with-pathsolver-with-indexing/124488 "2025-01-31T19:23:36Z")

</div>

Hello, I am trying to solve an MCP that requires performing operations across some indices. Here is a MWE: using JuMP using Random using LinearAlgebra using BenchmarkTools using JuMP import PATHSolver PATHSolver.c\_ap…

---

## [Register Array Symbolic Output Indexing](https://discourse.julialang.org/t/register-array-symbolic-output-indexing/125271)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 3\
**Last updated:** [January 31, 2025, 10:07am UTC](https://discourse.julialang.org/t/register-array-symbolic-output-indexing/125271 "2025-01-31T10:07:11Z")

</div>

I’m looking to use an array function in a ModelingToolkit.jl model through the @register\_array\_symbolic macro, but I’m having trouble figuring out how to use it properly. The following MWE shows what I’m trying to do: u…

---

## [Multivariate polynomial regression of discrete data in L-infinity norm](https://discourse.julialang.org/t/multivariate-polynomial-regression-of-discrete-data-in-l-infinity-norm/125369)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 16\
**Last updated:** [January 31, 2025, 1:10am UTC](https://discourse.julialang.org/t/multivariate-polynomial-regression-of-discrete-data-in-l-infinity-norm/125369 "2025-01-31T01:10:55Z")

</div>

Hi everyone, Does anyone know of a Julia package that implements polynomial approximations (preferably Chebyshev polynomials) given data on a multivariate function with a L-infinity norm? Specifically, I have x, f(x) p…

---

## [Solving a system of multivariate polynomials (or finding extrema)](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [January 30, 2025, 9:12pm UTC](https://discourse.julialang.org/t/solving-a-system-of-multivariate-polynomials-or-finding-extrema/110451 "2025-01-30T21:12:45Z")

</div>

I have a multivariate (in practice, 2–5 dimensions) function approximated with Chebyshev polynomials. I would like to find all the local extrema of the approximation. This is equivalent to solving the system obtained fro…

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

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