Cardinality Dependent Connection Equations

1 CardinalityResistor

In certain cases there is a need to let the behavior of a model be dependent on the number of connections to certain connectors of the model. Below is an example class containing a conditional if-clause equation with a condition that is a parameter expression (the built-in function cardinality has parameter variability), i.e.the condition does not change during simulation. The function cardinality(c) with formal parameter c returns the total number of (internal and external) occurrences of the connector c in connect statements in the total model.

2 Simulation of CardinalityResistor

Simulate it!