# Modelling & Simulations

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

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

**Page:** 18

---

## [SymbolicRegression: Python -\> Julia?](https://discourse.julialang.org/t/symbolicregression-python-julia/119463)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 10\
**Last updated:** [September 18, 2024, 10:41am UTC](https://discourse.julialang.org/t/symbolicregression-python-julia/119463 "2024-09-18T10:41:15Z")

</div>

I’m trying to use SymbolicRegression from Julia, based on some \[SRRegressor\] model in Python. Here is the Python model: model\_SK = PySRRegressor( batching=True, niterations=400, model\_selection="accuracy", …

---

## [Optimising allocations and memory use in ODEProblems](https://discourse.julialang.org/t/optimising-allocations-and-memory-use-in-odeproblems/119513)

<div class="topic-metadata">

**Author:** [@markjholmes](https://discourse.julialang.org/u/markjholmes)\
**Replies:** 2\
**Last updated:** [September 18, 2024, 9:14am UTC](https://discourse.julialang.org/t/optimising-allocations-and-memory-use-in-odeproblems/119513 "2024-09-18T09:14:30Z")

</div>

If I have an ODEProblem with many lines of computation going on at each step, when (if ever) does it become sensible to pre-allocate the space for these computations inside the parameters, p? With a simplified example, …

---

## [How can I solve this 4-equation NonlinearSystem? It gives \`retcode: Unstable\`](https://discourse.julialang.org/t/how-can-i-solve-this-4-equation-nonlinearsystem-it-gives-retcode-unstable/119384)

<div class="topic-metadata">

**Author:** [@JohsEnevoldsen](https://discourse.julialang.org/u/JohsEnevoldsen)\
**Replies:** 8\
**Last updated:** [September 17, 2024, 12:29pm UTC](https://discourse.julialang.org/t/how-can-i-solve-this-4-equation-nonlinearsystem-it-gives-retcode-unstable/119384 "2024-09-17T12:29:52Z")

</div>

I am trying to solve a system of equations with NonlinearSolve.jl and ModelingToolkit.jl. Specifically a simplified version of Stewart’s model for Acid-Base disturbances in blood (Independence of Variables in Stewart's …

---

## [Meshes.jl - CartesianGrid - FaceElement connectivity](https://discourse.julialang.org/t/meshes-jl-cartesiangrid-faceelement-connectivity/119473)

<div class="topic-metadata">

**Author:** [@Domenico\_Lahaye](https://discourse.julialang.org/u/Domenico_Lahaye)\
**Replies:** 8\
**Last updated:** [September 16, 2024, 9:14pm UTC](https://discourse.julialang.org/t/meshes-jl-cartesiangrid-faceelement-connectivity/119473 "2024-09-16T21:14:06Z")

</div>

How can I build the face-element connectivity of a 2D CartesianGrid in Meshes.jl ? Thx!

---

## [Signalling towards convergence of chain/ chains in turing](https://discourse.julialang.org/t/signalling-towards-convergence-of-chain-chains-in-turing/118441)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 5\
**Last updated:** [September 13, 2024, 8:31am UTC](https://discourse.julialang.org/t/signalling-towards-convergence-of-chain-chains-in-turing/118441 "2024-09-13T08:31:31Z")

</div>

Hello everyone :)… Based on my understanding of Turing based inference(case of NUTS). We see that during warmup time chain gets to convergence and then we collect samples. Now there are two things . when model is sim…

---

## [Is it possible to create a non-normal distribution of agents on a grid using Agents.jl?](https://discourse.julialang.org/t/is-it-possible-to-create-a-non-normal-distribution-of-agents-on-a-grid-using-agents-jl/119351)

<div class="topic-metadata">

**Author:** [@tfranks](https://discourse.julialang.org/u/tfranks)\
**Replies:** 4\
**Last updated:** [September 12, 2024, 10:26pm UTC](https://discourse.julialang.org/t/is-it-possible-to-create-a-non-normal-distribution-of-agents-on-a-grid-using-agents-jl/119351 "2024-09-12T22:26:51Z")

</div>

Hello, Using Julia Agents.jl, I’ve built an agent-based model where the bank agents are plotted on a x-y axis and added to the grid by “add\_agents!.” This function adds the agents in a normal distribution as shown belo…

---

## [ModelingToolkit... documenting my models](https://discourse.julialang.org/t/modelingtoolkit-documenting-my-models/119310)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 5\
**Last updated:** [September 12, 2024, 12:00pm UTC](https://discourse.julialang.org/t/modelingtoolkit-documenting-my-models/119310 "2024-09-12T12:00:24Z")

</div>

A recurring problem as my ModelingToolkit \[MTK\] models get more complex… I am running a MTK model developed for my students, i.e., the model is complete in that it runs. I now have to create a problem document for the s…

---

## [Register\_symbolic with arrays: What am I doing wrong](https://discourse.julialang.org/t/register-symbolic-with-arrays-what-am-i-doing-wrong/118655)

<div class="topic-metadata">

**Author:** [@HSnowden](https://discourse.julialang.org/u/HSnowden)\
**Replies:** 11\
**Last updated:** [September 12, 2024, 11:52am UTC](https://discourse.julialang.org/t/register-symbolic-with-arrays-what-am-i-doing-wrong/118655 "2024-09-12T11:52:06Z")

</div>

Hello, I am unable to register a symbolic function that takes an array and returns a scalar. This makes me think I need to use register\_symbolic rather than the array counterpart. However, the array that is sent is a Ve…

---

## [Best type for passing parameters to an ODE](https://discourse.julialang.org/t/best-type-for-passing-parameters-to-an-ode/118968)

<div class="topic-metadata">

**Author:** [@julien-arino](https://discourse.julialang.org/u/julien-arino)\
**Replies:** 3\
**Last updated:** [September 5, 2024, 7:30am UTC](https://discourse.julialang.org/t/best-type-for-passing-parameters-to-an-ode/118968 "2024-09-05T07:30:48Z")

</div>

New to julia, apologies if this is trivial. I am struggling to work out how to pass parameters to an ODE. In short, I have two systems: one 7N dimensional (with N in the hundreds or thousands) and a 7-D one. I am not ev…

---

## [Devito equivalent](https://discourse.julialang.org/t/devito-equivalent/118736)

<div class="topic-metadata">

**Author:** [@abuAnat](https://discourse.julialang.org/u/abuAnat)\
**Replies:** 3\
**Last updated:** [September 3, 2024, 4:34pm UTC](https://discourse.julialang.org/t/devito-equivalent/118736 "2024-09-03T16:34:24Z")

</div>

Hello! Is there a package or framework in Julia that is equivalent to the Devito Python package?

---

## [MTK: connection of flow variable forces it to zero](https://discourse.julialang.org/t/mtk-connection-of-flow-variable-forces-it-to-zero/118976)

<div class="topic-metadata">

**Author:** [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Replies:** 3\
**Last updated:** [September 3, 2024, 10:56am UTC](https://discourse.julialang.org/t/mtk-connection-of-flow-variable-forces-it-to-zero/118976 "2024-09-03T10:56:21Z")

</div>

Hello, I encountered some problem in MTK which I could recreate in the following MWE: using Pkg pkg"activate --temp" pkg"add ModelingToolkit" using ModelingToolkit using ModelingToolkit: t\_nounits as t, D\_nounits as Dt…

---

## [Stability of steady-state heat equation example for MethodOfLines.jl](https://discourse.julialang.org/t/stability-of-steady-state-heat-equation-example-for-methodoflines-jl/98651)

<div class="topic-metadata">

**Author:** [@thomasteisberg](https://discourse.julialang.org/u/thomasteisberg)\
**Replies:** 16\
**Last updated:** [September 1, 2024, 2:59pm UTC](https://discourse.julialang.org/t/stability-of-steady-state-heat-equation-example-for-methodoflines-jl/98651 "2024-09-01T14:59:31Z")

</div>

The steady-state heat equation example from the MethodOfLines.jl documentation seems to break for smaller step sizes. The example I’m referring to is here: Steady State Heat Equation - No Time Dependence - NonlinearProbl…

---

## [Solving Stiff-ODE using PINN via NNODE](https://discourse.julialang.org/t/solving-stiff-ode-using-pinn-via-nnode/118485)

<div class="topic-metadata">

**Author:** [@Reza\_AO](https://discourse.julialang.org/u/Reza_AO)\
**Replies:** 6\
**Last updated:** [August 30, 2024, 3:07pm UTC](https://discourse.julialang.org/t/solving-stiff-ode-using-pinn-via-nnode/118485 "2024-08-30T15:07:30Z")

</div>

Hi I have been trying to solve the ODE below: dc/dt = - Acexp(-E/(R\*T(t))) Then I scaled time and Temperature it turned into: dc/dt\_ = - Actim\_maxexp(-E/(RT\_(t)\*T\_max)) !Note that the temperature increases through …

---

## [How do I import t\_nounits with a different name than t in ModelingToolkit?](https://discourse.julialang.org/t/how-do-i-import-t-nounits-with-a-different-name-than-t-in-modelingtoolkit/118640)

<div class="topic-metadata">

**Author:** [@pmc4](https://discourse.julialang.org/u/pmc4)\
**Replies:** 4\
**Last updated:** [August 30, 2024, 10:10am UTC](https://discourse.julialang.org/t/how-do-i-import-t-nounits-with-a-different-name-than-t-in-modelingtoolkit/118640 "2024-08-30T10:10:59Z")

</div>

Hi everyone! I’ve been playing with ModelingToolkit for several weeks, but there’s still one issue I haven’t been able to fully understand. In the NEWS.md file of the github repo, it states: ModelingToolkit.jl now exp…

---

## [My second order ODE explodes](https://discourse.julialang.org/t/my-second-order-ode-explodes/118758)

<div class="topic-metadata">

**Author:** [@minetest2048](https://discourse.julialang.org/u/minetest2048)\
**Replies:** 1\
**Last updated:** [August 29, 2024, 8:15am UTC](https://discourse.julialang.org/t/my-second-order-ode-explodes/118758 "2024-08-29T08:15:30Z")

</div>

I’m trying to simulate a one-body problem: Two-Body Numerical Solution in an Inertial Frame — Orbital Mechanics & Astrodynamics \\ddot{r} = \\frac{-GM}{|r|^3}r = \\frac{\\mu}{|r|^3}r Which can be split into: \\ddot{r\_x} =…

---

## [Using derived quantities from previous time step](https://discourse.julialang.org/t/using-derived-quantities-from-previous-time-step/118642)

<div class="topic-metadata">

**Author:** [@pulk\_jain](https://discourse.julialang.org/u/pulk_jain)\
**Replies:** 11\
**Last updated:** [August 28, 2024, 10:29pm UTC](https://discourse.julialang.org/t/using-derived-quantities-from-previous-time-step/118642 "2024-08-28T22:29:54Z")

</div>

What is the best way to use a derived value (not part of the solution vector) from the previous time step. I was thinking of passing it like a parameter and updating at each time. I did something like: #Approach1 funct…

---

## [Tips on implementing a hybrid system](https://discourse.julialang.org/t/tips-on-implementing-a-hybrid-system/118649)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 4\
**Last updated:** [August 27, 2024, 2:26pm UTC](https://discourse.julialang.org/t/tips-on-implementing-a-hybrid-system/118649 "2024-08-27T14:26:01Z")

</div>

I’d like to implement a hybrid model using the SciML ecosystem, that switches between a jump process (at ‘low’ population sizes) and an SDE. Individual examples of these models are here and here. Any suggestions on best …

---

## [Parameter inference for agents based model](https://discourse.julialang.org/t/parameter-inference-for-agents-based-model/118613)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 3\
**Last updated:** [August 26, 2024, 11:41pm UTC](https://discourse.julialang.org/t/parameter-inference-for-agents-based-model/118613 "2024-08-26T23:41:39Z")

</div>

Hello everyone, Im doing parameter inference for my agent based model. At the moment, Im using NUTS() from Turing package. Im not sure if its the right choice as model is stochastic in nature. I was wondering that if a A…

---

## [ApproxFun: how to define initial conditions for a second-order ODE?](https://discourse.julialang.org/t/approxfun-how-to-define-initial-conditions-for-a-second-order-ode/15295)

<div class="topic-metadata">

**Author:** [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Replies:** 4\
**Last updated:** [August 25, 2024, 9:09pm UTC](https://discourse.julialang.org/t/approxfun-how-to-define-initial-conditions-for-a-second-order-ode/15295 "2024-08-25T21:09:49Z")

</div>

Hello, I am struggling with the very basics of usage of ApproxFun package. I would like to use it solve the very simplest second-order linear initial value problem \\ddot u(t) + \\dot u(t) + u(t) = 0, u(0) = 1, \\dot u(0) …

---

## [Why FlowDivider and Valve are not exported in MTK Standard Library?](https://discourse.julialang.org/t/why-flowdivider-and-valve-are-not-exported-in-mtk-standard-library/118571)

<div class="topic-metadata">

**Author:** [@romantimo](https://discourse.julialang.org/u/romantimo)\
**Replies:** 4\
**Last updated:** [August 24, 2024, 8:14pm UTC](https://discourse.julialang.org/t/why-flowdivider-and-valve-are-not-exported-in-mtk-standard-library/118571 "2024-08-24T20:14:51Z")

</div>

I see many useful components (FlowDivider, Valve, Actuator, SpoolValve…) in src/Hydraulic/IsothermalCompressible/components.jl Any reason why they are not exported? @ChrisRackauckas Thanks a lot for making MTK with st…

---

## [Large allocation problem while simulating agents model](https://discourse.julialang.org/t/large-allocation-problem-while-simulating-agents-model/118522)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 12\
**Last updated:** [August 23, 2024, 2:18pm UTC](https://discourse.julialang.org/t/large-allocation-problem-while-simulating-agents-model/118522 "2024-08-23T14:18:30Z")

</div>

Hello, This is a continuation of previous thread multithreading in agents. I have put an example here which overall is weird as a model but gives idea of memory allocation regions in my original model. Please ignore if y…

---

## [Compose Vector and Scalar Equations together](https://discourse.julialang.org/t/compose-vector-and-scalar-equations-together/118474)

<div class="topic-metadata">

**Author:** [@HSnowden](https://discourse.julialang.org/u/HSnowden)\
**Replies:** 7\
**Last updated:** [August 23, 2024, 12:48pm UTC](https://discourse.julialang.org/t/compose-vector-and-scalar-equations-together/118474 "2024-08-23T12:48:47Z")

</div>

When I try to connect an equation of scalars with an equation of vectors, something on the compose step fails even though what is being connected is the same type (both scalar etc.). I am not sure why this is. An MWE is …

---

## [Multithreading in Agents.jl](https://discourse.julialang.org/t/multithreading-in-agents-jl/118452)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 11\
**Last updated:** [August 23, 2024, 8:21am UTC](https://discourse.julialang.org/t/multithreading-in-agents-jl/118452 "2024-08-23T08:21:24Z")

</div>

Hello everyone, Im trying to use multithreading in EventBasedModel. Im getting this error while doing this. Can someone comment ? What can be issue? What is this error trying to say? Threads.@threads for agen…

---

## [Handling Instability When Solving ODE Problems](https://discourse.julialang.org/t/handling-instability-when-solving-ode-problems/9019)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 14\
**Last updated:** [August 23, 2024, 6:48am UTC](https://discourse.julialang.org/t/handling-instability-when-solving-ode-problems/9019 "2024-08-23T06:48:55Z")

</div>

I have a model which have previously been constructed in matlab, now I want to try that model in Julia. (The model is a system of differential equations in 5 variables which oscillates) In matlab it is solved successfu…

---

## [Creating MTK components](https://discourse.julialang.org/t/creating-mtk-components/118426)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [August 22, 2024, 5:43pm UTC](https://discourse.julialang.org/t/creating-mtk-components/118426 "2024-08-22T17:43:49Z")

</div>

I created a nice tether model using MTK. Now the question arises, can I create an MTK component out of it. It would need two or three ports: at point one a force vector and and a speed vector at point two the same in …

---

## [Computing the jacobian of NN while using Lux](https://discourse.julialang.org/t/computing-the-jacobian-of-nn-while-using-lux/93059)

<div class="topic-metadata">

**Author:** [@clm](https://discourse.julialang.org/u/clm)\
**Replies:** 6\
**Last updated:** [August 22, 2024, 2:17pm UTC](https://discourse.julialang.org/t/computing-the-jacobian-of-nn-while-using-lux/93059 "2024-08-22T14:17:05Z")

</div>

I’m revisiting some code I was working on a while ago and rewrite it from Flux to Lux. Previously, I was trying to use DiffEqFlux to solve for a neural network U where my differential equation contains both U(\[x,y,t\],p) …

---

## [Integral of some ModelingToolkitQuantity](https://discourse.julialang.org/t/integral-of-some-modelingtoolkitquantity/118398)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 1\
**Last updated:** [August 20, 2024, 3:05am UTC](https://discourse.julialang.org/t/integral-of-some-modelingtoolkitquantity/118398 "2024-08-20T03:05:57Z")

</div>

I’m interested in computing the definite integral of some variable X, defined in ModelingToolkit. For sake of example, consider something like: X ~ Y \* Z D(Y) ~ Y \* 2 D(Z) ~ Z / t (in particular, X is an “observed” in …

---

## [\`solve(::OptimizationProblem)\`: ub argument not quite respected](https://discourse.julialang.org/t/solve-optimizationproblem-ub-argument-not-quite-respected/118393)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 1\
**Last updated:** [August 20, 2024, 12:09am UTC](https://discourse.julialang.org/t/solve-optimizationproblem-ub-argument-not-quite-respected/118393 "2024-08-20T00:09:33Z")

</div>

I have a fairly benign Optimization.OptimizationProblem (over an MTK problem). Passing lb, ub clearly works, but I encountered a case today where the output was retcode: Success u: 3×2 Matrix{Float64}: 10.0 15.0 18…

---

## [BVP Shooting method with free parameters](https://discourse.julialang.org/t/bvp-shooting-method-with-free-parameters/117955)

<div class="topic-metadata">

**Author:** [@psillano](https://discourse.julialang.org/u/psillano)\
**Replies:** 13\
**Last updated:** [August 19, 2024, 2:55am UTC](https://discourse.julialang.org/t/bvp-shooting-method-with-free-parameters/117955 "2024-08-19T02:55:29Z")

</div>

Hey, Im trying to solve a Boundary Value Problems with DifferentialEquations.jl. My system of equations is composed by 4 equations of which I know 3 initial conditions. One initial condition u\_0 and 2 free parameters (o…

---

## [\[DifferentialEquations.jl\] Resolution of time variant exitation term](https://discourse.julialang.org/t/differentialequations-jl-resolution-of-time-variant-exitation-term/118266)

<div class="topic-metadata">

**Author:** [@Maucejo](https://discourse.julialang.org/u/Maucejo)\
**Replies:** 2\
**Last updated:** [August 18, 2024, 7:58am UTC](https://discourse.julialang.org/t/differentialequations-jl-resolution-of-time-variant-exitation-term/118266 "2024-08-18T07:58:50Z")

</div>

Hi all, my question may be somewhat related to this thread. I want to solve a FEM second-order differential equation with DifferentialEquations.jl using a constant and given time-step \\Delta t. The problem is basically …

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

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