# Specific Domains

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

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

**Page:** 191

---

## [Package for machanic/static framework](https://discourse.julialang.org/t/package-for-machanic-static-framework/69900)

<div class="topic-metadata">

**Author:** [@f.L0x](https://discourse.julialang.org/u/f.L0x)\
**Replies:** 5\
**Last updated:** [May 27, 2023, 3:07pm UTC](https://discourse.julialang.org/t/package-for-machanic-static-framework/69900 "2023-05-27T15:07:48Z")

</div>

Hi there, Is there a package to build simple mechanic/static framework? For example like this? I just need, simplified beams, simplified bearings and forces. I had a look at Gridap.jl and JuaFEM.jl, but these seems…

---

## [Unsafe\_convert when trying to run a neural network on GPU](https://discourse.julialang.org/t/unsafe-convert-when-trying-to-run-a-neural-network-on-gpu/99396)

<div class="topic-metadata">

**Author:** [@jarroyoe](https://discourse.julialang.org/u/jarroyoe)\
**Replies:** 4\
**Last updated:** [May 27, 2023, 1:22pm UTC](https://discourse.julialang.org/t/unsafe-convert-when-trying-to-run-a-neural-network-on-gpu/99396 "2023-05-27T13:22:17Z")

</div>

I want to run a single input neural network using CUDA as follows. using CUDA, Lux, Random rng = Random.default\_rng() data = gpu(rand(3,10)) neuralNetwork = Lux.Chain(Lux.Dense(1,4),Lux.Dense(4,2)) ps,st = Lux.setup(rn…

---

## [Linear Algebra - Unit vectors e\_i](https://discourse.julialang.org/t/linear-algebra-unit-vectors-e-i/10409)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 15\
**Last updated:** [May 27, 2023, 10:45am UTC](https://discourse.julialang.org/t/linear-algebra-unit-vectors-e-i/10409 "2023-05-27T10:45:34Z")

</div>

Hi, Is there an easy way to add a standard unit vector (e\_i, which is vector of length ‘l’ with all zeros except for ith position? Example: Let x be a vector of length 5. I want to add e\_3 (= \[ 0 0 1 0 0\]) to it. Righ…

---

## [Nonlinear systems and ModelingToolkitStandardLibrary](https://discourse.julialang.org/t/nonlinear-systems-and-modelingtoolkitstandardlibrary/99460)

<div class="topic-metadata">

**Author:** [@Paulo\_Jabardo](https://discourse.julialang.org/u/Paulo_Jabardo)\
**Replies:** 1\
**Last updated:** [May 26, 2023, 8:31pm UTC](https://discourse.julialang.org/t/nonlinear-systems-and-modelingtoolkitstandardlibrary/99460 "2023-05-26T20:31:48Z")

</div>

Much work in thermal/fluid problems involve steady state cases. I have been playing around with NonlinearSolve.jl and it works well. What I’m having trouble is in the integration it with ModelingToolkitStandardLibrary.jl…

---

## [How to globally change a data frame inside for loop?](https://discourse.julialang.org/t/how-to-globally-change-a-data-frame-inside-for-loop/99361)

<div class="topic-metadata">

**Author:** [@Yao\_Vang](https://discourse.julialang.org/u/Yao_Vang)\
**Replies:** 4\
**Last updated:** [May 26, 2023, 6:06pm UTC](https://discourse.julialang.org/t/how-to-globally-change-a-data-frame-inside-for-loop/99361 "2023-05-26T18:06:16Z")

</div>

Hi there! How to apply changes in for loops to be kept outside of for loop too? I have a dataframe that is read inside a for loop via a function and and after bunch of computation, I apply a filter command over it and …

---

## [Makie.hist/hist! can't add a label for legend if bar\_labels is specified](https://discourse.julialang.org/t/makie-hist-hist-cant-add-a-label-for-legend-if-bar-labels-is-specified/99352)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 5\
**Last updated:** [May 26, 2023, 1:33pm UTC](https://discourse.julialang.org/t/makie-hist-hist-cant-add-a-label-for-legend-if-bar-labels-is-specified/99352 "2023-05-26T13:33:08Z")

</div>

It seems like the legend doesn’t work for all situations. This works: use GLMakie h1=hist(rand(16,),bins = 10, label="a", strokewidth = 1, strokecolor = :black, normalization = :probability) axislegend() And this wo…

---

## [Obtaining readable polynomial chaos surrogate model using Surrogates.jl](https://discourse.julialang.org/t/obtaining-readable-polynomial-chaos-surrogate-model-using-surrogates-jl/99431)

<div class="topic-metadata">

**Author:** [@kakarot0108](https://discourse.julialang.org/u/kakarot0108)\
**Replies:** 1\
**Last updated:** [May 26, 2023, 1:09pm UTC](https://discourse.julialang.org/t/obtaining-readable-polynomial-chaos-surrogate-model-using-surrogates-jl/99431 "2023-05-26T13:09:37Z")

</div>

Hi all, I am trying to develop a polynomial chaos surrogate using Surrogates.jl. Let’s say we have the following surrogate model: poly = PolynomialChaosSurrogate(x, y, lower\_bound, upper\_bound, op = SurrogatesPolyChaos…

---

## [Error when running DiffEqGPU example from documentation](https://discourse.julialang.org/t/error-when-running-diffeqgpu-example-from-documentation/99405)

<div class="topic-metadata">

**Author:** [@jogama](https://discourse.julialang.org/u/jogama)\
**Replies:** 2\
**Last updated:** [May 26, 2023, 1:06pm UTC](https://discourse.julialang.org/t/error-when-running-diffeqgpu-example-from-documentation/99405 "2023-05-26T13:06:30Z")

</div>

Hello, I ran the following example, copy-pasted from here, and received an UndefVarError. Here is the example snippet from the linked website: using DiffEqGPU, OrdinaryDiffEq function lorenz(du, u, p, t) du\[1\] = p…

---

## [New to ModelingToolkit, problems trying to include derivatives on RHS of ODESystem](https://discourse.julialang.org/t/new-to-modelingtoolkit-problems-trying-to-include-derivatives-on-rhs-of-odesystem/99062)

<div class="topic-metadata">

**Author:** [@markjholmes](https://discourse.julialang.org/u/markjholmes)\
**Replies:** 5\
**Last updated:** [May 26, 2023, 12:10pm UTC](https://discourse.julialang.org/t/new-to-modelingtoolkit-problems-trying-to-include-derivatives-on-rhs-of-odesystem/99062 "2023-05-26T12:10:41Z")

</div>

I’m trying to model a biological system of a population, N, and a trait, X. The rate of change of the population, \\frac{dN}{dt}, depends on some nonlinear function that is governed by some dynamic trait of the populatio…

---

## [Change circle radius of Shell() graph in GraphMakie](https://discourse.julialang.org/t/change-circle-radius-of-shell-graph-in-graphmakie/99306)

<div class="topic-metadata">

**Author:** [@Dario\_Sarra](https://discourse.julialang.org/u/Dario_Sarra)\
**Replies:** 2\
**Last updated:** [May 26, 2023, 9:52am UTC](https://discourse.julialang.org/t/change-circle-radius-of-shell-graph-in-graphmakie/99306 "2023-05-26T09:52:54Z")

</div>

I am using GraphMakie on a MetaGraphNext structure to visualise the relationship between organizations in a story. I would like to use ilabels with the organization name in a Shell layout. However, because of the length …

---

## [Help with SparseArrays/ChainRules error](https://discourse.julialang.org/t/help-with-sparsearrays-chainrules-error/99425)

<div class="topic-metadata">

**Author:** [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Replies:** 0\
**Last updated:** [May 26, 2023, 6:07am UTC](https://discourse.julialang.org/t/help-with-sparsearrays-chainrules-error/99425 "2023-05-26T06:07:01Z")

</div>

Ran into this error running code similar to this MWE, and was hoping someone who knows more about the AD ecosystem could help point me where to file an issue–is this a missing ChainRule, or overly-strict typing in Sparse…

---

## [Modelling arbitrary non-linear expression (returned by a function) in JuMP](https://discourse.julialang.org/t/modelling-arbitrary-non-linear-expression-returned-by-a-function-in-jump/99419)

<div class="topic-metadata">

**Author:** [@pkoir](https://discourse.julialang.org/u/pkoir)\
**Replies:** 4\
**Last updated:** [May 26, 2023, 3:23am UTC](https://discourse.julialang.org/t/modelling-arbitrary-non-linear-expression-returned-by-a-function-in-jump/99419 "2023-05-26T03:23:43Z")

</div>

Hi, I’m new to Julia and JuMP so please forgive me if this is a trivial problem. I have a constraint function of the form: function g(x) \[ exp(x\[1\]) + exp(x\[2\]), x\[1\]^4 + x\[2\]^4 \] end I’m trying to mo…

---

## [CategoricalArrays Binning](https://discourse.julialang.org/t/categoricalarrays-binning/99400)

<div class="topic-metadata">

**Author:** [@astro-kevin](https://discourse.julialang.org/u/astro-kevin)\
**Replies:** 3\
**Last updated:** [May 26, 2023, 1:37am UTC](https://discourse.julialang.org/t/categoricalarrays-binning/99400 "2023-05-26T01:37:11Z")

</div>

When using the cut function of CategoricalArrays, it returns CategoricalArray objects which contain CategoricalValue objects like \[0,1). However, I don’t seem to understand how to access the value that was cut, for examp…

---

## [Direct Feedback Alignment](https://discourse.julialang.org/t/direct-feedback-alignment/99414)

<div class="topic-metadata">

**Author:** [@marco\_menarini](https://discourse.julialang.org/u/marco_menarini)\
**Replies:** 0\
**Last updated:** [May 25, 2023, 11:03pm UTC](https://discourse.julialang.org/t/direct-feedback-alignment/99414 "2023-05-25T23:03:45Z")

</div>

I am trying to implement a form of Direct Feedback Aligment that allows for custom derivatives based on this paper using Flux The code seems to work correctly and fast if I pass the data points individually, but it beco…

---

## [DiffEq documentation example slower on GPU (33 sec) than on CPU (0.14 sec)](https://discourse.julialang.org/t/diffeq-documentation-example-slower-on-gpu-33-sec-than-on-cpu-0-14-sec/99407)

<div class="topic-metadata">

**Author:** [@jogama](https://discourse.julialang.org/u/jogama)\
**Replies:** 4\
**Last updated:** [May 25, 2023, 10:41pm UTC](https://discourse.julialang.org/t/diffeq-documentation-example-slower-on-gpu-33-sec-than-on-cpu-0-14-sec/99407 "2023-05-25T22:41:31Z")

</div>

Hello, We were surprized to see that example code on the online documentation ran slower on the GPU than on the CPU. https://docs.sciml.ai/DiffEqGPU/stable/getting\_started/#Simple-Example-of-Within-Method-GPU-Paralleli…

---

## [Add local and purgeable cuts in CPLEX](https://discourse.julialang.org/t/add-local-and-purgeable-cuts-in-cplex/99378)

<div class="topic-metadata">

**Author:** [@Zacharie\_ALES](https://discourse.julialang.org/u/Zacharie_ALES)\
**Replies:** 4\
**Last updated:** [May 25, 2023, 7:48pm UTC](https://discourse.julialang.org/t/add-local-and-purgeable-cuts-in-cplex/99378 "2023-05-25T19:48:43Z")

</div>

I am using CPLEX.jl and I add cuts in a callback with this syntax: con = @build\_constraint(x \<= 0) MOI.submit(myModel, MOI.UserCut(cb\_data), con) CPLEX library normally has several parameters when addin…

---

## [MethodOfLines discretization error: missing initial conditions](https://discourse.julialang.org/t/methodoflines-discretization-error-missing-initial-conditions/98828)

<div class="topic-metadata">

**Author:** [@A\_09](https://discourse.julialang.org/u/A_09)\
**Replies:** 8\
**Last updated:** [May 25, 2023, 2:38pm UTC](https://discourse.julialang.org/t/methodoflines-discretization-error-missing-initial-conditions/98828 "2023-05-25T14:38:41Z")

</div>

I have developed a code for solving differential equations and I have been trying to solve it using the ModelingToolkit package and the MethodOfLines: begin @parameters t, r, x \`@variables T(…) Dr=Differential(r) Drr…

---

## [Adding NL expressions to an AffExpr type Vector](https://discourse.julialang.org/t/adding-nl-expressions-to-an-affexpr-type-vector/99279)

<div class="topic-metadata">

**Author:** [@PatrickeTownsend](https://discourse.julialang.org/u/PatrickeTownsend)\
**Replies:** 5\
**Last updated:** [May 25, 2023, 8:32am UTC](https://discourse.julialang.org/t/adding-nl-expressions-to-an-affexpr-type-vector/99279 "2023-05-25T08:32:23Z")

</div>

Hello again everybody, I’m trying to generate a Vector where which element is a NL expression, here is the code where I’m trying to implement it. register(rocket2d\_hs\_2, :StateFunc, 10, StateFunc; autodiff=true) x\_c = …

---

## [Error precompiling Plots.jl](https://discourse.julialang.org/t/error-precompiling-plots-jl/99349)

<div class="topic-metadata">

**Author:** [@leonbello](https://discourse.julialang.org/u/leonbello)\
**Replies:** 0\
**Last updated:** [May 24, 2023, 8:14pm UTC](https://discourse.julialang.org/t/error-precompiling-plots-jl/99349 "2023-05-24T20:14:58Z")

</div>

I am getting a weird precompiling warning each time I’m trying to use Plots.jl: \[ Info: Precompiling Plots \[91a5bcdd-55d7-5caf-9e0b-520d859cae80\] ┌ Warning: The call to compilecache failed to create a usable precompiled…

---

## [Solving different parts of state vector with different schemes/solvers](https://discourse.julialang.org/t/solving-different-parts-of-state-vector-with-different-schemes-solvers/99305)

<div class="topic-metadata">

**Author:** [@p\_f](https://discourse.julialang.org/u/p_f)\
**Replies:** 1\
**Last updated:** [May 24, 2023, 12:06am UTC](https://discourse.julialang.org/t/solving-different-parts-of-state-vector-with-different-schemes-solvers/99305 "2023-05-24T00:06:20Z")

</div>

Hi all, I hope this question finds you well. I have two state vectors X1 and X2 that comprise my total state X = \[X1; X2\]. X1 evolves according to dX1 = f(X1,X2) and X2 evolves according to dX2 = g(X2) - h(X1,X2,dX1) …

---

## [Invalid Argument Error on 3D Array](https://discourse.julialang.org/t/invalid-argument-error-on-3d-array/99147)

<div class="topic-metadata">

**Author:** [@huiyuxie](https://discourse.julialang.org/u/huiyuxie)\
**Replies:** 4\
**Last updated:** [May 23, 2023, 10:26pm UTC](https://discourse.julialang.org/t/invalid-argument-error-on-3d-array/99147 "2023-05-23T22:26:23Z")

</div>

Hi! I am working on using CUDA.jl to write kernels for 1D, 2D, and 3D arrays. The kernel worked well for 1D and 2D arrays and here is the 2D code. using CUDA function gpu\_add1!(y, x) index\_i = (blockIdx().x - 1) \* blo…

---

## [Elliptic functions of complex argument](https://discourse.julialang.org/t/elliptic-functions-of-complex-argument/51876)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 8\
**Last updated:** [May 23, 2023, 8:42pm UTC](https://discourse.julialang.org/t/elliptic-functions-of-complex-argument/51876 "2023-05-23T20:42:52Z")

</div>

Does anyone know a good package where Elliptic functions are implemented for complex values of the argument? May be some C or Fortran package that can be easily called from Julia? I know that there is the package Ellipt…

---

## [Copy of Image](https://discourse.julialang.org/t/copy-of-image/99186)

<div class="topic-metadata">

**Author:** [@SergeantMike67](https://discourse.julialang.org/u/SergeantMike67)\
**Replies:** 3\
**Last updated:** [May 23, 2023, 8:40pm UTC](https://discourse.julialang.org/t/copy-of-image/99186 "2023-05-23T20:40:33Z")

</div>

I want to take an image and convert all colors to white leaving only the black pixels. I wrote the following code using Images pix=“” for pixel in pix

---

## [Using CPLEX (solver dependent) callbacks for custom branching strategy in Julia](https://discourse.julialang.org/t/using-cplex-solver-dependent-callbacks-for-custom-branching-strategy-in-julia/99054)

<div class="topic-metadata">

**Author:** [@valdemarsoegaard](https://discourse.julialang.org/u/valdemarsoegaard)\
**Replies:** 6\
**Last updated:** [May 23, 2023, 7:01pm UTC](https://discourse.julialang.org/t/using-cplex-solver-dependent-callbacks-for-custom-branching-strategy-in-julia/99054 "2023-05-23T19:01:18Z")

</div>

Greetings! I am working on my master thesis on a large-scale flow problem, where I have implemented a surrogate model derived from a neural network in the form of a set of mixed integer linear constraints which replaces…

---

## [Turing checkpointing by callbacks](https://discourse.julialang.org/t/turing-checkpointing-by-callbacks/99293)

<div class="topic-metadata">

**Author:** [@astro-kevin](https://discourse.julialang.org/u/astro-kevin)\
**Replies:** 0\
**Last updated:** [May 23, 2023, 3:42pm UTC](https://discourse.julialang.org/t/turing-checkpointing-by-callbacks/99293 "2023-05-23T15:42:28Z")

</div>

How does one save a chain via callbacks in Turing? Right now, I have something like: function checkpoint(rng, model, sampler, sample, state, i; kwargs...) if i % 1000 == 0 serialize("testchainfull$i", chn) …

---

## [Struggling with lighting on GLMakie Meshes](https://discourse.julialang.org/t/struggling-with-lighting-on-glmakie-meshes/98678)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 8\
**Last updated:** [May 23, 2023, 3:20pm UTC](https://discourse.julialang.org/t/struggling-with-lighting-on-glmakie-meshes/98678 "2023-05-23T15:20:48Z")

</div>

Can anyone point me to an up to date resource on lighting meshes in GLMakie? Whatever I try at the moment results in a completely flat color, with no way to percieve depth.

---

## [Simple question about priors in bayesian analysis](https://discourse.julialang.org/t/simple-question-about-priors-in-bayesian-analysis/97255)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 4\
**Last updated:** [May 23, 2023, 3:00pm UTC](https://discourse.julialang.org/t/simple-question-about-priors-in-bayesian-analysis/97255 "2023-05-23T15:00:12Z")

</div>

Hello. Imagine I want to use a small dataset (from an experiment) to fit a bayesian model. Is it right if I first apply that model to a large dataset (such as the public health service) and use the output as the prior …

---

## [Getter that returns all optimizer attributes](https://discourse.julialang.org/t/getter-that-returns-all-optimizer-attributes/99113)

<div class="topic-metadata">

**Author:** [@raphaelsaavedra](https://discourse.julialang.org/u/raphaelsaavedra)\
**Replies:** 2\
**Last updated:** [May 23, 2023, 12:28pm UTC](https://discourse.julialang.org/t/getter-that-returns-all-optimizer-attributes/99113 "2023-05-23T12:28:05Z")

</div>

I couldn’t find in the JuMP docs how to get all optimizer attributes from a solver. There’s the following, which allows you to get one particular attribute: get\_attribute(model::Model, attr::MOI.AbstractModelAttribute) …

---

## [HTTP hangs indefinitely for certain sites](https://discourse.julialang.org/t/http-hangs-indefinitely-for-certain-sites/98585)

<div class="topic-metadata">

**Author:** [@bhalpin](https://discourse.julialang.org/u/bhalpin)\
**Replies:** 4\
**Last updated:** [May 23, 2023, 12:26pm UTC](https://discourse.julialang.org/t/http-hangs-indefinitely-for-certain-sites/98585 "2023-05-23T12:26:40Z")

</div>

I’m using HTTP to talk to the Mastodon API, which involves connecting to many sites, many of which do not actually run the API (any more). For a very few sites (but not zero), HTTP.get() hangs, apparently indefinitely. F…

---

## [Replace Values in a DataFrames Column with Another Value](https://discourse.julialang.org/t/replace-values-in-a-dataframes-column-with-another-value/79548)

<div class="topic-metadata">

**Author:** [@Lamis\_Njeh](https://discourse.julialang.org/u/Lamis_Njeh)\
**Replies:** 19\
**Last updated:** [May 23, 2023, 9:21am UTC](https://discourse.julialang.org/t/replace-values-in-a-dataframes-column-with-another-value/79548 "2023-05-23T09:21:21Z")

</div>

In my dataframe I have several columns which values are string I would like to extract those values and then doing it’s preprocessing Thnak you for your help

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

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