# Modelling & Simulations

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

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

**Page:** 42

---

## [Dojo - simulating a quadcopter](https://discourse.julialang.org/t/dojo-simulating-a-quadcopter/90050)

<div class="topic-metadata">

**Author:** [@Daniel\_Lewis](https://discourse.julialang.org/u/Daniel_Lewis)\
**Replies:** 2\
**Last updated:** [November 13, 2022, 6:46am UTC](https://discourse.julialang.org/t/dojo-simulating-a-quadcopter/90050 "2022-11-13T06:46:26Z")

</div>

Hello, I started working on a multi rigid body dynamic using Dojo.jl. I’m interested in simulating a Quadcopter, my question is : How can I simulate the fan’s thrust force? thanks Daniel

---

## [How to specify vector MTK states or parameters to ODESystem call? (ODESystem(eq,t,var,par))](https://discourse.julialang.org/t/how-to-specify-vector-mtk-states-or-parameters-to-odesystem-call-odesystem-eq-t-var-par/89844)

<div class="topic-metadata">

**Author:** [@jondavis847](https://discourse.julialang.org/u/jondavis847)\
**Replies:** 2\
**Last updated:** [November 10, 2022, 4:13pm UTC](https://discourse.julialang.org/t/how-to-specify-vector-mtk-states-or-parameters-to-odesystem-call-odesystem-eq-t-var-par/89844 "2022-11-10T16:13:48Z")

</div>

Hey folks, I’m working to implement a simple vectorized step function using callbacks as a learning exercise. I was able to create a simple scalar step function: function step(time;name) x = @variables u(t)=0 \[…

---

## [Constraints in a stochastic differential equation problem](https://discourse.julialang.org/t/constraints-in-a-stochastic-differential-equation-problem/90004)

<div class="topic-metadata">

**Author:** [@jmg367](https://discourse.julialang.org/u/jmg367)\
**Replies:** 1\
**Last updated:** [November 9, 2022, 8:39pm UTC](https://discourse.julialang.org/t/constraints-in-a-stochastic-differential-equation-problem/90004 "2022-11-09T20:39:54Z")

</div>

I am trying to implement constraints into a spatial chemical langevin equation. I have an array where every two indices corresponds to a spatial location. Every odd/even index corresponds to the number of agents of type …

---

## [Performing mul!() with Sparse Matrices inside DiffEq.jl model](https://discourse.julialang.org/t/performing-mul-with-sparse-matrices-inside-diffeq-jl-model/89963)

<div class="topic-metadata">

**Author:** [@jarias9](https://discourse.julialang.org/u/jarias9)\
**Replies:** 2\
**Last updated:** [November 9, 2022, 4:04pm UTC](https://discourse.julialang.org/t/performing-mul-with-sparse-matrices-inside-diffeq-jl-model/89963 "2022-11-09T16:04:50Z")

</div>

Hello all, I was trying to improve the runtime of a model I am running in DiffEq.jl I have been going through the optimization steps for an eqnsystem!(du, u, p, t) however I am a bit stuck with regards to how to optimi…

---

## [Help solving coupled differential equations involving complex numbers](https://discourse.julialang.org/t/help-solving-coupled-differential-equations-involving-complex-numbers/89893)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 6\
**Last updated:** [November 9, 2022, 11:13am UTC](https://discourse.julialang.org/t/help-solving-coupled-differential-equations-involving-complex-numbers/89893 "2022-11-09T11:13:36Z")

</div>

Original title: “Some help solving set of differential equations” Hi. I am stuck in doing some homework, and I was hoping I could get some help. The task is to analytically or numerically solve some differential equati…

---

## [Improve model parameters in a chain of simple transfer functions by optimization](https://discourse.julialang.org/t/improve-model-parameters-in-a-chain-of-simple-transfer-functions-by-optimization/89565)

<div class="topic-metadata">

**Author:** [@JanKap](https://discourse.julialang.org/u/JanKap)\
**Replies:** 3\
**Last updated:** [November 8, 2022, 6:19pm UTC](https://discourse.julialang.org/t/improve-model-parameters-in-a-chain-of-simple-transfer-functions-by-optimization/89565 "2022-11-08T18:19:47Z")

</div>

I hope this is the right section here. Suppose there’s a simple chain of transfer functions which originate from an electrical system. I try to match an output curve to be as close to a target as possible. I’ll try to d…

---

## [Unitful SymbolicNumericIntegration ambiguity](https://discourse.julialang.org/t/unitful-symbolicnumericintegration-ambiguity/89917)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [November 8, 2022, 11:22am UTC](https://discourse.julialang.org/t/unitful-symbolicnumericintegration-ambiguity/89917 "2022-11-08T11:22:30Z")

</div>

What is supposed to happen here? using Symbolics, SymbolicNumericIntegration, Unitful @variables x julia\> integrate(9.8u"m/s^2"\*x) ERROR: MethodError: \*(::Quantity{Float64, 𝐋 𝐓^-2, …}, ::Num) is ambiguous. Candidates: …

---

## [Packages for Fluid Simulations and Modelling?](https://discourse.julialang.org/t/packages-for-fluid-simulations-and-modelling/89882)

<div class="topic-metadata">

**Author:** [@wali\_waqar](https://discourse.julialang.org/u/wali_waqar)\
**Replies:** 1\
**Last updated:** [November 7, 2022, 9:34pm UTC](https://discourse.julialang.org/t/packages-for-fluid-simulations-and-modelling/89882 "2022-11-07T21:34:36Z")

</div>

Hi, I have to simulate Faraday Waves and Faraday Instability in floating droplets for a project that I’m doing, and I really wanted to use Julia for the task. Are there any packages that I could be of use to me?

---

## [Understanding the confidence interval of Sobol indices](https://discourse.julialang.org/t/understanding-the-confidence-interval-of-sobol-indices/89643)

<div class="topic-metadata">

**Author:** [@Ge0rges](https://discourse.julialang.org/u/Ge0rges)\
**Replies:** 4\
**Last updated:** [November 6, 2022, 2:15am UTC](https://discourse.julialang.org/t/understanding-the-confidence-interval-of-sobol-indices/89643 "2022-11-06T02:15:20Z")

</div>

Hello, The documentation around the confidence level of Sobol indices is a bit sparse. Could someone explain how the following works in GlobalSensitivity: The role of nboot The role of setting conf\_level How to retr…

---

## [ControlSystems / Numeric representation of the x-axis for bodeplot](https://discourse.julialang.org/t/controlsystems-numeric-representation-of-the-x-axis-for-bodeplot/89562)

<div class="topic-metadata">

**Author:** [@GottDengDirk](https://discourse.julialang.org/u/GottDengDirk)\
**Replies:** 14\
**Last updated:** [November 4, 2022, 8:24am UTC](https://discourse.julialang.org/t/controlsystems-numeric-representation-of-the-x-axis-for-bodeplot/89562 "2022-11-04T08:24:00Z")

</div>

Hello, I want the numbers on the x-axis to be integers wenn i use “bodeplot”. For example 0 0.2 0.4, but not 210^-1 410^-1. Thanks in advance.

---

## [Analysis of ensembles of different solution lengths (DiffEq)](https://discourse.julialang.org/t/analysis-of-ensembles-of-different-solution-lengths-diffeq/89752)

<div class="topic-metadata">

**Author:** [@Lachlan-Bn](https://discourse.julialang.org/u/Lachlan-Bn)\
**Replies:** 1\
**Last updated:** [November 5, 2022, 8:56pm UTC](https://discourse.julialang.org/t/analysis-of-ensembles-of-different-solution-lengths-diffeq/89752 "2022-11-05T20:56:39Z")

</div>

I’m solving some ensembles where each trajectory is going to have a wildly different length due to a termination callback. I’d like to be able to, e.g using the EnsembleSolution/EnsembleSummary methods visualize how this…

---

## [Customizing legends of rootlocusplot by ControlSystem.jl?](https://discourse.julialang.org/t/customizing-legends-of-rootlocusplot-by-controlsystem-jl/89756)

<div class="topic-metadata">

**Author:** [@emone](https://discourse.julialang.org/u/emone)\
**Replies:** 3\
**Last updated:** [November 5, 2022, 8:19am UTC](https://discourse.julialang.org/t/customizing-legends-of-rootlocusplot-by-controlsystem-jl/89756 "2022-11-05T08:19:56Z")

</div>

Hello mates, I would like to manipulate the rootlocusplot syntax by modifying the legends to be able to differentiate the system that I am graphing. Has anyone tried this? My algorithm is this using ControlSystems usi…

---

## [Modeling a crowbar circuit with ModelingToolkit.jl](https://discourse.julialang.org/t/modeling-a-crowbar-circuit-with-modelingtoolkit-jl/81968)

<div class="topic-metadata">

**Author:** [@Irene\_Ndindabahizi](https://discourse.julialang.org/u/Irene_Ndindabahizi)\
**Replies:** 5\
**Last updated:** [November 4, 2022, 3:35pm UTC](https://discourse.julialang.org/t/modeling-a-crowbar-circuit-with-modelingtoolkit-jl/81968 "2022-11-04T15:35:10Z")

</div>

Hi All, I am trying to model an electromagnetic launcher using ModelingToolkit.jl. The electric circuit is basically an RLC with a crowbar circuit that cut off the capacitor when the voltage is 0V. I managed to do the s…

---

## [ODEFunctionExpr and observed variables \[Modeling Toolkit\]](https://discourse.julialang.org/t/odefunctionexpr-and-observed-variables-modeling-toolkit/89728)

<div class="topic-metadata">

**Author:** [@lxsilva](https://discourse.julialang.org/u/lxsilva)\
**Replies:** 0\
**Last updated:** [November 3, 2022, 5:30pm UTC](https://discourse.julialang.org/t/odefunctionexpr-and-observed-variables-modeling-toolkit/89728 "2022-11-03T17:30:44Z")

</div>

Hello! so, I’m using MTK as a tool for modeling. I’m using ModelingToolkitStandardLibrary in order to build my models (great tool btw). After I build my ODESystem and run “structural\_simplify” I would like to save my …

---

## [Rlocusplot provide gain K](https://discourse.julialang.org/t/rlocusplot-provide-gain-k/89578)

<div class="topic-metadata">

**Author:** [@GottDengDirk](https://discourse.julialang.org/u/GottDengDirk)\
**Replies:** 5\
**Last updated:** [November 1, 2022, 8:23pm UTC](https://discourse.julialang.org/t/rlocusplot-provide-gain-k/89578 "2022-11-01T20:23:13Z")

</div>

Hello, i have a problem that i want to provide K for rlocusplot, but it does no work. thanks in advance using ControlSystems w0=2\*pi D=0.1 Ki=0.05 sys = Kiw0^2/(s^3+2Dw0s^2+w0^2s+Kiw0^2) k=range(1e-6,stop=1000,le…

---

## [Decade missing in bode plot](https://discourse.julialang.org/t/decade-missing-in-bode-plot/89564)

<div class="topic-metadata">

**Author:** [@lucasmsoares96](https://discourse.julialang.org/u/lucasmsoares96)\
**Replies:** 3\
**Last updated:** [October 31, 2022, 6:22pm UTC](https://discourse.julialang.org/t/decade-missing-in-bode-plot/89564 "2022-10-31T18:22:35Z")

</div>

When I plot the bode diagram it hides the decade 10¹ begin using ControlSystems using Plots h₁ = tf( \[10\], \[1, 20\] ) bodeplot(h₁) end How to show the missing decade?

---

## [GBODE solver: is it relevant?](https://discourse.julialang.org/t/gbode-solver-is-it-relevant/89496)

<div class="topic-metadata">

**Author:** [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Replies:** 7\
**Last updated:** [October 30, 2022, 7:18pm UTC](https://discourse.julialang.org/t/gbode-solver-is-it-relevant/89496 "2022-10-30T19:18:47Z")

</div>

Going through OpenModelica’s user guide I stumbled upon one of its default integration methods: GBODE. I was surprised to not find a Julia implementation/port of it e.g. available via DifferentialEquations.jl. I wonder…

---

## [Help debugging differential equation](https://discourse.julialang.org/t/help-debugging-differential-equation/89271)

<div class="topic-metadata">

**Author:** [@Ge0rges](https://discourse.julialang.org/u/Ge0rges)\
**Replies:** 6\
**Last updated:** [October 30, 2022, 5:45pm UTC](https://discourse.julialang.org/t/help-debugging-differential-equation/89271 "2022-10-30T17:45:56Z")

</div>

Hello all, I have a set of relatively simple differential equations modeling growth of bacteria as a function of available substrates. Unfortunately, my model fails to be solved in one particular case, and I cannot figu…

---

## [Using Symbolics and Flux](https://discourse.julialang.org/t/using-symbolics-and-flux/89498)

<div class="topic-metadata">

**Author:** [@Max\_Beez](https://discourse.julialang.org/u/Max_Beez)\
**Replies:** 4\
**Last updated:** [October 29, 2022, 7:02pm UTC](https://discourse.julialang.org/t/using-symbolics-and-flux/89498 "2022-10-29T19:02:42Z")

</div>

Let’s say I have something along the lines of using Symbolics, Flux @variables x,y function f() \[x^2y^3 ; x+y^2\] end grad\_f(x,y) = Flux.gradient(transpose(f())\*f(), x,y) display(grad\_f(x,y)) The following error…

---

## [ModelingToolkit - the concept of "state"](https://discourse.julialang.org/t/modelingtoolkit-the-concept-of-state/89304)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 7\
**Last updated:** [October 28, 2022, 8:07am UTC](https://discourse.julialang.org/t/modelingtoolkit-the-concept-of-state/89304 "2022-10-28T08:07:53Z")

</div>

I’m a little confused about the use of the word “state” (not only in ModelingToolkit). In classic dynamic systems theory, the state is the minimum information necessary to describe current time of a dynamic system, so th…

---

## [ModelingToolkit.jl ODEProblem throwing error when differential term not isolated to the LHS](https://discourse.julialang.org/t/modelingtoolkit-jl-odeproblem-throwing-error-when-differential-term-not-isolated-to-the-lhs/89365)

<div class="topic-metadata">

**Author:** [@ap2013](https://discourse.julialang.org/u/ap2013)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 4:36pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-odeproblem-throwing-error-when-differential-term-not-isolated-to-the-lhs/89365 "2022-10-27T16:36:59Z")

</div>

I am constructing an ODESystem by connecting 4 different systems. I recently changed one of the systems, I want it to be a 2-DOF planar arm with equations M(\\theta)\\ddot{\\theta} + C(\\theta,\\dot{\\theta})\\dot{\\theta} = u …

---

## [Diffeq ContinuousCallback "not callable" errors](https://discourse.julialang.org/t/diffeq-continuouscallback-not-callable-errors/88198)

<div class="topic-metadata">

**Author:** [@John\_Boik](https://discourse.julialang.org/u/John_Boik)\
**Replies:** 9\
**Last updated:** [October 26, 2022, 7:42pm UTC](https://discourse.julialang.org/t/diffeq-continuouscallback-not-callable-errors/88198 "2022-10-26T19:42:36Z")

</div>

My use of ContinuousCallback from DifferentialEquations.jl is throwing an error and I don’t know why. Any help would be appreciated. The short version of the error is: LoadError: MethodError: objects of type SciMLBase.C…

---

## [ModelingToolkit - component defaults](https://discourse.julialang.org/t/modelingtoolkit-component-defaults/89281)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 4\
**Last updated:** [October 26, 2022, 3:54pm UTC](https://discourse.julialang.org/t/modelingtoolkit-component-defaults/89281 "2022-10-26T15:54:18Z")

</div>

I have some background with Modelica, where the specification and modification of defaults is relatively simple. From the ModelingToolkit documentation \[p. 2 of ModelingToolkit.jl documentation\]: Often it is a good ide…

---

## [JumpProcesses.jl : Specify the specific jumps which occured](https://discourse.julialang.org/t/jumpprocesses-jl-specify-the-specific-jumps-which-occured/89291)

<div class="topic-metadata">

**Author:** [@ashwingop](https://discourse.julialang.org/u/ashwingop)\
**Replies:** 5\
**Last updated:** [October 26, 2022, 12:53pm UTC](https://discourse.julialang.org/t/jumpprocesses-jl-specify-the-specific-jumps-which-occured/89291 "2022-10-26T12:53:54Z")

</div>

Hey all, I am working with a Markov jump process with multiple possible reactions (Variable rates) coupled to a stochastic differential equation. I am trying to simulate it using the JumpProcesses.jl package. I am tryi…

---

## [Optimising an imperfect, high-dimensional simulation with experimental data](https://discourse.julialang.org/t/optimising-an-imperfect-high-dimensional-simulation-with-experimental-data/89234)

<div class="topic-metadata">

**Author:** [@duncan](https://discourse.julialang.org/u/duncan)\
**Replies:** 6\
**Last updated:** [October 26, 2022, 12:00am UTC](https://discourse.julialang.org/t/optimising-an-imperfect-high-dimensional-simulation-with-experimental-data/89234 "2022-10-26T00:00:15Z")

</div>

I have used data from CFD simulations to create a Gaussian process surrogate of a mixing tank. The GP can estimate the reaction rate of the tank given a subset of the operating conditions, e.g. reagent concentration and …

---

## [How can I specify a vector of coupled ODEs symbolically (for use in ModelingToolkit)?](https://discourse.julialang.org/t/how-can-i-specify-a-vector-of-coupled-odes-symbolically-for-use-in-modelingtoolkit/89211)

<div class="topic-metadata">

**Author:** [@yohan](https://discourse.julialang.org/u/yohan)\
**Replies:** 2\
**Last updated:** [October 25, 2022, 8:20pm UTC](https://discourse.julialang.org/t/how-can-i-specify-a-vector-of-coupled-odes-symbolically-for-use-in-modelingtoolkit/89211 "2022-10-25T20:20:38Z")

</div>

I am new to Julia and trying to learn ModelingToolkit. I have looked at the tutorials and they are bit simpler than the use case I have: I would like to implement coupled ODEs for a firing rate-based neuronal network mod…

---

## [Awkward ODE problem](https://discourse.julialang.org/t/awkward-ode-problem/88435)

<div class="topic-metadata">

**Author:** [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Replies:** 7\
**Last updated:** [October 24, 2022, 11:14am UTC](https://discourse.julialang.org/t/awkward-ode-problem/88435 "2022-10-24T11:14:02Z")

</div>

I have a differential equation of the kind \\dot q\_1 = f(q\_1, q\_2)\\\\ A(q\_1,q\_2)\\dot q\_2=B(q\_1,q\_2)\\dot q\_1 where q\_1, q\_2 are vectors, A is a symmetric, positive-definite real matrix, and B is a real (non-square) matri…

---

## [How to obtain maximized ELBO value from Turing to use as approximation to model evidence?](https://discourse.julialang.org/t/how-to-obtain-maximized-elbo-value-from-turing-to-use-as-approximation-to-model-evidence/88787)

<div class="topic-metadata">

**Author:** [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)\
**Replies:** 5\
**Last updated:** [October 23, 2022, 11:02am UTC](https://discourse.julialang.org/t/how-to-obtain-maximized-elbo-value-from-turing-to-use-as-approximation-to-model-evidence/88787 "2022-10-23T11:02:33Z")

</div>

Hi all! I’m running variational inference in Turing. However, I can’t seem to find a way to extract the maximized ELBO from the Turing ADVI. If anyone can point me to relevant information that would be wonderful!

---

## [CallWithMetadata has no field val error for simple PDE system in ModelingToolkit](https://discourse.julialang.org/t/callwithmetadata-has-no-field-val-error-for-simple-pde-system-in-modelingtoolkit/89055)

<div class="topic-metadata">

**Author:** [@hbooth](https://discourse.julialang.org/u/hbooth)\
**Replies:** 2\
**Last updated:** [October 21, 2022, 1:02pm UTC](https://discourse.julialang.org/t/callwithmetadata-has-no-field-val-error-for-simple-pde-system-in-modelingtoolkit/89055 "2022-10-21T13:02:26Z")

</div>

Hi using DifferentialEquations using ModelingToolkit, MethodOfLines @parameters x @variables t c(..) Dx = Differential(x) Dxx = Differential(x)^2 Dt = Differential(t) L = 1. D = 0.16 k = 1. j0 = 0.4 eq = Dt(c(t,x))…

---

## [How to integrate out latent variables/ intermediate values in Turing model](https://discourse.julialang.org/t/how-to-integrate-out-latent-variables-intermediate-values-in-turing-model/89003)

<div class="topic-metadata">

**Author:** [@neuro\_enthusiast](https://discourse.julialang.org/u/neuro_enthusiast)\
**Replies:** 4\
**Last updated:** [October 21, 2022, 9:27am UTC](https://discourse.julialang.org/t/how-to-integrate-out-latent-variables-intermediate-values-in-turing-model/89003 "2022-10-21T09:27:05Z")

</div>

Hi all, my generative model has the following form. P(y |\\theta) = \\int P(y|x) P(x|\\theta) dx I want to get the posterior of θ given fixed data y. But I unfortunately don’t have an analytical solution for the inte…

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

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