Multibonds can be joined or split by the usage of the Composition element.
The order of the single bonds within a multibond can be changed by the element PermutMultiBond.
The models FromMultiBond and ToMultiBond are an interface to the classic BondLib.
| Name | Description |
|---|---|
| bondgraphic element to compose / decompose multibonds | |
| permuts the order of a multibond | |
| converter bond: converts a 1-multibond to a simple bond | |
| converter bond: converts a simple bond to a 1-multibond |
MultiBondLib.Compositions.Composition
The two multibonds at connector A and B with cardinalities nA and nB are merged to a multibond of cardinality nA+nB, so that the first vector nA elements are equivalent to the multibond at connector A and the other ones are equal to the multibond at connector B.
Because this is an acausal element, it can also be used to decompose multibonds.
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nA | N | Cardinality of upper Bond connection |
| Integer | nB | N | Cardinality of lower Bond connection |
| Type | Name | Description |
|---|---|---|
| MultiBondCon | MultiBondCon1 | |
| MultiBondCon | MultiBondCon2 | |
| MultiBondCon | MultiBondCon3 |
model Composition "bondgraphic element to compose / decompose multibonds" final parameter Integer N = MBG_defaults.n; parameter Integer nA=N "Cardinality of upper Bond connection"; parameter Integer nB=N "Cardinality of lower Bond connection"; Interfaces.MultiBondCon MultiBondCon1(n=nA); Interfaces.MultiBondCon MultiBondCon2(n=nB); Interfaces.MultiBondCon MultiBondCon3(n=nA+nB); protected outer Defaults MBG_defaults; equation MultiBondCon3.e[1:nA] = MultiBondCon1.e; MultiBondCon3.f[1:nA]*MultiBondCon3.d = -MultiBondCon1.f*MultiBondCon1.d; MultiBondCon3.e[(nA+1):(nA+nB)] = MultiBondCon2.e; MultiBondCon3.f[(nA+1):(nA+nB)]*MultiBondCon3.d = -MultiBondCon2.f*MultiBondCon2.d; end Composition;
MultiBondLib.Compositions.PermutMultiBond
The permutation is fully specified by permutation vector p of size n, where n is the cardinality of the permutation bond.
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | n | N | Cardinality of Bond |
| Integer | p[n] | {1} | permutation vector (contains all Integers in 1:n) |
| Type | Name | Description |
|---|---|---|
| MultiBondCon | MultiBondCon1 | |
| MultiBondCon | MultiBondCon2 |
model PermutMultiBond "permuts the order of a multibond"
final parameter Integer N = MBG_defaults.n;
parameter Integer n = N "Cardinality of Bond";
parameter Integer p[n] = {1}
"permutation vector (contains all Integers in 1:n)";
Interfaces.MultiBondCon MultiBondCon1(n=n);
Interfaces.MultiBondCon MultiBondCon2(n=n);
protected
outer Defaults MBG_defaults;
equation
MultiBondCon2.e = MultiBondCon1.e[p];
MultiBondCon2.f = MultiBondCon1.f[p];
MultiBondCon1.d = -1;
MultiBondCon2.d = +1;
end PermutMultiBond;
MultiBondLib.Compositions.FromMultiBond
This bond is an interface to the classic bondgraphic connectors of the BondLib.
| Type | Name | Description |
|---|---|---|
| MultiBondCon | MultiBondCon1 | |
| BondCon | BondCon1 |
model FromMultiBond "converter bond: converts a 1-multibond to a simple bond" Interfaces.MultiBondCon MultiBondCon1(n=1); BondLib.Interfaces.BondCon BondCon1; equation BondCon1.e = MultiBondCon1.e[1]; BondCon1.f = MultiBondCon1.f[1]; BondCon1.d = +1; MultiBondCon1.d = -1; end FromMultiBond;
MultiBondLib.Compositions.ToMultiBond
This bond is an interface to the classic bondgraphic connectors of the BondLib.
| Type | Name | Description |
|---|---|---|
| MultiBondCon | MultiBondCon1 | |
| BondCon | BondCon1 |
model ToMultiBond "converter bond: converts a simple bond to a 1-multibond" Interfaces.MultiBondCon MultiBondCon1(n=1); BondLib.Interfaces.BondCon BondCon1; equation BondCon1.e = MultiBondCon1.e[1]; BondCon1.f = MultiBondCon1.f[1]; BondCon1.d = -1; MultiBondCon1.d = +1; end ToMultiBond;