Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From the website:

> Modelica is a high-level declarative language for describing mathematical behavior. It is typically applied to engineering systems...

We use Modelica quite a bit in HVAC industry. In my case (controls engineer), I can request FMUs of various components from systems engineers for optimization work. (Functional Mockup Unit (FMU)[1]: stand-alone binary representing a dynamical system that can be driven by another application). My background is in Reinforcement learning/Model predictive control/python. Having a physics-driven model written in a domain-specific language which I can embed into my python workflow [2] is convenient.

I will say, Modelica requires a different perspective from "regular" imperative programming (python/matlab). It is a declarative language: you define equations, variables, constraints for a system, regardless of order. The compiler decides how to run the simulation; which variables to solve first etc.

While OpenModelica[3] has come a long way towards making an open source implementation of the language standard, proprietary applications (Dymola) still have an edge in the industry.

[1]: https://fmi-standard.org/

[2]: https://fmpy.readthedocs.io/en/latest/

[3]: https://openmodelica.org/




Another up-and-coming solution is Julia's simulation ecosystem [1]. It is powered by the commercial organization behind the Julia programming language, which has received DARPA funding [2] to build out these tools. This ecosystem unifies researchers in numerical methods [3], scalable compute, and domain experts in modeling engineering systems (electrical, mechanical, etc.) I believe this is where simulation is headed.

[1] https://juliahub.com/products/juliasim

[2] https://news.ycombinator.com/item?id=26425659

[3] https://docs.sciml.ai/DiffEqDocs/stable/


JuliaSim looks interesting! From my understanding, it's 100% proprietary/commercial, but built on top of the open source https://github.com/SciML/ModelingToolkit.jl?


I believe it's open source but requires a commercial license; free for academics.


To be slightly more precise, it's not open source, but source available.


Good distinction


"Another up-and-coming solution is Julia's simulation ecosystem"

Still not comparable with Modelica that has proper specification, including graphical representation of models.


JuliaSim does have graphical representation, a GUI and an IDE. But, granted, it is also a commercial product, not open source.


But this representation is exclusive to JuliaSim, is it not? MTK package didn't have equivalents of Dialog, Icon and Diagram annotations the last time I checked.


It is exclusive to JuliaSim. But the tools generate MTK compatible component models so, once built, they can be used with MTK.



Does MATLAB also compete in the same field?


MATLAB/Simulnk is imperative. They have signal flow/causal approach. So you should know ahead of time which variable causes another variable to change i.e. which is defined first.

Modelica is acausal. You define the variables and how they are related (equations). The compiler handles variable dependencies and resolution internally.

There are pros & cons of each. Both are used for simulating cyber-physical systems.


I seem to have a problem understanding "acausal". Is its meaning "not causal"? To me that wouldn't make much sense and sounds like another buzzword. The software still runs inside a computer. Everything inside of it is causal. And nust because the compiler decides in what order to do what, that also doesn't make it not causal, since surely the compiler follows some well known rules that _cause_ it to decide this way or that way. And surely defining relations _is_ in a way defining the causal ... relations.

So what is really the meaning of "acausal" in this context?


It's like the difference between an imperative framework and a declarative one. In a causal modeling system you as the user are responsible for writing out the causality of your model. In an acausal system, you write what components you have and how they connect and part of the compilation process is "causalization" i.e. taking the elements and connections and inferring from that the direction of causality.

This makes modeling much easier because causality doesn't compose. Adding a new component to a model can totally change what the optimal causalization is, so using an acausal framework the compiler will figure that out, but in a causal framework the user has to re-derive the causality of their model.


It means the causality is not built into the components but instead decided once your system is defined. The point is that you can make a change to the causality without having to refactor major parts of your model. It also means, even without the factoring, that the causalization (determining what is computed in terms of what) is done for you by the compiler, which spares you from doing lots of tedious, time-consuming and error prone work.


It means data flow is bidirectional.


Sounds like Simulink to me, which is one of the major MATLAB programming environments.

ETA: Apparently MathWorks has Simscape in this category.


And Mathematica has this: https://www.wolfram.com/system-modeler/


Yeah but that's a Modelica compiler and environment too.


I would love to use Modelica but in my field Simulink is king




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: