# Modelling & Simulations

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

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

**Page:** 60

---

## [SymPy vs Sympy.jl and/or symengine.jl](https://discourse.julialang.org/t/sympy-vs-sympy-jl-and-or-symengine-jl/39464)

<div class="topic-metadata">

**Author:** [@SanAlphaTau](https://discourse.julialang.org/u/SanAlphaTau)\
**Replies:** 14\
**Last updated:** [September 2, 2020, 12:13pm UTC](https://discourse.julialang.org/t/sympy-vs-sympy-jl-and-or-symengine-jl/39464 "2020-09-02T12:13:15Z")

</div>

Hello, I’ve been using python and sympy to build up a series of quite large symbolic equations. I then use python to evaluate them numerically and solve for minima (using a combination of lambdify and scipy optimize). T…

---

## [Models precompilation and general modelling platform architecture](https://discourse.julialang.org/t/models-precompilation-and-general-modelling-platform-architecture/45599)

<div class="topic-metadata">

**Author:** [@ivborissov](https://discourse.julialang.org/u/ivborissov)\
**Replies:** 11\
**Last updated:** [September 1, 2020, 9:01am UTC](https://discourse.julialang.org/t/models-precompilation-and-general-modelling-platform-architecture/45599 "2020-09-01T09:01:45Z")

</div>

Hi, could you please help me with the following workflow question. Let’s say I have a simulation platform as julia package X and a number of models as julia .jl files. I would like say using X then precompile and upload…

---

## [Using ModelingToolkit to invert a symbolic matrix](https://discourse.julialang.org/t/using-modelingtoolkit-to-invert-a-symbolic-matrix/45642)

<div class="topic-metadata">

**Author:** [@Bruno\_Mendes](https://discourse.julialang.org/u/Bruno_Mendes)\
**Replies:** 10\
**Last updated:** [August 31, 2020, 9:31pm UTC](https://discourse.julialang.org/t/using-modelingtoolkit-to-invert-a-symbolic-matrix/45642 "2020-08-31T21:31:14Z")

</div>

Hi. I’m trying to invert a mass matrix with the purpose of decoupling the second order derivatives of a dynamic system, using ModelingToolkit.jl. The matrix is something like this: In Julia, the elements of this matr…

---

## [Creating an array of equations in ModelingToolkit](https://discourse.julialang.org/t/creating-an-array-of-equations-in-modelingtoolkit/45712)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 2\
**Last updated:** [August 29, 2020, 2:53am UTC](https://discourse.julialang.org/t/creating-an-array-of-equations-in-modelingtoolkit/45712 "2020-08-29T02:53:04Z")

</div>

I am trying to model a set of differential equations in ModelingToolkit. And I want to formulate it using vector variables. Namely, I will have a variable vector z = \[z₁, z₂, z₃\] (just a minimal example): julia\> using M…

---

## [Setting really small values in ODE to zero](https://discourse.julialang.org/t/setting-really-small-values-in-ode-to-zero/45693)

<div class="topic-metadata">

**Author:** [@levasco](https://discourse.julialang.org/u/levasco)\
**Replies:** 3\
**Last updated:** [August 28, 2020, 2:31pm UTC](https://discourse.julialang.org/t/setting-really-small-values-in-ode-to-zero/45693 "2020-08-28T14:31:03Z")

</div>

In modelling biological communities with ODEs, given that individuals are somewhat finite entities, I am trying to avoid infinitesimal densities which are mathematically correct but make no sense. More specifically, I wa…

---

## [Calculating principal curvatures of point clouds](https://discourse.julialang.org/t/calculating-principal-curvatures-of-point-clouds/45621)

<div class="topic-metadata">

**Author:** [@Roy\_Toren](https://discourse.julialang.org/u/Roy_Toren)\
**Replies:** 0\
**Last updated:** [August 27, 2020, 12:24pm UTC](https://discourse.julialang.org/t/calculating-principal-curvatures-of-point-clouds/45621 "2020-08-27T12:24:33Z")

</div>

Hello everyone, I am trying to calculate the surface variance of 3D objects. I searched for implementations of such calculations in Julia but failed to find appropriate libraries. Do you know of any libraries which im…

---

## [ModelingToolkit.jl: '===' comparison on Operations(/Expressions)](https://discourse.julialang.org/t/modelingtoolkit-jl-comparison-on-operations-expressions/45559)

<div class="topic-metadata">

**Author:** [@NumHack](https://discourse.julialang.org/u/NumHack)\
**Replies:** 2\
**Last updated:** [August 26, 2020, 4:24pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-comparison-on-operations-expressions/45559 "2020-08-26T16:24:10Z")

</div>

Hi, Since this is my first post, I want to thank everyone involved in the creation of the Julia language. I would like to compare Operation/Expression objects, my initial goal being to replace sub-(Operation/Expression…

---

## [Ensemble simulations with "paired" trajectories](https://discourse.julialang.org/t/ensemble-simulations-with-paired-trajectories/45194)

<div class="topic-metadata">

**Author:** [@Lachlan-Bn](https://discourse.julialang.org/u/Lachlan-Bn)\
**Replies:** 5\
**Last updated:** [August 19, 2020, 10:07am UTC](https://discourse.julialang.org/t/ensemble-simulations-with-paired-trajectories/45194 "2020-08-19T10:07:49Z")

</div>

I’m interested in doing something roughly like the following: Choose a (possibly random) initial condition u0 From u0, take a (possibly random) “perturbation” of u0, say, x0 = u0 + s Integrate both trajectories, and ev…

---

## [FreeCAD with Julia](https://discourse.julialang.org/t/freecad-with-julia/44966)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 10\
**Last updated:** [August 15, 2020, 4:16pm UTC](https://discourse.julialang.org/t/freecad-with-julia/44966 "2020-08-15T16:16:11Z")

</div>

Looks like the FreeCAD community has taken an interest in supporting Julia computations: https://forum.freecadweb.org/viewtopic.php?f=8&t=42400

---

## [Error: Unexpected values in bisection. (DifferentialEquations)](https://discourse.julialang.org/t/error-unexpected-values-in-bisection-differentialequations/45145)

<div class="topic-metadata">

**Author:** [@Lachlan-Bn](https://discourse.julialang.org/u/Lachlan-Bn)\
**Replies:** 3\
**Last updated:** [August 18, 2020, 3:08pm UTC](https://discourse.julialang.org/t/error-unexpected-values-in-bisection-differentialequations/45145 "2020-08-18T15:08:02Z")

</div>

I’m encountering an error related to using BigFloats and a callback that terminates the integrator upon certain conditions. More specifically, julia throws the following error when calling solve() with the callback on a …

---

## [DiffEq result for a dynamical system differs from wolframalpha](https://discourse.julialang.org/t/diffeq-result-for-a-dynamical-system-differs-from-wolframalpha/45101)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 3\
**Last updated:** [August 17, 2020, 1:38pm UTC](https://discourse.julialang.org/t/diffeq-result-for-a-dynamical-system-differs-from-wolframalpha/45101 "2020-08-17T13:38:52Z")

</div>

I want to solve this differential equation: (d^2 y(t))/(dt^2) = -0.1×(dy(t))/(dt) + 0.5 y(t) - 2 y(t)^3 + 2 cos(2.4 t) How I tried to solve it using DiffEq: using DifferentialEquations using Plots function duffing!(d…

---

## [Proper syntax for adding reactions to a reaction network using addreaction!() function in Catalyst.jl](https://discourse.julialang.org/t/proper-syntax-for-adding-reactions-to-a-reaction-network-using-addreaction-function-in-catalyst-jl/44804)

<div class="topic-metadata">

**Author:** [@spock1](https://discourse.julialang.org/u/spock1)\
**Replies:** 3\
**Last updated:** [August 13, 2020, 4:15am UTC](https://discourse.julialang.org/t/proper-syntax-for-adding-reactions-to-a-reaction-network-using-addreaction-function-in-catalyst-jl/44804 "2020-08-13T04:15:42Z")

</div>

I recently started to thinking about switching my simulations to Julia and got to know about Catalyst.jl package and its convenient macro to create and modify reaction networks. I wanted to add a reaction to an already…

---

## [Rand() period](https://discourse.julialang.org/t/rand-period/44837)

<div class="topic-metadata">

**Author:** [@steve1313](https://discourse.julialang.org/u/steve1313)\
**Replies:** 1\
**Last updated:** [August 13, 2020, 12:50am UTC](https://discourse.julialang.org/t/rand-period/44837 "2020-08-13T00:50:15Z")

</div>

What is the period of Julia’s rand() function (default rand(), returning Float64)? How many times can you call rand() before it starts repeating?

---

## [Type error when using sciml\_train with a stiff ODE solver](https://discourse.julialang.org/t/type-error-when-using-sciml-train-with-a-stiff-ode-solver/44763)

<div class="topic-metadata">

**Author:** [@told](https://discourse.julialang.org/u/told)\
**Replies:** 2\
**Last updated:** [August 12, 2020, 2:44pm UTC](https://discourse.julialang.org/t/type-error-when-using-sciml-train-with-a-stiff-ode-solver/44763 "2020-08-12T14:44:20Z")

</div>

I’m using Julia since today so I might miss something fundamental. I recently discovered the UDE for SciML paper and the super nice SciML library. I try to rebuild something similar to the Lotka-Voltera example from the …

---

## [Stochastic DDEs?](https://discourse.julialang.org/t/stochastic-ddes/24338)

<div class="topic-metadata">

**Author:** [@maedoc](https://discourse.julialang.org/u/maedoc)\
**Replies:** 9\
**Last updated:** [August 12, 2020, 7:12am UTC](https://discourse.julialang.org/t/stochastic-ddes/24338 "2020-08-12T07:12:04Z")

</div>

hi I’m new to Julia, but looking to port a neural mass network model with both delays & (linear additive) stochastic forcing (which I’ve solved elsewhere by adding delays by hand to typical SDE methods). Looking throug…

---

## [DifferentialEquations; how to simulate limit stops](https://discourse.julialang.org/t/differentialequations-how-to-simulate-limit-stops/44376)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 10\
**Last updated:** [August 10, 2020, 10:22pm UTC](https://discourse.julialang.org/t/differentialequations-how-to-simulate-limit-stops/44376 "2020-08-10T22:22:17Z")

</div>

I’m trying to simulate a spring mass system in which the mass is constrained by limits stops or walls. There’s a driving force which, if it pushes the mass to one wall or the other, essentially halts the system until th…

---

## [ModelingToolkit.jl and differential equations with step/pulse inputs](https://discourse.julialang.org/t/modelingtoolkit-jl-and-differential-equations-with-step-pulse-inputs/40272)

<div class="topic-metadata">

**Author:** [@DR59](https://discourse.julialang.org/u/DR59)\
**Replies:** 17\
**Last updated:** [August 9, 2020, 4:42pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-and-differential-equations-with-step-pulse-inputs/40272 "2020-08-09T16:42:52Z")

</div>

In lots of differential equations applications, we want to solve a ‘forced’ DE whose evolution depends upon some input u(t). For instance we can consider a harmonic oscillator with a forcing term. The equation below make…

---

## [Using symbolic mathematics to find equations of motion](https://discourse.julialang.org/t/using-symbolic-mathematics-to-find-equations-of-motion/44442)

<div class="topic-metadata">

**Author:** [@Bruno\_Mendes](https://discourse.julialang.org/u/Bruno_Mendes)\
**Replies:** 1\
**Last updated:** [August 6, 2020, 6:11pm UTC](https://discourse.julialang.org/t/using-symbolic-mathematics-to-find-equations-of-motion/44442 "2020-08-06T18:11:48Z")

</div>

I am working with a reduced-order mathematical model for the motion of a offshore platform. The deduction of equations of motion requires a lot of symbolic computation as differentiation of time-dependent variables and …

---

## [FEM frameworks for simulations which couple diffusion and linear elasticity](https://discourse.julialang.org/t/fem-frameworks-for-simulations-which-couple-diffusion-and-linear-elasticity/44431)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 0\
**Last updated:** [August 6, 2020, 4:30pm UTC](https://discourse.julialang.org/t/fem-frameworks-for-simulations-which-couple-diffusion-and-linear-elasticity/44431 "2020-08-06T16:30:19Z")

</div>

I want to simulate a cylinder symmetric 2d multi material structure to solve a reaction diffusion problem coupled with a linear elasticity. What FEM package would be most suited for a simulation like this? As the react…

---

## [Non-diagonal noise](https://discourse.julialang.org/t/non-diagonal-noise/44004)

<div class="topic-metadata">

**Author:** [@mzhai2](https://discourse.julialang.org/u/mzhai2)\
**Replies:** 2\
**Last updated:** [August 1, 2020, 5:13pm UTC](https://discourse.julialang.org/t/non-diagonal-noise/44004 "2020-08-01T17:13:11Z")

</div>

How am I supposed to use non-diagonal noise when du is a matrix? When I run the example below I get: BoundsError: attempt to access 2-element Array{Float64,1} at index \[1, 2\] using DifferentialEquations, LinearAlgebra …

---

## [Large initial values in DAE system](https://discourse.julialang.org/t/large-initial-values-in-dae-system/43592)

<div class="topic-metadata">

**Author:** [@lob](https://discourse.julialang.org/u/lob)\
**Replies:** 0\
**Last updated:** [July 23, 2020, 10:17pm UTC](https://discourse.julialang.org/t/large-initial-values-in-dae-system/43592 "2020-07-23T22:17:13Z")

</div>

Hi all, I am trying to solve a DAE system using DifferentialEquations.jl where initial values can be relatively large (order 1e22). The MWE below (algebraic equations omitted) solves fine up to n0\[1\] = 1e15 but throws a…

---

## [Synthetic X-ray tomography with Julia](https://discourse.julialang.org/t/synthetic-x-ray-tomography-with-julia/19353)

<div class="topic-metadata">

**Author:** [@KirillGerke](https://discourse.julialang.org/u/KirillGerke)\
**Replies:** 10\
**Last updated:** [July 23, 2020, 8:03pm UTC](https://discourse.julialang.org/t/synthetic-x-ray-tomography-with-julia/19353 "2020-07-23T20:03:23Z")

</div>

Dear All, Objective: My aim is to use Julia to combine a number of complex computational tasks, one of them being creation of synthetic tomography. My search provided no results on existing Julia packages related to X-r…

---

## [Heterogeneous units and ModelingToolkit](https://discourse.julialang.org/t/heterogeneous-units-and-modelingtoolkit/37922)

<div class="topic-metadata">

**Author:** [@mefob](https://discourse.julialang.org/u/mefob)\
**Replies:** 5\
**Last updated:** [July 15, 2020, 9:04pm UTC](https://discourse.julialang.org/t/heterogeneous-units-and-modelingtoolkit/37922 "2020-07-15T21:04:58Z")

</div>

I am trying to use the ModelingToolkit together with Unitful to model a coupled system of two ODEs with different units. The following code fails on ODEProblem with a DimensionError unless both units in u0 are the same: …

---

## [Agents.jl/AgentsPlots.jl/InteractiveChaos.jl errors](https://discourse.julialang.org/t/agents-jl-agentsplots-jl-interactivechaos-jl-errors/42941)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [July 15, 2020, 2:23pm UTC](https://discourse.julialang.org/t/agents-jl-agentsplots-jl-interactivechaos-jl-errors/42941 "2020-07-15T14:23:22Z")

</div>

I’m trying to build a simple model and I’m experiencing some errors that I’m unable to debug. Here’s the code I’m running: using Agents using AgentsPlots using Distributions using LightGraphs mutable struct EmployerAge…

---

## [DifferentialEquations and Parameter Estimation with Indicator Variables](https://discourse.julialang.org/t/differentialequations-and-parameter-estimation-with-indicator-variables/42633)

<div class="topic-metadata">

**Author:** [@Alfie](https://discourse.julialang.org/u/Alfie)\
**Replies:** 4\
**Last updated:** [July 8, 2020, 8:40am UTC](https://discourse.julialang.org/t/differentialequations-and-parameter-estimation-with-indicator-variables/42633 "2020-07-08T08:40:54Z")

</div>

Hi I am new to Julia, sorry for this basic question, I am doing some parameter fitting, and would like to use a binary indicator variable (0/1) to differentiate groups from my data. I have the following code: f…

---

## [ODE Sundials not recognizing \`maxiters\` argument](https://discourse.julialang.org/t/ode-sundials-not-recognizing-maxiters-argument/42377)

<div class="topic-metadata">

**Author:** [@Yuki-Kanai](https://discourse.julialang.org/u/Yuki-Kanai)\
**Replies:** 2\
**Last updated:** [July 2, 2020, 6:18am UTC](https://discourse.julialang.org/t/ode-sundials-not-recognizing-maxiters-argument/42377 "2020-07-02T06:18:18Z")

</div>

I am using OrdinaryDiffEq with Sundials. While other options such as stability\_limit\_detect max\_hnil\_warns max\_error\_test\_failures seem to be working, the option maxiters doesn’t seem to stop iteration at all; The it…

---

## [Issue with Callbacks When Solving Differential Equations Having Dual Number States](https://discourse.julialang.org/t/issue-with-callbacks-when-solving-differential-equations-having-dual-number-states/41883)

<div class="topic-metadata">

**Author:** [@tomaklutfu](https://discourse.julialang.org/u/tomaklutfu)\
**Replies:** 7\
**Last updated:** [June 29, 2020, 1:25pm UTC](https://discourse.julialang.org/t/issue-with-callbacks-when-solving-differential-equations-having-dual-number-states/41883 "2020-06-29T13:25:44Z")

</div>

When I solve the same ODE with callback to stop simulation early and without callback, I get different partials at the same time not even close. I believe that adding callback introduces dual times and, at the event time…

---

## [Component based modelling with ModelingToolkit.jl](https://discourse.julialang.org/t/component-based-modelling-with-modelingtoolkit-jl/41116)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [June 27, 2020, 3:59am UTC](https://discourse.julialang.org/t/component-based-modelling-with-modelingtoolkit-jl/41116 "2020-06-27T03:59:15Z")

</div>

I want to model a simple heating system using ModelingToolkit.jl. It consists of a thermal storage, a boiler and a heat consumer. The following equations govern this model. Thermal Storage The thermal storage has one …

---

## [Adaptive control and online parameter estimation](https://discourse.julialang.org/t/adaptive-control-and-online-parameter-estimation/42054)

<div class="topic-metadata">

**Author:** [@jonniedie](https://discourse.julialang.org/u/jonniedie)\
**Replies:** 2\
**Last updated:** [June 26, 2020, 2:01am UTC](https://discourse.julialang.org/t/adaptive-control-and-online-parameter-estimation/42054 "2020-06-26T02:01:27Z")

</div>

Since control systems modeling questions tend to pop up on here quite a bit, I figured I’d share the approach I’ve been taking for these kinds of things using ControlSystems.jl to build linear components for nonlinear Di…

---

## [Stiff system (of \>100 equations) - Rodas5 - multiple runs - instability or not](https://discourse.julialang.org/t/stiff-system-of-100-equations-rodas5-multiple-runs-instability-or-not/41868)

<div class="topic-metadata">

**Author:** [@Polina](https://discourse.julialang.org/u/Polina)\
**Replies:** 7\
**Last updated:** [June 23, 2020, 4:30am UTC](https://discourse.julialang.org/t/stiff-system-of-100-equations-rodas5-multiple-runs-instability-or-not/41868 "2020-06-23T04:30:38Z")

</div>

Dear all, I have a stiff system of \>100 equations (which I’m not allowed to post anywhere at the moment). I tried solve(my\_prob, Rodas5(autodiff=false),reltol=1e-8,abstol=1e-8,saveat=1.0) # let's call it method1 and …

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

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