# Modelling & Simulations

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

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

**Page:** 3

---

## [How to get a numeric value for equations of an MTK system with given numeric inputs](https://discourse.julialang.org/t/how-to-get-a-numeric-value-for-equations-of-an-mtk-system-with-given-numeric-inputs/136191)

<div class="topic-metadata">

**Author:** [@mark.garnett](https://discourse.julialang.org/u/mark.garnett)\
**Replies:** 2\
**Last updated:** [March 13, 2026, 8:05pm UTC](https://discourse.julialang.org/t/how-to-get-a-numeric-value-for-equations-of-an-mtk-system-with-given-numeric-inputs/136191 "2026-03-13T20:05:34Z")

</div>

Hi all, new to Julia here. I have created a decently sized MTK system out of connected components. (Thermal fluid system, components connected via ports. That part is several hundred lines of code so I don’t want to post…

---

## [Mutation attempt in \`ContinuousCallback\` when solving \`SDEProblem{StaticArraysCore.SVector{2, Float64}}\`](https://discourse.julialang.org/t/mutation-attempt-in-continuouscallback-when-solving-sdeproblem-staticarrayscore-svector-2-float64/136168)

<div class="topic-metadata">

**Author:** [@NoFishLikeIan](https://discourse.julialang.org/u/NoFishLikeIan)\
**Replies:** 1\
**Last updated:** [March 13, 2026, 11:37am UTC](https://discourse.julialang.org/t/mutation-attempt-in-continuouscallback-when-solving-sdeproblem-staticarrayscore-svector-2-float64/136168 "2026-03-13T11:37:29Z")

</div>

I have an SDE where the drift function f is defined out-of-place and the state is a StaticArrays.SVector. I need to terminate! the integration using a ContinuousCallback. This raises an error, as the StochasticDiffEq pac…

---

## [Bridging MTK and JuMP](https://discourse.julialang.org/t/bridging-mtk-and-jump/136148)

<div class="topic-metadata">

**Author:** [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Replies:** 5\
**Last updated:** [March 12, 2026, 2:19pm UTC](https://discourse.julialang.org/t/bridging-mtk-and-jump/136148 "2026-03-12T14:19:53Z")

</div>

I am doing some basic thermal modelling in MTK, and I want to use the resulting discretized dynamics in a JuMP model. I came up with the following PoC: using Pkg Pkg.activate(".") import ModelingToolkit as MTK using J…

---

## [Evaluating arbitrary symbolic expression on ODE solution](https://discourse.julialang.org/t/evaluating-arbitrary-symbolic-expression-on-ode-solution/136130)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 2\
**Last updated:** [March 11, 2026, 9:23am UTC](https://discourse.julialang.org/t/evaluating-arbitrary-symbolic-expression-on-ode-solution/136130 "2026-03-11T09:23:56Z")

</div>

If I have an ODESolution, I can evaluate some variable at some t=5 with sol(5, idxs=sys.some\_variable), but what if I have EvalAt(15)(sys.some\_variable) - EvalAt(10)(sys.other\_variable). This is a reasonable expression t…

---

## [Julia's SciML and UDE in temporal networks: preprint out](https://discourse.julialang.org/t/julias-sciml-and-ude-in-temporal-networks-preprint-out/136099)

<div class="topic-metadata">

**Author:** [@gvdr](https://discourse.julialang.org/u/gvdr)\
**Replies:** 1\
**Last updated:** [March 9, 2026, 10:37am UTC](https://discourse.julialang.org/t/julias-sciml-and-ude-in-temporal-networks-preprint-out/136099 "2026-03-09T10:37:07Z")

</div>

Hi everyone, I got a new pre-print out on arXiv, that uses the Julia’s SciML ecosystem quite a bit. The base idea is: if we consider a complex network that changes in time as a dynamical system (and take a nice model …

---

## [MTK with MonteCarloMeasurements Error](https://discourse.julialang.org/t/mtk-with-montecarlomeasurements-error/135988)

<div class="topic-metadata">

**Author:** [@optimal\_georg](https://discourse.julialang.org/u/optimal_georg)\
**Replies:** 7\
**Last updated:** [March 4, 2026, 2:05pm UTC](https://discourse.julialang.org/t/mtk-with-montecarlomeasurements-error/135988 "2026-03-04T14:05:21Z")

</div>

Hi out there! I am trying to use MonteCarloMeasurements.jl together with MTK to solve a differential equation with uncertain parameters. using ModelingToolkit, DifferentialEquations using MonteCarloMeasurements using C…

---

## [Best practices for testing numerical results that are unstable across package versions](https://discourse.julialang.org/t/best-practices-for-testing-numerical-results-that-are-unstable-across-package-versions/135847)

<div class="topic-metadata">

**Author:** [@jakobjpeters](https://discourse.julialang.org/u/jakobjpeters)\
**Replies:** 30\
**Last updated:** [March 2, 2026, 12:37pm UTC](https://discourse.julialang.org/t/best-practices-for-testing-numerical-results-that-are-unstable-across-package-versions/135847 "2026-03-02T12:37:47Z")

</div>

My team is using OrdinaryDiffEq.jl and several other numerical packages, where we are testing a variety of solver results to be within some tolerance. On multiple occasions, some of these tests have begun to fail after u…

---

## [Multithreading very slow](https://discourse.julialang.org/t/multithreading-very-slow/135711)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 14\
**Last updated:** [February 26, 2026, 7:47pm UTC](https://discourse.julialang.org/t/multithreading-very-slow/135711 "2026-02-26T19:47:45Z")

</div>

Greetings, I am translating a C++ particle simulation code into Julia. In each iteration, the algorithm computes forces that are given by pairwise interactions, which leads to an O(N^2) operation, with N the number of p…

---

## [Downloading maps using OSM in Agents.jl. OpenSSLError](https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751)

<div class="topic-metadata">

**Author:** [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Replies:** 4\
**Last updated:** [February 23, 2026, 8:39pm UTC](https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751 "2026-02-23T20:39:22Z")

</div>

I am trying to use the OSM module og Agents.jl to download maps from openstreetmaps. With the following MWE using Agents map\_path = OSM.download\_osm\_network(:place\_name; place\_name = "Trondheim", networ…

---

## [How to create a differential model at run time?](https://discourse.julialang.org/t/how-to-create-a-differential-model-at-run-time/135704)

<div class="topic-metadata">

**Author:** [@thudjx](https://discourse.julialang.org/u/thudjx)\
**Replies:** 6\
**Last updated:** [February 20, 2026, 12:50am UTC](https://discourse.julialang.org/t/how-to-create-a-differential-model-at-run-time/135704 "2026-02-20T00:50:48Z")

</div>

I want to create a differential algebraic model by reading information from a file, thus I can only construct the model at run time. But I don’t know how to do this because the example models from documentation of Differ…

---

## [ODE Parameter Estimation with Priors](https://discourse.julialang.org/t/ode-parameter-estimation-with-priors/135691)

<div class="topic-metadata">

**Author:** [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Replies:** 2\
**Last updated:** [February 17, 2026, 5:54pm UTC](https://discourse.julialang.org/t/ode-parameter-estimation-with-priors/135691 "2026-02-17T17:54:42Z")

</div>

I have never done parameter estimation with priors(bayesian inference) before and I am a little unsure if I am going about it the right way. I created a simple example, but will ultimately be doing it for a more complica…

---

## [How to narrow the variants of agents returned by \`random\_agent\`?](https://discourse.julialang.org/t/how-to-narrow-the-variants-of-agents-returned-by-random-agent/135674)

<div class="topic-metadata">

**Author:** [@filipe](https://discourse.julialang.org/u/filipe)\
**Replies:** 11\
**Last updated:** [February 16, 2026, 8:14pm UTC](https://discourse.julialang.org/t/how-to-narrow-the-variants-of-agents-returned-by-random-agent/135674 "2026-02-16T20:14:03Z")

</div>

Hello! Is there a way to tell random\_agent which variant of a @multiagent model to return? My specific problem is this: @agent struct Supplier(NoSpaceAgent) sellingPrice::Float64 = 1 end @agent struct Buyer(NoSpac…

---

## [Different initial conditions / trajectories when updating parameters with setp+remake vs re-solving steady state (ModelingToolkit ODEProblem)](https://discourse.julialang.org/t/different-initial-conditions-trajectories-when-updating-parameters-with-setp-remake-vs-re-solving-steady-state-modelingtoolkit-odeproblem/135676)

<div class="topic-metadata">

**Author:** [@celia.bat](https://discourse.julialang.org/u/celia.bat)\
**Replies:** 2\
**Last updated:** [February 16, 2026, 4:20pm UTC](https://discourse.julialang.org/t/different-initial-conditions-trajectories-when-updating-parameters-with-setp-remake-vs-re-solving-steady-state-modelingtoolkit-odeproblem/135676 "2026-02-16T16:20:50Z")

</div>

Hi all, I’m confused about how remake interacts with initialization / consistent initial conditions in a ModelingToolkit workflow where I: Solve a “static” system using a SteadyStateProblem to get an equilibrium. Use …

---

## [Linearising an nonlinear, algebraic DAE for MPC control](https://discourse.julialang.org/t/linearising-an-nonlinear-algebraic-dae-for-mpc-control/135151)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [February 13, 2026, 5:30pm UTC](https://discourse.julialang.org/t/linearising-an-nonlinear-algebraic-dae-for-mpc-control/135151 "2026-02-13T17:30:55Z")

</div>

We have the idea that we might be able to use linear MPC to control kites modelled as differential-algebraic equations using MTK. I have a student who has some issues with linearizing: It is easy to linearize a system a…

---

## [ModelingToolkit.jl: Handling Output/Input Dependency in a DAE Model](https://discourse.julialang.org/t/modelingtoolkit-jl-handling-output-input-dependency-in-a-dae-model/126172)

<div class="topic-metadata">

**Author:** [@AndhikaTama](https://discourse.julialang.org/u/AndhikaTama)\
**Replies:** 4\
**Last updated:** [February 11, 2026, 4:46am UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-handling-output-input-dependency-in-a-dae-model/126172 "2026-02-11T04:46:00Z")

</div>

Hello everyone, I’m currently working on a dynamic of microgas turbine system model in Julia using a system of Differential-Algebraic Equations (DAE). I want to adapt modelica acausal modelling problem into Julia …

---

## [Issue adding Julia package from GitHub: Unsatisfiable requirements (SymbolicUtils / SciCompDSL / ModelingToolkit)](https://discourse.julialang.org/t/issue-adding-julia-package-from-github-unsatisfiable-requirements-symbolicutils-scicompdsl-modelingtoolkit/135334)

<div class="topic-metadata">

**Author:** [@pandeysudan27](https://discourse.julialang.org/u/pandeysudan27)\
**Replies:** 6\
**Last updated:** [February 7, 2026, 12:11am UTC](https://discourse.julialang.org/t/issue-adding-julia-package-from-github-unsatisfiable-requirements-symbolicutils-scicompdsl-modelingtoolkit/135334 "2026-02-07T00:11:47Z")

</div>

Unsatisfiable requirements when adding package from GitHub (SymbolicUtils / SciCompDSL / MTK) Hi everyone, I’m developing a Julia package for acausal hydropower system modeling based on ModelingToolkit.jl and ModelingT…

---

## [Simulating a disconnected line](https://discourse.julialang.org/t/simulating-a-disconnected-line/135324)

<div class="topic-metadata">

**Author:** [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Replies:** 2\
**Last updated:** [February 6, 2026, 1:48pm UTC](https://discourse.julialang.org/t/simulating-a-disconnected-line/135324 "2026-02-06T13:48:40Z")

</div>

In pandapower it is possible to set a line parameter “in\_service” to false and the model will still run with all connected loads set to zero. I tried to set “br\_status” to 0 in powermodels but then the model returns infe…

---

## [MTK - Any models of electrical machines?](https://discourse.julialang.org/t/mtk-any-models-of-electrical-machines/135446)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [February 4, 2026, 2:23pm UTC](https://discourse.julialang.org/t/mtk-any-models-of-electrical-machines/135446 "2026-02-04T14:23:51Z")

</div>

Are there any models of electrical machines already available that are programmed using MTK? I am looking for: DC machine asynchronous machine synchronous machine two-speed Dahlander motor

---

## [MTK & library components - good practice?](https://discourse.julialang.org/t/mtk-library-components-good-practice/135448)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 0\
**Last updated:** [February 4, 2026, 1:36pm UTC](https://discourse.julialang.org/t/mtk-library-components-good-practice/135448 "2026-02-04T13:36:46Z")

</div>

I’m curious: what is good practice with MTK components which uses Stream variables/has multiple substances? How to ensure that the various components are created/instantiated with equal number of substances, so that I …

---

## [MTK -- status of symbolic vectors?](https://discourse.julialang.org/t/mtk-status-of-symbolic-vectors/135150)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 12\
**Last updated:** [February 4, 2026, 11:52am UTC](https://discourse.julialang.org/t/mtk-status-of-symbolic-vectors/135150 "2026-02-04T11:52:35Z")

</div>

What is the status of MTK and vectors of symbolic variables? I am working my way through connectors and components, aided by Google AI Studio, but I have a feeling it is hallucinating some proposals…

---

## [Callbacks are skipped in various settings](https://discourse.julialang.org/t/callbacks-are-skipped-in-various-settings/135293)

<div class="topic-metadata">

**Author:** [@sceptri](https://discourse.julialang.org/u/sceptri)\
**Replies:** 2\
**Last updated:** [February 2, 2026, 10:59am UTC](https://discourse.julialang.org/t/callbacks-are-skipped-in-various-settings/135293 "2026-02-02T10:59:58Z")

</div>

Hello! I am working on simulations related to spiking neuron networks (with discontinuous models, like LIF, and possible delays), and I have run into several problems with callbacks in DifferentialEquations.jl. I opene…

---

## [Direct collocation, stiff dynamics, and discrete adjoints — where does the instability go?](https://discourse.julialang.org/t/direct-collocation-stiff-dynamics-and-discrete-adjoints-where-does-the-instability-go/135385)

<div class="topic-metadata">

**Author:** [@PhysicsBender](https://discourse.julialang.org/u/PhysicsBender)\
**Replies:** 3\
**Last updated:** [February 1, 2026, 1:33pm UTC](https://discourse.julialang.org/t/direct-collocation-stiff-dynamics-and-discrete-adjoints-where-does-the-instability-go/135385 "2026-02-01T13:33:00Z")

</div>

Hi all, I’ve been experimenting with ModelingToolkit.jl and InfiniteOpt.jl for direct-collocation optimal control problems. In my model I am using smooth boolean logic that is based on hyperbolic functions quite extensi…

---

## [How to trace positions of agents](https://discourse.julialang.org/t/how-to-trace-positions-of-agents/135340)

<div class="topic-metadata">

**Author:** [@ahcvankampen](https://discourse.julialang.org/u/ahcvankampen)\
**Replies:** 5\
**Last updated:** [January 30, 2026, 12:23pm UTC](https://discourse.julialang.org/t/how-to-trace-positions-of-agents/135340 "2026-01-30T12:23:39Z")

</div>

Hi, I have a multiagent model and want to extract agent data from this model. In one of the tutorial examples we have something like: adata = \[(cd4, count), (cd8, count), (dc, count)\] fig, ax, abmobs = abmplot(ln\_mode…

---

## [Parameter sharing and abstraction in MTK](https://discourse.julialang.org/t/parameter-sharing-and-abstraction-in-mtk/135269)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 3\
**Last updated:** [January 30, 2026, 9:26am UTC](https://discourse.julialang.org/t/parameter-sharing-and-abstraction-in-mtk/135269 "2026-01-30T09:26:27Z")

</div>

I have started using ParametrizedInterpolation from the standard library in my code, and while it works fine, having to add a clock to each component that uses it tarnishes the code a bit. So I wrote this: """ A step fu…

---

## [Force MTK to generate explicit ODEs?](https://discourse.julialang.org/t/force-mtk-to-generate-explicit-odes/135245)

<div class="topic-metadata">

**Author:** [@benjamin](https://discourse.julialang.org/u/benjamin)\
**Replies:** 9\
**Last updated:** [January 29, 2026, 1:30pm UTC](https://discourse.julialang.org/t/force-mtk-to-generate-explicit-odes/135245 "2026-01-29T13:30:05Z")

</div>

Hi! I am using ModelingToolkit.jl to model a physical system. The compiler generates an index-1 DAE, which works great for simulation. However, I need to use a standard Kalman Filter, which requires a minimal state-spa…

---

## [Stokes solver as an ODEproblem takes time to initiate](https://discourse.julialang.org/t/stokes-solver-as-an-odeproblem-takes-time-to-initiate/135317)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 6\
**Last updated:** [January 29, 2026, 10:15am UTC](https://discourse.julialang.org/t/stokes-solver-as-an-odeproblem-takes-time-to-initiate/135317 "2026-01-29T10:15:42Z")

</div>

Hi everyone. I wrote a small code to solve 2D linear visco-elastic Stokes using finite difference and OrdinaryDiffEq to test how that would work out. So, in this case, I only have algebraic equations and have some param…

---

## [Catalyst.jl and ModelingToolkit (question after reading about ModelingToolkit license changes)](https://discourse.julialang.org/t/catalyst-jl-and-modelingtoolkit-question-after-reading-about-modelingtoolkit-license-changes/135303)

<div class="topic-metadata">

**Author:** [@twcawm](https://discourse.julialang.org/u/twcawm)\
**Replies:** 1\
**Last updated:** [January 28, 2026, 4:06am UTC](https://discourse.julialang.org/t/catalyst-jl-and-modelingtoolkit-question-after-reading-about-modelingtoolkit-license-changes/135303 "2026-01-28T04:06:51Z")

</div>

Hi, I have been investigating and trying out the Catalyst.jl package (it’s really awesome, by the way!). I saw recently the discussions on ModelingToolkit license changes. Is the plan to keep maintaining Catalyst.jl a…

---

## [Stokes Operator is Singular After Applying Dirichlet Boundary Conditions](https://discourse.julialang.org/t/stokes-operator-is-singular-after-applying-dirichlet-boundary-conditions/135278)

<div class="topic-metadata">

**Author:** [@noetheriankoala](https://discourse.julialang.org/u/noetheriankoala)\
**Replies:** 7\
**Last updated:** [January 27, 2026, 5:53pm UTC](https://discourse.julialang.org/t/stokes-operator-is-singular-after-applying-dirichlet-boundary-conditions/135278 "2026-01-27T17:53:11Z")

</div>

Hello! I am trying to implement a simple incompressible Navier-Stokes simulation. I have a mesh consisting of a cylinder with the Stanford bunny excised from its center. When I apply Drichlet boundary conditions, the Sto…

---

## [Singular BVP with integrable boundaries](https://discourse.julialang.org/t/singular-bvp-with-integrable-boundaries/135224)

<div class="topic-metadata">

**Author:** [@NoFishLikeIan](https://discourse.julialang.org/u/NoFishLikeIan)\
**Replies:** 2\
**Last updated:** [January 26, 2026, 7:13am UTC](https://discourse.julialang.org/t/singular-bvp-with-integrable-boundaries/135224 "2026-01-26T07:13:46Z")

</div>

I’m solving a singular first-order, two dimensional ODE arising in reputation games (Faingold & Sannikov, 2011). On \\phi \\in \[0, 1\], I have u' = \\frac{v}{\\phi(1-\\phi)} \\\\ v' = \\frac{1}{\\phi(1-\\phi)} \\left(v + 2\\rho \\f…

---

## [MTK problem from tests fails](https://discourse.julialang.org/t/mtk-problem-from-tests-fails/135226)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 3\
**Last updated:** [January 25, 2026, 8:02pm UTC](https://discourse.julialang.org/t/mtk-problem-from-tests-fails/135226 "2026-01-25T20:02:55Z")

</div>

I took the RC example from the tests of ModelingToolkitStandardLibrary.jl: ModelingToolkitStandardLibrary.jl/test/Electrical/analog.jl at main · SciML/ModelingToolkitStandardLibrary.jl · GitHub using ModelingToolkitStan…

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

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