# Modelling & Simulations

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

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

**Page:** 44

---

## [SymbolicUtils: LiteralReal](https://discourse.julialang.org/t/symbolicutils-literalreal/87044)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 0\
**Last updated:** [September 10, 2022, 5:14pm UTC](https://discourse.julialang.org/t/symbolicutils-literalreal/87044 "2022-09-10T17:14:22Z")

</div>

When should the LiteralReal type be used? How can I convert an expression that contains LiteralReal types?

---

## [SOLVED: Cannot Precompile OrdinaryDiffEq. Do others have problems with SciML/MTK packages at the moment?](https://discourse.julialang.org/t/solved-cannot-precompile-ordinarydiffeq-do-others-have-problems-with-sciml-mtk-packages-at-the-moment/86729)

<div class="topic-metadata">

**Author:** [@TS-CUBED](https://discourse.julialang.org/u/TS-CUBED)\
**Replies:** 0\
**Last updated:** [September 3, 2022, 1:52pm UTC](https://discourse.julialang.org/t/solved-cannot-precompile-ordinarydiffeq-do-others-have-problems-with-sciml-mtk-packages-at-the-moment/86729 "2022-09-03T13:52:46Z")

</div>

SOLVED: not sure what the problem was. But setting the environment back up from scratch, after deleting all the precompile cache helped. I guess I had a few bad bits cached. I just did an update of my Julia packages an…

---

## [Can MTK validate dimensions when using "connect" function?](https://discourse.julialang.org/t/can-mtk-validate-dimensions-when-using-connect-function/86699)

<div class="topic-metadata">

**Author:** [@TS-CUBED](https://discourse.julialang.org/u/TS-CUBED)\
**Replies:** 2\
**Last updated:** [September 2, 2022, 10:49pm UTC](https://discourse.julialang.org/t/can-mtk-validate-dimensions-when-using-connect-function/86699 "2022-09-02T22:49:02Z")

</div>

I’m trying to set up a circulation model with units. Or at least allow consistency checks. So I was playing around with Model Validation and Units · ModelingToolkit.jl and set up the following: using ModelingToolkit, Un…

---

## [Determinant of a symbolic matrix](https://discourse.julialang.org/t/determinant-of-a-symbolic-matrix/85587)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 4\
**Last updated:** [September 1, 2022, 12:33am UTC](https://discourse.julialang.org/t/determinant-of-a-symbolic-matrix/85587 "2022-09-01T00:33:39Z")

</div>

With Symbolics.jl how do I get the determinant of a symbolic matrix? I tried this: @variables a\[1:2, 1:2\] det(a) The only thing I can get is: Symbolics.\_det(a, true)

---

## [NeuralPDE cubature issue](https://discourse.julialang.org/t/neuralpde-cubature-issue/84427)

<div class="topic-metadata">

**Author:** [@marcofrancis](https://discourse.julialang.org/u/marcofrancis)\
**Replies:** 5\
**Last updated:** [August 31, 2022, 3:34pm UTC](https://discourse.julialang.org/t/neuralpde-cubature-issue/84427 "2022-08-31T15:34:07Z")

</div>

Hi, I’m moving my first steps with NeuralPDE.jl and I came up with this issue. I want to solve a fairly simple PDE: h(ω) = exp.(-(γ-1)\*ω) μω = λ\*(ω-ωb) σω = σ eq = 1/100\*Dτ(f(τ,ω)) ~ 0.5\*σω^2\*Dωω(f(τ,ω)) - μω\*Dω(f(τ,ω…

---

## [Symbolics and polynomials](https://discourse.julialang.org/t/symbolics-and-polynomials/86541)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 0\
**Last updated:** [August 30, 2022, 11:23am UTC](https://discourse.julialang.org/t/symbolics-and-polynomials/86541 "2022-08-30T11:23:50Z")

</div>

What is the best package for working with polynomials with Symbolics.jl?

---

## [Symbolics and Polynomial](https://discourse.julialang.org/t/symbolics-and-polynomial/86503)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 3\
**Last updated:** [August 29, 2022, 7:31pm UTC](https://discourse.julialang.org/t/symbolics-and-polynomial/86503 "2022-08-29T19:31:24Z")

</div>

Is there a function that lets you know if a given expression is a polynomial?

---

## [Symbolics.jl and struct](https://discourse.julialang.org/t/symbolics-jl-and-struct/86490)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 4\
**Last updated:** [August 29, 2022, 11:08am UTC](https://discourse.julialang.org/t/symbolics-jl-and-struct/86490 "2022-08-29T11:08:44Z")

</div>

Should I create structs when using Symbolics.jl or is it better not to use structs and always work with purely symbolic expressions? For example, if I wanted to create my functions for calculating the truncated Taylor s…

---

## [Tree corresponding to expression in Symbolics](https://discourse.julialang.org/t/tree-corresponding-to-expression-in-symbolics/86034)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 3\
**Last updated:** [August 28, 2022, 6:59pm UTC](https://discourse.julialang.org/t/tree-corresponding-to-expression-in-symbolics/86034 "2022-08-28T18:59:57Z")

</div>

In a video on YB I saw that you can get the tree corresponding to the expression with unwrap. tree\_expr = unwrap(sin(cos(x))) How can i access the elements of the tree? Also I saw that it can be displayed with: show…

---

## [Symbolics avoid simplifications with rules](https://discourse.julialang.org/t/symbolics-avoid-simplifications-with-rules/86421)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 2\
**Last updated:** [August 27, 2022, 2:39pm UTC](https://discourse.julialang.org/t/symbolics-avoid-simplifications-with-rules/86421 "2022-08-27T14:39:04Z")

</div>

How can I avoid simplification before applying a rule in Symbolics? I have (xy-yx) and I want to replace it with commutator(x, y), but before the rule can be applied xy-yx is simplified to 0.

---

## [Symbolics: Extend a rule to a sum with multiple terms](https://discourse.julialang.org/t/symbolics-extend-a-rule-to-a-sum-with-multiple-terms/86384)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 2\
**Last updated:** [August 26, 2022, 8:22pm UTC](https://discourse.julialang.org/t/symbolics-extend-a-rule-to-a-sum-with-multiple-terms/86384 "2022-08-26T20:22:38Z")

</div>

I have this: @syms commutator(a, b) myRule = @rule commutator((~a)+(~b), ~c) =\> commutator(~a, ~c) + commutator(~b, ~c) how can I extend the rule to get: myRule\_ = @rule commutator((~a)+(~b)+(~d), ~c) =\> commutator(~a…

---

## [Order of rules in Symbolics / SymbolicUtils](https://discourse.julialang.org/t/order-of-rules-in-symbolics-symbolicutils/86383)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [August 26, 2022, 1:50pm UTC](https://discourse.julialang.org/t/order-of-rules-in-symbolics-symbolicutils/86383 "2022-08-26T13:50:12Z")

</div>

Does the order of the rules in Symbolics/SymbolicUtils matter when simplifying?

---

## [Comparison of integrators DifferentialEquations.jl](https://discourse.julialang.org/t/comparison-of-integrators-differentialequations-jl/86271)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 15\
**Last updated:** [August 25, 2022, 11:11am UTC](https://discourse.julialang.org/t/comparison-of-integrators-differentialequations-jl/86271 "2022-08-25T11:11:56Z")

</div>

I get two different trajectoriesf or identical parametres, time, and initial condition. for comparison i using integrator from Julia and python. I have used several integrators from Julia and python and get completely d…

---

## [Could SciML benefit from a DifferentiationProblem and solvers with caches?](https://discourse.julialang.org/t/could-sciml-benefit-from-a-differentiationproblem-and-solvers-with-caches/86267)

<div class="topic-metadata">

**Author:** [@jt1](https://discourse.julialang.org/u/jt1)\
**Replies:** 1\
**Last updated:** [August 24, 2022, 3:06pm UTC](https://discourse.julialang.org/t/could-sciml-benefit-from-a-differentiationproblem-and-solvers-with-caches/86267 "2022-08-24T15:06:09Z")

</div>

I’ve been using SciML with great success for over a year now. I’m a very big fan. I hope this doesn’t seem rude, but I have 2 propositions which would improve SciML imo. I noticed that my main struggle is calculating d…

---

## [Visualization attractors DynamicalSystems.jl](https://discourse.julialang.org/t/visualization-attractors-dynamicalsystems-jl/86247)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 0\
**Last updated:** [August 24, 2022, 8:25am UTC](https://discourse.julialang.org/t/visualization-attractors-dynamicalsystems-jl/86247 "2022-08-24T08:25:03Z")

</div>

Is it possible to construct an attractor not in the form of points, but in the form of a continuous curve? I tried to do it and got this result. The curve is not closed due to incorrect visualization or is it becaus…

---

## [Ttr lyapunovspectrum DynamicalSystems.jl](https://discourse.julialang.org/t/ttr-lyapunovspectrum-dynamicalsystems-jl/86206)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 4:21pm UTC](https://discourse.julialang.org/t/ttr-lyapunovspectrum-dynamicalsystems-jl/86206 "2022-08-23T16:21:45Z")

</div>

I have code: lyapunovspectrum(ds, 300000.0; Ttr = 200000.0, diffeq = (alg = Vern9(), abstol = 1e-11, reltol = 1e-11, dense = false, maxiters = 10000…

---

## [Agents.jl : how to smartly implement Triangular and Hexagonal Grids](https://discourse.julialang.org/t/agents-jl-how-to-smartly-implement-triangular-and-hexagonal-grids/86106)

<div class="topic-metadata">

**Author:** [@Rouzaire](https://discourse.julialang.org/u/Rouzaire)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 9:19am UTC](https://discourse.julialang.org/t/agents-jl-how-to-smartly-implement-triangular-and-hexagonal-grids/86106 "2022-08-23T09:19:30Z")

</div>

Hello everyone, First of all, I would like to thank the devs for the great piece of work that is Agents.jl . In the world of two dimensional lattice, the square one is ubiquitous in numerical simulations. In this packa…

---

## [Video annotation software for Flux project](https://discourse.julialang.org/t/video-annotation-software-for-flux-project/85545)

<div class="topic-metadata">

**Author:** [@franfram](https://discourse.julialang.org/u/franfram)\
**Replies:** 4\
**Last updated:** [August 22, 2022, 11:24pm UTC](https://discourse.julialang.org/t/video-annotation-software-for-flux-project/85545 "2022-08-22T23:24:35Z")

</div>

Hello everyone, For my PhD, I’m working on a accelerometer decoder using flux. But first I need to annotate videos of animal behaviour, and I’d like to have some software or julia code that allows me te predefine the cl…

---

## [Non commutative variables Symbolics.jl](https://discourse.julialang.org/t/non-commutative-variables-symbolics-jl/86089)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [August 21, 2022, 2:46pm UTC](https://discourse.julialang.org/t/non-commutative-variables-symbolics-jl/86089 "2022-08-21T14:46:10Z")

</div>

I don’t understand how to work with variables that don’t commute. It would be nice if there was documentation with examples of non-commutativity with Symbolics.jl. Two particular examples would be useful: -there are v…

---

## [Modeling system with piecewise constant control input](https://discourse.julialang.org/t/modeling-system-with-piecewise-constant-control-input/86057)

<div class="topic-metadata">

**Author:** [@stepanoslejsek](https://discourse.julialang.org/u/stepanoslejsek)\
**Replies:** 7\
**Last updated:** [August 20, 2022, 1:01pm UTC](https://discourse.julialang.org/t/modeling-system-with-piecewise-constant-control-input/86057 "2022-08-20T13:01:48Z")

</div>

Hello, I would like to simulate a model with use of DifferentialEquations.jl. I know I can provide an input to the system via anonymous function, but I am not able to approximate such function. Is there any possible wa…

---

## [Inverse of symbolic matrix](https://discourse.julialang.org/t/inverse-of-symbolic-matrix/85764)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 27\
**Last updated:** [August 19, 2022, 9:32am UTC](https://discourse.julialang.org/t/inverse-of-symbolic-matrix/85764 "2022-08-19T09:32:52Z")

</div>

using Symbolics, LinearAlgebra @variables q::Real iden = collect(I(4) .\* 1.0) k = inv(iden .\* q^2) I get true/q^2 on the diagonal instead of 1/q^2

---

## [Catalyst.jl compositions with parameters as stoichiometric constants](https://discourse.julialang.org/t/catalyst-jl-compositions-with-parameters-as-stoichiometric-constants/85934)

<div class="topic-metadata">

**Author:** [@snystrom](https://discourse.julialang.org/u/snystrom)\
**Replies:** 4\
**Last updated:** [August 19, 2022, 2:36am UTC](https://discourse.julialang.org/t/catalyst-jl-compositions-with-parameters-as-stoichiometric-constants/85934 "2022-08-19T02:36:47Z")

</div>

I am trying to build a set of reaction models that I can compose together using Catalyst.jl, but running into a small problem. Say I want to model a system and include stoichiometric terms as parameters. For instance, t…

---

## [DiffEqParamEstim with Modellingtoolkit](https://discourse.julialang.org/t/diffeqparamestim-with-modellingtoolkit/85788)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 11\
**Last updated:** [August 19, 2022, 2:22am UTC](https://discourse.julialang.org/t/diffeqparamestim-with-modellingtoolkit/85788 "2022-08-19T02:22:52Z")

</div>

Hi I am generating a model using MTK and would like to generate a simple loss function for it. Is there a way in which I can access the observed variables in my solution when solving my problem. I know given a standar…

---

## [Symbolics Einstein notation](https://discourse.julialang.org/t/symbolics-einstein-notation/85866)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [August 17, 2022, 9:19am UTC](https://discourse.julialang.org/t/symbolics-einstein-notation/85866 "2022-08-17T09:19:41Z")

</div>

How do I do this with the arrayop macro in Symbolics.jl? using Tullio, Symbolics @variables x₀ q = x₀\*rand(4, 4) t = x₀\*rand(4, 4, 4) @tullio r\[a, b, c\] := q\[a, i\]\*t\[i, b, c\] I tried this r = Symbolics.@arrayop (a, …

---

## [Basins of attractros for 6D system DynamicalSystems.jl](https://discourse.julialang.org/t/basins-of-attractros-for-6d-system-dynamicalsystems-jl/85781)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 11\
**Last updated:** [August 16, 2022, 7:16am UTC](https://discourse.julialang.org/t/basins-of-attractros-for-6d-system-dynamicalsystems-jl/85781 "2022-08-16T07:16:24Z")

</div>

I trye found basins for attractors, but i have some problems. First problem is out of memmory when i use big length for xg1 = yg1 = zg1 = xg2 = yg2 = zg2 = range(-6.0, 6.0; length = 10) If i using for example length …

---

## [DiffEqParamEstim.jl - Generalized Likelihood Inference](https://discourse.julialang.org/t/diffeqparamestim-jl-generalized-likelihood-inference/85709)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 2\
**Last updated:** [August 15, 2022, 5:39pm UTC](https://discourse.julialang.org/t/diffeqparamestim-jl-generalized-likelihood-inference/85709 "2022-08-15T17:39:10Z")

</div>

Hi, I am looking to implement the method that is found here I can follow the method well but I can not for the life of me see a way in which I could extend this to a problem to a situation where we have got n\>2 paramete…

---

## [Orbitdiagram DynamicalSystems.jl](https://discourse.julialang.org/t/orbitdiagram-dynamicalsystems-jl/85766)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 0\
**Last updated:** [August 15, 2022, 9:43am UTC](https://discourse.julialang.org/t/orbitdiagram-dynamicalsystems-jl/85766 "2022-08-15T09:43:04Z")

</div>

Parameter that changes at high values leads to synchronization, that is, a regular mode appears. Ideally, the diagram should show the transition from chaos to regularity. The diagram show this, but there are windows that…

---

## [Agents.elastic\_collision!() makes ageents move faster and faster](https://discourse.julialang.org/t/agents-elastic-collision-makes-ageents-move-faster-and-faster/84740)

<div class="topic-metadata">

**Author:** [@Wen-Wei\_Tseng](https://discourse.julialang.org/u/Wen-Wei_Tseng)\
**Replies:** 1\
**Last updated:** [August 14, 2022, 12:18pm UTC](https://discourse.julialang.org/t/agents-elastic-collision-makes-ageents-move-faster-and-faster/84740 "2022-08-14T12:18:41Z")

</div>

I tried replicating the results of social distancing example in Agents.jl Example Zoo. And the agents (balls) moved faster and faster in the output video. I was using Julia 1.8.0-rc3 (I’ve tried Julia 1.7.3, but the res…

---

## [Tullio without product](https://discourse.julialang.org/t/tullio-without-product/85708)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [August 13, 2022, 5:13pm UTC](https://discourse.julialang.org/t/tullio-without-product/85708 "2022-08-13T17:13:26Z")

</div>

How can I replace the \* with a function? @tullio c := a\[i\]\*b\[i\] a is an array of symbolic differential and b is an array of symbolic functions. I would like to get: a\[1\](b\[1\])+a\[2\](b\[2\]) Thank you

---

## [Lyapunov spectrum, HyperChaos, DynamicalSystems.jl](https://discourse.julialang.org/t/lyapunov-spectrum-hyperchaos-dynamicalsystems-jl/85539)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 8\
**Last updated:** [August 11, 2022, 1:19pm UTC](https://discourse.julialang.org/t/lyapunov-spectrum-hyperchaos-dynamicalsystems-jl/85539 "2022-08-11T13:19:53Z")

</div>

I calculate lyapunov spectrum in hyperchaos. Why i have such spectrum: \[0.015581182326147337, 0.0028325903213687266, 1.0762649529273773e-6, -0.007004756972893843, -5.7866575928839605, -11.883439707053556\] For hyp…

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

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