# Modelling & Simulations

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

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

**Page:** 43

---

## [Matrix SDEs](https://discourse.julialang.org/t/matrix-sdes/89038)

<div class="topic-metadata">

**Author:** [@simoneb](https://discourse.julialang.org/u/simoneb)\
**Replies:** 2\
**Last updated:** [October 21, 2022, 6:20am UTC](https://discourse.julialang.org/t/matrix-sdes/89038 "2022-10-21T06:20:47Z")

</div>

Hi all, I am trying to fit the following matrix SDE using the following code: G = \[0 -1; 1 0\]; p = (A=G, B=G) function drift(du, u, p, t) ## drift function for the SDE du = t \* p.A; end # drift function diffusion…

---

## [Problem with reversediff when using Turing](https://discourse.julialang.org/t/problem-with-reversediff-when-using-turing/88798)

<div class="topic-metadata">

**Author:** [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)\
**Replies:** 2\
**Last updated:** [October 20, 2022, 10:44am UTC](https://discourse.julialang.org/t/problem-with-reversediff-when-using-turing/88798 "2022-10-20T10:44:41Z")

</div>

I’m receiving the following error when using reversediff for fitting my model. Does anyone have any clue what may be causing this? I’m using reversediff 1.7.0. Forward diff works fine for my model. The sampler is NUTS(20…

---

## [Substitution of products of symbolic variables](https://discourse.julialang.org/t/substitution-of-products-of-symbolic-variables/88733)

<div class="topic-metadata">

**Author:** [@afossa](https://discourse.julialang.org/u/afossa)\
**Replies:** 3\
**Last updated:** [October 17, 2022, 11:42am UTC](https://discourse.julialang.org/t/substitution-of-products-of-symbolic-variables/88733 "2022-10-17T11:42:06Z")

</div>

I am trying to simplify a symbolic expression by replacing products of symbolic variables, eg. x\*y, with a single new variable, e.g. z, but I cannot succeed in doing it. Any suggestion? MWE: using Symbolics using Symbo…

---

## [Tutorials for Modeling Toolkit look a little messed up](https://discourse.julialang.org/t/tutorials-for-modeling-toolkit-look-a-little-messed-up/88199)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 3\
**Last updated:** [October 16, 2022, 6:33pm UTC](https://discourse.julialang.org/t/tutorials-for-modeling-toolkit-look-a-little-messed-up/88199 "2022-10-16T18:33:28Z")

</div>

https://tutorials.sciml.ai/stable/ode\_extras/01-ModelingToolkit/ This is probably not the place to report this, but I wanted to mark it down before I forget. Looks like some errors and screen dumps are happening in the…

---

## [Does ModelingToolKit suitable for this kind of battery modeling (Example in simulink)?](https://discourse.julialang.org/t/does-modelingtoolkit-suitable-for-this-kind-of-battery-modeling-example-in-simulink/88759)

<div class="topic-metadata">

**Author:** [@Jian\_ZUO](https://discourse.julialang.org/u/Jian_ZUO)\
**Replies:** 2\
**Last updated:** [October 15, 2022, 8:15am UTC](https://discourse.julialang.org/t/does-modelingtoolkit-suitable-for-this-kind-of-battery-modeling-example-in-simulink/88759 "2022-10-15T08:15:29Z")

</div>

Hi all, I want to implement a battery simulation model, an example is given on Matlab Simulink: I am new to ModelingToolkit and trying to the possibilities of implementing this in Julia. Thank you very much for the p…

---

## [How to obtain log likelihoods from turing model](https://discourse.julialang.org/t/how-to-obtain-log-likelihoods-from-turing-model/88700)

<div class="topic-metadata">

**Author:** [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)\
**Replies:** 4\
**Last updated:** [October 14, 2022, 7:00pm UTC](https://discourse.julialang.org/t/how-to-obtain-log-likelihoods-from-turing-model/88700 "2022-10-14T19:00:07Z")

</div>

What are some good ways of obtaining the likelihood of observing some data given the parameters ( P(y|\\theta), where I feed in y and \\theta )? I couldn’t quite find it in the documentation. edit: would be especially hel…

---

## [Variable is not a function of independent variable error for trivial example](https://discourse.julialang.org/t/variable-is-not-a-function-of-independent-variable-error-for-trivial-example/88669)

<div class="topic-metadata">

**Author:** [@drandran12](https://discourse.julialang.org/u/drandran12)\
**Replies:** 1\
**Last updated:** [October 13, 2022, 11:44pm UTC](https://discourse.julialang.org/t/variable-is-not-a-function-of-independent-variable-error-for-trivial-example/88669 "2022-10-13T23:44:39Z")

</div>

I am trying out the ModelingToolkit.jl package and I get this weird error when defing the classical harmonic oscillator with the following code using ModelingToolkit, @variables t x(t) @parameters ω₀ Dₜ = Differential(t…

---

## [Can we use LinearExponential with Turing.jl model?](https://discourse.julialang.org/t/can-we-use-linearexponential-with-turing-jl-model/88479)

<div class="topic-metadata">

**Author:** [@aelmokadem](https://discourse.julialang.org/u/aelmokadem)\
**Replies:** 18\
**Last updated:** [October 13, 2022, 11:39am UTC](https://discourse.julialang.org/t/can-we-use-linearexponential-with-turing-jl-model/88479 "2022-10-13T11:39:36Z")

</div>

Trying to use the LinearExponential solver with a Turing.jl model to run a Bayesian inference. Can this example work? Model: dat\_test = \[0.0,4.4,6.9,8.2,7.8,7.5,6.2,5.3,4.9,3.7,1.05\] times = \[0.0,0.27,0.58,1.02,2.02,3.…

---

## [Rlocusplot() does not plot the roots](https://discourse.julialang.org/t/rlocusplot-does-not-plot-the-roots/88547)

<div class="topic-metadata">

**Author:** [@lucasmsoares96](https://discourse.julialang.org/u/lucasmsoares96)\
**Replies:** 3\
**Last updated:** [October 13, 2022, 10:46am UTC](https://discourse.julialang.org/t/rlocusplot-does-not-plot-the-roots/88547 "2022-10-13T10:46:34Z")

</div>

Hello guys. I’m having trouble plotting the root locus diagram. He doesn’t show my roots. X(s) = \\frac{6s+204}{s^3+10s^2+34s} using ControlSystems sys2 = tf( \[6,204\], \[1,10,34,0\] ) rlocusplot(sys2) The Julia code ab…

---

## [Issue with UDE repository - LV\_Scenario 1](https://discourse.julialang.org/t/issue-with-ude-repository-lv-scenario-1/88618)

<div class="topic-metadata">

**Author:** [@xztt](https://discourse.julialang.org/u/xztt)\
**Replies:** 8\
**Last updated:** [October 12, 2022, 10:33pm UTC](https://discourse.julialang.org/t/issue-with-ude-repository-lv-scenario-1/88618 "2022-10-12T22:33:38Z")

</div>

Hi, When trying to perform the optimisation with Adam adtype = Optimization.AutoZygote() optf = Optimization.OptimizationFunction((x,p)-\>loss(x), adtype) optprob = Optimization.OptimizationProblem(optf, ComponentVector…

---

## [Efficiently access data that changes rarely](https://discourse.julialang.org/t/efficiently-access-data-that-changes-rarely/88564)

<div class="topic-metadata">

**Author:** [@braeburn](https://discourse.julialang.org/u/braeburn)\
**Replies:** 1\
**Last updated:** [October 11, 2022, 10:27am UTC](https://discourse.julialang.org/t/efficiently-access-data-that-changes-rarely/88564 "2022-10-11T10:27:07Z")

</div>

Hey. I want to run some simulations depending on weather forecasts. The data is used very often so access is performance critical. It also may change, even though this only happens whenever a new forecast is available. I…

---

## [ModelingToolkit and State Variables with Optimization](https://discourse.julialang.org/t/modelingtoolkit-and-state-variables-with-optimization/84430)

<div class="topic-metadata">

**Author:** [@mzhenirovskyy](https://discourse.julialang.org/u/mzhenirovskyy)\
**Replies:** 11\
**Last updated:** [October 10, 2022, 3:01am UTC](https://discourse.julialang.org/t/modelingtoolkit-and-state-variables-with-optimization/84430 "2022-10-10T03:01:50Z")

</div>

I have the simple system from the documentation. module Grid1 export get\_model using ModelingToolkit using ModelingToolkitStandardLibrary.Electrical using ModelingToolkitStandardLibrary.Blocks: Constant function get\_…

---

## [Ferrite.jl periodic boundary conditions](https://discourse.julialang.org/t/ferrite-jl-periodic-boundary-conditions/39387)

<div class="topic-metadata">

**Author:** [@blaszm](https://discourse.julialang.org/u/blaszm)\
**Replies:** 2\
**Last updated:** [October 6, 2022, 11:42am UTC](https://discourse.julialang.org/t/ferrite-jl-periodic-boundary-conditions/39387 "2022-10-06T11:42:34Z")

</div>

Hi, I’m a PhD student working on the multiscale simulation of complex materials. Recently I discovered Julia and the JuAFEM package for my work. I’m trying to do FE² (finite element square). For this purpose, usually the…

---

## [SDE simulation using DifferentialEquations.jl SDE solver RKMilGeneral](https://discourse.julialang.org/t/sde-simulation-using-differentialequations-jl-sde-solver-rkmilgeneral/88312)

<div class="topic-metadata">

**Author:** [@Max\_Beez](https://discourse.julialang.org/u/Max_Beez)\
**Replies:** 3\
**Last updated:** [October 6, 2022, 2:20am UTC](https://discourse.julialang.org/t/sde-simulation-using-differentialequations-jl-sde-solver-rkmilgeneral/88312 "2022-10-06T02:20:55Z")

</div>

I am simulating an SDE and using scatter! to plot the results. I set dt = 0.1 with timespan 0.0 to 1.0, then if use EM() as the SDE solver method I get 10 equally spaced (in-time) scatter points on the plot. Howeve…

---

## [Q: Using Metatheory.jl for code optimization](https://discourse.julialang.org/t/q-using-metatheory-jl-for-code-optimization/88201)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 0\
**Last updated:** [October 4, 2022, 2:20am UTC](https://discourse.julialang.org/t/q-using-metatheory-jl-for-code-optimization/88201 "2022-10-04T02:20:28Z")

</div>

Hello, After going through the rather terse Metatheory.jl documentation, there are a number of concepts that are novel and unfamilair to me, so I’m unable to discern if the package can do the following: It is possible …

---

## [How to avoid recompiling when using job array on a cluster](https://discourse.julialang.org/t/how-to-avoid-recompiling-when-using-job-array-on-a-cluster/88126)

<div class="topic-metadata">

**Author:** [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)\
**Replies:** 8\
**Last updated:** [October 2, 2022, 11:09pm UTC](https://discourse.julialang.org/t/how-to-avoid-recompiling-when-using-job-array-on-a-cluster/88126 "2022-10-02T23:09:34Z")

</div>

Hi all, I am trying to run MCMC sampling for a model built with Turing.jl. Since different chains can be sampled in parallel using multiple processes, I want to use the following line: # some lines in my code, model\_si…

---

## [Geometric Integrators for SDE problems](https://discourse.julialang.org/t/geometric-integrators-for-sde-problems/87961)

<div class="topic-metadata">

**Author:** [@simoneb](https://discourse.julialang.org/u/simoneb)\
**Replies:** 3\
**Last updated:** [September 29, 2022, 6:54am UTC](https://discourse.julialang.org/t/geometric-integrators-for-sde-problems/87961 "2022-09-29T06:54:33Z")

</div>

Hi, I am trying to figure out how to use an SDE solver for matrix-valued Stochastic Differential Equations. It looks like the packages GeometricIntegrators.jl, and StochasticIntegrators.jl might have the functionality b…

---

## [Parameter tunability?](https://discourse.julialang.org/t/parameter-tunability/87756)

<div class="topic-metadata">

**Author:** [@lamorton](https://discourse.julialang.org/u/lamorton)\
**Replies:** 1\
**Last updated:** [September 24, 2022, 7:20pm UTC](https://discourse.julialang.org/t/parameter-tunability/87756 "2022-09-24T19:20:37Z")

</div>

I noticed in the docs on ModelingToolkit master branch that there’s a mention of having a metadata tag that controls whether a parameter is considered adjustable by an optimizer. Is this supported already, or still in t…

---

## [Get variables number in Symbolics](https://discourse.julialang.org/t/get-variables-number-in-symbolics/87739)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [September 24, 2022, 1:57pm UTC](https://discourse.julialang.org/t/get-variables-number-in-symbolics/87739 "2022-09-24T13:57:30Z")

</div>

Symbolics/ModelingToolkit How do I know the number of independent variables and their names in an equation or expression? @variables x u(x) get\_variables(u+x+cos(x)) # \[x, y(x)\] but I want only x get\_variables(0 ~ x^2 …

---

## [Orbit diagram from the sum of two variables DynamicalSystems.jl](https://discourse.julialang.org/t/orbit-diagram-from-the-sum-of-two-variables-dynamicalsystems-jl/87620)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 4\
**Last updated:** [September 22, 2022, 9:57am UTC](https://discourse.julialang.org/t/orbit-diagram-from-the-sum-of-two-variables-dynamicalsystems-jl/87620 "2022-09-22T09:57:12Z")

</div>

Hello, I need to repeat the following orbit diagram, where 𝑥||𝑚𝑎𝑥 is maximums from 𝑥|| = x1 + x2. I know how calculate him from two variable but i don’t know how ploting him, examples in documentation only for one varia…

---

## [Incorrect bifurcation diagram bifurcationkit.jl](https://discourse.julialang.org/t/incorrect-bifurcation-diagram-bifurcationkit-jl/87259)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 30\
**Last updated:** [September 22, 2022, 8:19am UTC](https://discourse.julialang.org/t/incorrect-bifurcation-diagram-bifurcationkit-jl/87259 "2022-09-22T08:19:27Z")

</div>

This is my first time using this package and I need to get a bifurcation diagram for the following system function sigma(x) return 1.0 / ( 1.0 + exp( -10.0 \* ( x - ( - 0.25 ) ) ) ) end function HR(u, p) a…

---

## [Pathfinding and update\_vel!](https://discourse.julialang.org/t/pathfinding-and-update-vel/87471)

<div class="topic-metadata">

**Author:** [@InesP](https://discourse.julialang.org/u/InesP)\
**Replies:** 2\
**Last updated:** [September 21, 2022, 6:37pm UTC](https://discourse.julialang.org/t/pathfinding-and-update-vel/87471 "2022-09-21T18:37:45Z")

</div>

Hey, I started using Agents.jl recently, and I have a question regarding using pathfinding and update\_vel! together. I’m trying to use Agents to model crowd dynamics in emergency situations. Right now, I’m using the AS…

---

## [How to partilly instantiate parameters of a reaction network in Catalyst (or ModelingToolkit ?)](https://discourse.julialang.org/t/how-to-partilly-instantiate-parameters-of-a-reaction-network-in-catalyst-or-modelingtoolkit/87427)

<div class="topic-metadata">

**Author:** [@Cedric\_Lh](https://discourse.julialang.org/u/Cedric_Lh)\
**Replies:** 4\
**Last updated:** [September 20, 2022, 10:11am UTC](https://discourse.julialang.org/t/how-to-partilly-instantiate-parameters-of-a-reaction-network-in-catalyst-or-modelingtoolkit/87427 "2022-09-20T10:11:39Z")

</div>

Hi! Is there a simple way, in Catalyst.jl, to instantiate some of the parameters of a reaction system ? Suppose, I have this simple network: rn1 = @reaction\_network begin a, X --\> ∅ b, Y --\> X end a b so, param…

---

## [Modia doc page fail](https://discourse.julialang.org/t/modia-doc-page-fail/87489)

<div class="topic-metadata">

**Author:** [@Jian\_ZUO](https://discourse.julialang.org/u/Jian_ZUO)\
**Replies:** 4\
**Last updated:** [September 19, 2022, 7:58pm UTC](https://discourse.julialang.org/t/modia-doc-page-fail/87489 "2022-09-19T19:58:29Z")

</div>

Hi all, I found the Modia.jl documentation page can not be opened, is this a temporary problem or it is no longer available? Thank you in advance!

---

## [Using ModelingToolkit.jl to model a matrix ODE](https://discourse.julialang.org/t/using-modelingtoolkit-jl-to-model-a-matrix-ode/82490)

<div class="topic-metadata">

**Author:** [@golanor](https://discourse.julialang.org/u/golanor)\
**Replies:** 3\
**Last updated:** [September 17, 2022, 12:44pm UTC](https://discourse.julialang.org/t/using-modelingtoolkit-jl-to-model-a-matrix-ode/82490 "2022-09-17T12:44:04Z")

</div>

Hi, I’m trying to create a matrix ODE using ModelingToolkit,jl (to simplify autodiff and code optimization), but I’m receiving an error which I did not find in any of the issues of the library. Any idea what I’m doing w…

---

## [Best practices for defining stochastic affect! functions for Jump Problems (RNG)](https://discourse.julialang.org/t/best-practices-for-defining-stochastic-affect-functions-for-jump-problems-rng/87202)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 7\
**Last updated:** [September 15, 2022, 12:43pm UTC](https://discourse.julialang.org/t/best-practices-for-defining-stochastic-affect-functions-for-jump-problems-rng/87202 "2022-09-15T12:43:42Z")

</div>

I have created a small module based on DifferentialEquations to help me define a certain kind of stochastic differential equations where the stochastic processes are Lévy processes. As the jumps are stochastic, the kind …

---

## [Using fixed points from dynamicalsystems.jl in BifurcationKit.jl](https://discourse.julialang.org/t/using-fixed-points-from-dynamicalsystems-jl-in-bifurcationkit-jl/87213)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 4\
**Last updated:** [September 13, 2022, 2:08pm UTC](https://discourse.julialang.org/t/using-fixed-points-from-dynamicalsystems-jl-in-bifurcationkit-jl/87213 "2022-09-13T14:08:19Z")

</div>

I find fixed points by changing two parameters of a continuous system using the fixed point() function. How correctly use finded fixed points for plotting bifurcation diagram by BifurcationKit.jl? Are there any examp…

---

## [How to identify oscillatory conditions in Julia ODEs?](https://discourse.julialang.org/t/how-to-identify-oscillatory-conditions-in-julia-odes/81824)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 24\
**Last updated:** [September 12, 2022, 11:59am UTC](https://discourse.julialang.org/t/how-to-identify-oscillatory-conditions-in-julia-odes/81824 "2022-09-12T11:59:46Z")

</div>

Dear all, I am simulating bacterial infections and I would like to know if there is a way to spot cases when the population enters an oscillatory equilibrium, for instance, as in this case: To note that the two theo…

---

## [Efficiently creating a data frame that is made up of smaller data frames](https://discourse.julialang.org/t/efficiently-creating-a-data-frame-that-is-made-up-of-smaller-data-frames/87055)

<div class="topic-metadata">

**Author:** [@erickawaguchi](https://discourse.julialang.org/u/erickawaguchi)\
**Replies:** 5\
**Last updated:** [September 11, 2022, 10:25am UTC](https://discourse.julialang.org/t/efficiently-creating-a-data-frame-that-is-made-up-of-smaller-data-frames/87055 "2022-09-11T10:25:43Z")

</div>

Hi all, I’m trying to create a “long” version data frame (e.g. several observations per individual as in a longitudinal study). However, the data frame for each individual will depend on certain parameters - not the sam…

---

## [When are two expressions equal?](https://discourse.julialang.org/t/when-are-two-expressions-equal/87045)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [September 10, 2022, 6:31pm UTC](https://discourse.julialang.org/t/when-are-two-expressions-equal/87045 "2022-09-10T18:31:37Z")

</div>

We know that an expression can be written in various forms. For example: (x - 2)^2 and 4 + x^2 - 4x are the same function. Given a set of substitution rules (such as the default ones in SymbolicUtils.jl), what is the be…

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

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