# Modelling & Simulations

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

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

**Page:** 8

---

## [\[ANN\] ModelingToolkitTolerances.jl](https://discourse.julialang.org/t/ann-modelingtoolkittolerances-jl/131460)

<div class="topic-metadata">

**Author:** [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Replies:** 2\
**Last updated:** [August 8, 2025, 11:24am UTC](https://discourse.julialang.org/t/ann-modelingtoolkittolerances-jl/131460 "2025-08-08T11:24:41Z")

</div>

Very happy to announce a new package I’ve been working on to help debug ModelingToolkit.jl models. Using the power of Julia’s autodiff and the symbolics in ModelingToolkit.jl, it’s possible to estimate the error (or r…

---

## [Catalyst.jl - @observables usage](https://discourse.julialang.org/t/catalyst-jl-observables-usage/131377)

<div class="topic-metadata">

**Author:** [@Mindy](https://discourse.julialang.org/u/Mindy)\
**Replies:** 3\
**Last updated:** [August 6, 2025, 2:22pm UTC](https://discourse.julialang.org/t/catalyst-jl-observables-usage/131377 "2025-08-06T14:22:39Z")

</div>

Hi, I have a question about using @observables inside @reaction\_network - How to write the observable contains both parameters and species? For example, what’s the correct syntax for writing Tree? function model() …

---

## [Issue with recreating MTK problems](https://discourse.julialang.org/t/issue-with-recreating-mtk-problems/131344)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 4\
**Last updated:** [August 5, 2025, 8:45am UTC](https://discourse.julialang.org/t/issue-with-recreating-mtk-problems/131344 "2025-08-05T08:45:00Z")

</div>

Hi, I am playing with a simple system consisting of a first-order dynamics and a PI-controller. The goal is to find a good tuning of the controller using optimization, with Integral Square Error as the objective functio…

---

## [Dyad vs Dyad](https://discourse.julialang.org/t/dyad-vs-dyad/131330)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 0\
**Last updated:** [August 4, 2025, 12:15pm UTC](https://discourse.julialang.org/t/dyad-vs-dyad/131330 "2025-08-04T12:15:56Z")

</div>

I have just noticed that besides Dyad, there is also Dyad (https://www.dyad.sh). By the way, both referring to AI. I bet that it will happen frequently that people searching for one will be directed to the other. But per…

---

## [Convergence Issues with Controllable Switch and Square Wave using MTK](https://discourse.julialang.org/t/convergence-issues-with-controllable-switch-and-square-wave-using-mtk/131264)

<div class="topic-metadata">

**Author:** [@junmorenodi99](https://discourse.julialang.org/u/junmorenodi99)\
**Replies:** 3\
**Last updated:** [August 3, 2025, 1:13am UTC](https://discourse.julialang.org/t/convergence-issues-with-controllable-switch-and-square-wave-using-mtk/131264 "2025-08-03T01:13:36Z")

</div>

Hi everyone, I am new to the Julia community and I’m interested in the applications of the ModelingToolkit package. In particular, I’m trying to simulate a switching circuit using an External Control Signal and a Cont…

---

## [Callback in DifferentialEquation.jl changes the \`p\` parameter vector. Is this expected behaviour?](https://discourse.julialang.org/t/callback-in-differentialequation-jl-changes-the-p-parameter-vector-is-this-expected-behaviour/131273)

<div class="topic-metadata">

**Author:** [@Vitor\_Patricio\_Canta](https://discourse.julialang.org/u/Vitor_Patricio_Canta)\
**Replies:** 3\
**Last updated:** [August 2, 2025, 9:33am UTC](https://discourse.julialang.org/t/callback-in-differentialequation-jl-changes-the-p-parameter-vector-is-this-expected-behaviour/131273 "2025-08-02T09:33:06Z")

</div>

This is a MWE showing that p defined outside of the integrator is also modified by the callback. Is this expected behaviour? Thanks, using OrdinaryDiffEq function rhs(du, u, p, t) V, Q, c\_in = p c = u\[1\] d…

---

## [Calling complete() adds differential constraints to algebraic extension of ReactionSystem](https://discourse.julialang.org/t/calling-complete-adds-differential-constraints-to-algebraic-extension-of-reactionsystem/131115)

<div class="topic-metadata">

**Author:** [@spackman](https://discourse.julialang.org/u/spackman)\
**Replies:** 2\
**Last updated:** [July 28, 2025, 2:07pm UTC](https://discourse.julialang.org/t/calling-complete-adds-differential-constraints-to-algebraic-extension-of-reactionsystem/131115 "2025-07-28T14:07:17Z")

</div>

Hey guys, I’m doing some experimentation with Catalyst.jl and algebraic equations to define systems where the system volume is not constant. This can occur when the major solvent is a reactant in appreciable quantities…

---

## [Catalyst.jl - updating kinetic parameters to be time-dependent after loading a reaction network](https://discourse.julialang.org/t/catalyst-jl-updating-kinetic-parameters-to-be-time-dependent-after-loading-a-reaction-network/130989)

<div class="topic-metadata">

**Author:** [@spackman](https://discourse.julialang.org/u/spackman)\
**Replies:** 12\
**Last updated:** [July 27, 2025, 8:23pm UTC](https://discourse.julialang.org/t/catalyst-jl-updating-kinetic-parameters-to-be-time-dependent-after-loading-a-reaction-network/130989 "2025-07-27T20:23:59Z")

</div>

Hi there, I am trying to build a ReactionSystem with time-varying parameters using ReactionNetworkImporters.jl function loadrxnetwork(). I want to initialize the network with placeholder time-varying kinetic parameters …

---

## [Smooth progress bar for multithreads sampling in turing.jl](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 6\
**Last updated:** [July 26, 2025, 1:13pm UTC](https://discourse.julialang.org/t/smooth-progress-bar-for-multithreads-sampling-in-turing-jl/130768 "2025-07-26T13:13:42Z")

</div>

Hello everyone, Im working with turing.jl and what I have noticed that when sampling multiple chains with mulithreads option. Progress bar show progress based on number of chains used for example if I use 3 chains then …

---

## [Help speeding up \`DiscreteProblem\`](https://discourse.julialang.org/t/help-speeding-up-discreteproblem/130986)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 5\
**Last updated:** [July 25, 2025, 2:48pm UTC](https://discourse.julialang.org/t/help-speeding-up-discreteproblem/130986 "2025-07-25T14:48:49Z")

</div>

Hi Everyone, I’m finding that using DiscreteProblem on my toy example is about 4x slower than a vanilla loop with pre-allocated output. DiscreteProblem version Base Julia version My model is as follows: function sir…

---

## [Dealing with type stability when nothing can be returned](https://discourse.julialang.org/t/dealing-with-type-stability-when-nothing-can-be-returned/131040)

<div class="topic-metadata">

**Author:** [@sea\_slug](https://discourse.julialang.org/u/sea_slug)\
**Replies:** 1\
**Last updated:** [July 25, 2025, 9:58am UTC](https://discourse.julialang.org/t/dealing-with-type-stability-when-nothing-can-be-returned/131040 "2025-07-25T09:58:53Z")

</div>

I have a relatively complex Agent Based Model (ABM) that I am profiling. One function in particular (get\_shark\_pos) is dominating the runtime according to the flame graph. I am surprised because the function is very simp…

---

## [Particle Filtering methods](https://discourse.julialang.org/t/particle-filtering-methods/130828)

<div class="topic-metadata">

**Author:** [@Tanya123](https://discourse.julialang.org/u/Tanya123)\
**Replies:** 9\
**Last updated:** [July 25, 2025, 6:07am UTC](https://discourse.julialang.org/t/particle-filtering-methods/130828 "2025-07-25T06:07:43Z")

</div>

Hi everyone! I’m new to data assimilation and working with particle filters. I have a model where the β function is sinusoidal and linearly advects over time. It’s a 2D field on an 80×80 grid with double bumps. I’m tryi…

---

## [RMSE vague in 2D particle filtering with LowLevelParticleFilters.jl?](https://discourse.julialang.org/t/rmse-vague-in-2d-particle-filtering-with-lowlevelparticlefilters-jl/131042)

<div class="topic-metadata">

**Author:** [@Tanya123](https://discourse.julialang.org/u/Tanya123)\
**Replies:** 1\
**Last updated:** [July 25, 2025, 6:37am UTC](https://discourse.julialang.org/t/rmse-vague-in-2d-particle-filtering-with-lowlevelparticlefilters-jl/131042 "2025-07-25T06:37:13Z")

</div>

Hi all, I’m applying particle filtering to a 2D linear advection problem (60x60 grid, 3600 states) using LowLevelParticleFilters.jl with: \*Particles: 10,000 \*Process noise: 0.01 \*Measurement noise: 0.1 at 100 random …

---

## [Solving a free-boundary PDE by mapping to a fixed domain](https://discourse.julialang.org/t/solving-a-free-boundary-pde-by-mapping-to-a-fixed-domain/131006)

<div class="topic-metadata">

**Author:** [@naoufelcre](https://discourse.julialang.org/u/naoufelcre)\
**Replies:** 0\
**Last updated:** [July 24, 2025, 2:21pm UTC](https://discourse.julialang.org/t/solving-a-free-boundary-pde-by-mapping-to-a-fixed-domain/131006 "2025-07-24T14:21:34Z")

</div>

Hello everyone, I’m trying to solve a 1-D Free Boundary PDE using Julia and it is my first time manipulating the language for such a complex problem so I apologize if this sounds trivial to most of you. Basically, the …

---

## [Catalyst.jl - what is the appropriate way to model equilibrium (i.e. pKa?)](https://discourse.julialang.org/t/catalyst-jl-what-is-the-appropriate-way-to-model-equilibrium-i-e-pka/130149)

<div class="topic-metadata">

**Author:** [@spackman](https://discourse.julialang.org/u/spackman)\
**Replies:** 8\
**Last updated:** [July 24, 2025, 11:28am UTC](https://discourse.julialang.org/t/catalyst-jl-what-is-the-appropriate-way-to-model-equilibrium-i-e-pka/130149 "2025-07-24T11:28:16Z")

</div>

Hello again, I’m working to add some additional equilibrium conditions to a reaction network, particularly pKa. I’m inclined to think that algebraic constraint equations are the appropriate choice here assuming that th…

---

## [Ideal Diode and Ideal Switch instability problem](https://discourse.julialang.org/t/ideal-diode-and-ideal-switch-instability-problem/107769)

<div class="topic-metadata">

**Author:** [@luca.andriotto](https://discourse.julialang.org/u/luca.andriotto)\
**Replies:** 11\
**Last updated:** [July 24, 2025, 9:44am UTC](https://discourse.julialang.org/t/ideal-diode-and-ideal-switch-instability-problem/107769 "2025-07-24T09:44:11Z")

</div>

Greetings, I am new to Julia community and, in particular, to the use of ModelingToolkit package. I would like to implement an IdealDiode component to be replaced by a short circuit when the controlled variable (i.e. i…

---

## [Sparsity of SimpleChains Errors](https://discourse.julialang.org/t/sparsity-of-simplechains-errors/130947)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 6\
**Last updated:** [July 23, 2025, 8:31pm UTC](https://discourse.julialang.org/t/sparsity-of-simplechains-errors/130947 "2025-07-23T20:31:58Z")

</div>

I’ve been playing around with SimpleChains.jl for potential use in a larger sparse model, but I’m having some issues figuring out how to obtain a sparsity pattern. After some testing with both SparseConnectivityTracer.jl…

---

## [Getting results until the point of nonconvergence in DAE system](https://discourse.julialang.org/t/getting-results-until-the-point-of-nonconvergence-in-dae-system/130897)

<div class="topic-metadata">

**Author:** [@total](https://discourse.julialang.org/u/total)\
**Replies:** 7\
**Last updated:** [July 22, 2025, 10:21am UTC](https://discourse.julialang.org/t/getting-results-until-the-point-of-nonconvergence-in-dae-system/130897 "2025-07-22T10:21:12Z")

</div>

Hello, I’m trying to simulate a DAE system with Sundials IDA solver. I implemented my controlvector with callbacks and it works just fine. However, depending on the controls I run into infeasible regions and the solver…

---

## [Symbolics.jl - Retrieving Differential Variables](https://discourse.julialang.org/t/symbolics-jl-retrieving-differential-variables/130891)

<div class="topic-metadata">

**Author:** [@Gray\_GALLANT](https://discourse.julialang.org/u/Gray_GALLANT)\
**Replies:** 2\
**Last updated:** [July 21, 2025, 8:18pm UTC](https://discourse.julialang.org/t/symbolics-jl-retrieving-differential-variables/130891 "2025-07-21T20:18:07Z")

</div>

Is there a way to retrieve differential variables from an expression using Symbolics.jl? For example, if I use get\_variables on Differential(t)(x(t)) it only returns x(t), but I need to get the differential part as well …

---

## [Control systems, pid, and high-order transfer functions](https://discourse.julialang.org/t/control-systems-pid-and-high-order-transfer-functions/130837)

<div class="topic-metadata">

**Author:** [@romain-chiap](https://discourse.julialang.org/u/romain-chiap)\
**Replies:** 7\
**Last updated:** [July 21, 2025, 10:26am UTC](https://discourse.julialang.org/t/control-systems-pid-and-high-order-transfer-functions/130837 "2025-07-21T10:26:06Z")

</div>

Hello, It’s specific to control systems and this is my first post, so I still decided to post under “new to Julia” as I might be asking beginner questions. I’m making a 1-dimension model of the PX4 cascaded control loo…

---

## [Very high memory use with DelayDifferentialEquations](https://discourse.julialang.org/t/very-high-memory-use-with-delaydifferentialequations/99862)

<div class="topic-metadata">

**Author:** [@jarias9](https://discourse.julialang.org/u/jarias9)\
**Replies:** 12\
**Last updated:** [July 21, 2025, 6:05am UTC](https://discourse.julialang.org/t/very-high-memory-use-with-delaydifferentialequations/99862 "2025-07-21T06:05:22Z")

</div>

I have a large PDE system that I originally was solving with an explicit ODE solver via ODEProblem with DiffEq.jl. I have added a component to that system that requires the time derivative info so I changed it to a DDE a…

---

## [Unhelpful interpolation for solution from differential equation](https://discourse.julialang.org/t/unhelpful-interpolation-for-solution-from-differential-equation/130857)

<div class="topic-metadata">

**Author:** [@miles-1](https://discourse.julialang.org/u/miles-1)\
**Replies:** 3\
**Last updated:** [July 20, 2025, 1:40am UTC](https://discourse.julialang.org/t/unhelpful-interpolation-for-solution-from-differential-equation/130857 "2025-07-20T01:40:23Z")

</div>

I am trying to use the solution from my differential equation to find local maxima. I am following the example found here, but am running into an issue. I have found that the interpolation of my solution is very poor. He…

---

## [Getting warning, but model works well](https://discourse.julialang.org/t/getting-warning-but-model-works-well/130850)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 5\
**Last updated:** [July 19, 2025, 2:11am UTC](https://discourse.julialang.org/t/getting-warning-but-model-works-well/130850 "2025-07-19T02:11:41Z")

</div>

I am getting this warning during mtkcompile, while I was not getting it before. It might be related to an update in StructuralTransformations. The model still works fine. How can I disable the warning? ┌ Warning: Intern…

---

## [Energy conserving (or symplectic) solvers for differential equations?](https://discourse.julialang.org/t/energy-conserving-or-symplectic-solvers-for-differential-equations/130840)

<div class="topic-metadata">

**Author:** [@Flow](https://discourse.julialang.org/u/Flow)\
**Replies:** 2\
**Last updated:** [July 18, 2025, 10:52am UTC](https://discourse.julialang.org/t/energy-conserving-or-symplectic-solvers-for-differential-equations/130840 "2025-07-18T10:52:41Z")

</div>

Hello there, I am relatively new to Julia and am currently trying to calculate trajectories of a physical system on GPUs, which in generally works like a charm, as long as I do not include an minimum coupling term in my…

---

## [BifurcationKit - Error using continuation()](https://discourse.julialang.org/t/bifurcationkit-error-using-continuation/130737)

<div class="topic-metadata">

**Author:** [@jackwoodruff](https://discourse.julialang.org/u/jackwoodruff)\
**Replies:** 2\
**Last updated:** [July 15, 2025, 11:11am UTC](https://discourse.julialang.org/t/bifurcationkit-error-using-continuation/130737 "2025-07-15T11:11:36Z")

</div>

Hello, I am new to Julia and trying to use BifurcationKit to do some continuation analysis. However, I have yet to get it working for my system of ODEs. Having debugged a few errors, I am now getting this one that I cann…

---

## [Modeling Toolkit: mtkcompile taking forever for large systems](https://discourse.julialang.org/t/modeling-toolkit-mtkcompile-taking-forever-for-large-systems/130646)

<div class="topic-metadata">

**Author:** [@njacki](https://discourse.julialang.org/u/njacki)\
**Replies:** 8\
**Last updated:** [July 15, 2025, 8:42am UTC](https://discourse.julialang.org/t/modeling-toolkit-mtkcompile-taking-forever-for-large-systems/130646 "2025-07-15T08:42:47Z")

</div>

I recently re-coded an advection-reaction biogeochemical box model using ModelingToolkit.jl, that allows a smooth transition form papers’ equations to actual code and make it easily understandable. I build the model in a…

---

## [How to extract the dependency (also called causal) graph of a ModelingToolkit.jl ODE model?](https://discourse.julialang.org/t/how-to-extract-the-dependency-also-called-causal-graph-of-a-modelingtoolkit-jl-ode-model/130576)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 4\
**Last updated:** [July 9, 2025, 7:31pm UTC](https://discourse.julialang.org/t/how-to-extract-the-dependency-also-called-causal-graph-of-a-modelingtoolkit-jl-ode-model/130576 "2025-07-09T19:31:17Z")

</div>

I am trying to create the dependency (sometimes called causal) graph of a complex ODE System I have created symbolically with MTK. To do this I am using the dependency graph functionality of MTK \[found here\], however I c…

---

## [Combining \`SparseDiffTools.jl\` and \`OrdinaryDiffEq.jl\`](https://discourse.julialang.org/t/combining-sparsedifftools-jl-and-ordinarydiffeq-jl/130555)

<div class="topic-metadata">

**Author:** [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Replies:** 8\
**Last updated:** [July 9, 2025, 10:53am UTC](https://discourse.julialang.org/t/combining-sparsedifftools-jl-and-ordinarydiffeq-jl/130555 "2025-07-09T10:53:43Z")

</div>

I managed to get the sparsity structure detection (via SparseDiffTools.j) of the rhs! function (the RHS of the ODE problem fed into OrdinaryDiffEq.jl) for our code Trixi.jl to run. Can I supply the cache = sparse\_jacob…

---

## [Benchmarking slow agents.jl code](https://discourse.julialang.org/t/benchmarking-slow-agents-jl-code/129871)

<div class="topic-metadata">

**Author:** [@geoffdougherty](https://discourse.julialang.org/u/geoffdougherty)\
**Replies:** 8\
**Last updated:** [July 9, 2025, 1:52am UTC](https://discourse.julialang.org/t/benchmarking-slow-agents-jl-code/129871 "2025-07-09T01:52:08Z")

</div>

Hi, all. I am relatively new to Agents.jl and am noticing that my model is running quite slowly compared to similar models using other platforms. Following the performance advice in the Agents.jl documentation, I’d like …

---

## [Issue with scoping rules of parameter (and variable) declaration in components (Catalyst vs ModelingToolkit)](https://discourse.julialang.org/t/issue-with-scoping-rules-of-parameter-and-variable-declaration-in-components-catalyst-vs-modelingtoolkit/130232)

<div class="topic-metadata">

**Author:** [@Cedric\_Lhoussaine](https://discourse.julialang.org/u/Cedric_Lhoussaine)\
**Replies:** 8\
**Last updated:** [July 2, 2025, 3:19pm UTC](https://discourse.julialang.org/t/issue-with-scoping-rules-of-parameter-and-variable-declaration-in-components-catalyst-vs-modelingtoolkit/130232 "2025-07-02T15:19:18Z")

</div>

Working with Catalyst v15.0.8 and ModelingToolkit v9.80.5, I found a strange and misleading behavior w.r.t. parameter declarations in reaction components: suppose I declare a parameter (k) in two different components (n…

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

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