Are there Modelica programmers? Or is it a tool engineers use? Like could you become a Modelica developer and do that as a living?
Not fully up to date, but a starting point: https://modelica.org/jobs
31–40 of 47 posts
Are there Modelica programmers? Or is it a tool engineers use? Like could you become a Modelica developer and do that as a living?
Not fully up to date, but a starting point: https://modelica.org/jobs
There's a project to create a language similar to Modelica as a DSL in Julia, Modia[1]. I'm not currently a user of either language, but saw a presentation at JuliaCon about it[2] and thought it looked interesting. [1] https://github.com/ModiaSim/Modia.jl [2] https://youtu.be/hVg1eL1Qkws
That looks really promising. But development seems to have completely stopped earlier this year. Anybody knows what's going on there?
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's Differential equations.
OpenModelica is a wonderful piece of software, I just wish it had a better UI, UX and error messages. Wolfram's system modeler offers an excellent experience but it is very expensive.
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.
As a final note, I truly wished that Modelica was taught more in engineering and physics degrees.
Are there Modelica programmers? Or is it a tool engineers use? Like could you become a Modelica developer and do that as a living?
I work as a full time Modelica programmer :-) And I do have colleagues. Not fully up to date, but a starting point: https://modelica.org/jobs
I have been used modelica and modelica-like languages for the past few months, and I have completely been blown away by the experience. 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's Differential equations. OpenModelica is a wonderful piece of software, I just wish it had a be…
Been working in Modelica for a couple of years. Modelica compilers generate C code since they'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.
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 t…
Another thing that we discovered when testing out using Modelica for some stuff is that it is very easy to design yourself a model that can't be solved. The whole premise of the "object orientation" is that you can just compose models without knowing how to solve the entire system. Once the solver fails, though, all that abstraction comes crashing down and you're left with trying to look at a 500-variable Jacobian an…
For instance, even finding a set of consistent initial condition requires the solution of a typically nonconvex nonlinear system of equations, which in turn requires a good initial guess (where domain knowledge is needed -- arbitrary guesses may work but often don't). This is a "solved" problem in a sense that algorithms exist that do this, but anyone who's done numerical work know how hard it is to reliably find the solution of an arbitrary nonlinear system of equations -- there's a significant element of luck involved, even with heuristics.
Formulating good models is an art. Good modelers know to avoid issues with numerical scaling (by changing units of measure, doing log or linear scaling, or simply avoiding computation of certain intermediate quantities) and avoidance of singularities (e.g. instead of x/y = z, a better and equivalent formulation is x = y * z because if y is ever 0 during iteration, one avoids div-by-0 errors). It gets even tougher with hybrid models that have discontinuities (switching behavior), because the integrator needs to do a reinitialization every time a switch is encountered. Most solvers do this well (the integrated system up to that point is usually a good initial guess for the NLE system), but not 100% of the time.
When I was doing this stuff full-time, I've often thought of writing a linter that detected poor formulations and suggested improved ones -- sort of like a spell-checker for mathematical models. I never pursued it.
These days I guess this can be done using a language server that can parse equations and generate ASTs. I'm no longer interested in these problems, but I do wonder if anyone has tried to do something like this.
[1] DAEs take the following (implicit) form:
f(ẋ, x, z, θ) = 0, x(0) = x₀
g(x, z, θ) = 0
where x = differential vars, z = algebraic vars, θ = constants. The form is very general and can be used to model any number of continuous dynamic systems. Hybrid systems can be modeled by introducing discrete variables into the mix.
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's relative obscurity, but there's an opportunity for it to become pervasive in engineering, both in the academy and industry.
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 t…
Another thing that we discovered when testing out using Modelica for some stuff is that it is very easy to design yourself a model that can't be solved. The whole premise of the "object orientation" is that you can just compose models without knowing how to solve the entire system. Once the solver fails, though, all that abstraction comes crashing down and you're left with trying to look at a 500-variable Jacobian an…
The "object-oriented" part of Modelica is intended to make creating large scale models manageable. You make it sound like the object-oriented features are some kind of facade behind which all kinds of peril lies. But the peril is always there. And my experience of building such models both using a modeling language vs. creating them by hand is that you can't escape the limitations of contemporary numerical/symbolic methods or singular systems. You are, of course, free to hand code models or manually transform them into state space equations if you think there is some benefit to that in the same way. Perhaps it will make it easier to diagnose singular systems. But speaking entirely for me, I find being able to create acausal models using a modeling language gives me a productivity boost that I'd be unwilling to give up.
Earlier quoted context omitted.
Another thing that we discovered when testing out using Modelica for some stuff is that it is very easy to design yourself a model that can't be solved. The whole premise of the "object orientation" is that you can just compose models without knowing how to solve the entire system. Once the solver fails, though, all that abstraction comes crashing down and you're left with trying to look at a 500-variable Jacobian an…
That's absolutely true. A severe limitation of Modelica's type system is that you cannot constrain your modeling domain to something that is always solvable, or at least analyzable. You cannot, for instance, limit yourself to linear equations. In my opinion it would be the library author's responsibility to constrain the usage of their models in a way that prevents typical modeling errors (as in your example, the swi…