top | item 42431924

(no title)

hazrmard | 1 year ago

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/

discuss

order

alhirzel|1 year ago

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/

wolvesechoes|1 year ago

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

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

whereistimbo|1 year ago

Does MATLAB also compete in the same field?

hazrmard|1 year ago

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.

toxik|1 year ago

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

ETA: Apparently MathWorks has Simscape in this category.