back

by pkoird·1y ago·view on hn ↗
Obligatory mention to Openmodelica[1] which is an open source implementation based on the Modelica language. While I haven't used it yet, I was planning on exploring some of the features this holiday.

[1] https://openmodelica.org/

3 comments
If you intend to explore OpenModelica you may also like ModelingToolkit.jl:

https://docs.sciml.ai/ModelingToolkit/dev/

There is also a project by Hilding Elmqvist, who worked for Dassault on Dymola (the leading commercial implementation of Modelica). His project is Modia.jl:

https://github.com/ModiaSim/Modia.jl

I can personally feel the Julia community settling on MTK, but Modia was ahead in the early stages of dynamic system simulation in Julia, and I believe MTK has drawn a lot of inspiration from each Modia and Modelica. Modia is a bit more ergonomic while also being the first to integrating things like 3D viewers and a complete multibody package by years, with Julia Computing only now catching up [1]. MTK has a better support for back-end solvers and holds a lot of promise to leapfrog Modia, especially since the release cadence for Modia seems to have slowed.

[1] https://github.com/JuliaComputing/Multibody.jl

Hilding Elmqvist not only worked on Dymola, he is the original creator of modelica
In fact Dymola was published (including source code) in Hilding Elmqvist's doctoral thesis:

Elmqvist, H. (1978). A Structured Model Language for Large Continuous Systems. [Doctoral Thesis (monograph), Department of Automatic Control]. Department of Automatic Control, Lund Institute of Technology (LTH).

portal: https://portal.research.lu.se/en/publications/a-structured-m...

direct pdf link: https://lucris.lub.lu.se/ws/portalfiles/portal/4602422/85704...

Having used it in the work. My 2 cts about the not free version: KEEP AWAY. RUN! Cannot do much more than any free SPICE, complex licensing, buggy. Is just like the LabVIEW of simulations.

I haven't used the free Version though.

One of the advantages Dymola had a few years ago was an extremely advanced vehicle dynamics toolbox, to the point where it is considered a standard for NASCAR [1]. This is one of the tool's originating claims to fame circa 2015-19 when I was bringing it into a previous employer in the automotive industry. For some applications that are "first class", you will have a great experience with Dymola. Where they have filled in the blanks in toolboxes, however, you are likely not a cut above other tools.

[1] https://www.claytex.com/applications/motorsport/

Together with colleagues, I have been developing the dynamical systems modeling language "NESTML" for hybrid dynamical systems, that is, systems that contain continuous-time dynamics (expressed as ordinary differential equations) as well as being able to emit and receive discrete events that happen instantaneously in time. We strive for a minimal syntax, so you can write a model really concisely, for example:

  model lorenz_attractor:

  state:
    x real = 1
    y real = 1
    z real = 1

  equations:
    x' = sigma * (y - x) / s
    y' = (x * (rho - z) - y) / s
    z' = (x * y - beta * z) / s

  update:
    integrate_odes()

  parameters:
    sigma real = 10
    beta real = 8/3
    rho real = 28
For events, there are constructs like "onReceive(in_port_name)" and "emit_spike()" (nomenclature there being clearly somewhat influenced from our neuroscience application domain).

It's still a work in progress, but we already have some cool applications, like a spiking neural network that learns and then replays sequences (https://nestml.readthedocs.io/en/latest/tutorials/sequence_l...).

I was frankly surprised that something like this did not already exist when I started development on NESTML. Modelica is similar, but does not seem to have support for discrete events. I realise all of this is a shameless plug ;) but in actuality we are of course very happy to receive comments and feedback! All development is out in the open on GitHub and it is GPL licensed. If someone knows of similar DSLs, I would be very happy to read your comments. Cheers!

Modelica not only has discrete events (see other comment), it includes support for synchronous (clocked) systems of equations directly in the language. These kinds of language semantics are necessary if you want to have unambiguous discrete models.

https://specification.modelica.org/maint/3.6/synchronous-lan...

Modelica absolutely has discrete events: https://mbe.modelica.university/behavior/discrete/events/
Thank you for the pointer!
That's a really interesting project!

In the docs you say > Currently, there is support for GSL, forward Euler, and exact integration

Does 'GSL' refer to GNU Scientific Library, which you use as a backend?