# Modelling & Simulations

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

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

**Page:** 54

---

## [\[Symbolics.jl\] How to select between simplifier backends?](https://discourse.julialang.org/t/symbolics-jl-how-to-select-between-simplifier-backends/65973)

<div class="topic-metadata">

**Author:** [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Replies:** 1\
**Last updated:** [August 7, 2021, 1:58pm UTC](https://discourse.julialang.org/t/symbolics-jl-how-to-select-between-simplifier-backends/65973 "2021-08-07T13:58:13Z")

</div>

My understanding is that Symbolics.jl has multiple different simplifier backends (ref Symbolics.jl - High performance symbolic numerics via multiple dispatch, Julia Computer Algebra - YouTube). But I haven’t been able to…

---

## [Why won't Symbolics.jl simplify \`sqrt(1)\` to \`1\`?](https://discourse.julialang.org/t/why-wont-symbolics-jl-simplify-sqrt-1-to-1/65921)

<div class="topic-metadata">

**Author:** [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Replies:** 5\
**Last updated:** [August 6, 2021, 8:42pm UTC](https://discourse.julialang.org/t/why-wont-symbolics-jl-simplify-sqrt-1-to-1/65921 "2021-08-06T20:42:09Z")

</div>

@variables x sqrt(cos(x)^2 + sin(x)^2) |\> simplify gives me sqrt(1). Why isn’t this reduced to simply 1? OTOH sqrt(0\*x+1) |\> simplify reduces to 1, no problem.

---

## [Quality of life improvements for ModelingToolkit/DiffEq/SciML ecosystem](https://discourse.julialang.org/t/quality-of-life-improvements-for-modelingtoolkit-diffeq-sciml-ecosystem/65939)

<div class="topic-metadata">

**Author:** [@dawbarton](https://discourse.julialang.org/u/dawbarton)\
**Replies:** 1\
**Last updated:** [August 6, 2021, 12:14pm UTC](https://discourse.julialang.org/t/quality-of-life-improvements-for-modelingtoolkit-diffeq-sciml-ecosystem/65939 "2021-08-06T12:14:40Z")

</div>

I’m applying for funding for a research software engineer to do some quality-of-life improvements for the ModelingToolkit/DiffEq/SciML ecosystem from one of the research councils in the UK (specifically the EPSRC Softwar…

---

## [ModelingToolkit performance issue with repeated evaluations of variables in system of equations](https://discourse.julialang.org/t/modelingtoolkit-performance-issue-with-repeated-evaluations-of-variables-in-system-of-equations/64890)

<div class="topic-metadata">

**Author:** [@ograsdijk](https://discourse.julialang.org/u/ograsdijk)\
**Replies:** 3\
**Last updated:** [August 6, 2021, 10:21am UTC](https://discourse.julialang.org/t/modelingtoolkit-performance-issue-with-repeated-evaluations-of-variables-in-system-of-equations/64890 "2021-08-06T10:21:20Z")

</div>

Solving an ODEProblem created from an ODESystem with ModelingToolkit is slow when a simple time dependent variable (e.g. sin(t)) is added to the system of equations. For example: using ModelingToolkit using Differentia…

---

## [Is there a package for creating custom world](https://discourse.julialang.org/t/is-there-a-package-for-creating-custom-world/65883)

<div class="topic-metadata">

**Author:** [@development\_mentor](https://discourse.julialang.org/u/development_mentor)\
**Replies:** 8\
**Last updated:** [August 6, 2021, 6:35am UTC](https://discourse.julialang.org/t/is-there-a-package-for-creating-custom-world/65883 "2021-08-06T06:35:36Z")

</div>

I’m searching for a package that could create a 3D or 2D costume world. Something like the game world, in which you or artificial agent could interact with the environment. Which would follow rules specified by the creat…

---

## [CUDA memory error while using DifferentialEquations.jl](https://discourse.julialang.org/t/cuda-memory-error-while-using-differentialequations-jl/65855)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 2\
**Last updated:** [August 5, 2021, 7:40pm UTC](https://discourse.julialang.org/t/cuda-memory-error-while-using-differentialequations-jl/65855 "2021-08-05T19:40:39Z")

</div>

Not sure if I could get an answer to this kind of question here, but hopefully someone has an insight. I am solving a differential equation whose solution is in the form of f(z,ω). For each z, f(z,ω) is some sort of di…

---

## [Constructing ODEProblem parameter map from JSON data](https://discourse.julialang.org/t/constructing-odeproblem-parameter-map-from-json-data/65772)

<div class="topic-metadata">

**Author:** [@juliascrub](https://discourse.julialang.org/u/juliascrub)\
**Replies:** 3\
**Last updated:** [August 5, 2021, 3:43am UTC](https://discourse.julialang.org/t/constructing-odeproblem-parameter-map-from-json-data/65772 "2021-08-05T03:43:06Z")

</div>

I posted before here regarding this when my project was less fleshed out. Now that Ive actually got things mostly working I’m still struggling with this last task. Ive got some JSON that looks something like this: \[ …

---

## [Handling fluid systems in MTK](https://discourse.julialang.org/t/handling-fluid-systems-in-mtk/65305)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [August 4, 2021, 1:50am UTC](https://discourse.julialang.org/t/handling-fluid-systems-in-mtk/65305 "2021-08-04T01:50:45Z")

</div>

In Modelica a fluid Connector has a medium property, see \[1\]. Is this possible with the existing parameter system in MTK? As I understand it it has to be a subtype of Real, which a medium would not. If a large fluid s…

---

## [Cannot specify symbolic types](https://discourse.julialang.org/t/cannot-specify-symbolic-types/65702)

<div class="topic-metadata">

**Author:** [@yuvalw](https://discourse.julialang.org/u/yuvalw)\
**Replies:** 2\
**Last updated:** [August 3, 2021, 5:42pm UTC](https://discourse.julialang.org/t/cannot-specify-symbolic-types/65702 "2021-08-03T17:42:28Z")

</div>

Hello, I cannot specify any symbolic type. using Symbolics @variables u::Complex # or any other type gives the following error: ERROR: LoadError: AssertionError: @variables expects a tuple of expressions or an expres…

---

## [Lathe.jl: No Method Matching Error](https://discourse.julialang.org/t/lathe-jl-no-method-matching-error/65455)

<div class="topic-metadata">

**Author:** [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Replies:** 0\
**Last updated:** [July 28, 2021, 6:41pm UTC](https://discourse.julialang.org/t/lathe-jl-no-method-matching-error/65455 "2021-07-28T18:41:48Z")

</div>

Hello Everyone: I am using Lathe:preprocess Have attempted to activate the following functions from HERE: begin mutable struct OneHotEncoder{P} \<: Lathe.preprocess.Encoder predict::P function OneHotEncoder…

---

## [About @connectors](https://discourse.julialang.org/t/about-connectors/65083)

<div class="topic-metadata">

**Author:** [@juliascrub](https://discourse.julialang.org/u/juliascrub)\
**Replies:** 3\
**Last updated:** [July 26, 2021, 12:47am UTC](https://discourse.julialang.org/t/about-connectors/65083 "2021-07-26T00:47:08Z")

</div>

Ive got a model defined as a connector @connector function Pin(iv::Num; name) ... end And another model composed of these connectors: function ModelWithConnectors(iv::Num; name) @named a = Pin(iv) @named b …

---

## [Any Julia’s equivalent to Python’s pakacges: tespy, fluprodia](https://discourse.julialang.org/t/any-julia-s-equivalent-to-python-s-pakacges-tespy-fluprodia/65090)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 0\
**Last updated:** [July 22, 2021, 8:36am UTC](https://discourse.julialang.org/t/any-julia-s-equivalent-to-python-s-pakacges-tespy-fluprodia/65090 "2021-07-22T08:36:32Z")

</div>

Hello, there are packages in Julia equivalent or similar to: tespy fluprodia, from Python. It is of our interest Refrigeration Machine model, AND PARTICULARLY, Plotting and animating States into the Diagram All help,…

---

## [Passing data to modeling toolkit from a frontend](https://discourse.julialang.org/t/passing-data-to-modeling-toolkit-from-a-frontend/65013)

<div class="topic-metadata">

**Author:** [@juliascrub](https://discourse.julialang.org/u/juliascrub)\
**Replies:** 0\
**Last updated:** [July 21, 2021, 4:14am UTC](https://discourse.julialang.org/t/passing-data-to-modeling-toolkit-from-a-frontend/65013 "2021-07-21T04:14:25Z")

</div>

I am working on a little frontend for my modeling toolkit based project. let’s say I have a model my\_model. It has 3 parameters a,b, and c. I can call string.(parameters(my\_model)) and get a list of the parameter names,…

---

## [Calling Julia from EMTDC/PSCAD or MATLAB code](https://discourse.julialang.org/t/calling-julia-from-emtdc-pscad-or-matlab-code/52417)

<div class="topic-metadata">

**Author:** [@anchasatish](https://discourse.julialang.org/u/anchasatish)\
**Replies:** 5\
**Last updated:** [July 20, 2021, 9:52pm UTC](https://discourse.julialang.org/t/calling-julia-from-emtdc-pscad-or-matlab-code/52417 "2021-07-20T21:52:20Z")

</div>

I would like to use Julia programming as a software in loop for my EMTDC/PSCAD or MATLAB simulation i.e., optimization problem solved in julia and output of this optimization solution is given to the Simulation platform …

---

## [Empty container reduce error: diff eq](https://discourse.julialang.org/t/empty-container-reduce-error-diff-eq/64956)

<div class="topic-metadata">

**Author:** [@graham](https://discourse.julialang.org/u/graham)\
**Replies:** 10\
**Last updated:** [July 20, 2021, 2:52pm UTC](https://discourse.julialang.org/t/empty-container-reduce-error-diff-eq/64956 "2021-07-20T14:52:17Z")

</div>

Hi all, I’m trying to use the DifferentialEquations.jl package to perform explicit integration of a mass-spring-damper system. Here are the function I’m solving, and how I passed it into the SecondOrderODEProblem() fun…

---

## [Fixing parameter values when solving inverse problem using DiffEqFlux](https://discourse.julialang.org/t/fixing-parameter-values-when-solving-inverse-problem-using-diffeqflux/64963)

<div class="topic-metadata">

**Author:** [@juliascrub](https://discourse.julialang.org/u/juliascrub)\
**Replies:** 1\
**Last updated:** [July 20, 2021, 4:27am UTC](https://discourse.julialang.org/t/fixing-parameter-values-when-solving-inverse-problem-using-diffeqflux/64963 "2021-07-20T04:27:12Z")

</div>

Is there a way to fix certain parameters when using sciml\_train? I could manually override them in the loss function like below but am curious if theres a better way function loss(p) overridden\_p = p but with some p…

---

## [Optimization and Modelingtoolkit](https://discourse.julialang.org/t/optimization-and-modelingtoolkit/64483)

<div class="topic-metadata">

**Author:** [@juliascrub](https://discourse.julialang.org/u/juliascrub)\
**Replies:** 7\
**Last updated:** [July 14, 2021, 3:02am UTC](https://discourse.julialang.org/t/optimization-and-modelingtoolkit/64483 "2021-07-14T03:02:51Z")

</div>

Note: I am brand new to Julia and system modeling in general so I dont really have any idea of what I am doing haha. Ive got a simple voltage divider system (my intended model is more complex but I figured Id start smal…

---

## [Convenient parameter change for remake ODEProblem made with ODESystem](https://discourse.julialang.org/t/convenient-parameter-change-for-remake-odeproblem-made-with-odesystem/64537)

<div class="topic-metadata">

**Author:** [@ograsdijk](https://discourse.julialang.org/u/ograsdijk)\
**Replies:** 2\
**Last updated:** [July 12, 2021, 11:34pm UTC](https://discourse.julialang.org/t/convenient-parameter-change-for-remake-odeproblem-made-with-odesystem/64537 "2021-07-12T23:34:39Z")

</div>

I’m creating an ODESystem using ModelingToolkit.jl and was wondering if for EnsembleProblems there is an easier way to specify the parameters in remake. Example, from the documentation of ModelingToolkit: using Modelin…

---

## [Export/interface Julia code to FMI/FMU standard .fmu](https://discourse.julialang.org/t/export-interface-julia-code-to-fmi-fmu-standard-fmu/21211)

<div class="topic-metadata">

**Author:** [@bienpierre](https://discourse.julialang.org/u/bienpierre)\
**Replies:** 10\
**Last updated:** [July 12, 2021, 4:12pm UTC](https://discourse.julialang.org/t/export-interface-julia-code-to-fmi-fmu-standard-fmu/21211 "2021-07-12T16:12:02Z")

</div>

Hi everyone, I will start to build a modeling framework. I have simulation models which are built with Modelica, some others with Simulink/Simscape Toolbox and finally I have a control system designs with Julia and pa…

---

## [ModelingToolkit matrix form system of equations and complex values](https://discourse.julialang.org/t/modelingtoolkit-matrix-form-system-of-equations-and-complex-values/64431)

<div class="topic-metadata">

**Author:** [@ograsdijk](https://discourse.julialang.org/u/ograsdijk)\
**Replies:** 5\
**Last updated:** [July 10, 2021, 9:55pm UTC](https://discourse.julialang.org/t/modelingtoolkit-matrix-form-system-of-equations-and-complex-values/64431 "2021-07-10T21:55:56Z")

</div>

I’ve started looking into ModelingToolkit and I wanted to solve optical bloch differential equations with it, which have a complex part. I’ll preface this by saying I don’t have much experience with Julia yet, I started…

---

## [Failed to use DiffEqOperator in fluidized bed simulation](https://discourse.julialang.org/t/failed-to-use-diffeqoperator-in-fluidized-bed-simulation/64143)

<div class="topic-metadata">

**Author:** [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Replies:** 0\
**Last updated:** [July 6, 2021, 10:25am UTC](https://discourse.julialang.org/t/failed-to-use-diffeqoperator-in-fluidized-bed-simulation/64143 "2021-07-06T10:25:37Z")

</div>

Hello all, I tried to use the DiffEqOperator.jl in fluidized bed simulation but failed. I am not sure if I defined the bc or derivative operator wrongly or it’s another problem. the test code are in the two files: fu…

---

## [Performance overhead observed variables ModelingToolkit](https://discourse.julialang.org/t/performance-overhead-observed-variables-modelingtoolkit/64164)

<div class="topic-metadata">

**Author:** [@Elmo](https://discourse.julialang.org/u/Elmo)\
**Replies:** 1\
**Last updated:** [July 6, 2021, 9:43pm UTC](https://discourse.julialang.org/t/performance-overhead-observed-variables-modelingtoolkit/64164 "2021-07-06T21:43:51Z")

</div>

Hi all, I am using ModelingToolkit to simulate a system and noticed that there seems to be a serious performance cost associated with using the nice observed variables functionality of ModelingToolkit. Here is a minimal …

---

## [Modelling and Simulation: Regarding DDEs](https://discourse.julialang.org/t/modelling-and-simulation-regarding-ddes/63677)

<div class="topic-metadata">

**Author:** [@Phonindra](https://discourse.julialang.org/u/Phonindra)\
**Replies:** 19\
**Last updated:** [July 2, 2021, 10:43pm UTC](https://discourse.julialang.org/t/modelling-and-simulation-regarding-ddes/63677 "2021-07-02T22:43:13Z")

</div>

I was facing a problem regarding delay. For low delay e.g. tau = 0.101 the code was fine as tau increases slightly as tau = 0.104 or more it shows some error not exactly error but warning and shows no promising result. W…

---

## [(seems) a more efficient way to use diffEqOperator.jl](https://discourse.julialang.org/t/seems-a-more-efficient-way-to-use-diffeqoperator-jl/63506)

<div class="topic-metadata">

**Author:** [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Replies:** 5\
**Last updated:** [July 2, 2021, 12:12pm UTC](https://discourse.julialang.org/t/seems-a-more-efficient-way-to-use-diffeqoperator-jl/63506 "2021-07-02T12:12:04Z")

</div>

I found the derivative operators are not efficient, there seems to have a more efficient way to use. If I am wrong please tell me. For example when I have : dx = 0.01 x = dx:dx:0.3 Δ1 = UpwindDifference(1, 1, dx, lengt…

---

## [Event handling in jump problems](https://discourse.julialang.org/t/event-handling-in-jump-problems/63882)

<div class="topic-metadata">

**Author:** [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Replies:** 3\
**Last updated:** [July 1, 2021, 4:40pm UTC](https://discourse.julialang.org/t/event-handling-in-jump-problems/63882 "2021-07-01T16:40:26Z")

</div>

Consider for the sake of a minimal example the following pure jump problem. rn2 = @reaction\_network begin a, 0 --\> X end a prob2\_jump = JumpProblem(rn2, DiscreteProblem(rn2, \[0\], (0.0, 10.0), \[1.0\]), Direct()) I w…

---

## [ModelingToolkit: troubles using ode\_order\_lowering (A differentiated state's operation must be a \`Sym\`)](https://discourse.julialang.org/t/modelingtoolkit-troubles-using-ode-order-lowering-a-differentiated-states-operation-must-be-a-sym/63716)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 1\
**Last updated:** [June 30, 2021, 11:56am UTC](https://discourse.julialang.org/t/modelingtoolkit-troubles-using-ode-order-lowering-a-differentiated-states-operation-must-be-a-sym/63716 "2021-06-30T11:56:25Z")

</div>

I am trying to model a simple mechanical chain composed of a few masses interconnected with springs and exposed to friction. Such model comes in the form of a few coupled second-order differential equations. These I mode…

---

## [Update parameters in ModelingToolkit using callbacks](https://discourse.julialang.org/t/update-parameters-in-modelingtoolkit-using-callbacks/63770)

<div class="topic-metadata">

**Author:** [@jairorua](https://discourse.julialang.org/u/jairorua)\
**Replies:** 12\
**Last updated:** [June 30, 2021, 8:19am UTC](https://discourse.julialang.org/t/update-parameters-in-modelingtoolkit-using-callbacks/63770 "2021-06-30T08:19:30Z")

</div>

Hello, I was trying to create a simple control loop with modelingtoolkit. The idea was to have a generic controller whose setpoint can be changed using callbacks during a dynamic simulation. For example: using Modelin…

---

## [reactionMechanismSimulator.jl idealGas() call fails due to no default for stoichmatrix](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502)

<div class="topic-metadata">

**Author:** [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Replies:** 7\
**Last updated:** [June 30, 2021, 6:51am UTC](https://discourse.julialang.org/t/reactionmechanismsimulator-jl-idealgas-call-fails-due-to-no-default-for-stoichmatrix/61502 "2021-06-30T06:51:04Z")

</div>

The basic example of idealGas in reactionMechanism.jl fails to due no default for stoichmatrix. Advice to fix is much appreciated. Thx! using ReactionMechanismSimulator phaseDict = readinput("src/superminimal.rms"…

---

## [Sub plus (₊) instead of dot in the dot notation in equations displayed by ModelingToolkit](https://discourse.julialang.org/t/sub-plus-instead-of-dot-in-the-dot-notation-in-equations-displayed-by-modelingtoolkit/61113)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 4\
**Last updated:** [June 29, 2021, 6:45pm UTC](https://discourse.julialang.org/t/sub-plus-instead-of-dot-in-the-dot-notation-in-equations-displayed-by-modelingtoolkit/61113 "2021-06-29T18:45:49Z")

</div>

I was just wondering what was the reason for displaying the MTK equations using (for example) capacitor₊n₊v instead of capacitor.n.v (as in the RC Circuit example). Couldn’t dots be used for displaying as well (when they…

---

## [Chain rule in Symbolics.jl](https://discourse.julialang.org/t/chain-rule-in-symbolics-jl/63146)

<div class="topic-metadata">

**Author:** [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Replies:** 5\
**Last updated:** [June 22, 2021, 5:05pm UTC](https://discourse.julialang.org/t/chain-rule-in-symbolics-jl/63146 "2021-06-22T17:05:29Z")

</div>

Probably I’m blind, but is there a way to get the transformation \\frac{d}{d t} x(y(t)) = \\frac{\\partial x}{\\partial y}(y(t)) \\frac{\\partial y}{\\partial t}(t) where x and y are symbolic. (I want do do a symbolic transf…

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

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