next up previous
Next: Modeling Environment Up: Software Structure Previous: Class Attributes

The Hybrid Aspects

In hybrid bond graphs the BGJunction component provides the interface between the continuous (bond graph) part and the discrete modeling formalism. This is achieved by switching junctions between ON and OFF states. If ON, the junction behaves as a normal junction. When OFF, a 0-junction propagates 0 effort on all its ports and a 1-junction propagates 0 flow on all its ports. Therefore, in the OFF state these elements act as sources, and, consequently, causality changes on one of the ports.

An example HYBRSIM model of a nonelastic collision between a bullet and a piece of wood is shown in Fig. 5. The bullet and piece of wood are modeled as inertias, I, with values m1 and m2, respectively. Initially, m1 is at x1 = -0.2 and m2 is at x2 = 0, and the bodies move freely with no external forces acting. In this mode, the connecting 0-junction is OFF and is shown grayed out in the hybrid bond graph. Upon collision, the junction becomes active and the two inertias become dependent upon each other, and, therefore, continue to move with equal velocity.


  
Figure 5: Non-elastic collision between two bodies.
\begin{figure}\center\mbox{\psfig{figure=nonelas.eps,width=3.3in} }
\end{figure}

To model the discrete switching logic that controls the state of a junction, a finite state machine model class is implemented. Each junction is equipped with one instance of this class. The finite state machine has two types of states, ON and OFF (see Fig. 6). Initially it has one of each and the ON state is the initial state. States of the ON and OFF type can be added or deleted and any of them can be specified as the initial state. The state transitions of a junction are controlled by signals from the block diagram structure that are connected to the junction component and by active bonds. These controlling signals appear as signal ports in the finite state machine of the junction, e.g., dx in Fig. 6, which corresponds to dx = x2 - x1. Any of the operations $<, \leq, =, \geq, >$ can be used for comparison of the corresponding signal variable value with a user defined value. The signal port then generates a true or false signal that can enable transitions between the ON and OFF state of the junction. In Fig. 6, c0 controls whether the transition is allowed or not.


  
Figure 6: Finite state machine of nonelastic collision.
\begin{figure}\center\mbox{\psfig{figure=non_fsm.eps,width=1.35in} }
\end{figure}

Note the `+' sign in the dx signal port of the finite state machine that specifies a nonelastic collision. This is a user-defined property that indicates that the discrete junction state change is the result from a parameter abstraction. The other abstraction type, time scale abstraction, is indicated by a `-' sign. In case of a time scale abstraction, switching conditions are based on the a priori (`-') model variable values (the final values in the last model configuration with continuous behavior), whereas switching conditions because of parameter abstraction are based on a posteriori (`+') model variable values (the initial values in the new model configuration). Details of this distinction are presented elsewhere [Mosterman1997,Mosterman & Biswas1997b].


next up previous
Next: Modeling Environment Up: Software Structure Previous: Class Attributes
Pieter J. Mosterman ER
1998-11-13