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 *m*_{1} and *m*_{2}, respectively.
Initially, *m*_{1} is at
*x*_{1} = -0.2 and *m*_{2} is at *x*_{2} = 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.

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* = *x*_{2} - *x*_{1}.
Any of the operations
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, *c*_{0} controls whether the transition is
allowed or not.

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].

1998-11-13