Open Mathadon opened 6 years ago
The cardinality()
operator is deprecated, but actually I find it very useful.. For more information see http://modelica.readthedocs.io/en/latest/operators.html#operator-cardinality
Some things might be discussed in the form of Modelica Change Proposals (MCP): https://trac.modelica.org/Modelica/query?component=--MCP-- https://www.modelica.org/devs https://github.com/modelica/ModelicaSpecification
Occasionally I bump into limitations of the Modelica specification. Not all of them equally important, but I propose to collect these in this topic such that they are publicly available and such that we can identify common problems. At some point it may make sense to flag these to the broader community.
Bus parameters
Important:
Expandable
connectors allow the definition of parameters, but they need to be defined in each connector instantiation. I.e. it is not possible to use expandable connectors to communicate parameters between multiple blocks. It also does not seem possible to create an expandable connector with theparameter
modifier, as bellow, to circumvent this:A workaround is to send continuous signals through the bus and then use a parameter declaration on the other end of the bus with
fixed=false
and an initial equation. However, this way the translator cannot preprocess the parameter values, which leads to less efficient code and the resulting parameters cannot be used in structural parameters, etc.Propagate replaceables.
When instantiating a model that contains a replaceable component, it is not possible to 'propagate' this replaceable as you would do with a parameter.
Impossible to define implicit
functions
.Conditional replaceables.
It is not possible to redeclare a replaceable component by one of two models based on some boolean condition.
Conditional attributes.
It could be useful at some point to be able to do something like
if condition then inner else outer _some_component_definition_
.