Ports and Streams II – Using streams to connect ports of units

 
Stefan Kuntsche, Sanam Sabeti Adibpour

In this section the units created in the tutorial Ports and Streams I – Defining units by adding ports are assembled by connecting their ports via streams.

A Stream in MOSAICmodeling consists of an Interface and of a specification of the two ports that are connected.

Preparation task

  • Create the Notation ‘nota stream’ and the Interface ‘itfc stream’ specified below.

Interface ‘itfc stream’

  • Notation: ‘nota stream’
  • Variables:

L, T

Notation ‘nota stream’

  • Base Names
Name Description
L var L
T var T

Equation system with streams The equation system below contains two equation systems that are connected by streams.

Equation system ‘first general process’

  • Connected equation systems

-‘unit small latin’
-‘unit cap latin’

  • Streams

-Stream 0:

♦Interface: ‘itfc stream’

♦Port One:

◊Unit port: ‘unit small latin’.’port blue’
◊Connector: ‘conn i small greek to i stream’

♦Port Two:

◊Unit port: ‘unit cap latin’.’port purple’
◊Connector: ‘conn i cap greek to i stream’

 -Stream 1:

♦Interface: ‘itfc stream’

♦Port One:

◊Unit port: ‘unit small latin’.’port green’

◊Connector: ‘conn i small_greek to i stream’

♦Port Two:

◊Unit port: ‘unit cap latin’.’port yellow’
◊Connector: ‘conn i cap greek to i stream’

 

Connector ‘conn i small greek to i stream’

  • Subnotation: ‘nota small greek’
  • Supernotation: ‘nota stream’
  • Value list:

\lambda -> L
\tau -> T

Connector ‘conn i cap greek to i stream’

  • Subnotation: ‘nota cap greek’
  • Supernotation:’nota stream’
  • Value list:

\Lambda -> L
\Omega -> T

Tasks

  • Create the connectors ‘conn i small greek to i stream’ and ‘conn i cap greek to i stream’.
  • Select the Equation System Editor , activate tab Connected Elements, press [Add] and load ‘unit small latin’ (do not yet close the dialog).
  • Make sure that the Naming policy is set to streams and close the dialog.
  • Add the equation system ‘unit cap latin’ in the same way.
  • Activate the tab Internal Streams
  • Press [Add], which opens the Edit Stream Connection dialog.
  • In the Relation section load Interface ‘itfc stream’.
  • In the Port One section press [Change] next to the Port text field. This opens the Choose Port dialog.
  • In the upper table of the Choose Port dialog you see all equation systems that are present in this equation system. Click the row for ‘unit small latin’. You see the ports of ‘unit small latin’ in the lower table. Select ‘port blue’ (click into the row). Press [OK] to close the Choose Port dialog.
  • Still in the Port One section load the Connector ‘conn i small greek to i stream’.
  • In the Port Two section press [Change] next to the Port text field and select ‘unit cap latin’ and port ‘port purple’.
  • Load Connector ‘conn i cap greek to i stream’ for Port Two.
  • Press [OK] to close the Edit Stream Connection dialog.
  • Add the second stream as specified in the description above.
  • Save the equation system as ‘first general process’.