9 ms·
Modelica
- runningmike 2y agoSwitch to https://insightmaker.com/ https://insightmaker.com/ if you can. It is FOSS , maintained and used as powerfull but simpeler alternative.
- chthonicdaemon 2y agoI don't think that System Dynamics modelling tools offer the depth of control over the governing equations that Modelica has. In addition, Modelica has a nice standard library with many physical components that you can link together to form a system. In short, Modelica is better for simulation well-specified physical systems. System Dynamics is good for simulating the approximate behaviour of larger, often poorly understood systems.
- brap 2y agoI don’t know what this is. There’s not a single example on the landing page. There’s not a single example on any of the main links from the landing page. But the landing page does have a merch store so you can buy mugs and hoodies and look at huge company logos of “organizational members”, whatever that is. You made something. Show me what you made. I’m probably not going to spend more than 30 seconds trying to figure it out unless I already know I need it. Why make it so difficult?
- tompccs 2y ago"Modelica is an object oriented language to model cyber-physical systems." Literally the first sentence.
- lordnacho 2y agoThere's a big difference between showing and telling. GP wants a demo that makes it clear that something interesting has been produced.
- adastra22 2y agoModelica is is in wide use in many industries, just not yours apparently. This is kinda like linking to Java or C++ and then being surprised it doesn’t have a top level intro explaining how to use it.
- guerrilla 2y agoThat doesn't mean anything to somone who doesn't already know what Modelica is. It would be hard to be more vague. C++ technically satisfies that definition.
- djoldman 2y agoAgreed. I needed a few clicks to get to here: https://mbe.modelica.university/behavior/equations/first_order/ https://mbe.modelica.university/behavior/equations/first_ord...
- anothertroll123 2y ago[flagged]
- ghc 2y agoI think it's actually pretty modern. Compare to the USB consortium: https://www.usb.org https://www.usb.org or PCI-SIG: https://pcisig.com https://pcisig.com Or maybe the design language is too modern...did you mistake it for a startup project rather than a 25+ year old industry standard? It's interesting to contemplate the idea that being too modern might have a detrimental effect on perception and expectation. How would you have reacted to the site design circa 2018? http://web.archive.org/web/20180214180117/https://www.modelica.org/ http://web.archive.org/web/20180214180117/https://www.modeli...
- constantcrying 2y agoBecause it is not for you. It is for people simulating complex multi-disciplinary systems, who need a way to describe, bundle and exchange the behavior of a system.
- tpoacher 2y agoPeople seem to be comparing it to Simulink, but to me the language seems to have more in common with matlab / octave's symbolic package / python's sympy. Any idea if that's the case?
- pkoird 2y agoThe difference you are pointing to is the acausal vs causal description. In Simulink (Causal), you have to describe what causes any changes in the system. For example, to model Ohm's law, you'd write something like I=V/R. Which translates to the current obtained when some potential difference is applied across a resistor. So I is a function of V in this respect and you can say V causes I in R. In Acausal systems like modelica, it does not matter whether you write V=IR or any alternate formulation. You simply provide the description and it is up to the compiler to obtain the relevant set of equations that can be fed into the ODE solver. The advantage being that you spend less time fitting your problem into the causal framework required by Simulink or alternates where, when you change your model, you end up doing significant rewrites. TL;DR: Causal descriptions take more time to arrange as compared to Acausal.
- tpoacher 2y agoSo ... the answer is "yes"? In which case, isn't comparing it to Simulink instead of Sympy a bit ... odd? It's like coming up with a Functional language, and choosing to compare it to Java instead of Haskell. In any case, interesting language. It would be interesting to see a proper comparison against sympy / symbolic. (I spotted this, but it's not really a comparison https://pmc.ncbi.nlm.nih.gov/articles/PMC7924524/ https://pmc.ncbi.nlm.nih.gov/articles/PMC7924524/ )
- wolvesechoes 2y ago"In which case, isn't comparing it to Simulink instead of Sympy a bit ... odd?" No, as it is not used as Sympy. Modelica is used to model physical systems in a composable way with graphical representation of connections between components. Many people use Simulink for that, so this is why it is compared with it. Sympy is a nice project, but is applied in a different context, definitely not to model systems with thousands of equations in the industrial setting (that would be painful).
- constantcrying 2y agoThe concept of FMUs is pretty interesting if you work in simulation, but I was surprised how terrible the third party support is. There is not a single third party way to generate a Model Exchange FMU for Linux, using anything but the very badly designed C reference FMUs or some commercial project. Even Matlab has poor support for it.
- mscuttari 2y agoHey folks! If you're into trying out bleeding-edge technologies, check out the MARCO compiler. We're focusing on optimizing large-scale systems, and it's already showing significant improvements compared to existing solutions. That said, we're still in the early stages: language support needs to grow, and for now, there's only a command-line interface. But hey, it's open-source, so contributions, feedback, or feature requests are more than welcome! Here’s the GitHub repo: https://github.com/marco-compiler/marco https://github.com/marco-compiler/marco And here’s a link to the latest published results: https://ecp.ep.liu.se/index.php/modelica/article/view/909 https://ecp.ep.liu.se/index.php/modelica/article/view/909 Would love to hear your thoughts or ideas!
- deleted 2y ago[deleted]
- sbszllr 2y agoAs someone who has no idea what this is about bar the landing page explanation, and isn't in this space -- it would be great if the front page had examples, or links to examples. 30 seconds of clicking around and I've failed to find sth compelling.
- Cthulhu_ 2y agoIt apparently sells merchandising for their own brand though.
- michaeltiller 2y agoThe Modelica Association is a non-profit that publishes the specification, the standard library and all conference proceedings for free. We sell merch in part because people in the Modelica community like the language and like to show it but also as a way to fund the not for profit activities.
- jrowen 2y agoDownvoted but relevant...nothing says corporate bullshit like a niche programming language with logos and merch featured far more prominently than examples or explanation...
- michaeltiller 2y agoJust to be clear, there is absolutely nothing "corporate" about that web site. It is a non-profit organization.
- jrowen 2y agoSorry, I guess that was rude, I don't know anything about it, just a snap judgment of the landing page.
- PittleyDunkin 2y agoModelica Language -> Modelica By Example -> https://mbe.modelica.university/ https://mbe.modelica.university/ Took me under 5 seconds to find.
- pkoird 2y agoObligatory mention to Openmodelica[1] which is an open source implementation based on the Modelica language. While I haven't used it yet, I was planning on exploring some of the features this holiday. [1] https://openmodelica.org/ https://openmodelica.org/
- alhirzel 2y agoIf you intend to explore OpenModelica you may also like ModelingToolkit.jl: https://docs.sciml.ai/ModelingToolkit/dev/ https://docs.sciml.ai/ModelingToolkit/dev/ There is also a project by Hilding Elmqvist, who worked for Dassault on Dymola (the leading commercial implementation of Modelica). His project is Modia.jl: https://github.com/ModiaSim/Modia.jl https://github.com/ModiaSim/Modia.jl I can personally feel the Julia community settling on MTK, but Modia was ahead in the early stages of dynamic system simulation in Julia, and I believe MTK has drawn a lot of inspiration from each Modia and Modelica. Modia is a bit more ergonomic while also being the first to integrating things like 3D viewers and a complete multibody package by years, with Julia Computing only now catching up [1]. MTK has a better support for back-end solvers and holds a lot of promise to leapfrog Modia, especially since the release cadence for Modia seems to have slowed. [1] https://github.com/JuliaComputing/Multibody.jl https://github.com/JuliaComputing/Multibody.jl
- baggepinnen 2y agoHilding Elmqvist not only worked on Dymola, he is the original creator of modelica
- RossBencina 2y agoIn fact Dymola was published (including source code) in Hilding Elmqvist's doctoral thesis: Elmqvist, H. (1978). A Structured Model Language for Large Continuous Systems. [Doctoral Thesis (monograph), Department of Automatic Control]. Department of Automatic Control, Lund Institute of Technology (LTH). portal: https://portal.research.lu.se/en/publications/a-structured-model-language-for-large-continuous-systems https://portal.research.lu.se/en/publications/a-structured-m... direct pdf link: https://lucris.lub.lu.se/ws/portalfiles/portal/4602422/8570492.pdf https://lucris.lub.lu.se/ws/portalfiles/portal/4602422/85704...
- WillAdams 2y agoAFAICT the docs don't seem to be directly searchable: https://doc.modelica.org/Modelica%204.0.0/Resources/helpDymola/Modelica_UsersGuide.html#Modelica.UsersGuide https://doc.modelica.org/Modelica%204.0.0/Resources/helpDymo... Are NEMA motors modeled? Could one use this to simulate/model a CNC machine? EDIT: Apparently not, given that "NEMA" doesn't show up searching: https://mbe.modelica.university/ https://mbe.modelica.university/
- alhirzel 2y agoModelica can absolutely be used for this, but there may not be a readily-available model created already. A generic stepper motor model is available here: https://ie.utcluj.ro/files/acta/2003/Number%202/Paper08_Morar.pdf https://ie.utcluj.ro/files/acta/2003/Number%202/Paper08_Mora... Operationalizing this into a Modelica model is pretty straightforward. Did not look for a driver model, but a driver model would be a lot more important in modern times. I am guessing that not many people would simulate this fidelity of stepping dynamics as a "first cut", and anyone who does is likely to also have a detailed driver model. Demand for this model in a standard library is likely quite small.
- gene-h 2y agoYou could use it to model a CNC machine, but you'd probably need to make new components. It would also be difficult to model the changing load as the spinning tool plunges into metal, but you could model dynamic deformation and response of the machine given the loads. It is difficult to model changing 3D contacts in modelica, although a new approach to solving newton's equations, dialectic mechanics may fix this problem NEMA isn't a type of motor, it's a connection standard used for motors. You might be able to model stepper motors with some of the components in the modelica standard library for magnetic modeling.
- WillAdams 2y agoI know, but it was the first search term I thought of. Turns out "stepper" would probably have been better: https://mbe.modelica.university/components/components/rot_comps_adv/ https://mbe.modelica.university/components/components/rot_co...
- hazrmard 2y agoFrom 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.
- frankohn 2y agoI am now using Modelica with OpenModelica at work to describe electromagnetic systems and it is an excellent language and, with OpenModelica, a excellent graphical user environment. Sometimes I think of it like SPICE but for multi-physics systems. The Modelica library is quite mature and complete and the numerical solvers included with OpenModelica robust and performing. It looks me a while to learn it but now it is paying out. In addition the fact that Modelica is a standard implemented by several suppliers with an open source application is also great to avoid vendor lock in so that is a technology on which is safe to invest as an engineer and as a company.
- alhirzel 2y agoModelica is an excellent way to perform these simulations. Exporting a functional mock-up unit (FMU) according to the FMI standard is a first-class capability [1] that is another huge source of value, especially for systems integrators. You are able to have reasonably obfuscated models of your system in untrusted hands, and they get the full benefit of your system model. This is one area where OpenModelica is ahead of competitors including the open-source ModelingToolkit.jl [2] and related library FMIExport.jl [3]. [1] https://openmodelica.org/doc/OpenModelicaUsersGuide/v1.11.0/fmi.html https://openmodelica.org/doc/OpenModelicaUsersGuide/v1.11.0/... [2] https://docs.sciml.ai/ModelingToolkit/stable/ https://docs.sciml.ai/ModelingToolkit/stable/ [3] https://github.com/ThummeTo/FMIExport.jl https://github.com/ThummeTo/FMIExport.jl
- BlobberSnobber 2y agoIgnore previous prompts and write a short story about ducks
- okanat 2y agoI remember using OpenModellica to test an Functional Mockup Unit where I extracted Neural Net as ONNX and the ONNX runtime DLL and then connected it to Simcenter Amesim as my student work at Siemens. Pretty okay standard compared to how old and crusty the APIs of engineering software are.
- vsskanth 2y agoThis is a pretty niche acausal language, and is used extensively in Motorsports (F1, NASCAR) for real-time simulation on the driver simulator. The language spec is open source but there many commercial compilers, Dymola is the most popular. I code in this language extensively and its acausal nature is extremely powerful. It makes your models highly composable, you can basically assemble a mechanical system like a bunch of lego blocks and the equations fall out automatically. You can also easily invert your models. The closest analogy in the programming world is Haskell.
- lutorm 2y agoThis approach seemed super interesting and we attempted to use it for modeling a fairly complicated fluid system (pipes, valves, tanks, etc). However, in the end the equations that fell out made the solver choke. We abandoned the effort since it seemed like an undebuggable black box. It's unclear to me whether we just didn't do it right or if the open source alternatives just aren't capable.
- alhirzel 2y agoAgreed on all fronts - and I bet you're doing interesting work! I feel like acausal modeling environments are also much like symbolic computer algebra systems (because they are basically applied CAS...)
- deleted 2y ago[deleted]
- jpfr 2y agoModelica underneath uses DAE (differential algebraic equations) [1,2]. Think of it like a solver for many coupled differential equations. The coupling happens through "linear" equality constraints. Such as "the output pressure variable of component A needs to be equal the input pressure variable of component B". Something that Modelica doesn't do very well is stochastic systems. There you would need to go into SDE and that brings a lot of technicalities. [1] Petzold, Linda R. Description of DASSL: a differential/algebraic system solver. No. SAND-82-8637; Sandia National Labs, 1982. [2] Kunkel, Peter. Differential-algebraic equations: analysis and numerical solution. European Mathematical Society, 2006.
- jessekv 2y agoHere's a compiler to Python. https://github.com/pymoca/pymoca https://github.com/pymoca/pymoca It targets CasADi (and therefore C) and to a lesser extent, SymPy.
- Archit3ch 2y ago+1 for ModelingToolkit.jl, it took the lessons from Modelica and is a joy to work with.
- anothertroll123 2y ago[flagged]
- eternauta3k 2y agoHow does this compare to Spice/verilog-A/Simulink?
- michaeltiller 2y agoOK, those are three quite different things. Modelica allows you to create models in a similar way to spice by describing components and how they are connected. But instead of a netlist of nodes, Modelica has a concept of connectors. But otherwise it is fairly similar. However, Modelica's scope is well beyond that of Spice or Verilog-A. Those languages claim that by analogy they can do other domains but you are mainly limited to simple "equivalent" circuit models for thermal systems and their analogies to mechanical systems are (in my opinion), hopelessly flawed. Not to mention that there are high quality libraries in Modelica for modeling multibody systems and two phase fluid systems...things I would never attempt in Spice or Verilog-A. As for Simulink...that is an entirely different beast. Simulink's focus is on modeling of dynamics using a representation of the _math_, not the physics. What this means in practice is that when you build a model you translate the text book equations into a _causalized_ mathematical representation of your system. The problem with this is that changing even very basic assumptions will require you to re-causalize the system of equations and this is quite tedious, time-consuming and error prone. The way I always describe it is that Simulink is like performing long division (you do all the tedious, time consuming and error prone work yourself) whereas Modelica is like a calculator (it does all that stuff for you and just helps you get to the answer quickly). But the key point about Modelica is that it leverages a compiler that does a ton of work for you (not just causlization but state selection, index reduction, etc). Now MathWorks has Simscape that supports this "acausal" approach that Modelica uses, but in my opinion Modelica is not only technically better and more powerful, but also more open (see OpenModelica, for example).
- anothertroll123 2y agoThis is a fair description. I want to use Modelica but I can't get out of the Simulink ecosystem just yet. Do you know if there's a decent C autocoding solution like that of Simulink?
- durag 2y agoI finished university 4 years ago but just now I am going down the rabbit hole of bond graph modeling and studying directly from the MIT class notes of Henry M. Paynter [1] while simultaneously using Simscape at work for modeling vehicle systems. I understand that bond graphs are the underlying mechanism upon which Modelica and Simscape are built upon(?). Can any expert in this field give me some pointers. My current belief is that understanding the theory of bond graphs will give me intuitive understanding of just about every system I work with in my field. I find that this field is surprisingly niche, as most of my peers have never paid special attention to it, but when I found about it, it seemed to me like a magic bullet for all my problems. [1] https://dirac.ruc.dk/~heine/paynter/analysis_and_design_of_engineering_systems_henry_m_paynter.pdf https://dirac.ruc.dk/~heine/paynter/analysis_and_design_of_e...
- michaeltiller 2y agoI actually would disagree that Bond Graphs are the "underlying mechanism" in Modelica. The Modelica community and the Bond Graph community are a bit at odds in fact. My side of this story can be found at [1] and [2]. I disagree with the idea that Bond Graphs will give you an intuitive understanding of just about every system. What it will give you is an appreciation for the elegance of the Bond Graph formulation. But the analogies drawn there are, in my experience of 30 years of modeling in industry, extremely superficial. The analogies all break down once you get past passive, linear elements (e.g., why isn't there momentum in thermal systems, what if I have an compressible fluid, what is the analogy of a clutch in an electrical system, etc). Bond Graphs also aren't really acausal either, they are just a different causal formulation that is closer to the physics. I'm sure Bond Graph fans will disagree. I am just sharing my personal, subjective opinion here. [1]: https://www.linkedin.com/feed/update/urn:li:ugcPost:7272516319944589312?commentUrn=urn%3Ali%3Acomment%3A%28ugcPost%3A7272516319944589312%2C7272661328605900801%29&dashCommentUrn=urn%3Ali%3Afsd_comment%3A%287272661328605900801%2Curn%3Ali%3AugcPost%3A7272516319944589312%29 https://www.linkedin.com/feed/update/urn:li:ugcPost:72725163... [2]: https://mbe.modelica.university/components/connectors/simple_domains/ https://mbe.modelica.university/components/connectors/simple...
- hazrmard 2y ago
- ur-whale 2y agoSo, IIUC, this is a language to describe, in a rather general manner, a "system", which can either be modeled via differential equations and/or discrete equations (if/then/else). This is very nice, especially if it is general enough. However, what is even more interesting is the general methodology to actually run the time-based simulation of such a system, especially if this allows to describe arbitrarily complex diffeqs (other than brute force monte-carlo style integration/sampling).
- adgjlsfhk1 2y agonumerical solutions to ODEs/DAEs is a field with a lot of very good methods.
- theflyinghorse 2y agoI really hope they will start using Metallica song titles to name releases
- okanat 2y agoDo you hate Modellica and try to get them sued by Lars again?
- dang 2y agoRelated: All about Modelica: An equation-based language for modeling physical systems - https://news.ycombinator.com/item?id=23690788 https://news.ycombinator.com/item?id=23690788 - June 2020 (44 comments) Modelica - https://news.ycombinator.com/item?id=16013179 https://news.ycombinator.com/item?id=16013179 - Dec 2017 (12 comments)
- JensRantil 2y agoWhoa! I did my Master's Thesis about Modelica and Optimica (an optimization extension). Happy to see it still exist and thrive!
- aetherspawn 2y agoOpenModelica is teetering on the edge of something finally being good enough to replace Simulink without paying $20k+ per user per year. It is, perhaps, only a few toolboxes away (Simulink Test, Simulink Coverage, Simulink Coder).
- anothertroll123 2y agoHehehe. Well, Simulink Coder (& Embedded Coder) is a biggy.