Hacker News new | past | comments | ask | show | jobs | submit login

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




As someone who is a curious outsider to Modelica, it piqued my interest a few years ago when I found out that this language lets you write equations more directly than most other programming languages. Take the ideal gas law, for example, PV = nRT, which has 5 identifiers. In most programming languages, you'd have to keep only one variable to the left, that is assigned to, e.g. T=PV/nR, and a similar set of equations if you want to determine any of the other variables, given the rest. In Modelica, the same equation, expressed as you would in natural math, works for determining the unknown, based on the knowns.

https://mbe.modelica.university/behavior/equations/electrica...

I don't know much beyond this.


This is generally referred to as an acausal modeling environment - you don't need to bring the causality of mathematical relationships, just bring the relationships.

There are several other tools in this space, not the least prevalent of which is Mathworks' Simscape product line [1]. Wolfram has a solution that is also very similar to Modelica [2]. Finally, I believe that you will find ModelingToolkit.jl [3] worth a look (along with Julia in general) if your interest is piqued here by Modelica. I believe MTK is a big slice of the future of acausal modeling tools.

[1] https://www.mathworks.com/products/simscape.html

[2] https://www.wolfram.com/system-modeler/

[3] https://docs.sciml.ai/ModelingToolkit/stable/examples/spring...


Wolfram SystemModeler is a Modelica implementation.


Here are some examples. Looks like a simplified framework for writing physical and electrical system simulations.

https://mbe.modelica.university/


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)


Ah! You're the author of Modelica by example?


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


Nice to cross your path, I got the first one to kickstart myself some years ago (and still struggling with evaporation / condensation).

Would you recommend the second to introduce a colleague to OpenModelica? He is into gPROMS but will lose access to the software at retirement.

Sidenote: invest in software with freedom to operate and good knowledge reusability.


Modelica by Example is the most recent and free, so I would recommend that.


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.


I wouldn't say simplified. You can model a lot of systems with it. It's pretty good.


The first link for “Modelica Language” includes tutorials and examples. Five seconds of clicking around got me to:

> Let us consider an extremely simple differential equation:

x = (1-X)

Looking at this equation, we see there is only one variable, x

This equation can be represented in Modelica as follows:

  model FirstOrder
    Real x;
  equation
    der(x) = 1-x;
  end FirstOrder;
This code starts with the keyword model which is used to indicate the start of the model definition.

The model keyword is followed by the model name, FirstOrder. This, in turn, is followed by a declaration of all the variables we are interested in.

[et cetera]


Modelica Language -> Modelica By Example -> https://mbe.modelica.university/

Took me under 5 seconds to find.


[flagged]


I wonder if some of those words might be terms-of-art, written with a specialist rather than a generalist audience in mind.


Accessible to whom? I work in a field that uses things like Modelica and it reads just fine to me.


It apparently sells merchandising for their own brand though.


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


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.


Another day, another nondescript product name on HN for Russian roulette clicking. Dare to say anything about it, get downvoted into a smoking hole in the ground (e.g. by webdevs who assume everyone else is), yadda yadda... I'm pretty convinced by now that it will never change.


I wonder if anyone is keeping a list of the new languages that come out every year.


Modelica is nearly 30 years old, BTW.


TIL. Thanks.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: