4 ms·
From the website: > Modelica is a high-level declarative language for describing mathematical behavior. It is typically applied to engineering systems... We u
by hazrmard 2y 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/ https://fmi-standard.org/
[2]: https://fmpy.readthedocs.io/en/latest/ https://fmpy.readthedocs.io/en/latest/
[3]: https://openmodelica.org/ https://openmodelica.org/
- alhirzel 2y agoAnother 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 https://juliahub.com/products/juliasim [2] https://news.ycombinator.com/item?id=26425659 https://news.ycombinator.com/item?id=26425659 [3] https://docs.sciml.ai/DiffEqDocs/stable/ https://docs.sciml.ai/DiffEqDocs/stable/
- wolvesechoes 2y 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.
- michaeltiller 2y agoJuliaSim does have graphical representation, a GUI and an IDE. But, granted, it is also a commercial product, not open source.
- wolvesechoes 2y agoBut 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.
- michaeltiller 2y agoIt is exclusive to JuliaSim. But the tools generate MTK compatible component models so, once built, they can be used with MTK.
- xgdgsc 2y agoThere' s a Chinese company also using Julia and Modelica https://www.tongyuan.cc/product/MWorks https://www.tongyuan.cc/product/MWorks . They have projects like https://github.com/Suzhou-Tongyuan/syslab-deploy https://github.com/Suzhou-Tongyuan/syslab-deploy using https://discourse.julialang.org/t/syslabcc-suzhou-tongyuans-proprietary-julia-aot-compiler-is-now-available-for-free-use-personal-educational-license-only/114633 https://discourse.julialang.org/t/syslabcc-suzhou-tongyuans-... .
- auxym 2y agoJuliaSim looks interesting! From my understanding, it's 100% proprietary/commercial, but built on top of the open source https://github.com/SciML/ModelingToolkit.jl https://github.com/SciML/ModelingToolkit.jl?
- hatmatrix 2y agoI believe it's open source but requires a commercial license; free for academics.
- adgjlsfhk1 2y agoTo be slightly more precise, it's not open source, but source available.
- f1shy 2y agoGood distinction
- whereistimbo 2y agoDoes MATLAB also compete in the same field?
- toxik 2y agoSounds like Simulink to me, which is one of the major MATLAB programming environments. ETA: Apparently MathWorks has Simscape in this category.
- sampo 2y agoAnd Mathematica has this: https://www.wolfram.com/system-modeler/ https://www.wolfram.com/system-modeler/
- anothertroll123 2y agoYeah but that's a Modelica compiler and environment too.
- anothertroll123 2y agoI would love to use Modelica but in my field Simulink is king
- hazrmard 2y agoMATLAB/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.
- zelphirkalt 2y agoI 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?