Skip to content

Connecting declared variables in expandable connectors #2172

@modelica-trac-importer

Description

@modelica-trac-importer

Reported by eshmoylova on 28 Mar 2017 18:11 UTC
Resolution of ticket #428 changed the text of specification for elaborating expandable connectors in 9.1.3 to:
"One connector in the connect equation must reference a declared component, and if the other connector is an undeclared element in a declared expandable connector it is handled as follows (elements that are only potentially present are not seen as declared)"

Does it mean the following example is illegal?

expandable connector A
end A;

expandable connector B
  input Real x;
end B;

connector RealInput = input Real;

model M
  A a;
  B b;
  RealInput ri;
...
equation
...
  connect(a.x,b.x);
end M

According to the new text, the connect equation should not be allowed because a.x is not seen as declared because it is only potentially existing. What would happen if there was instead a pair of connect equations?

  connect(a.x,ri);
  connect(a.x,b.x);

After the first connect equation a.x is no longer only potentially existing, and it is declared. So is it considered as declared when we process the second equation? I think it should not be because that would make the result dependent on the order of processing. But the specification does not say so explicitly.

Is the paragraph about connecting two expandable connectors correct?
"When two expandable connectors are connected, each is augmented with the variables that are only declared in the other expandable connector (the new variables are neither input nor output). This is repeated until all connected expandable connector instances have matching variables [i.e. each of the connector instances is expanded to be the union of all connector variables.]"

It talks only about variables that are declared. What about the variables that are added to a connector as a result of connection?


Migrated-From: https://trac.modelica.org/Modelica/ticket/2172

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions