# Modelling & Simulations

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

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

**Page:** 52

---

## [Tensor coordinate transforms for linear elasticity](https://discourse.julialang.org/t/tensor-coordinate-transforms-for-linear-elasticity/70326)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 4\
**Last updated:** [October 26, 2021, 3:08pm UTC](https://discourse.julialang.org/t/tensor-coordinate-transforms-for-linear-elasticity/70326 "2021-10-26T15:08:36Z")

</div>

I have a linear elasticity problem in 2D (plane stress) with anisotropic material properties. I can easily calculate the displacement in the (100) plane, but I have difficulty understanding how to get the correct initia…

---

## [How to use DiffEqFlux on DAEProblem](https://discourse.julialang.org/t/how-to-use-diffeqflux-on-daeproblem/70276)

<div class="topic-metadata">

**Author:** [@clm](https://discourse.julialang.org/u/clm)\
**Replies:** 0\
**Last updated:** [October 23, 2021, 11:02pm UTC](https://discourse.julialang.org/t/how-to-use-diffeqflux-on-daeproblem/70276 "2021-10-23T23:02:01Z")

</div>

I’m trying to use diffeqflux on differential algebraic equations. I know there is an example in the diffeqflux docs, but there they use constant mass matrices. I want to have the option to use non-constant matrices. Ulti…

---

## [DifferentialEquations: Callback which is only triggered the first time condition is satisfied](https://discourse.julialang.org/t/differentialequations-callback-which-is-only-triggered-the-first-time-condition-is-satisfied/70216)

<div class="topic-metadata">

**Author:** [@pbryde](https://discourse.julialang.org/u/pbryde)\
**Replies:** 5\
**Last updated:** [October 22, 2021, 5:31pm UTC](https://discourse.julialang.org/t/differentialequations-callback-which-is-only-triggered-the-first-time-condition-is-satisfied/70216 "2021-10-22T17:31:04Z")

</div>

Is there an elegant way to define a ContinuousCallback which calls affect! only the first time that condition is satisfied (after which it does nothing)? For example, how could one modify the Bouncing Ball example (Event…

---

## [Questions about modeling Fokker-Planck equation](https://discourse.julialang.org/t/questions-about-modeling-fokker-planck-equation/70118)

<div class="topic-metadata">

**Author:** [@jlmaccal](https://discourse.julialang.org/u/jlmaccal)\
**Replies:** 2\
**Last updated:** [October 22, 2021, 5:30pm UTC](https://discourse.julialang.org/t/questions-about-modeling-fokker-planck-equation/70118 "2021-10-22T17:30:16Z")

</div>

I’m interested in solving a certain Fokker-Planck equation. The goal is to learn an underlying potential energy function given a time series of the evolution of a distribution. I’m planning to use the approach of this p…

---

## [\[ParallelStencil\] Boundary Conditions](https://discourse.julialang.org/t/parallelstencil-boundary-conditions/70171)

<div class="topic-metadata">

**Author:** [@apattyn](https://discourse.julialang.org/u/apattyn)\
**Replies:** 2\
**Last updated:** [October 22, 2021, 1:22am UTC](https://discourse.julialang.org/t/parallelstencil-boundary-conditions/70171 "2021-10-22T01:22:55Z")

</div>

I was taking a look at the acoustic apps, and I was able to modify it to include a time-varying pressure source. However, I can’t quite figure out how to prevent back reflections from the boundary. Is it possible to m…

---

## [Looking for MG solver for sparse matrix on GPU](https://discourse.julialang.org/t/looking-for-mg-solver-for-sparse-matrix-on-gpu/61347)

<div class="topic-metadata">

**Author:** [@Ludovic\_Dumoulin](https://discourse.julialang.org/u/Ludovic_Dumoulin)\
**Replies:** 7\
**Last updated:** [October 21, 2021, 8:24am UTC](https://discourse.julialang.org/t/looking-for-mg-solver-for-sparse-matrix-on-gpu/61347 "2021-10-21T08:24:27Z")

</div>

Hey, I’m looking for an algebraic multigrid solver that run on GPU. The AlgebraicMultigrid.jl package is not compatible with CUDA and I can’t find other package. I could use the AMGX library in Cuda and C++ but then I’l…

---

## [CellmlToolkit.jl: How to get observables?](https://discourse.julialang.org/t/cellmltoolkit-jl-how-to-get-observables/69151)

<div class="topic-metadata">

**Author:** [@andreypikunov](https://discourse.julialang.org/u/andreypikunov)\
**Replies:** 3\
**Last updated:** [October 20, 2021, 2:19pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-how-to-get-observables/69151 "2021-10-20T14:19:59Z")

</div>

Hello! Using Beeler-Reuter model from the README I can list observables: julia\> ml = CellModel("models/beeler\_reuter\_1977.cellml.xml") julia\> observed(ml.sys) 39-element Vector{Equation}: slow\_inward\_current\_f\_gate₊V(…

---

## [\[ParallelStencil\] Wave Equation](https://discourse.julialang.org/t/parallelstencil-wave-equation/70012)

<div class="topic-metadata">

**Author:** [@apattyn](https://discourse.julialang.org/u/apattyn)\
**Replies:** 2\
**Last updated:** [October 19, 2021, 9:07pm UTC](https://discourse.julialang.org/t/parallelstencil-wave-equation/70012 "2021-10-19T21:07:03Z")

</div>

I was looking at ParallelStencil.jl, and trying to just use it to directly solve the second order form of the wave equation. I noticed in the 2D acoustic example that it is broken up into two first order equations, and I…

---

## [Optimizing model description](https://discourse.julialang.org/t/optimizing-model-description/69885)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 0\
**Last updated:** [October 16, 2021, 11:05am UTC](https://discourse.julialang.org/t/optimizing-model-description/69885 "2021-10-16T11:05:52Z")

</div>

I need to optimize a model description for an ODEProblem, which is a hand-coded discretization of a PDE (so the state is a matrix). I know I should… avoid creating arrays in the model. My plan is to instead operate on …

---

## [Independent variable t - @parameter or @variable?](https://discourse.julialang.org/t/independent-variable-t-parameter-or-variable/69619)

<div class="topic-metadata">

**Author:** [@SCher](https://discourse.julialang.org/u/SCher)\
**Replies:** 1\
**Last updated:** [October 15, 2021, 2:37pm UTC](https://discourse.julialang.org/t/independent-variable-t-parameter-or-variable/69619 "2021-10-15T14:37:29Z")

</div>

While creating models in MTK for a system of ODEs, should time t be specified as a @parameter or @variable? I have seen different examples use both ways, and both seem to work. Which is recommended? Any particular reaso…

---

## [Solving time-dependent system of equations from Modelica with ModelingToolkit - hasmetadata error](https://discourse.julialang.org/t/solving-time-dependent-system-of-equations-from-modelica-with-modelingtoolkit-hasmetadata-error/69817)

<div class="topic-metadata">

**Author:** [@Pere](https://discourse.julialang.org/u/Pere)\
**Replies:** 4\
**Last updated:** [October 15, 2021, 1:37pm UTC](https://discourse.julialang.org/t/solving-time-dependent-system-of-equations-from-modelica-with-modelingtoolkit-hasmetadata-error/69817 "2021-10-15T13:37:29Z")

</div>

I’m trying to find \\bar{v}\_{dq}^+ and \\bar{v}\_{dq}^- in the equation below where {v}\_{dq}^+ and {v}\_{dq}^- are known time-varying signals. I’ve done this in Modelica, but I’d like to try with Julia. This is the Mod…

---

## [Sparsity in DifferentialEquations: how to exploit?](https://discourse.julialang.org/t/sparsity-in-differentialequations-how-to-exploit/69808)

<div class="topic-metadata">

**Author:** [@ignace](https://discourse.julialang.org/u/ignace)\
**Replies:** 8\
**Last updated:** [October 15, 2021, 1:35pm UTC](https://discourse.julialang.org/t/sparsity-in-differentialequations-how-to-exploit/69808 "2021-10-15T13:35:20Z")

</div>

Sorry for bothering you with a small request for help. I have the following code, but I would expect the solution to the one-timestep ODEProblem (using implicit Euler) to be computed in a time similar to AA\\b or (I+AA)…

---

## [Periodic Boundary conditions in ParallelStencil / ImplicitGlobalGrid](https://discourse.julialang.org/t/periodic-boundary-conditions-in-parallelstencil-implicitglobalgrid/69670)

<div class="topic-metadata">

**Author:** [@gerhardu](https://discourse.julialang.org/u/gerhardu)\
**Replies:** 2\
**Last updated:** [October 14, 2021, 10:53am UTC](https://discourse.julialang.org/t/periodic-boundary-conditions-in-parallelstencil-implicitglobalgrid/69670 "2021-10-14T10:53:25Z")

</div>

Hello, i want to solve a pde with periodic boundary conditions on multiple processors. There is a good way to do it with Petsc, but i would like to move to julia. Is there a way to do this with ParallelStencil / Impli…

---

## [Differential Equations: resolving instability in ODE problem](https://discourse.julialang.org/t/differential-equations-resolving-instability-in-ode-problem/69671)

<div class="topic-metadata">

**Author:** [@spinystellate](https://discourse.julialang.org/u/spinystellate)\
**Replies:** 1\
**Last updated:** [October 13, 2021, 9:29am UTC](https://discourse.julialang.org/t/differential-equations-resolving-instability-in-ode-problem/69671 "2021-10-13T09:29:22Z")

</div>

I am trying to transfer a Matlab model to Julia, but am running into instability issues. I have found this discussion: \[Handling Instability When Solving ODE Problems\] and tried some of the suggested actions, but am st…

---

## [Derivative of a registered function](https://discourse.julialang.org/t/derivative-of-a-registered-function/69656)

<div class="topic-metadata">

**Author:** [@PikaPei](https://discourse.julialang.org/u/PikaPei)\
**Replies:** 2\
**Last updated:** [October 13, 2021, 7:03am UTC](https://discourse.julialang.org/t/derivative-of-a-registered-function/69656 "2021-10-13T07:03:27Z")

</div>

I want to compute some Jacobian matrix and get the numerical value. However, if I registered the user-defined function, I can’t get the result. For example, before @register: using ModelingToolkit @parameters t D = D…

---

## [CellListMap.jl / CellListMap.florpi documentation](https://discourse.julialang.org/t/celllistmap-jl-celllistmap-florpi-documentation/68390)

<div class="topic-metadata">

**Author:** [@anon28281882](https://discourse.julialang.org/u/anon28281882)\
**Replies:** 2\
**Last updated:** [October 11, 2021, 7:21pm UTC](https://discourse.julialang.org/t/celllistmap-jl-celllistmap-florpi-documentation/68390 "2021-10-11T19:21:28Z")

</div>

Is there any documentation on CellListMap.florpi “function” / “code” that computes pairwise velocity distributions? Any additional information like github documentation, research paper, accessible explanation in literatu…

---

## [Finding the value of a field at a spatial location in JuAFEM](https://discourse.julialang.org/t/finding-the-value-of-a-field-at-a-spatial-location-in-juafem/38975)

<div class="topic-metadata">

**Author:** [@jbmuir](https://discourse.julialang.org/u/jbmuir)\
**Replies:** 7\
**Last updated:** [October 11, 2021, 9:48am UTC](https://discourse.julialang.org/t/finding-the-value-of-a-field-at-a-spatial-location-in-juafem/38975 "2021-10-11T09:48:12Z")

</div>

Is there a relatively simple way to extract the value of a field in JuAFEM at a point in space within the grid? Use cases are - visualisation within Julia (not using ParaView); doing inverse problems with point observati…

---

## [DifferentialEquations.jl - how to calculate an 'assignment' and pass back to an ODE?](https://discourse.julialang.org/t/differentialequations-jl-how-to-calculate-an-assignment-and-pass-back-to-an-ode/69390)

<div class="topic-metadata">

**Author:** [@bgsmall](https://discourse.julialang.org/u/bgsmall)\
**Replies:** 10\
**Last updated:** [October 11, 2021, 9:29am UTC](https://discourse.julialang.org/t/differentialequations-jl-how-to-calculate-an-assignment-and-pass-back-to-an-ode/69390 "2021-10-11T09:29:22Z")

</div>

Hi. I have hit a snag in that I wish to calculate a quantity u\[3\] as an ‘assignment’ (not sure that is the correct terminology) within the ODE function and pass back to one of my ODE’s du\[3\] My code is below: # Package…

---

## [Dimension problem for variable multiplication in ModelingToolkit.jl](https://discourse.julialang.org/t/dimension-problem-for-variable-multiplication-in-modelingtoolkit-jl/69479)

<div class="topic-metadata">

**Author:** [@PikaPei](https://discourse.julialang.org/u/PikaPei)\
**Replies:** 2\
**Last updated:** [October 10, 2021, 12:11pm UTC](https://discourse.julialang.org/t/dimension-problem-for-variable-multiplication-in-modelingtoolkit-jl/69479 "2021-10-10T12:11:21Z")

</div>

This is what I did: using ModelingToolkit @parameters t @variables a(t) b(t) c\[1:2\](t) # then calculate: (c' \* \[a, b\]) \* c I think (c' \* \[a, b\]) can be a scalar, so the dimension is correct. julia\> size(c' \* \[a, b\]) …

---

## [ChargedParticles Example Seems Too Boring as an Example of NBodySimulator - Am I doing something wrong?](https://discourse.julialang.org/t/chargedparticles-example-seems-too-boring-as-an-example-of-nbodysimulator-am-i-doing-something-wrong/69439)

<div class="topic-metadata">

**Author:** [@Adam\_Fleischhacker](https://discourse.julialang.org/u/Adam_Fleischhacker)\
**Replies:** 1\
**Last updated:** [October 8, 2021, 3:43pm UTC](https://discourse.julialang.org/t/chargedparticles-example-seems-too-boring-as-an-example-of-nbodysimulator-am-i-doing-something-wrong/69439 "2021-10-08T15:43:29Z")

</div>

I am using the NBodySimulator.jl package and trying to understand it to model “blue-noise sampling” (see here if interested: Blue noise sampling using an N-body simulation-based method | SpringerLink). I am swimming ou…

---

## [DifferentialEquations.jl -- store intermediate variables?](https://discourse.julialang.org/t/differentialequations-jl-store-intermediate-variables/68928)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 3\
**Last updated:** [October 8, 2021, 10:15am UTC](https://discourse.julialang.org/t/differentialequations-jl-store-intermediate-variables/68928 "2021-10-08T10:15:49Z")

</div>

Is there a way to store intermediate variables in ODEs using the DifferentialEquations package? MWE: using DifferentialEquations # function sys!(dx,x,p,t) r = 1 u = 5\*(r-x\[1\]) dx\[1\] = 0.1\*(u-x\[1\]) end # x0 …

---

## [ModelingToolkit: Index reduction and linear algebraic loops](https://discourse.julialang.org/t/modelingtoolkit-index-reduction-and-linear-algebraic-loops/69312)

<div class="topic-metadata">

**Author:** [@AnHeuermann](https://discourse.julialang.org/u/AnHeuermann)\
**Replies:** 6\
**Last updated:** [October 7, 2021, 9:57pm UTC](https://discourse.julialang.org/t/modelingtoolkit-index-reduction-and-linear-algebraic-loops/69312 "2021-10-07T21:57:02Z")

</div>

Hey all, I’m trying out ModelingToolkit.jl and want to investigate what is currently possible and what not and compare it to the OpenModelica Compiler Backend. Let’s say we have the following DAE: der(x) = y + a y = 3…

---

## [Newbie: Variables are missing from the variable map: PMSM model](https://discourse.julialang.org/t/newbie-variables-are-missing-from-the-variable-map-pmsm-model/69314)

<div class="topic-metadata">

**Author:** [@gruemelmonster](https://discourse.julialang.org/u/gruemelmonster)\
**Replies:** 3\
**Last updated:** [October 7, 2021, 7:41pm UTC](https://discourse.julialang.org/t/newbie-variables-are-missing-from-the-variable-map-pmsm-model/69314 "2021-10-07T19:41:14Z")

</div>

Based from the RC example I am trying to build something different to learn more about ModelingToolkit.jl. But I am struggling with an error message about “\[Ψd(t), Ψq(t), ω(t)\] are missing from the variable map” and I am…

---

## [Predator\_prey\_multiagent vs predator\_prey\_fast.jl example](https://discourse.julialang.org/t/predator-prey-multiagent-vs-predator-prey-fast-jl-example/69359)

<div class="topic-metadata">

**Author:** [@Edu\_P](https://discourse.julialang.org/u/Edu_P)\
**Replies:** 4\
**Last updated:** [October 7, 2021, 1:34pm UTC](https://discourse.julialang.org/t/predator-prey-multiagent-vs-predator-prey-fast-jl-example/69359 "2021-10-07T13:34:00Z")

</div>

Hello, in the predator\_prey\_multiagent.jl example I read the following comment: “This approach is less performant than the version in \[Predator-prey dynamics\]”. Has someone more details on what makes it a less performan…

---

## [Projected coordinate system and multi-agents](https://discourse.julialang.org/t/projected-coordinate-system-and-multi-agents/69289)

<div class="topic-metadata">

**Author:** [@Edu\_P](https://discourse.julialang.org/u/Edu_P)\
**Replies:** 2\
**Last updated:** [October 7, 2021, 11:21am UTC](https://discourse.julialang.org/t/projected-coordinate-system-and-multi-agents/69289 "2021-10-07T11:21:43Z")

</div>

I’m a newbie to Julia agents.jl. How hard is to develop models in agents.jl requiring shape files and multi-agents using locations in a projected coordinate system? any experiences that can be compared to Gama Thanks

---

## [DifferentialEquations -- transform time for all variables?](https://discourse.julialang.org/t/differentialequations-transform-time-for-all-variables/69356)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 1\
**Last updated:** [October 7, 2021, 11:12am UTC](https://discourse.julialang.org/t/differentialequations-transform-time-for-all-variables/69356 "2021-10-07T11:12:43Z")

</div>

I have solved a matrix ODE with state u, and want to plot the solution sol. But I want to scale the time axis from second to year. Can I do this for all variables, something like: y2s = 365\*24\*60\*60 plot(sol,vars=((t,u)…

---

## [Structural\_simplify fails if differential term is on the Right Hand Side of an equation](https://discourse.julialang.org/t/structural-simplify-fails-if-differential-term-is-on-the-right-hand-side-of-an-equation/69302)

<div class="topic-metadata">

**Author:** [@SCher](https://discourse.julialang.org/u/SCher)\
**Replies:** 2\
**Last updated:** [October 7, 2021, 8:58am UTC](https://discourse.julialang.org/t/structural-simplify-fails-if-differential-term-is-on-the-right-hand-side-of-an-equation/69302 "2021-10-07T08:58:07Z")

</div>

I am working on ModelingToolkit.jl using the RC circuit example at https://mtk.sciml.ai/stable/tutorials/acausal\_components/. It appears that as long as the Differential(t) terms in the equations are on the Left Hand Sid…

---

## [DifferentialEquations: enforcing realistic solution?](https://discourse.julialang.org/t/differentialequations-enforcing-realistic-solution/69332)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 7\
**Last updated:** [October 7, 2021, 8:36am UTC](https://discourse.julialang.org/t/differentialequations-enforcing-realistic-solution/69332 "2021-10-07T08:36:03Z")

</div>

I have a (large) ODE where each state x must lie in the range \[0,1\]. Due to numeric inaccuracies, the solution does drift outside of this range. I have tried to map x into the allowed range at the start of the function d…

---

## [System modeling workflow example](https://discourse.julialang.org/t/system-modeling-workflow-example/67612)

<div class="topic-metadata">

**Author:** [@holmesthinking](https://discourse.julialang.org/u/holmesthinking)\
**Replies:** 5\
**Last updated:** [October 5, 2021, 7:51pm UTC](https://discourse.julialang.org/t/system-modeling-workflow-example/67612 "2021-10-05T19:51:26Z")

</div>

Hi, I have some experience in Simulink but I want to do stuff in Julia (ModelingToolkit). I’m searching for examples of simple system models for example two water tanks and pump or something similar in complexity. I wo…

---

## [StochasticDiffEq for receiver BER estimation?](https://discourse.julialang.org/t/stochasticdiffeq-for-receiver-ber-estimation/68957)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 2\
**Last updated:** [October 2, 2021, 3:48pm UTC](https://discourse.julialang.org/t/stochasticdiffeq-for-receiver-ber-estimation/68957 "2021-10-02T15:48:58Z")

</div>

Having an engineering background, I would like to ask the more mathematically inclined experts. One of the key parameters of a radio reception device is its bit error rate (BER) for a given ratio of wanted signal and di…

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

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