It is assumed that you have already worked through the first section of connectors.

**Rules**

The basic contract of the naming policy **‘encapsulate’** is as follows:

- Basic rule: If an equation or equation system (sub element) is added to a super equation system (super element), the sub element’s variables will get an own namespace.
- Additional rule using a connector: If a sub element is added to a super element by using a connector, only those variable names of the sub element that are translated by the connector will get the super element’s namespace.
- Result: When considering the sub element, only the variables translated by a connector have a
*top level naming*according to the super notation.

**‘Encapsulate’ case a: Two notations involved.**

In this example case one connected equation uses a different notation. Only one (generic) variable needs to be translated as the other variables do not appear in the super equation system (not even within the naming convention of the super notation).

Equation System ‘encaps a’

Notation y

Base Names:

Name | Description |
---|---|

values | |

parameter 1 | |

parameter 2 | |

parameter 3 | |

parameter 4 |

Indices:

Name | Description |
---|---|

value index-max val: Nj |

Collaboration

In this example, equation (\ref{eq:itgr:b:incl}) is taken from another project. To avoid reimplementation the existing equation (\ref{eq:itgr:b:used}) using ‘Notation x’ is employed here.

Equation one

$latex x_{i=1} + b \cdot x_{i=2} = c$

Notation x

Base Names:

Name | Description |
---|---|

values | |

parameter 1 | |

parameter 2 | |

parameter 3 | |

parameter 4 |

Indices:

Name | Description |
---|---|

value index-max val: Ni |

Connector selective one

- Subnotation: Notation x
- Supernotation: Notation y
- Value list:

Figure 1: Graph of the variable interpretation

After the parsing process the equations have the following appearance:

$latex e0.y_{j=1} + e1.b \cdot e0.y_{j=2} = e1.c$

$latex e0.\delta \cdot (e0.y_{j=2})^{2} = -e0.\alpha + e0.y_{j=1}$

Alternatively, the user can decide to view the equations without namespaces:

$latex y_{j=1} + b \cdot y_{j=2} = c$

This view, however, might be confusing as names of different variables can appear identical.

Problem description

Design variables with values:

$latex e0.\alpha = 1$

Iteration variables with guess values:

Iteration variables with result values:

**Re-use of model elements** This section is based on previous sections. Usually you should have created many of the needed model parts. We will try to use as much of the existing parts as possible.

**Creating the connector**

- In the Editor bar click on Connector tab and open ‘Connector one’ that you have created in Connection techniques I and save it as a new one named ‘Connector selective one’.
- Activate tab
.`Edit Matching` - In the table
select the row for**Matching***b*and $$\beta$$. - Press [Break]. The symbols
*b*and*$$\beta$$*should have been removed from thetable and be present in the tables`Matching`and**Sub Notation**respectively.`Super Notation` - Remove all matchings except for
*$$x_{i}\rightarrow y_{i}$$*from thetable as described above.`Matching` - In the
tab load ‘Equation one’ created in Connection techniques I. If everything went well, only the instances of $$x{i}$$ should be matched to instances of $$y_{i}$$.`Test Connector` - Save the connector.

**Creating the equation system**

- In the Equation System Editor specify ‘Notation y’ as the equation system’s notation.
- Press
in the lower right corner, which brings up the`[Add]`dialog.**Edit Connection to Element** - In the dialog press
for the**[Change]**field.**Conn. Elem.** - Select ‘Equation one’ created in Connection techniques I.
- In the
dialog use the drop down list box next to`Edit Connection to Element`and change the value to`Naming policy`.**encapsulate** - In the
section tick the field**Advanced**and press**Use connector**next to the corresponding field.**[Change]** - Select ‘Connector selective one’, which you created above in this tutorial.
- Press
.**[Submit]** - Add ‘Equation two’ created in Connection techniques I using the naming policy ‘integrated’ and without loading any connector.
- Save the equation system.

**Evaluating the equation system**

- Activate the Evaluation Editor and load the equation system ‘encaps\_a’ you just created.
- In the
tab specify**Indexing**as a maximum value for the index**2***i*. - Now have a look at the equation system in the
tab. You should see the equation system in the view of (\ref{eq:itgr:b:incl}”) and (\ref{eq:itgr:b:eq:two:new}”) above.`Instance` - Press
, which toggles the views between the name space free above and the one view of (\ref{eq:itgr:b:incl}’) and (\ref{eq:itgr:b:eq:two:new}’).**[Name Spaces]** - On the tab
you find the specification of the two name spaces involved.**Info** - Solve the modeling task as usual entering the rest of the information given under Problem description above.

##### ‘Encapsulate’ case b: Three notations involved.

In this example the connected equations have different notations. They have only one common (generic) variable . Using the naming policy encapsulate makes it possible to specify only the translation of this common variable and to assure at the same time that all other variables are not matched by accident.

Equation System ‘encaps b’

$latex z_{k=1} + B \cdot z_{k=2} = C$

Notation z

Base Names:

Name | Description |
---|---|

values | |

parameter 1 | |

parameter 2 | |

parameter 3 | |

parameter 4 |

Indices:

Name | Description |
---|---|

value index-max val: Nk |

Collaboration

In this example, equations (\ref{eq:itgr:c:incl:one}) and (\ref{eq:itgr:c:incl:two}) are taken from other projects. To avoid reimplementation, the existing equations (\ref{eq:itgr:b:used}) and (\ref{eq:itgr:b:eq:two:new}) are used here. The only translation is made to from and respectively.

Equation one

$latex x_{i=1} + b \cdot x_{i=2} = c$

Notation x

Base Names:

Name | Description |
---|---|

values | |

parameter 1 | |

parameter 2 | |

parameter 3 | |

parameter 4 |

Indices:

Name | Description |
---|---|

value index |

Connector x-z

- Subnotation: Notation x
- Supernotation: Notation z
- Value list:

Equation two

Notation y

Base Names:

Name | Description |
---|---|

values | |

parameter 1 | |

parameter 2 | |

parameter 3 | |

parameter 4 |

Indices:

Name | Description |
---|---|

value index-max val: Nj |

Connector y-z

- Subnotation: Notation y
- Supernotation: Notation z
- Value list:

Figure 2: Graph of the variable interpretation

View of the equation system with name spaces:

$latex e1.z_{k=1} + e2.b \cdot e1.z_{k=2} = e2.c$

View of the the equation system without names spaces:

Problem description

Design Variables with values:

$latex e0.\alpha = 1.0$

Iteration Variables with guess values:

$latex e1.z_{k=1} = 1$

Iteration Variables with result values:

$latex e1.z_{k=1} = 2.27$

##### Creating the connectors and the equation system

- Create the connectors ‘Connector x-z’ and ‘Connector y-z’.
- Create the equation system ‘encaps b’ using ‘Notation z’.
- Add ‘Equation one’ to ‘encaps b’ specifying the naming policy as ‘encapsulate’ and choosing ‘Connector x-z’.
- Add ‘Equation two’ to ‘encaps b’ as ‘encapsulate’ and choose ‘Connector y-z’.

##### Evaluating the equation system

- Load equation system ‘encaps b’ into the Evaluation Editor and specify the maximum value of the index to
.**2** - Look again at the instance of the equation system in the
tab and toggle between the different views using the**Instance**button.`[Name Spaces]` - In the
tab the three name spaces are specified.`Info` - In the Variable Specification tab select the variable and use the buttons
, [] and [] to navigate between the different namings of this variable.**[T]** - Enter the missing pieces of the problem description and solve the problem.