Live data from Hacker News

Modelica

modelica.org

111–118 of 118 posts

Re: Modelica

#111

Earlier quoted context omitted.

"Another up-and-coming solution is Julia's simulation ecosystem" Still not comparable with Modelica that has proper specification, including graphical representation of models.

JuliaSim does have graphical representation, a GUI and an IDE. But, granted, it is also a commercial product, not open source.

But 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.

Re: Modelica

#112

Earlier quoted context omitted.

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.

I 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…

It means the causality is not built into the components but instead decided once your system is defined. The point is that you can make a change to the causality without having to refactor major parts of your model. It also means, even without the factoring, that the causalization (determining what is computed in terms of what) is done for you by the compiler, which spares you from doing lots of tedious, time-consuming and error prone work.

Re: Modelica

#113

Earlier quoted context omitted.

Over 20 years ago I modeled an internal combustion engine, an automatic transmission and a multibody chassis model all in a single model. IIRC, the model had something like 250,000 equations in it and it modeled combustion, hydraulics, friction, and 3D rigid body motion. It is capable of far more than simple models. https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&d...

That’s incredible, I had no idea this was even possible. Are most auto manufacturers modelling their vehicles this way? Seems like an amazing way to search for optimizations, predictive failures, etc.

It is pretty wide spread in automotive. I think nearly all F1 teams use it (hard to know for sure since they are quite secretive, but it is very common in my experience)

Re: Modelica

#114
post #106

Earlier quoted context omitted.

The 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…

So ... 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/…

"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).

Re: Modelica

#115

So, 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 di…

numerical solutions to ODEs/DAEs is a field with a lot of very good methods.

Re: Modelica

#116

Earlier quoted context omitted.

JuliaSim does have graphical representation, a GUI and an IDE. But, granted, it is also a commercial product, not open source.

But 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.

It is exclusive to JuliaSim. But the tools generate MTK compatible component models so, once built, they can be used with MTK.

Re: Modelica

#117

Earlier quoted context omitted.

Yes. And "Introduction to Physical Modeling with Modelica". I also built the Modelica Playground (which I deliberately didn't link to because a thundering herd of HN readers would have crashed it).

Are you aware of any books like your "Introduction to Physical Modeling with Modelica" but for readers without a background in EE, math, physics? I am looking for something for a mediocre SWE like myself. It doesn't have to be Modelica; I could try learning MatLab or Mathematica, etc.

Well if you are interested in the intersection of software engineering and technical computing, I'd recommend Julia. I'm currently working on JuliaSim which is a Modelica like system built on top of Julia. So Julia might interest you as a programming language and then you could pick and choose what aspects of things like ModelingToolkit if you are interested in the engineering, math and physics aspect or you can just stick to the software/programming aspects of Julia.

Re: Modelica

#118
post #60

Earlier quoted context omitted.

Downvoted but relevant...nothing says corporate bullshit like a niche programming language with logos and merch featured far more prominently than examples or explanation...

Just to be clear, there is absolutely nothing "corporate" about that web site. It is a non-profit organization.

Sorry, I guess that was rude, I don't know anything about it, just a snap judgment of the landing page.
Post reply on HN