# Modelling & Simulations

**URL:** https://discourse.julialang.org/c/domain/models/21.md?page=12

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

**Page:** 13

---

## [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…

---

## [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…

---

## [Identical samples during mcmc run in Turing.jl with NUTS algorithm](https://discourse.julialang.org/t/identical-samples-during-mcmc-run-in-turing-jl-with-nuts-algorithm/125361)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 0\
**Last updated:** [January 29, 2025, 8:37pm UTC](https://discourse.julialang.org/t/identical-samples-during-mcmc-run-in-turing-jl-with-nuts-algorithm/125361 "2025-01-29T20:37:01Z")

</div>

Hello Everyone, Im running some differential Equation based model for inference using Turing.jl Im running 3 chains in parallel. Following result is with 2000 warmup and 2000 samples. Though Im not sure whats going on …

---

## [How can I define a vector in ModelingToolkit](https://discourse.julialang.org/t/how-can-i-define-a-vector-in-modelingtoolkit/107278)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [January 29, 2025, 11:12am UTC](https://discourse.julialang.org/t/how-can-i-define-a-vector-in-modelingtoolkit/107278 "2025-01-29T11:12:55Z")

</div>

The following code fails: # Example one: # Falling mass. using ModelingToolkit, OrdinaryDiffEq G\_EARTH = Float64\[0.0, 0.0, -9.81\] # gravitational acceleration # model @variables t pos(t)\[1:3\]=\[0.0, 0.0, 0.0\] @va…

---

## [Solve discretized PDE with new initial conditions](https://discourse.julialang.org/t/solve-discretized-pde-with-new-initial-conditions/125319)

<div class="topic-metadata">

**Author:** [@oswaldo](https://discourse.julialang.org/u/oswaldo)\
**Replies:** 0\
**Last updated:** [January 28, 2025, 7:40pm UTC](https://discourse.julialang.org/t/solve-discretized-pde-with-new-initial-conditions/125319 "2025-01-28T19:40:46Z")

</div>

Hi I’m discretizing a PDE system using MethodOfLines.jl with mixed boundary conditions. It works well. I would like to solve the discretized PDE (ODE) system with new initial conditions (at each discretized point). I do n…

---

## [Using Automatic Differentiation with FinEtoolsFlexStructures.jl](https://discourse.julialang.org/t/using-automatic-differentiation-with-finetoolsflexstructures-jl/125198)

<div class="topic-metadata">

**Author:** [@Edan\_Lazerson](https://discourse.julialang.org/u/Edan_Lazerson)\
**Replies:** 2\
**Last updated:** [January 27, 2025, 6:32pm UTC](https://discourse.julialang.org/t/using-automatic-differentiation-with-finetoolsflexstructures-jl/125198 "2025-01-27T18:32:30Z")

</div>

Hello everyone, I am exploring the use of automatic differentiation (AD) with the FinEtoolsFlexStructures.jl package and would like to know if anyone has experience with this. Specifically, I aim to compute the derivati…

---

## [Modeling Toolkit - parameters type conversion issue](https://discourse.julialang.org/t/modeling-toolkit-parameters-type-conversion-issue/125255)

<div class="topic-metadata">

**Author:** [@NinaOmejc](https://discourse.julialang.org/u/NinaOmejc)\
**Replies:** 0\
**Last updated:** [January 27, 2025, 10:58am UTC](https://discourse.julialang.org/t/modeling-toolkit-parameters-type-conversion-issue/125255 "2025-01-27T10:58:12Z")

</div>

I am trying to optimize my code and remove types Any. However, I am stuck with one within Modeling Toolkit. The code below shows the problem. When calling System function, sometimes I get parameters of type “Vector{Num}”…

---

## [Order for finite elements when using Gridap and Gmsh](https://discourse.julialang.org/t/order-for-finite-elements-when-using-gridap-and-gmsh/125094)

<div class="topic-metadata">

**Author:** [@mikeliux](https://discourse.julialang.org/u/mikeliux)\
**Replies:** 9\
**Last updated:** [January 27, 2025, 8:22am UTC](https://discourse.julialang.org/t/order-for-finite-elements-when-using-gridap-and-gmsh/125094 "2025-01-27T08:22:18Z")

</div>

I am experimenting with Gridap package for solving partial differential equations (PDEs) in Julia. I am creating my meshes with GMSH, using the API provided by the Gmsh package in Julia. I save them as \*.msh files, and t…

---

## [Vacuum & Substrate](https://discourse.julialang.org/t/vacuum-substrate/125161)

<div class="topic-metadata">

**Author:** [@Vincenzo\_Pierro](https://discourse.julialang.org/u/Vincenzo_Pierro)\
**Replies:** 5\
**Last updated:** [January 25, 2025, 9:46am UTC](https://discourse.julialang.org/t/vacuum-substrate/125161 "2025-01-25T09:46:06Z")

</div>

how I can define a infinite layer of Vacuum. It is no clear the substrate how can be defined in the structure

---

## [Agents abmexploration callback errors in "on hover"](https://discourse.julialang.org/t/agents-abmexploration-callback-errors-in-on-hover/124675)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 7\
**Last updated:** [January 22, 2025, 10:38am UTC](https://discourse.julialang.org/t/agents-abmexploration-callback-errors-in-on-hover/124675 "2025-01-22T10:38:18Z")

</div>

Hi. I’m struggling a bit with understanding all the details of using abmexploration with the Agents package. I got occasional crashes with small models, but they greatly increased with large numbers of agents. Finally, I…

---

## [Errors in Discretization in ModelingToolkit.jl](https://discourse.julialang.org/t/errors-in-discretization-in-modelingtoolkit-jl/124403)

<div class="topic-metadata">

**Author:** [@JustPickedThisUp](https://discourse.julialang.org/u/JustPickedThisUp)\
**Replies:** 5\
**Last updated:** [January 21, 2025, 10:25am UTC](https://discourse.julialang.org/t/errors-in-discretization-in-modelingtoolkit-jl/124403 "2025-01-21T10:25:17Z")

</div>

Hello, I’ve been trying to solve this time dependent Schrodingers equation with these conditions: It keeps throwing up errors like AssertionError: There must be the same number of equations and unknowns, got 2 equat…

---

## [How to get started modeling systems in SciML](https://discourse.julialang.org/t/how-to-get-started-modeling-systems-in-sciml/124780)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 2\
**Last updated:** [January 17, 2025, 9:26am UTC](https://discourse.julialang.org/t/how-to-get-started-modeling-systems-in-sciml/124780 "2025-01-17T09:26:59Z")

</div>

Hi everyone. I would like to port a “systems modeling” approach from R into SciML and have some questions about how to start. Let me describe some background. Several years ago I and coauthors worked out a method to simu…

---

## [Improving DAE performance](https://discourse.julialang.org/t/improving-dae-performance/124775)

<div class="topic-metadata">

**Author:** [@clm](https://discourse.julialang.org/u/clm)\
**Replies:** 5\
**Last updated:** [January 17, 2025, 9:26am UTC](https://discourse.julialang.org/t/improving-dae-performance/124775 "2025-01-17T09:26:54Z")

</div>

I’m looking to solve two implicitly-defined nonlinear ODEs. The system diverges toward the final integration z=H, but in a way that I expect, T\\sim1/(H-z) and u\\sim\\log(H-z), plus constants. What I’m hoping to do is int…

---

## [Handling of saturated integrator with anti-windeup](https://discourse.julialang.org/t/handling-of-saturated-integrator-with-anti-windeup/124819)

<div class="topic-metadata">

**Author:** [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Replies:** 7\
**Last updated:** [January 16, 2025, 7:40pm UTC](https://discourse.julialang.org/t/handling-of-saturated-integrator-with-anti-windeup/124819 "2025-01-16T19:40:32Z")

</div>

I want to model a saturated integrator T\\dot{u} ~ = r\_\\mathrm{ref}-u in which u follows r\_\\mathrm{ref} but is also bounded to stay within u\\in(u\_\\mathrm{min}, u\_\\mathrm{max}). To prevent windeup effects, the integrato…

---

## [HomotopyContinuation: Duffing Revisited: Plotting Solution from Multiple Paths](https://discourse.julialang.org/t/homotopycontinuation-duffing-revisited-plotting-solution-from-multiple-paths/124735)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 3\
**Last updated:** [January 15, 2025, 5:03pm UTC](https://discourse.julialang.org/t/homotopycontinuation-duffing-revisited-plotting-solution-from-multiple-paths/124735 "2025-01-15T17:03:16Z")

</div>

I am seeking to plot the solutions that HomotopyContinuation.jl returns in case of multiple solution branches. Same question reformulated: I am seeking to reproduce BifurcationKit: Duffing Equation: Time-Harmonic: Singl…

---

## [Unable to reproduce a simple bifurcation diagram](https://discourse.julialang.org/t/unable-to-reproduce-a-simple-bifurcation-diagram/124738)

<div class="topic-metadata">

**Author:** [@vembha](https://discourse.julialang.org/u/vembha)\
**Replies:** 8\
**Last updated:** [January 15, 2025, 6:37am UTC](https://discourse.julialang.org/t/unable-to-reproduce-a-simple-bifurcation-diagram/124738 "2025-01-15T06:37:56Z")

</div>

Hello, New to BifurcationKit.jl here! I have a simple ODE-based model from an article (Fig. 2A in https://www.pnas.org/doi/10.1073/pnas.1419162112), which is known to have three bifurcation points when varied over a par…

---

## [Modifying time in sol after solve() function using DifferentialEquations.jl](https://discourse.julialang.org/t/modifying-time-in-sol-after-solve-function-using-differentialequations-jl/124647)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 4\
**Last updated:** [January 10, 2025, 10:24pm UTC](https://discourse.julialang.org/t/modifying-time-in-sol-after-solve-function-using-differentialequations-jl/124647 "2025-01-10T22:24:49Z")

</div>

Hi, I was wondering, using DifferentialEquations.jl (and co), if there is an easy way to modify the t in sol object after it is output and to synchronise it with the interpolation? I have tried to simply modify it with…

---

## [Allowing simultaneous ContinuousCallback to trigger (DifferentialEquations.jl)](https://discourse.julialang.org/t/allowing-simultaneous-continuouscallback-to-trigger-differentialequations-jl/124594)

<div class="topic-metadata">

**Author:** [@lte678](https://discourse.julialang.org/u/lte678)\
**Replies:** 1\
**Last updated:** [January 10, 2025, 3:14pm UTC](https://discourse.julialang.org/t/allowing-simultaneous-continuouscallback-to-trigger-differentialequations-jl/124594 "2025-01-10T15:14:31Z")

</div>

I am working on an application where ContinuousCallbacks are dynamically generated based on a user configuration. Since I have “no control” over these, collisions can and do occur. For example if two of the conditions ha…

---

## [How to use sol.retcode to catch ODE instability?](https://discourse.julialang.org/t/how-to-use-sol-retcode-to-catch-ode-instability/124274)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 3\
**Last updated:** [January 2, 2025, 10:08am UTC](https://discourse.julialang.org/t/how-to-use-sol-retcode-to-catch-ode-instability/124274 "2025-01-02T10:08:07Z")

</div>

I would like to make an interactive plot with GLMakie. There are some instances when the ODEs generate instability. I would like to plot a label “INSTABILITY DETECTED” in the plot itself when instability occurs. I under…

---

## [Recommendations for Julia Packages for FEA to be used in shape and topology optimization of 3D Shell Structures](https://discourse.julialang.org/t/recommendations-for-julia-packages-for-fea-to-be-used-in-shape-and-topology-optimization-of-3d-shell-structures/124270)

<div class="topic-metadata">

**Author:** [@Edan\_Lazerson](https://discourse.julialang.org/u/Edan_Lazerson)\
**Replies:** 6\
**Last updated:** [December 31, 2024, 6:57pm UTC](https://discourse.julialang.org/t/recommendations-for-julia-packages-for-fea-to-be-used-in-shape-and-topology-optimization-of-3d-shell-structures/124270 "2024-12-31T18:57:55Z")

</div>

Hello everyone, I’m working on my master’s project, which involves shape and topology optimization for a 3D shell structure. Initially, I plan to work within the linear static regime. Instead of writing my own finite el…

---

## [Gridap & Richards equation](https://discourse.julialang.org/t/gridap-richards-equation/123961)

<div class="topic-metadata">

**Author:** [@Fabio\_Zottele](https://discourse.julialang.org/u/Fabio_Zottele)\
**Replies:** 5\
**Last updated:** [December 24, 2024, 10:58pm UTC](https://discourse.julialang.org/t/gridap-richards-equation/123961 "2024-12-24T22:58:30Z")

</div>

Hi all. I am rather new to julia and totally new to Gridap. Before starting a new time and energy consuming project I would like to know if Gridap is suitable for solving “highly non linear problem” (the Richards equatio…

---

## [Getting started with the Agents tutorial](https://discourse.julialang.org/t/getting-started-with-the-agents-tutorial/124063)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 3\
**Last updated:** [December 23, 2024, 6:55pm UTC](https://discourse.julialang.org/t/getting-started-with-the-agents-tutorial/124063 "2024-12-23T18:55:34Z")

</div>

Hi, I just can’t seem to find out how to the Agents.jl tutorial up and running. I’ve used previous incarnations, but something’s not working this time - it’s been about a year since I last used it. The problems start wi…

---

## [ODESystem not handeling dynamic parameters](https://discourse.julialang.org/t/odesystem-not-handeling-dynamic-parameters/124118)

<div class="topic-metadata">

**Author:** [@Sushrut\_Deshpande](https://discourse.julialang.org/u/Sushrut_Deshpande)\
**Replies:** 0\
**Last updated:** [December 23, 2024, 12:11pm UTC](https://discourse.julialang.org/t/odesystem-not-handeling-dynamic-parameters/124118 "2024-12-23T12:11:06Z")

</div>

Hello, I have a toy problem where I have a parameter that depends on time using ModelingToolkit, DifferentialEquations using ModelingToolkit: t\_nounits as t, D\_nounits as D function test(;name) vars = @variables b…

---

## [Number of differential equation / degree of freedom](https://discourse.julialang.org/t/number-of-differential-equation-degree-of-freedom/123644)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 1\
**Last updated:** [December 19, 2024, 8:48pm UTC](https://discourse.julialang.org/t/number-of-differential-equation-degree-of-freedom/123644 "2024-12-19T20:48:36Z")

</div>

Today I was working on a (ModelingToolkit) problem with a single degree of freedom. But formulating everything with a single differential equation (plus supporting simple equations) turns out somewhat complicated / ugly.…

---

## [How fast does a model has to be for NMPC](https://discourse.julialang.org/t/how-fast-does-a-model-has-to-be-for-nmpc/120694)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 64\
**Last updated:** [December 19, 2024, 8:13am UTC](https://discourse.julialang.org/t/how-fast-does-a-model-has-to-be-for-nmpc/120694 "2024-12-19T08:13:11Z")

</div>

How many times faster than real-time does a model has to be to be feasible for using model predictive control? Assumptions: 20Hz update rate 5s required horizon controller with three scalar outputs Of course this dep…

---

## [Domains with callable parameters](https://discourse.julialang.org/t/domains-with-callable-parameters/123816)

<div class="topic-metadata">

**Author:** [@jmaedler](https://discourse.julialang.org/u/jmaedler)\
**Replies:** 2\
**Last updated:** [December 18, 2024, 1:53pm UTC](https://discourse.julialang.org/t/domains-with-callable-parameters/123816 "2024-12-18T13:53:30Z")

</div>

Hi folks, I am currently trying to define Domains with property data functions for the purpose of process simulation in ModelingToolkit.jl. To get started, I took the hydraulic example from the Domains doc page and modi…

---

## [BifurcationKit: Duffing Equation: Time-Harmonic: Single Harmonic](https://discourse.julialang.org/t/bifurcationkit-duffing-equation-time-harmonic-single-harmonic/123937)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 1\
**Last updated:** [December 17, 2024, 10:53pm UTC](https://discourse.julialang.org/t/bifurcationkit-duffing-equation-time-harmonic-single-harmonic/123937 "2024-12-17T22:53:05Z")

</div>

Amazing how easy this was! Apologies for the rusty documentation (in progress). """ input: x: x\[1\] and x\[2\] amplitude of cos and sin mode of single harmonic anzats input: p: angular frequency of the driving excitation…

---

## [Crossing conditions in ModelingToolkit @mtkmodel macro](https://discourse.julialang.org/t/crossing-conditions-in-modelingtoolkit-mtkmodel-macro/123780)

<div class="topic-metadata">

**Author:** [@nurban](https://discourse.julialang.org/u/nurban)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 3:30pm UTC](https://discourse.julialang.org/t/crossing-conditions-in-modelingtoolkit-mtkmodel-macro/123780 "2024-12-16T15:30:12Z")

</div>

I want to add a continuous event trigger to my @mtkmodel, with a downcrossing condition. Without the crossing direction condition, I think this should look like @mtkmodel odesys begin @variables begin X(t) …

---

## [BifurcationKit: Mesh adaptation error](https://discourse.julialang.org/t/bifurcationkit-mesh-adaptation-error/123876)

<div class="topic-metadata">

**Author:** [@mmplac14](https://discourse.julialang.org/u/mmplac14)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 11:41am UTC](https://discourse.julialang.org/t/bifurcationkit-mesh-adaptation-error/123876 "2024-12-16T11:41:37Z")

</div>

Hi, I am running a Periodic Orbit continuation but it is failing with this error: ┌ Error: \[Mesh-adaptation\]. The mesh is non monotonic! Please report the error to the website of BifurcationKit.jl └ @ BifurcationKit ~…

[Previous page](https://discourse.julialang.org/c/domain/models/21.md?page=11)

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