Modelica

What Modelica Is and Use Cases

  • Declarative, equation-based language for modeling cyber-physical systems (multi-domain: mechanical, electrical, fluids, thermals, etc.).
  • Used heavily in automotive and motorsports (including F1 and NASCAR), HVAC, and electromagnetic systems.
  • Capable of very large models (hundreds of thousands of equations) spanning engines, transmissions, multibody dynamics, hydraulics, etc.
  • Can model CNC-like systems and stepper motors, though off‑the‑shelf libraries for niche components may be limited.

Acausal Modeling and Technical Characteristics

  • “Acausal” means users specify relationships/equations, not explicit input→output causality; the compiler infers causality and does index reduction, state selection, etc.
  • This improves composability: adding components can change optimal causality without refactoring models.
  • Under the hood, models become systems of DAEs; strong numerical methods exist, but stochastic systems (SDEs) are noted as a weak spot.
  • Supports discrete events and synchronous (clocked) systems directly in the language.

Tooling: OpenModelica, Commercial Tools, and Julia

  • OpenModelica is the main open-source implementation; considered close to being a viable Simulink alternative, especially with strong FMU support.
  • Dymola is a leading commercial tool; praised for advanced vehicle dynamics libraries but criticized for licensing, bugs, and limited advantages over free tools in some areas.
  • Wolfram SystemModeler and some MATLAB products are also Modelica-based or comparable.
  • Julia’s ModelingToolkit and commercial JuliaSim adopt similar acausal ideas; JuliaSim adds GUIs and embedded-target work but is proprietary/source-available.

FMUs and Interoperability

  • FMI/FMUs are highlighted as a major strength: packaged models can be embedded into other environments (e.g., Python via fmpy, Simcenter, etc.).
  • Third‑party support for model‑exchange FMUs on Linux is reported as weak.

Comparisons and Alternatives

  • Compared to SPICE/Verilog‑A: Modelica covers more domains and has richer libraries (e.g., multibody, two‑phase fluids).
  • Compared to Simulink: Simulink is causal and math‑block oriented; Modelica is acausal and physics‑component oriented. Simscape narrows this gap.
  • Compared to SymPy/System Dynamics tools: Modelica is aimed at large, detailed physical models with graphical composition, not generic CAS work or high‑level system dynamics.

Strengths, Limitations, and Pain Points

  • Strengths: composability, multi-physics scope, open specification, FMU export, mature standard library, vendor diversity (reduces lock‑in).
  • Limitations/pain points: challenging debugging when solvers struggle, weaker stochastic support, inconsistent library coverage for some domains, and incomplete ecosystem vs. Simulink toolboxes.

Documentation, Website, and Accessibility

  • Several commenters found the landing page unclear, with merch and logos more prominent than examples.
  • Others note that tutorials and “Modelica by Example” are easy to reach after a few clicks.
  • Searchability across docs and libraries is considered limited; finding specific models often requires broader web search or conference proceedings.

Related Languages and Research Directions

  • Mention of NESTML (for hybrid dynamical systems with events), a new MARCO compiler for large-scale optimization, and discussion of bond graphs, with disagreement on how central they are to Modelica’s conceptual basis.