# Modelling & Simulations

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

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

**Page:** 29

---

## [Can ModelingToolkit be used for simulating fluid flow including fluid properties?](https://discourse.julialang.org/t/can-modelingtoolkit-be-used-for-simulating-fluid-flow-including-fluid-properties/107298)

<div class="topic-metadata">

**Author:** [@NikoBiele](https://discourse.julialang.org/u/NikoBiele)\
**Replies:** 6\
**Last updated:** [December 12, 2023, 5:39pm UTC](https://discourse.julialang.org/t/can-modelingtoolkit-be-used-for-simulating-fluid-flow-including-fluid-properties/107298 "2023-12-12T17:39:56Z")

</div>

Hi all, I am huge fan of Julia, and I used it for my Master’s thesis where I made a large dynamic model of a two-stage heat pump, including all of the fluid properties (via CoolProp.jl), such as: Temperature, pressure, …

---

## [How to convert an ODESystem to NonlinearSystem?](https://discourse.julialang.org/t/how-to-convert-an-odesystem-to-nonlinearsystem/91079)

<div class="topic-metadata">

**Author:** [@wangyunyueyueniao](https://discourse.julialang.org/u/wangyunyueyueniao)\
**Replies:** 8\
**Last updated:** [December 10, 2023, 2:31pm UTC](https://discourse.julialang.org/t/how-to-convert-an-odesystem-to-nonlinearsystem/91079 "2023-12-10T14:31:46Z")

</div>

I know there is a “convert\_system” function which can convert a “NonlinearSystem” to an “ODESystem”. Can we do it backwards? So that we can have both steady-state and dynamic simulation with a single code base.

---

## [Can this type of integro-differential equation be solved somewhere?](https://discourse.julialang.org/t/can-this-type-of-integro-differential-equation-be-solved-somewhere/107286)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 2\
**Last updated:** [December 10, 2023, 1:01pm UTC](https://discourse.julialang.org/t/can-this-type-of-integro-differential-equation-be-solved-somewhere/107286 "2023-12-10T13:01:24Z")

</div>

Hey, I admit that I am a novice in differential equations solving, this problem came out of completely somthing else… I want to solve an equation that has the following form : S(t) = \\exp(- H(t)) \\partial H(t) = F(t,…

---

## [ModelingToolkit - how to reset integrator](https://discourse.julialang.org/t/modelingtoolkit-how-to-reset-integrator/107364)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [December 9, 2023, 9:17pm UTC](https://discourse.julialang.org/t/modelingtoolkit-how-to-reset-integrator/107364 "2023-12-09T21:17:32Z")

</div>

I have the following code: # Falling mass, attached to non-linear spring without compression stiffness, # initially moving upwards with 4 m/s. using ModelingToolkit, OrdinaryDiffEq, PyPlot, LinearAlgebra G\_EARTH = Flo…

---

## [Issue adapting NeuralPDE.jl documentation example code to use case](https://discourse.julialang.org/t/issue-adapting-neuralpde-jl-documentation-example-code-to-use-case/107198)

<div class="topic-metadata">

**Author:** [@BenWhip](https://discourse.julialang.org/u/BenWhip)\
**Replies:** 2\
**Last updated:** [December 8, 2023, 11:45pm UTC](https://discourse.julialang.org/t/issue-adapting-neuralpde-jl-documentation-example-code-to-use-case/107198 "2023-12-08T23:45:48Z")

</div>

Hello everyone, I am attempting to adapt the code from \[an example in the NeuralPDE documentation\], but am running into trouble. I am still fairly new at using Julia, so I apologize in advance if the solution is trivial…

---

## [Linear Acoustics/Elasticity in Julia?](https://discourse.julialang.org/t/linear-acoustics-elasticity-in-julia/107270)

<div class="topic-metadata">

**Author:** [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Replies:** 8\
**Last updated:** [December 7, 2023, 8:06pm UTC](https://discourse.julialang.org/t/linear-acoustics-elasticity-in-julia/107270 "2023-12-07T20:06:32Z")

</div>

Hello. Are there any packages suitable for acoustic modelling in Julia? My problem (roughly) consists of a number of transducers transmitting inside a (finite) cylindrical shell and I’d like to compute the sound field. A…

---

## [Define DE Callbacks programmatically to operate on a parameter field](https://discourse.julialang.org/t/define-de-callbacks-programmatically-to-operate-on-a-parameter-field/107186)

<div class="topic-metadata">

**Author:** [@jondavis847](https://discourse.julialang.org/u/jondavis847)\
**Replies:** 4\
**Last updated:** [December 7, 2023, 7:44pm UTC](https://discourse.julialang.org/t/define-de-callbacks-programmatically-to-operate-on-a-parameter-field/107186 "2023-12-07T19:44:25Z")

</div>

I may not be thinking about this right, but currently I have a system defined as a heirarchy of models. I store the full system in the parameters of a DifferentialEquations.jl ODEProblem. I can then use methods directly …

---

## [Spatial bounds of integration of a PDE using DifferentialEquations](https://discourse.julialang.org/t/spatial-bounds-of-integration-of-a-pde-using-differentialequations/107241)

<div class="topic-metadata">

**Author:** [@Alberto\_Roman](https://discourse.julialang.org/u/Alberto_Roman)\
**Replies:** 3\
**Last updated:** [December 7, 2023, 5:21pm UTC](https://discourse.julialang.org/t/spatial-bounds-of-integration-of-a-pde-using-differentialequations/107241 "2023-12-07T17:21:31Z")

</div>

Hi there, I am solving a PDE over a large domain discretizing with finite difference the RHS and using DifferentialEquations.jl to integrate the ODE system in time. Is there anyway in which I can limit the integration t…

---

## [MTK: "Track" or print a non-state variable defined as an equation](https://discourse.julialang.org/t/mtk-track-or-print-a-non-state-variable-defined-as-an-equation/107170)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 1\
**Last updated:** [December 7, 2023, 5:01am UTC](https://discourse.julialang.org/t/mtk-track-or-print-a-non-state-variable-defined-as-an-equation/107170 "2023-12-07T05:01:58Z")

</div>

I have a rather large model which has two variables: @variables q, x that have some equations, let’s say eqs = \[ Differential(t)(x) ~ log(q), q ~ something \] After my equations are created x remains a state variable …

---

## [Error: Missing from the variable map](https://discourse.julialang.org/t/error-missing-from-the-variable-map/106853)

<div class="topic-metadata">

**Author:** [@aoifehealy](https://discourse.julialang.org/u/aoifehealy)\
**Replies:** 4\
**Last updated:** [December 6, 2023, 7:20pm UTC](https://discourse.julialang.org/t/error-missing-from-the-variable-map/106853 "2023-12-06T19:20:55Z")

</div>

Hi there, I am trying to modelling the circulatory system as an electrical circuit, based on the following image: My code is as follows, with resistors, capacitors and inductors based on those in the RC model exampl…

---

## [Stakeholders, Environment, Markets - Depiction in Land Use Models](https://discourse.julialang.org/t/stakeholders-environment-markets-depiction-in-land-use-models/107207)

<div class="topic-metadata">

**Author:** [@uweaschneider](https://discourse.julialang.org/u/uweaschneider)\
**Replies:** 0\
**Last updated:** [December 6, 2023, 9:35am UTC](https://discourse.julialang.org/t/stakeholders-environment-markets-depiction-in-land-use-models/107207 "2023-12-06T09:35:01Z")

</div>

Dear all, If you use JULIA for land use research, I would like to ask you to take part in the following short survey: https://umfragen.uni-hamburg.de/index.php/844656?lang=en The goal is to assess how existing scienti…

---

## [Plot the asymptotes on a bode diagram of any transfer function](https://discourse.julialang.org/t/plot-the-asymptotes-on-a-bode-diagram-of-any-transfer-function/107143)

<div class="topic-metadata">

**Author:** [@Frederic\_Gilt](https://discourse.julialang.org/u/Frederic_Gilt)\
**Replies:** 2\
**Last updated:** [December 6, 2023, 12:25am UTC](https://discourse.julialang.org/t/plot-the-asymptotes-on-a-bode-diagram-of-any-transfer-function/107143 "2023-12-06T00:25:47Z")

</div>

My question is in the title :). I used ControlSystems package but wasn’t able to find a clean way to plot those asymptotes, and didn’t find any related topics here… Do I need to built it from scratch ? Thx for the help ! …

---

## [Convert discrete to continuous using delays](https://discourse.julialang.org/t/convert-discrete-to-continuous-using-delays/106992)

<div class="topic-metadata">

**Author:** [@maltee1](https://discourse.julialang.org/u/maltee1)\
**Replies:** 15\
**Last updated:** [December 5, 2023, 8:14pm UTC](https://discourse.julialang.org/t/convert-discrete-to-continuous-using-delays/106992 "2023-12-05T20:14:03Z")

</div>

I have a discrete MIMO system in state space form and I’m trying to convert the internal feedback path from z^-1 to a continuous delay (i.e. exp(-s\*T)). In MATLAB, I have the fairly clunky but working solution to plug t…

---

## [Mutable structs in DifferentialEquations.jl parameters to cache data](https://discourse.julialang.org/t/mutable-structs-in-differentialequations-jl-parameters-to-cache-data/107029)

<div class="topic-metadata">

**Author:** [@jondavis847](https://discourse.julialang.org/u/jondavis847)\
**Replies:** 13\
**Last updated:** [December 5, 2023, 12:15am UTC](https://discourse.julialang.org/t/mutable-structs-in-differentialequations-jl-parameters-to-cache-data/107029 "2023-12-05T00:15:24Z")

</div>

Hello, I have a model implemented in DifferentialEquations.jl that saves lot of states. Some are just temporary for calculation or history, some are required for saving. Only a small subset of the states are the minimum…

---

## [Debugging an anonymous function passed to DynamicalSystems](https://discourse.julialang.org/t/debugging-an-anonymous-function-passed-to-dynamicalsystems/106890)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 8\
**Last updated:** [December 3, 2023, 11:14am UTC](https://discourse.julialang.org/t/debugging-an-anonymous-function-passed-to-dynamicalsystems/106890 "2023-12-03T11:14:58Z")

</div>

HI. This question is a continuation of a previous topic here, on constructing anonymous functions dynamically. In my case, these functions are intended to form the dynamical rule used for initialising CoupledODEs from a …

---

## [A small "API" I made for ModelingToolkit/MoL, need feedback on the general API structure](https://discourse.julialang.org/t/a-small-api-i-made-for-modelingtoolkit-mol-need-feedback-on-the-general-api-structure/107039)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 4\
**Last updated:** [December 2, 2023, 2:28pm UTC](https://discourse.julialang.org/t/a-small-api-i-made-for-modelingtoolkit-mol-need-feedback-on-the-general-api-structure/107039 "2023-12-02T14:28:03Z")

</div>

Essentially the API is “functional”, where parameterized functions are defined which give the variables, parameters, equations…etc of the model. The goal is to have a nice easy way to do experiments that involve changi…

---

## [\`@mtkmodel\` & \`constants\`?](https://discourse.julialang.org/t/mtkmodel-constants/106955)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 0\
**Last updated:** [November 30, 2023, 2:31pm UTC](https://discourse.julialang.org/t/mtkmodel-constants/106955 "2023-11-30T14:31:18Z")

</div>

I’m using ModelingToolkit v8.73.1. I’m trying to use @constants with a begin...end construct within an MTK model created by @mtkmodel \[similar to using a @parameters construct\], but Julia tells me that @constants is not…

---

## [Adjoint of 2d diffusion using SciMLSensitivity](https://discourse.julialang.org/t/adjoint-of-2d-diffusion-using-scimlsensitivity/106863)

<div class="topic-metadata">

**Author:** [@Alberto\_Roman](https://discourse.julialang.org/u/Alberto_Roman)\
**Replies:** 3\
**Last updated:** [November 29, 2023, 5:23pm UTC](https://discourse.julialang.org/t/adjoint-of-2d-diffusion-using-scimlsensitivity/106863 "2023-11-29T17:23:39Z")

</div>

I am trying to try to solve the adjoint problem of 2d diffusion using SciMLSensitivity. My test case follow the 1d case given at Partial Differential Equation (PDE) Constrained Optimization · SciMLSensitivity.jl Howeve…

---

## [ModelingToolkit, vars to varmap?](https://discourse.julialang.org/t/modelingtoolkit-vars-to-varmap/106904)

<div class="topic-metadata">

**Author:** [@rpex](https://discourse.julialang.org/u/rpex)\
**Replies:** 6\
**Last updated:** [November 29, 2023, 4:37pm UTC](https://discourse.julialang.org/t/modelingtoolkit-vars-to-varmap/106904 "2023-11-29T16:37:37Z")

</div>

Hello, Is there a function to get the index from variable names in ModelingToolkit.jl? Or a function that returns me a varmap (Vector{Pair{Num, Float64}})? So the opposite of ModelingToolkit.varmap\_to\_vars() I’m curr…

---

## [ModelingToolkit for (continuous) Model ID with (discrete) input and output data](https://discourse.julialang.org/t/modelingtoolkit-for-continuous-model-id-with-discrete-input-and-output-data/106889)

<div class="topic-metadata">

**Author:** [@rpex](https://discourse.julialang.org/u/rpex)\
**Replies:** 3\
**Last updated:** [November 29, 2023, 3:19pm UTC](https://discourse.julialang.org/t/modelingtoolkit-for-continuous-model-id-with-discrete-input-and-output-data/106889 "2023-11-29T15:19:19Z")

</div>

I want to model a quadrocpter with MTK. In the first step I want to identify the parameters of a simple model from real flight data. In the second step I want to learn not yet modeled effects from the data by different e…

---

## [Ideas for Saving Intermediate Results](https://discourse.julialang.org/t/ideas-for-saving-intermediate-results/106724)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 7\
**Last updated:** [November 29, 2023, 8:44am UTC](https://discourse.julialang.org/t/ideas-for-saving-intermediate-results/106724 "2023-11-29T08:44:52Z")

</div>

Hello, I’d appreciate any thoughts or feedback on how I could implement the following. I have a long-running simulation (several days) I run on my university’s HPC. Till now I have been saving the results at the end of…

---

## [Extending Symbolics.jl, How to dispatch all functions to the underlying Num](https://discourse.julialang.org/t/extending-symbolics-jl-how-to-dispatch-all-functions-to-the-underlying-num/106845)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 2\
**Last updated:** [November 28, 2023, 1:34pm UTC](https://discourse.julialang.org/t/extending-symbolics-jl-how-to-dispatch-all-functions-to-the-underlying-num/106845 "2023-11-28T13:34:13Z")

</div>

Hello, I want to extend Symbolics.jl Variables to encode bounds and default value of parameters in the “variable”; Currently something like this: using Symbolics: \_parse\_vars, Num, @variables import SciMLBase: issymbol…

---

## [Q: Using TermInterface to set up Metatheory](https://discourse.julialang.org/t/q-using-terminterface-to-set-up-metatheory/106480)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 0\
**Last updated:** [November 20, 2023, 6:22pm UTC](https://discourse.julialang.org/t/q-using-terminterface-to-set-up-metatheory/106480 "2023-11-20T18:22:43Z")

</div>

While I have been using Symbolics and SymbolicUtils for some time now , I am a novice in the use of Metatheory. My first attempt to set up Metatheory using TermInterface as described in the documentation is opened as an…

---

## [Modeling elliptical geometries with Meshes.jl](https://discourse.julialang.org/t/modeling-elliptical-geometries-with-meshes-jl/106467)

<div class="topic-metadata">

**Author:** [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)\
**Replies:** 2\
**Last updated:** [November 20, 2023, 2:42pm UTC](https://discourse.julialang.org/t/modeling-elliptical-geometries-with-meshes-jl/106467 "2023-11-20T14:42:02Z")

</div>

Maybe this is a dumb question but is there a native method for defining ellipses/ellipsoids in Meshes.jl? I didn’t see anything in the docs, and from a quick perusal of the source it doesn’t seem like Ball or Sphere were…

---

## [Library/package for calculating vertex curvature and normals of a mesh](https://discourse.julialang.org/t/library-package-for-calculating-vertex-curvature-and-normals-of-a-mesh/106456)

<div class="topic-metadata">

**Author:** [@Jacopo\_Romano](https://discourse.julialang.org/u/Jacopo_Romano)\
**Replies:** 1\
**Last updated:** [November 20, 2023, 11:42am UTC](https://discourse.julialang.org/t/library-package-for-calculating-vertex-curvature-and-normals-of-a-mesh/106456 "2023-11-20T11:42:05Z")

</div>

Hi everyone, I’m trying to develop a numerical scheme for simulating the equation of motion of a closed surface in 3D. To do it, I wanted to represent the surface as a mesh, compute the normal velocity, and use it to e…

---

## [Recording solutions to Julia Bifurcation Kit continuation](https://discourse.julialang.org/t/recording-solutions-to-julia-bifurcation-kit-continuation/106384)

<div class="topic-metadata">

**Author:** [@GeorgeA](https://discourse.julialang.org/u/GeorgeA)\
**Replies:** 5\
**Last updated:** [November 20, 2023, 7:11am UTC](https://discourse.julialang.org/t/recording-solutions-to-julia-bifurcation-kit-continuation/106384 "2023-11-20T07:11:46Z")

</div>

I can’t find the correct line of code to obtain the values for specific variables from Julia Bifurcation kit. I have a system of ODEs and a fixed point for the system. I can use the continuation function to obtain the no…

---

## [DynamicalSystems Poincare map of sin(u\[1\]) and u\[2\] \[using ProjectedDynamicalSystems\]](https://discourse.julialang.org/t/dynamicalsystems-poincare-map-of-sin-u-1-and-u-2-using-projecteddynamicalsystems/106443)

<div class="topic-metadata">

**Author:** [@hisacro](https://discourse.julialang.org/u/hisacro)\
**Replies:** 2\
**Last updated:** [November 20, 2023, 2:40am UTC](https://discourse.julialang.org/t/dynamicalsystems-poincare-map-of-sin-u-1-and-u-2-using-projecteddynamicalsystems/106443 "2023-11-20T02:40:38Z")

</div>

I will take an example from a predefined dynamical system using PredefinedDynamicalSystems, DynamicalSystems ds = Systems.double\_pendulum( \[π/2, 0, 0, π\]; G=10.0, L1 = 1.0, L2 = 1.0, M1 = 1.0, M2 = 1.0) Points, t = tra…

---

## [DifferentialEquations.jl callbacks\_buckExample not giving correct output](https://discourse.julialang.org/t/differentialequations-jl-callbacks-buckexample-not-giving-correct-output/106444)

<div class="topic-metadata">

**Author:** [@mongi](https://discourse.julialang.org/u/mongi)\
**Replies:** 1\
**Last updated:** [November 19, 2023, 10:42pm UTC](https://discourse.julialang.org/t/differentialequations-jl-callbacks-buckexample-not-giving-correct-output/106444 "2023-11-19T22:42:13Z")

</div>

Greetings, I have a question about the use of callbacks in differentialEquation.jl that was asked here: https://github.com/SciML/DifferentialEquations.jl/issues/998 thank you for your help

---

## [Handling Dynamical system with trigonometric function](https://discourse.julialang.org/t/handling-dynamical-system-with-trigonometric-function/106429)

<div class="topic-metadata">

**Author:** [@hisacro](https://discourse.julialang.org/u/hisacro)\
**Replies:** 14\
**Last updated:** [November 19, 2023, 10:45am UTC](https://discourse.julialang.org/t/handling-dynamical-system-with-trigonometric-function/106429 "2023-11-19T10:45:30Z")

</div>

using DynamicalSystems, GLMakie, OrdinaryDiffEq function rotor\_1( u, params, t) # @inbounds begin θ1,pθ1,θ2,pθ2 = u k,l = params…

---

## [Automatic complex valued differentiation for adjoint method](https://discourse.julialang.org/t/automatic-complex-valued-differentiation-for-adjoint-method/106408)

<div class="topic-metadata">

**Author:** [@marco\_menarini](https://discourse.julialang.org/u/marco_menarini)\
**Replies:** 0\
**Last updated:** [November 18, 2023, 3:11pm UTC](https://discourse.julialang.org/t/automatic-complex-valued-differentiation-for-adjoint-method/106408 "2023-11-18T15:11:14Z")

</div>

Is there a package that supports automatic differentiation for complex-valued functions (non-holomorphic)? So far I used a workaround of defining my own Wirtinger derivative in Zygote and I use the result as the input fo…

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

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