TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

All about Modelica: An equation-based language for modeling physical systems

193 pointsby macro-balmost 5 years ago

15 comments

choegeralmost 5 years ago
One thing about Modelica is quite important and might confuse newcomers: the language specification mostly only covers the model, not the equations. That is, when you evaluate your model under, e.g., Dymola and Openmodelica you will (most of the time) end up with equal (or rather similar) systems of equations. The meaning of these equations, i.e., the actual simulation can easily differ, though (except for the most trivial models).<p>The reason for this is that the equations are extremely powerful (you can express pretty much anything computable inside an equation) and their numerical solution is often driven by heuristics (e.g., finding initial values). This makes it extremely difficult to come up with a common standard for the solution of Midelica&#x27;s hybrid DAEs. Hence you will find little written information about what exactly happens during a simulation that applies to more than one implementation.
评论 #23696089 未加载
pflanzealmost 5 years ago
There&#x27;s a project to create a language similar to Modelica as a DSL in Julia, Modia[1]. I&#x27;m not currently a user of either language, but saw a presentation at JuliaCon about it[2] and thought it looked interesting.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;ModiaSim&#x2F;Modia.jl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ModiaSim&#x2F;Modia.jl</a> [2] <a href="https:&#x2F;&#x2F;youtu.be&#x2F;hVg1eL1Qkws" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;hVg1eL1Qkws</a>
评论 #23712169 未加载
评论 #23699366 未加载
ptrott2017almost 5 years ago
This is a great overview of Modelica. For those looking to get started - check out OpenModelica (<a href="https:&#x2F;&#x2F;openmodelica.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;openmodelica.org&#x2F;</a>) and if you are curious how to approach deploying and using Modelica in web services the article&#x27;s author as a rather awesome open source project called LambdaSim see(<a href="https:&#x2F;&#x2F;github.com&#x2F;mbonvini&#x2F;LambdaSim" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mbonvini&#x2F;LambdaSim</a>)
vsskanthalmost 5 years ago
Been working in Modelica for a couple of years. Modelica compilers generate C code since they&#x27;re heavily used in the embedded and real-time space. Kinda amazing to see systems with hundreds of thousands of equations simulate faster than real time.
评论 #23704242 未加载
vsskanthalmost 5 years ago
a quick intro for programmers - Modelica is basically the equivalent of Haskell for engineers - the compiler does most of the work for you and produces highly performant code. You can compose a very complex system from individually modeled elements. The Modelica compiler will check constraints and basically come up with a system of equations. If it compiles, it is probably correct. The model wont compile if a particular variable is being modified in two places. Models have full introspection where you can observe any variable you choose.
评论 #23712593 未加载
NotPhysicsPhdalmost 5 years ago
I have been used modelica and modelica-like languages for the past few months, and I have completely been blown away by the experience.<p>I think the solvers are fantastic and produce better results, in terms of speed and scale, than any other method I had used previously, I was solving the DEs using either wolfram or Julia&#x27;s Differential equations.<p>OpenModelica is a wonderful piece of software, I just wish it had a better UI, UX and error messages. Wolfram&#x27;s system modeler offers an excellent experience but it is very expensive.<p>Recently I have been using Mathworks take on model-based languages, Simscape[1], which is great for my use case, as it integrates the whole MATLAB and simulink ecosystem. It is not modelica compatible, but it is possible to import FMUs created with modelica.<p>As a final note, I truly wished that Modelica was taught more in engineering and physics degrees.<p>[1] <a href="https:&#x2F;&#x2F;www.mathworks.com&#x2F;products&#x2F;simscape.html" rel="nofollow">https:&#x2F;&#x2F;www.mathworks.com&#x2F;products&#x2F;simscape.html</a>
评论 #23703882 未加载
zokieralmost 5 years ago
okay, its neat and all, but I missed seeing any <i>output</i> from the models, or examples how you use the models you built to analyze something? How do you interact with it, what sort visualizations you get etc etc??
评论 #23695219 未加载
scorecardalmost 5 years ago
In my experience Modelica is a good fit for sustainability engineering, as it works well across engineering disciplines. Simulation of hybrid gas&#x2F;electric engines was one of Modelica&#x27;s first major applications, power plants was another.<p>As others have noted Modelica is both more abstract and more performant than a lot of other ways of describing multiphysics systems; it got its start in out-of-the-way places, which may explain it&#x27;s relative obscurity, but there&#x27;s an opportunity for it to become pervasive in engineering, both in the academy and industry.
curlyfrondalmost 5 years ago
I&#x27;ve been using Modelica for about 15 years now as an engineer. Mainly 3 different interpreter front ends: Dymola, OpenModelica, and SystemModeler.<p>At first I was mainly interested in it&#x27;s ability to symbolically manipulate equations for me. With complex physical systems and interconnections it can become a tremendous chore rearranging systems to provide certain inputs and certain outputs. Modelica and the above compilers allowed me to specify the equations, and in fact automatically generate and interconnect larger and larger systems as one model. Specifying what were inputs and what were outputs became a simple few lines of code. For example, forward and inverse kinematics are the same equations in Modelica, you just specify different input&#x2F;outputs, and the compiler determines what&#x27;s the best way to do this. This can have significant challenges sometimes, when things don&#x27;t easily work, but on the whole the process has been more often than not straightforward.<p>Interconnection of the models to other simulations has also become more and more a delight. Initially we had to depend on specific interfaces being built, either on the modelica interpreter side, or on the external application side (for example, Mathworks or Dymola), but fortunately the growth in such use prompted the modelica community to partner with industry to foster an open specification (like modelica is) for model exchange, called FMI. Integrating my models with external software is now a relatively straightforward task, still with challenges, but not expensive ones.<p>I&#x27;d highly recommend modelica and the various compilers as a means of creating very effective models; easily readable and therefore maintainable, re-usable, and now more and more deployable.<p>I, myself, have used them in the truck industry, CNC machine controls, flight systems, and in underwater vehicles and power systems. I routinely interact with people who use modelica in a much wider domain than this, and more and more in on-board systems, such as controllers. For example, I believe northern Germany uses modelica for its power controls for a significant portion of their country&#x27;s energy supply.
dangalmost 5 years ago
If curious see also (from 2017): <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16013179" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=16013179</a>
amaticalmost 5 years ago
Is there a graphical interface, like Simulink, for Modelica?
评论 #23693798 未加载
评论 #23693735 未加载
评论 #23693713 未加载
jwilberalmost 5 years ago
Stellar example of naming gone right in software.
chadcmulliganalmost 5 years ago
Are there Modelica programmers? Or is it a tool engineers use? Like could you become a Modelica developer and do that as a living?
评论 #23700133 未加载
评论 #23696641 未加载
budadre75almost 5 years ago
does anyone know any industry usage of Modelica?
评论 #23694331 未加载
评论 #23694144 未加载
评论 #23700114 未加载
dangalmost 5 years ago
Is Modelica used for economic modeling as well?
评论 #23695925 未加载
评论 #23695506 未加载