# Modelling & Simulations

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

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

**Page:** 31

---

## [How to handle conflicting functions between 2 packages](https://discourse.julialang.org/t/how-to-handle-conflicting-functions-between-2-packages/105219)

<div class="topic-metadata">

**Author:** [@hisacro](https://discourse.julialang.org/u/hisacro)\
**Replies:** 4\
**Last updated:** [October 20, 2023, 1:32pm UTC](https://discourse.julialang.org/t/how-to-handle-conflicting-functions-between-2-packages/105219 "2023-10-20T13:32:24Z")

</div>

The issue is popping very often with DynamicalSystems.ji package now, here’s a sample of using … julia\> IntervalBox(-2..2, -2..2) WARNING: both ChaosTools and GLMakie export ".."; uses of it in module Main must be qual…

---

## [DynamicalSystems.jl and CUDA.jl](https://discourse.julialang.org/t/dynamicalsystems-jl-and-cuda-jl/105111)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 0\
**Last updated:** [October 18, 2023, 10:31am UTC](https://discourse.julialang.org/t/dynamicalsystems-jl-and-cuda-jl/105111 "2023-10-18T10:31:13Z")

</div>

Hello! Can i use CUDAj.jl and DynamicalSystems.jl together? I calculate map of spectrum Lyapunov exponents with inheritance of initial conditions. I manage to parallelize calculations using Threads.@threads for loop. B…

---

## [Change initial condition by set\_state! DynamicalSystems.jl](https://discourse.julialang.org/t/change-initial-condition-by-set-state-dynamicalsystems-jl/105064)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 8\
**Last updated:** [October 18, 2023, 9:43am UTC](https://discourse.julialang.org/t/change-initial-condition-by-set-state-dynamicalsystems-jl/105064 "2023-10-18T09:43:18Z")

</div>

Hello! I’m trying to change the initial condition using the set\_state! function and I integrate the system, but when I do this, I see that the initial state has not changed. Why doesn’t the initial condition change? Sho…

---

## [Maximum Codimension using BifurcationKit.jl](https://discourse.julialang.org/t/maximum-codimension-using-bifurcationkit-jl/105087)

<div class="topic-metadata">

**Author:** [@Rafalel\_Jupio](https://discourse.julialang.org/u/Rafalel_Jupio)\
**Replies:** 7\
**Last updated:** [October 18, 2023, 9:15am UTC](https://discourse.julialang.org/t/maximum-codimension-using-bifurcationkit-jl/105087 "2023-10-18T09:15:16Z")

</div>

Hello everyone! I am pretty new to Julia, but I have project for which I have to analyse a bifurcation behaviour with codimension 3 for a DDE model. Hence I was wondering if BifurcationKit.jl could handle this, since in…

---

## [MethodError: no method matching -(::SymbolicUtils.BasicSymbolic{Real}, ::Symbolics.Equation)](https://discourse.julialang.org/t/methoderror-no-method-matching-symbolicutils-basicsymbolic-real-symbolics-equation/105005)

<div class="topic-metadata">

**Author:** [@sabbraxcaddabra](https://discourse.julialang.org/u/sabbraxcaddabra)\
**Replies:** 2\
**Last updated:** [October 16, 2023, 10:43am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-symbolicutils-basicsymbolic-real-symbolics-equation/105005 "2023-10-16T10:43:37Z")

</div>

Hello everyone! I try to model simple internal ballistics model in ModelingToolkit.jl framework. using ModelingToolkit, DifferentialEquations, Plots begin @variables t D = Differential(t) end function terminate\_affect…

---

## [Accuracy of ModelingToolkit linearizations](https://discourse.julialang.org/t/accuracy-of-modelingtoolkit-linearizations/104902)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [October 16, 2023, 9:32am UTC](https://discourse.julialang.org/t/accuracy-of-modelingtoolkit-linearizations/104902 "2023-10-16T09:32:34Z")

</div>

I have a non-linear model with about 16 equations. I linearize it with different inputs and outputs around different operating point. I use both the linearize() function and the linerize\_symbolic() function. This works a…

---

## [DifferentialEquations - vector or one by one on rhs](https://discourse.julialang.org/t/differentialequations-vector-or-one-by-one-on-rhs/104886)

<div class="topic-metadata">

**Author:** [@blob](https://discourse.julialang.org/u/blob)\
**Replies:** 2\
**Last updated:** [October 12, 2023, 1:00pm UTC](https://discourse.julialang.org/t/differentialequations-vector-or-one-by-one-on-rhs/104886 "2023-10-12T13:00:51Z")

</div>

I wonder what the difference is between function lorenz!(du, u, p, t) du = \[10.0 \* (u\[2\] - u\[1\]), u\[1\] \* (28.0 - u\[3\]) - u\[2\], u\[1\] \* u\[2\] - (8 / 3) \* u\[3\]\] end and function lorenz!(du, u, p, t) du\[1\] = 10.0 \*…

---

## [MTK & Standard Library & independent variable, etc](https://discourse.julialang.org/t/mtk-standard-library-independent-variable-etc/104885)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 1\
**Last updated:** [October 12, 2023, 8:06am UTC](https://discourse.julialang.org/t/mtk-standard-library-independent-variable-etc/104885 "2023-10-12T08:06:27Z")

</div>

Thanks for all help with MTK so far – I’m learning quite a bit just by posing the questions… In Modelica, the independent variable has to be denoted time, and time differentiation is der(). In MTK, the choice of indepe…

---

## [MTK & Standard Library & Analysis points](https://discourse.julialang.org/t/mtk-standard-library-analysis-points/104853)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 8\
**Last updated:** [October 12, 2023, 6:15am UTC](https://discourse.julialang.org/t/mtk-standard-library-analysis-points/104853 "2023-10-12T06:15:28Z")

</div>

I’m trying to figure out how to define “analysis points” in my MTK models, and how to use such to linearize the model. Initial questions: Is the “analysis points” facility part of the standard library, or of MTK? It s…

---

## [Agents with an extent](https://discourse.julialang.org/t/agents-with-an-extent/104840)

<div class="topic-metadata">

**Author:** [@FMP](https://discourse.julialang.org/u/FMP)\
**Replies:** 4\
**Last updated:** [October 11, 2023, 12:37pm UTC](https://discourse.julialang.org/t/agents-with-an-extent/104840 "2023-10-11T12:37:28Z")

</div>

Hello! I am currently working on an ABM for growing bacteria using Agents.jl (akin to the, now outdated, example in the documentation) and it got me wondering whether it is/could be possible to have an “extensive” agent…

---

## [Normalizing a transfer function](https://discourse.julialang.org/t/normalizing-a-transfer-function/104834)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [October 11, 2023, 10:20am UTC](https://discourse.julialang.org/t/normalizing-a-transfer-function/104834 "2023-10-11T10:20:24Z")

</div>

Is there already a function to normalize a transfer function? I have: TransferFunction{Continuous, ControlSystemsBase.SisoRational{Float64}} -951.729934283765s^2 -----------------------…

---

## [MTK - simple case with \`@mtkmodel\` and standard library doesn't work](https://discourse.julialang.org/t/mtk-simple-case-with-mtkmodel-and-standard-library-doesnt-work/104807)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 2\
**Last updated:** [October 11, 2023, 7:10am UTC](https://discourse.julialang.org/t/mtk-simple-case-with-mtkmodel-and-standard-library-doesnt-work/104807 "2023-10-11T07:10:06Z")

</div>

I’m experimenting with the new @mtkmodel in combination with the ModelingToolkitStandardLibrary. I get an error message… My case is simple: a liquid tank “class” Tank\_m with flow out given by gravity, encoded via @mtkmo…

---

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

---

## [Modeling a leaking tank](https://discourse.julialang.org/t/modeling-a-leaking-tank/104750)

<div class="topic-metadata">

**Author:** [@lsablon](https://discourse.julialang.org/u/lsablon)\
**Replies:** 5\
**Last updated:** [October 10, 2023, 8:39am UTC](https://discourse.julialang.org/t/modeling-a-leaking-tank/104750 "2023-10-10T08:39:51Z")

</div>

Hello ! I’m currently working on modeling a system that resembles an open-topped tank with a leak, where the tank is also being supplied, so if the leak isn’t sufficient, it overflows. The system’s equations (reasonabl…

---

## [How to use the package ParallelStencil.jl to solve linear equation A\*x=b in GPU?](https://discourse.julialang.org/t/how-to-use-the-package-parallelstencil-jl-to-solve-linear-equation-a-x-b-in-gpu/69562)

<div class="topic-metadata">

**Author:** [@liaoweiyang2017](https://discourse.julialang.org/u/liaoweiyang2017)\
**Replies:** 9\
**Last updated:** [October 4, 2023, 8:23am UTC](https://discourse.julialang.org/t/how-to-use-the-package-parallelstencil-jl-to-solve-linear-equation-a-x-b-in-gpu/69562 "2023-10-04T08:23:23Z")

</div>

For example, I can use the following code to solve linear equation in GPU, but this package Krylov.jl cannot support the complex matrix input, so when solving the complex linear equation, it has a poor efficiency. I foun…

---

## [Using WriteVTK to write DiffEq sol to disk during timestepping](https://discourse.julialang.org/t/using-writevtk-to-write-diffeq-sol-to-disk-during-timestepping/104517)

<div class="topic-metadata">

**Author:** [@jarias9](https://discourse.julialang.org/u/jarias9)\
**Replies:** 1\
**Last updated:** [October 3, 2023, 9:57pm UTC](https://discourse.julialang.org/t/using-writevtk-to-write-diffeq-sol-to-disk-during-timestepping/104517 "2023-10-03T21:57:24Z")

</div>

Just had a quick question regarding alternative saving behavior for DiffEq. I was wondering if there was a way to write all solution data directly to disk with WriteVTK as timestepping advances instead of having all of m…

---

## [MethodOfLines PDESystem with Internal Systems](https://discourse.julialang.org/t/methodoflines-pdesystem-with-internal-systems/104409)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 1\
**Last updated:** [October 3, 2023, 1:13pm UTC](https://discourse.julialang.org/t/methodoflines-pdesystem-with-internal-systems/104409 "2023-10-03T13:13:52Z")

</div>

The definition for a PDESystem seems to show that internal systems are compatible, (PDESystem · ModelingToolkit.jl) but it looks like discretization of the PDESystem does not look at these systems, causing errors when di…

---

## [Incorporating Auxiliary Calculations as Functions in ModelingToolkit PDE Definitions, Method of Lines](https://discourse.julialang.org/t/incorporating-auxiliary-calculations-as-functions-in-modelingtoolkit-pde-definitions-method-of-lines/104428)

<div class="topic-metadata">

**Author:** [@Can\_Bozdogan](https://discourse.julialang.org/u/Can_Bozdogan)\
**Replies:** 1\
**Last updated:** [October 3, 2023, 1:09pm UTC](https://discourse.julialang.org/t/incorporating-auxiliary-calculations-as-functions-in-modelingtoolkit-pde-definitions-method-of-lines/104428 "2023-10-03T13:09:21Z")

</div>

Hello everyone, I’ve been working on a PDE model using the ModelingToolkit, MethodOfLines, and DifferentialEquations packages, and I’ve run into some challenges that I’m hoping to get guidance on. For confidentiality re…

---

## [Method of Lines Interface index error](https://discourse.julialang.org/t/method-of-lines-interface-index-error/104402)

<div class="topic-metadata">

**Author:** [@Can\_Bozdogan](https://discourse.julialang.org/u/Can_Bozdogan)\
**Replies:** 1\
**Last updated:** [October 3, 2023, 1:01pm UTC](https://discourse.julialang.org/t/method-of-lines-interface-index-error/104402 "2023-10-03T13:01:36Z")

</div>

Hi everyone, I’m new to Julia language, this is my first time asking a question, so please forgive me if there is any mistake in my question format. I have been working on discretizing a PDE system by using MethodOfLin…

---

## [RobustAndOptimalControl.jl Named State Space With Time Delay](https://discourse.julialang.org/t/robustandoptimalcontrol-jl-named-state-space-with-time-delay/104515)

<div class="topic-metadata">

**Author:** [@matthew3245](https://discourse.julialang.org/u/matthew3245)\
**Replies:** 2\
**Last updated:** [October 3, 2023, 11:50am UTC](https://discourse.julialang.org/t/robustandoptimalcontrol-jl-named-state-space-with-time-delay/104515 "2023-10-03T11:50:42Z")

</div>

Is there a way to make a named state space model with a time delay? The following code produces an error: julia\> named\_ss(ss(-1, 1, I, 0)) \* delay(0.1) ERROR: promotion of types NamedStateSpace{Continuous, StateSpace{Co…

---

## [RobustAndOptimalControl.jl Uncertain Time Delays For State Space Models](https://discourse.julialang.org/t/robustandoptimalcontrol-jl-uncertain-time-delays-for-state-space-models/104514)

<div class="topic-metadata">

**Author:** [@matthew3245](https://discourse.julialang.org/u/matthew3245)\
**Replies:** 2\
**Last updated:** [October 3, 2023, 11:50am UTC](https://discourse.julialang.org/t/robustandoptimalcontrol-jl-uncertain-time-delays-for-state-space-models/104514 "2023-10-03T11:50:06Z")

</div>

I can’t get uncertain time delays for state space models to work. For example, the following code: julia\> using LinearAlgebra, ControlSystems, RobustAndOptimalControl, MonteCarloMeasurements julia\> P = ss(-1, 1, I, 0) j…

---

## [How to tell ModelingToolkit.jl which variables are parameters](https://discourse.julialang.org/t/how-to-tell-modelingtoolkit-jl-which-variables-are-parameters/104501)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 4\
**Last updated:** [October 2, 2023, 4:11pm UTC](https://discourse.julialang.org/t/how-to-tell-modelingtoolkit-jl-which-variables-are-parameters/104501 "2023-10-02T16:11:07Z")

</div>

I have a Symbolics.Equation that I got from an external source. Now I want to use that equation in ModelingToolkit.jl, but I don’t know how to tell ModelingToolkit.jl which variables are parameters. For example, here I …

---

## [ControlSystems.jl Uncertain Model Parameters and Time Delays](https://discourse.julialang.org/t/controlsystems-jl-uncertain-model-parameters-and-time-delays/104373)

<div class="topic-metadata">

**Author:** [@matthew3245](https://discourse.julialang.org/u/matthew3245)\
**Replies:** 9\
**Last updated:** [October 2, 2023, 12:29am UTC](https://discourse.julialang.org/t/controlsystems-jl-uncertain-model-parameters-and-time-delays/104373 "2023-10-02T00:29:27Z")

</div>

I am using ControlSystems.jl with MonteCarloMeasurements.jl to analyse the step response of models with uncertain parameters and time delays. However, plotting the step response of a model with uncertain parameters vs. a…

---

## [Tool for composable circuit simulation?](https://discourse.julialang.org/t/tool-for-composable-circuit-simulation/103449)

<div class="topic-metadata">

**Author:** [@hacklint](https://discourse.julialang.org/u/hacklint)\
**Replies:** 28\
**Last updated:** [September 30, 2023, 4:10pm UTC](https://discourse.julialang.org/t/tool-for-composable-circuit-simulation/103449 "2023-09-30T16:10:14Z")

</div>

I’m looking for a (free) tool to do some rather basic electrical circuit simulations describing a unit with a couple of current sources, a couple of resistors, switches and some external connections. Having that I would …

---

## [DtLessThanMin while err estimate = 1.65e-10](https://discourse.julialang.org/t/dtlessthanmin-while-err-estimate-1-65e-10/104120)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 2\
**Last updated:** [September 30, 2023, 1:35am UTC](https://discourse.julialang.org/t/dtlessthanmin-while-err-estimate-1-65e-10/104120 "2023-09-30T01:35:15Z")

</div>

I was troubleshooting a mass-matrix ODE model for nonconvergence due to DtLessThanMin. It turns out that, with a set of properly initialized nonlinear algebraic equations (i.e., the mass matrix is all zero), OrdinaryDif…

---

## [ModelingToolkitStandardLibrary SampledData Component](https://discourse.julialang.org/t/modelingtoolkitstandardlibrary-sampleddata-component/104401)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 3\
**Last updated:** [September 29, 2023, 5:54pm UTC](https://discourse.julialang.org/t/modelingtoolkitstandardlibrary-sampleddata-component/104401 "2023-09-29T17:54:05Z")

</div>

I’ve been trying to understand how to use the SampledData component from ModelingToolkitStandardLibrary, but I’ve been having trouble getting the example from documentation working. I’ve modified the code from the exampl…

---

## [StackOverflowError() with ModellingToolkit.jl and NaNMath.jl](https://discourse.julialang.org/t/stackoverflowerror-with-modellingtoolkit-jl-and-nanmath-jl/104364)

<div class="topic-metadata">

**Author:** [@dleather](https://discourse.julialang.org/u/dleather)\
**Replies:** 6\
**Last updated:** [September 28, 2023, 9:04pm UTC](https://discourse.julialang.org/t/stackoverflowerror-with-modellingtoolkit-jl-and-nanmath-jl/104364 "2023-09-28T21:04:36Z")

</div>

The following code results in a StackOverflowError() in Julia 1.9. Is this expected behavior? using ModelingToolkit using NaNMath #Define Problem @variables t g(t) π(t) r(t) @parameters α\_g α\_π α\_r κ\_g κ\_π κ\_r ϕ\_g ϕ\_π…

---

## [Issues with Interactive Visualization in Agents.jl](https://discourse.julialang.org/t/issues-with-interactive-visualization-in-agents-jl/103640)

<div class="topic-metadata">

**Author:** [@daler6](https://discourse.julialang.org/u/daler6)\
**Replies:** 2\
**Last updated:** [September 26, 2023, 9:03am UTC](https://discourse.julialang.org/t/issues-with-interactive-visualization-in-agents-jl/103640 "2023-09-26T09:03:43Z")

</div>

schellingagentsjl5.jl (6.3 KB) The attached file contains my modified version of the code for the Schelling model, which I am running using the latest versions of VS Code, Julia, Agents.jl, and the other packages noted …

---

## [Using random\_agent with a condition](https://discourse.julialang.org/t/using-random-agent-with-a-condition/104229)

<div class="topic-metadata">

**Author:** [@daler6](https://discourse.julialang.org/u/daler6)\
**Replies:** 2\
**Last updated:** [September 25, 2023, 6:31pm UTC](https://discourse.julialang.org/t/using-random-agent-with-a-condition/104229 "2023-09-25T18:31:59Z")

</div>

I am working on reproducing the Zero Information trader in Julia using Agents.jl. My agents include a field named :traded, which is of type Bool and is initialized to false for all agents. This is changed to true once an…

---

## [Connecting components by adding term to DE in ModelingToolkit](https://discourse.julialang.org/t/connecting-components-by-adding-term-to-de-in-modelingtoolkit/104149)

<div class="topic-metadata">

**Author:** [@nkoch](https://discourse.julialang.org/u/nkoch)\
**Replies:** 2\
**Last updated:** [September 24, 2023, 2:45am UTC](https://discourse.julialang.org/t/connecting-components-by-adding-term-to-de-in-modelingtoolkit/104149 "2023-09-24T02:45:00Z")

</div>

I am trying to connect components by adding function of variables from each component to one of the DEs in each component. In other words, for components 1 and 2 (and their respective variables z\_1 and z\_2) \\frac{d z\_1}…

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

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