Modelica vs Simscape

Falsterbo picture Falsterbo · Sep 11, 2017 · Viewed 7.7k times · Source

This question has two main aspects actually. Right at the beginning, I have to admit that I am totally new to physical modeling and would be glad to be corrected as well, not only be answered. For those who find it too long to read, I can give a brief summary:

1) Simulink vs Modelica

2) Simscape vs Modelica

1) The first one is the comparison of modeling approaches. Conventionally, there are different names for the two main approaches I want to compare:

# Signal flow approach / block-based modeling / causal modeling ...: The typical models in Simulink. There are boxes with inputs and outputs and transfer functions in between.

vs

# Network Approach / component-based modeling / acausal(noncausal) modeling... : There are physical ports instead of signal I/O and the flow entities(current, heat etc) can flow in both directions.

In this comparison, I have read some opinions in the web and searched for some papers. It comes down to the comparison of Modelica based development environments and Simulink (for example), as far as I get. Disadvantages and advantages of these two are more clear to me than the other point I want to ask.

2) After reading much on the first comparison, it was more preferable for me to go with component-based modeling. However, Modelica isn't the only option here. There is also Simscape, using which you can combine physical ports (as in Modelica) with block-based modeling of Simulink.

I would like to know the advantages and disadvantages of this Simscape vs Modelica comparison. To avoid misunderstanding, I need to underline that Modelica is a language. Therefore, it would be more meaningful to compare any Modelica environment with Simscape, let's say, OpenModelica vs Simscape

Answer

Michael Tiller picture Michael Tiller · Sep 12, 2017

Well, since nobody seems to be answering this, I will take a shot at it.

It seems that you seem to have figured out the question to your first question. The basic answer is that causal modeling involves lots of upfront work by you that could otherwise be done by the compiler. Even worse, if you ever want to support different causalities, you need to either re-implement your component and/or have multiple versions supporting different causalities. Modeling complex physics that mix continuous and discrete behavior is tricky enough without having to do all this tedious, time-consuming and error prone work sorting out the causalities.

So that brings me to your second question of SimScape vs. Modelica. SimScape seems to be a recognition of the issues I mentioned in the previous paragraph. Honestly, it will be difficult for a third party to provide you with an analysis of SimScape vs. Modelica since so much depends on factors that may be different for you vs. other people.

Furthermore, I really haven't used SimScape much so I cannot really comment on so much there. But I can certainly tell you Modelica's strength. Modelica was developed by a design group composed in approximately equal parts of developers, users and academics. I think this is actually its great hidden strength of Modelica. As such, new features had to have support from all groups to be successful. Too much influence by one group is, in my opinion, detrimental.

The openness of Modelica means you can get Modelica support from lots of different tools (free and commercial). This, in turn, means that there are lots of different libraries out there. This openness is not just about the specification itself but about the eco-system (open tools, open libraries, etc).

Finally, the proof is really seeing all the various types of problems people are solving. Modelica is used in a wide range of engineering domains to solve really diverse problems. This is, in my opinion, a testament to the soundness of the design of the language and libraries. That success is not the result of lots of marketing dollars but rather a consequence of the fact that the technology is fundamentally powerful and that people around the world have recognized this and used it to solve real world problems...over and over again.

I would encourage you to look through the papers from past Modelica conferences. Every paper is available, for free, online at modelica.org.

Shameless plug: if you want to learn Modelica via examples from a wide range of engineering disciplines, you might want to check out the free, interactive and online book Modelica by Example.