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 |
---|---|
Composition | bondgraphic element to compose / decompose multibonds |
PermutMultiBond | permuts the order of a multibond |
FromMultiBond | converter bond: converts a 1-multibond to a simple bond |
ToMultiBond | converter bond: converts a simple bond to a 1-multibond |
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.
Name | Default | Description |
---|---|---|
nA | N | Cardinality of upper Bond connection |
nB | N | Cardinality of lower Bond connection |
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;
The permutation is fully specified by permutation vector p of size n, where n is the cardinality of the permutation bond.
Name | Default | Description |
---|---|---|
n | N | Cardinality of Bond |
p[n] | {1} | permutation vector (contains all Integers in 1:n) |
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;
This bond is an interface to the classic bondgraphic connectors of the BondLib.
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;
This bond is an interface to the classic bondgraphic connectors of the BondLib.
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;