Switches change their computational causality as a function of the switch position. For this reason, switches must always be attached to acausal bonds.
The application of multiibondgraphic switches is barely meaningful. One usually wishes to switch certain variables, not vectors of them. Try to use the single bond variants if possible.
References:
Name | Description |
---|---|
Sw | ideal bondgraphic switch |
Sw2 | leaking bondgraphic switch |
D | ideal bondgraphic diode |
D2 | leaking bondgraphic diode |
All elements of the effort and flow vector are switched synchronously.
The causality of the switch element must be free, i.e., the switch element must be placed inside an algebraic loop.
Name | Default | Description |
---|---|---|
n | N | Cardinality of Bond connection |
model Sw "ideal bondgraphic switch" extends Interfaces.PassiveOnePort; Modelica.Blocks.Interfaces.BooleanInput BooleanInPort1; Boolean open "Switch position"; equation open =BooleanInPort1; zeros(n) = if open then f else e; end Sw;
All elements of the effort and flow vector are switched synchronously.
The causality of the leaking switch element is free.
Name | Default | Description |
---|---|---|
n | N | Cardinality of Bond connection |
Ron[:] | {1.E-5} | Closed switch resistance |
Goff[:] | {1.E-5} | Opened switch conductance |
model Sw2 "leaking bondgraphic switch" extends Interfaces.PassiveOnePort; parameter Real[:] Ron(final min=0) = {1.E-5} "Closed switch resistance"; parameter Real[:] Goff(final min=0) = {1.E-5} "Opened switch conductance"; Modelica.Blocks.Interfaces.BooleanInput BooleanInPort1; protected parameter Real RonVec[n] = if size(Ron,1) == n then Ron else ones(n)*Ron[1]; parameter Real GoffVec[n] = if size(Goff,1) == n then Goff else ones(n)*Goff[1]; Real s[n] "Curve parameter"; Boolean open "Switch position"; equation assert((size(Ron,1) == n) or (size(Ron,1) == 1),"Ron must be of length 1 or n"); assert((size(Goff,1) == n) or (size(Goff,1) == 1),"Goff must be of length 1 or n"); open =BooleanInPort1; for i in 1:n loop f[i] = s[i]*(if open then GoffVec[i] else 1); e[i] = s[i]*(if open then 1 else RonVec[i]); end for; end Sw2;
In a the multibondgraphic extension of the classic diode, the flow vector is restricted to one side of a n-1 dimensional hyperplane. This hyperplane is specified by its normal vector d. The parameter vector d specifies the direction of the potentially arising effort.
The causality of the ideal diode element must be free, i.e., the ideal diode element must be placed inside an algebraic loop. If the causality of the diode is not free, use the leaking diode model, D2, instead.
Name | Default | Description |
---|---|---|
n | N | Cardinality of Bond connection |
d[n] | ones(n) | direction of effort |
model D "ideal bondgraphic diode" extends Interfaces.PassiveOnePort; parameter Real d[n] = ones(n) "direction of effort"; final parameter Real eD[n] = d/sqrt(d*d); protected Real s "Curve parameter"; Boolean blocking "Switch position"; Real f_d; Real e_d; equation f_d = f*eD; e = e_d*eD; blocking = s > 0; f_d = if blocking then 0 else s; e_d = if blocking then s else 0; end D;
In a the multibondgraphic extension of the classic diode, the flow vector is restricted to one side of a n-1 dimensional hyperplane. This hyperplane is specified by its normal vector d. The parameter vector d specifies the direction of the potentially arising effort.
The causality of the leaking diode element is free.
Name | Default | Description |
---|---|---|
n | N | Cardinality of Bond connection |
d[n] | ones(n) | direction of effort |
Ron | 1.E-5 | Closed switch resistance |
Goff | 1.E-5 | Opened switch conductance |
e0 | 0 | Avalanche breakdown effort |
model D2 "leaking bondgraphic diode" extends Interfaces.PassiveOnePort; parameter Real d[n] = ones(n) "direction of effort"; final parameter Real eD[n] = d/sqrt(d*d); parameter Real Ron(final min=0) = 1.E-5 "Closed switch resistance"; parameter Real Goff(final min=0) = 1.E-5 "Opened switch conductance"; parameter Real e0=0 "Avalanche breakdown effort"; protected Real s "Curve parameter"; Boolean blocking "Switch position"; Real f_d; Real e_d; equation f_d = f*eD; e = e_d*eD; blocking = s > 0; f_d = s*(if blocking then Goff else 1)+ Goff*e0; e_d = s*(if blocking then 1 else Ron)+ e0; end D2;