MultiBondLib.Switches

Bond graphic switches of the Modelica multibond library

Information


This package contains a collection of switching elements for the MultiBondLib. 

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:

  1. Cellier, F.E., M. Otter, and H. Elmqvist (1995), "Bond Graph Modeling of Variable Structure Systems," Proc. ICBGM'95, 2nd SCS Intl. Conf. on Bond Graph Modeling and Simulation, Las Vegas, Nevada, pp. 49-55.
  2. Krebs, M. (1997), Modeling of Conditional Index Changes, MS Thesis, Dept. of Electr. & Comp. Engr., University of Arizona, Tucson, AZ.

Package Content

NameDescription
MultiBondLib.Switches.Sw Sw ideal bondgraphic switch
MultiBondLib.Switches.Sw2 Sw2 leaking bondgraphic switch
MultiBondLib.Switches.D D ideal bondgraphic diode
MultiBondLib.Switches.D2 D2 leaking bondgraphic diode


MultiBondLib.Switches.Sw MultiBondLib.Switches.Sw

ideal bondgraphic switch

MultiBondLib.Switches.Sw

Information


The generic switch element is a passive one-port element.  It inherits the effort and flow variables from the passive OnePort.  The switch has an additional modulating boolean input signal modeling the switch position.  If the modulating input signal has a value of true, the switch is considered open. 

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.


Parameters

TypeNameDefaultDescription
IntegernNCardinality of Bond connection

Connectors

TypeNameDescription
MultiBondConMultiBondCon1 
input BooleanInputBooleanInPort1 

Modelica definition

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;

MultiBondLib.Switches.Sw2 MultiBondLib.Switches.Sw2

leaking bondgraphic switch

MultiBondLib.Switches.Sw2

Information


The leaking switch element is a passive one-port element with modulation.  It inherits the effort and flow variables from the passive OnePort.  If the modulating signal has a value of true, the switch is considered open. 

All elements of the effort and flow vector are switched synchronously.

The causality of the leaking switch element is free.


Parameters

TypeNameDefaultDescription
IntegernNCardinality of Bond connection
RealRon[:]{1.E-5}Closed switch resistance
RealGoff[:]{1.E-5}Opened switch conductance

Connectors

TypeNameDescription
MultiBondConMultiBondCon1 
input BooleanInputBooleanInPort1 

Modelica definition

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;

MultiBondLib.Switches.D MultiBondLib.Switches.D

ideal bondgraphic diode

MultiBondLib.Switches.D

Information


The ideal diode element is a passive OnePort element.  It inherits the effort and flow variables from the passive OnePort.  The ideal diode is a switch element with internal modulation.  If the modulating signal has a value of true, the diode is considered blocking. 

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.


Parameters

TypeNameDefaultDescription
IntegernNCardinality of Bond connection
Reald[n]ones(n)direction of effort

Connectors

TypeNameDescription
MultiBondConMultiBondCon1 

Modelica definition

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;

MultiBondLib.Switches.D2 MultiBondLib.Switches.D2

leaking bondgraphic diode

MultiBondLib.Switches.D2

Information


The ideal diode element is a passive OnePort element.  It inherits the effort and flow variables from the passive OnePort.  The ideal diode is a switch element with internal modulation.  If the modulating signal has a value of true, the diode is considered blocking. 

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.


Parameters

TypeNameDefaultDescription
IntegernNCardinality of Bond connection
Reald[n]ones(n)direction of effort
RealRon1.E-5Closed switch resistance
RealGoff1.E-5Opened switch conductance
Reale00Avalanche breakdown effort

Connectors

TypeNameDescription
MultiBondConMultiBondCon1 

Modelica definition

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;

HTML-documentation generated by Dymola Thu Aug 31 09:47:34 2006.