# \#mtk

**URL:** https://discourse.julialang.org/tag/mtk/1387.md

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

---

## [Invalidations caused by FixedPointNumbers](https://discourse.julialang.org/t/invalidations-caused-by-fixedpointnumbers/139232)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [September 6, 2026, 10:21pm UTC](https://discourse.julialang.org/t/invalidations-caused-by-fixedpointnumbers/139232 "2026-09-06T22:21:48Z")

</div>

The FixedPointNumbers package is causing many invalidations, even though it does not engage in type piracy. For details, see: Loading FixedPointNumbers invalidates ~7,700 precompiled method instances (7x slower first mtk…

---

## [\[ANN\] MethodOfLines v1: Symbolic Arrays =\> Massive Compile Speedups](https://discourse.julialang.org/t/ann-methodoflines-v1-symbolic-arrays-massive-compile-speedups/138974)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 5\
**Last updated:** [August 24, 2026, 4:50pm UTC](https://discourse.julialang.org/t/ann-methodoflines-v1-symbolic-arrays-massive-compile-speedups/138974 "2026-08-24T16:50:34Z")

</div>

MethodOfLines.jl v1.0 changes all discretizations to using symbolic arrays. If they lower to code using DAEProblem the array structure is kept intact, meaning no more scalarization and massive compile time speedups. Tim…

---

## [Load time of MTK models](https://discourse.julialang.org/t/load-time-of-mtk-models/138068)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [July 16, 2026, 5:09pm UTC](https://discourse.julialang.org/t/load-time-of-mtk-models/138068 "2026-07-16T17:09:02Z")

</div>

I am not happy with the TTFX of our MTK models (see: RamAirKites.jl). We already cache our simplified model after building it and use a custom system image. But nevertheless, the time to load a model from our cache is st…

---

## [Update initialization guesses on an existing problem without rebuilding?](https://discourse.julialang.org/t/update-initialization-guesses-on-an-existing-problem-without-rebuilding/137694)

<div class="topic-metadata">

**Author:** [@Bart\_van\_de\_Lint](https://discourse.julialang.org/u/Bart_van_de_Lint)\
**Replies:** 0\
**Last updated:** [June 19, 2026, 11:06am UTC](https://discourse.julialang.org/t/update-initialization-guesses-on-an-existing-problem-without-rebuilding/137694 "2026-06-19T11:06:55Z")

</div>

I have a DAE built with ModelingToolkit. Between solves I re-initialize from a new operating point. For variables that have an initial constraint\*I can update them in place via the Initial parameter: prob.ps\[Initial(x)\]…

---

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

---

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

---

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

---

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

---

## [How can I implement a vector of StaticArrays as a variable in MTK?](https://discourse.julialang.org/t/how-can-i-implement-a-vector-of-staticarrays-as-a-variable-in-mtk/134962)

<div class="topic-metadata">

**Author:** [@pmc4](https://discourse.julialang.org/u/pmc4)\
**Replies:** 6\
**Last updated:** [January 11, 2026, 5:13pm UTC](https://discourse.julialang.org/t/how-can-i-implement-a-vector-of-staticarrays-as-a-variable-in-mtk/134962 "2026-01-11T17:13:01Z")

</div>

Hi everyone. After trying for weeks I would like to ask the community if what I’m trying to do is possible or whether I have arrived to a dead end. I’ve reduced it to a MWE. The system I want to solve in ModelingToolkit…

---

## [Combining MTK standard library StateSpace with other Blocks](https://discourse.julialang.org/t/combining-mtk-standard-library-statespace-with-other-blocks/127322)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 5\
**Last updated:** [January 9, 2026, 2:42pm UTC](https://discourse.julialang.org/t/combining-mtk-standard-library-statespace-with-other-blocks/127322 "2026-01-09T14:42:18Z")

</div>

I’m currently trying to integrate a linear state-space model inside a ModelingToolkit model. For this purpose I used the ODESystem specialization provided by ControlSystemsMTK, which itself uses the StateSpace block pr…

---

## [PID sampling time in modelingtoolkit](https://discourse.julialang.org/t/pid-sampling-time-in-modelingtoolkit/134671)

<div class="topic-metadata">

**Author:** [@victor](https://discourse.julialang.org/u/victor)\
**Replies:** 3\
**Last updated:** [December 22, 2025, 4:36pm UTC](https://discourse.julialang.org/t/pid-sampling-time-in-modelingtoolkit/134671 "2025-12-22T16:36:06Z")

</div>

Hi. I’ve built a modelingtoolkit model to simulate my process system. It uses PID controllers, the issue is that the control system has a sampling time of 1s. This has a huge effect on the parameters for the controller a…

---

## [Modelling toolkit for simulating aerodynamics?](https://discourse.julialang.org/t/modelling-toolkit-for-simulating-aerodynamics/133739)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [November 9, 2025, 4:26pm UTC](https://discourse.julialang.org/t/modelling-toolkit-for-simulating-aerodynamics/133739 "2025-11-09T16:26:14Z")

</div>

Not so clear to me: What is the domain of MTK where using MTK to create models is a good choice? In particular, we have a package for modelling aerodynamic forces and moments of 3D wings: GitHub - OpenSourceAWE/VortexSt…

---

## [Best way for passing abstract type data via path variables in Dyad](https://discourse.julialang.org/t/best-way-for-passing-abstract-type-data-via-path-variables-in-dyad/132966)

<div class="topic-metadata">

**Author:** [@junsin0106](https://discourse.julialang.org/u/junsin0106)\
**Replies:** 4\
**Last updated:** [October 30, 2025, 5:55pm UTC](https://discourse.julialang.org/t/best-way-for-passing-abstract-type-data-via-path-variables-in-dyad/132966 "2025-10-30T17:55:02Z")

</div>

Hello, I have a question about the proper usage of path variables in MTK and Dyad. To calculate heat transfer coefficient(HTC) and pressure drop(dP), the specific type and geometry of the heat exchanger(HX) are crucial…

---

## [PI Controller oscillating between limit values](https://discourse.julialang.org/t/pi-controller-oscillating-between-limit-values/131510)

<div class="topic-metadata">

**Author:** [@madtorresga](https://discourse.julialang.org/u/madtorresga)\
**Replies:** 4\
**Last updated:** [August 12, 2025, 5:01am UTC](https://discourse.julialang.org/t/pi-controller-oscillating-between-limit-values/131510 "2025-08-12T05:01:23Z")

</div>

Hello, I’m trying to implement a PI controller that turns on once the cell goes out of the voltage limits. My model looks something like this: @mtkmodel Cell begin ... @components begin ... deadzone = DeadZ…

---

## [Signal Comparison Block](https://discourse.julialang.org/t/signal-comparison-block/130905)

<div class="topic-metadata">

**Author:** [@madtorresga](https://discourse.julialang.org/u/madtorresga)\
**Replies:** 2\
**Last updated:** [July 21, 2025, 9:20pm UTC](https://discourse.julialang.org/t/signal-comparison-block/130905 "2025-07-21T21:20:04Z")

</div>

Hello, I’m trying to compare 3 signals from the cells array like this: ... @equations begin # Series connect all cells \[connect(cells\[i\].n, cells\[i+1\].p) for i in 1:length(cells)-1\] v\_max ~ ma…

---

## [Nested loop in @mtkmodel / Matrix manipulation](https://discourse.julialang.org/t/nested-loop-in-mtkmodel-matrix-manipulation/130133)

<div class="topic-metadata">

**Author:** [@madtorresga](https://discourse.julialang.org/u/madtorresga)\
**Replies:** 2\
**Last updated:** [June 23, 2025, 4:56pm UTC](https://discourse.julialang.org/t/nested-loop-in-mtkmodel-matrix-manipulation/130133 "2025-06-23T16:56:09Z")

</div>

Hi :slight\_smile: I’m trying to automate the battery cells’ creation from an already defined ECM model: const Qs = \[4.8 4.4 4.2 ; 3.7 3.5 3.3\] @mtkmodel Series\_Connection begin @variables begin v\_max …

---

## [MTK Control System with Current Not Working](https://discourse.julialang.org/t/mtk-control-system-with-current-not-working/129558)

<div class="topic-metadata">

**Author:** [@madtorresga](https://discourse.julialang.org/u/madtorresga)\
**Replies:** 1\
**Last updated:** [June 2, 2025, 1:17pm UTC](https://discourse.julialang.org/t/mtk-control-system-with-current-not-working/129558 "2025-06-02T13:17:26Z")

</div>

Hello! I’m trying to implement this exact same example, but controlling with the current that passes through the resistance instead of the speed in speed\_sensor.w. @equations begin #... #connect(curre…

---

## [MTK components with shared parameters](https://discourse.julialang.org/t/mtk-components-with-shared-parameters/104811)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 1\
**Last updated:** [October 10, 2023, 6:22pm UTC](https://discourse.julialang.org/t/mtk-components-with-shared-parameters/104811 "2023-10-10T18:22:52Z")

</div>

I am looking to create a system which allows me to share input parameters, which as a consequence allows me to keep my system parameter space small. I give an MTK example from the standard library but I am also happy to …

---

## [Comparing Plot Outputs for Different Versions of Julia](https://discourse.julialang.org/t/comparing-plot-outputs-for-different-versions-of-julia/101538)

<div class="topic-metadata">

**Author:** [@emmabottomley](https://discourse.julialang.org/u/emmabottomley)\
**Replies:** 3\
**Last updated:** [July 15, 2023, 12:18am UTC](https://discourse.julialang.org/t/comparing-plot-outputs-for-different-versions-of-julia/101538 "2023-07-15T00:18:05Z")

</div>

Hello! I’m working on solving PDEs in julia and producing plots of their solutions for different lengths of time. I was having a lot of issues when using Julia v-1.9.0. When I increased the time in this specific settin…
