A formal model for coupling computer based systems and physical

A formal model for coupling computer based systems
and physical systems
Maria Brielmann, Bernd Kleinjohann
Cadlab, Bahnhofstr.32, 33102 Paderborn, Germany
fmaria,[email protected]
Abstract
One of the main challenges of information technology is the development of heterogeneous systems consisting of digital and analogue parts. In this paper a
technique for the common modelling of the dierent
system parts and their interfaces is shown that allows
to develop all parts of the system in a consistent manner. This technique is based on extensions of predicate/transition nets. Based on this model tools for the
specication and evaluation of heterogeneous systems
are built.
1 Introduction
One of the main challenges of current information
technology is the development of heterogeneous systems. In the last years it became apparent that it is
not sucient to develop the dierent system parts separately. Special methods are required which support
the development of a heterogeneous system as a whole.
Heterogeneous systems usually consist of physical system parts showing an analogue behaviour and computer based system parts showing a digital behaviour.
These dierent components have to work together.
Both parts may be highly concurrent systems themselves. The analogue components depend on a lot of
dierent parameters which might change concurrently,
whereas the digital parts may consist of distributed,
concurrent subsystems. The modelling of the analogue
behaviour of a physical system is very complex. Therefore, such systems are typically modelled in a time
discrete manner. A recent approach is the use of discrete transformations of dierential equations as for
example the Z{transform (cf [CvL85, Can88]).
For the ecient development of such heterogeneous
systems an environment for the specication, evaluation, and synthesis of discretely modelled and digitally controlled systems is required. A special requirement for the environment is the handling of highly
concurrent, discretely modelled systems. Particular
problems of such systems emerge from conicts between the concurrent parts, especially at the interface
between the digital and the analogue system parts.
Usual simulators solve such conicts by a xed algorithm. This often leads to a dierence between simulation results and the behaviour of the system in reality. This deciency can be overcome by the use of
dynamic resolution strategies. But usually only the
system developer has sucient knowledge about the
system under development to decide for the appropri-
ate conict resolution. Hence, an interactive simulator
is necessary to involve the system developer in this decision.
In this paper a common model for coupling computer based systems and physical systems is presented.
This model serves as a basis for tools responsible for
the graphical specication and validation of such heterogeneous systems. According to the requirements
listed above predicate/transition nets [GL81, Gen86]
seem to be a promising approach. They are frequently
used for the modelling of hardware and software. The
conicts between several concurrently working system
parts can be modelled very eciently. The net theory
provides ecient methods to deal with simulation runs
by reachability analysis. Predicate/transition nets are
extensions of the more simple Petri nets [Pet62] allowing the description of the system at a high abstraction
level. This makes it possible for the system developer
to control the simulation interactively. The introduction of hierarchy leads to a further reduction of the
complexity the system developer has to handle. But
there are yet no common means for both the description of discretely modelled, analogue systems and their
interfaces and for the description of digital systems.
This paper shows how these system components can
be modelled with extended predicate/transition nets.
2 Extended Predicate/transition nets
One of the main features of the dierent parts of
a heterogeneous system, the computer based system
part and the physical system part, is their high degree of concurrency. Within the area of digital systems predicate/transition nets developed by Genrich
and Lautenbach[GL81, Gen86] have been proved to
be an ecient means for the modelling of concurrent
behaviour. They are extensions of the formerly dened Petri nets reducing the complexity of the resulting model. Thus, they are used here for the modelling
of the heterogenous systems.
Predicate/transition nets consist of places, transitions and arcs betwen them, the ow. Places may
contain tokens dening a certain state of the net
and, thus, of the modelled system. Within predicate/transition nets, in contrast to Petri nets, these
tokens can be identied. The identiers are constants
of a language based on rst order predicate logic. An
identifyable token lying in a place means that a certain
condition annotating the place holds for this element.
During the execution of the net the transitions are r-
ing by removing tokens from their input places and
inserting new tokens into the output places. The ring of the transition can be further characterized by
actions specied by formulae of the language based on
rst order predicate logic annotating the transition.
Additional formulae are used to dene conditions for
the ring of the transition. Symbolic sums of variables annotating the arcs between places and transitions specify number and kind of tokens owing over
this arc. If the same variable occurs more than once
at an input or output arc, it has to be replaced by the
same constant. Thus, the transition can re (or is enabled) if tokens in the input places exist that are valid
substitutions of the variables within the symbolic sums
and if the condition formula of the transition is true.
During the ring of the transition the corresponding
tokens are removed from the input places, the action
is executed, and the calculated tokens are put into the
output places.
Figure 1 shows an example of a predicate/transition
net. It consists of ve places and three transitions.
Transition t1 and t2 contain only action formulae
whereas transition t3 contains a condition. The tokens within the net are tupels of integers. Starting
with the initial marking shown in the gure transition
t1 can re with the substitution a = 1, b = 2, c = 17,
and d = 5. The value 10 is calculated for e, the tupel
[1; 17] is fed to place p3, and the tupel [5; 10] is fed to
place p4. Thus we get the marking of Figure 2. Next
transition t2 is enabled calculating the value for f.
p2
p1
[1,2]
[17,5]
<a,b>
<c,d>
e= b*d
t1
<a,c>
<d,e>
p3
f= a*c
<f,c>
p5
<e,d>
<f,c>
t3
<e,f>
<a,b>
<c,d>
e= b*d
t1
<a,c>
<d,e>
p3 [1,17]
p4 [5,10]
<a,c>
t2
f= a*c
<f,c>
p5
<e,d>
<f,c>
t3
<e,f>
e<c
<c,d>
Figure 2: Net of Fig. 1 after ring.
duration time. When the transition is enabled and
starts ring the corresponding tokens within the input places are reserved. Then, the transition waits
the specied time steps, removes the tokens from the
input places, performs its action, and puts the calculated tokens into its output places. The reserved
tokens cannot be accessed by any other transition during the ring of the transition. This concept of time
has already been dened for the original Petri nets by
[Sif77, Zub80, CC89, Ram80].
3 Requirements for the common
model
p4
<a,c>
t2
p2
p1
e<c
<c,d>
Figure 1: A predicate/transition net.
For the modelling of physical systems showing an
analogue behaviour the handling of discrete time is
necessary. Therefore, the transitions are assigned a
With the modelling technique described above a
common model for computer based systems and physical systems can be constructed. For this purpose,
three problems have to be addressed:
1. digital modelling for computer based systems,
2. analogue modelling for physical systems,
3. combining analogue and digital modelling, i.e.,
regarding the interface between computer based
systems and physical systems.
For digital modelling it must be possible to handle
a high degree of concurrency, for example, if the system is split up into a lot of subsystems. Furthermore,
combined modelling of data and control ow should
be possible. The analogue modelling usually is done
by discrete transformations of dierential equations.
Thus, it requires especially the handling of timing aspects. To get a common model it is not enough to
model the two parts with the same technique but it
must also be possible to combine the two models. Such
a composition of the analogue and digital model allows
the simulation and analysis of the entire model and
thus the number of errors in the specication of the
system will be reduced. For the modelling of the interface between the dierent systems the same technique
has to be used as for the modelling of the digital and
the analogue system. In the following sections it is described how the three aspects of a system are modelled
with the modelling technique described in Section 2.
4 Modelling of computer based system
part
The modelling of computer based systems with
predicate/transition nets, as a rst aspect of the modelling of the more complex heterogeneous systems, has
frequently been shown in literature [Ram77, DD89].
The advantage of nets is their ability to combine
the modelling of data and control ow in one model.
Within transitions new values can be calculated (data
ow) and conditions can be tested (control ow).
Their eciency in the modelling of concurrent behaviour is another benet of nets. Figure 1 shows
as an example for the modelling of digital behaviour
the net representation of the following loop.
a:=1;
b:=2;
c:=17;
d:=5;
repeat
e:=b*d;
b:=a*c;
a:=e;
until (a>c)
The initialization of the variables is represented by
the initial marking of the net. The two calculations
can be found within transitions t1 and t2. Transition
t3 compares the new values. If the newly calculated a
is less than c, the values are again put into places p1
and p2 which are the input places of the loop. Otherwise, the calculation of the loop is nished and further
transitions not shown in the gure can be enabled by
ring transition t4.
Similarly other constructs of programming languages can be modelled with predicate/transition
nets. This shows, that predicate transition nets are
a useful means for the modelling of computer based
systems. For the further reduction of the models
complexity the introduction of hierarchy can be used
[Rei87, HJS91, Jen91, Tac92].
of dierent mechanisms to solve such linear dierential equations exist. For our purposes especially those
techniques are valuable which allow the construction
of so called block diagrams. These block diagrams can
then be transformed into a model consisting of timed
predicate/transition nets.
In some cases the block diagram can be easily derived from the dierential equation. As an example
consider the mass{spring system of Figure 3 [Can67].
It shows a mass m hanging from a movable support
by a linear spring with its spring constant k.
support
x
k
m
y
Figure 3: A mass{spring system.
Equation 1 describes the vertical motion y of the
mass when the support is given a certain motion x.
The system has no damping. The presence of gravity
does not inuence the dynamic behaviour of the system. It only determines the static position before the
support is moved. Thus, y is 0 when x is 0.
myZ + ky = kx
(1)
(2)
, v = m1 (kx ? ky) ^ v = y_
From this equation the block diagram shown in Figure 4 can be constructed. The boxes specify certain
operations on the signal. Within this gure we have
two dierent kinds of operations: the multiplication of
the signal with a constant denoted by a box containing
the constant and the integration as the inverse operation of the derivation denoted by D?1 . Equation 2
shows that the output signal y can be calculated by
integrating a newly introduced signal v which itself is
calculated by multiplying the integral of kx ? ky with
the constant m1 . This calculation is modelled by the
block diagram of Figure 4.
x
k
kx-ky
+
-
D-1
mv
1
__
m
v
D-1
y
5 Modelling of physical system part
The modelling of a physical system is a very complex task. Its analogue behaviour can very often be
described by nonlinear dierential equations. But the
solution of these equations is very dicult and time
consuming. In order to reduce this complexity and
to get a manageable abstraction of the analogue behaviour the dierential equations are linearized. A lot
k
Figure 4: Block diagram of the mass{spring system.
But the construction of the corresponding block diagram is not always as simple as for this example.
Therefore, transformation mechanisms, for example
the Z{transform, have been developed. Here we want
to describe, how the Z{transform works and how it can
be used to build a model of these physical systems using the timed predicate/transition nets described before.
The Z{transform can be used on a specialized representation of the system to be modelled. Here the
system is described as a time{discrete system. That
means, the input and output values are considered at
discrete points in time and not continuously. This is a
typical approach in systems theory in order to simplify
calculation. For each time{continuous signal it is possible to determine a time{discrete signal. Vice versa,
in signal theory it is usual to determine a formula for
a time{continuous signal from a time{discrete signal,
if the time points are close enough. This property is
called sampling theorem [Can88].
x(t)
Discrete Time
System
h(t)
y(t)
Figure 5: A discrete system.
Figure 5 shows a time{discrete system. Its behaviour can be characterized by a transfer function
h(t). Here, t species the t{th time step. This behaviour can be described by the convolution sum (cf
Equation 3, [Can88]) if it is a linear, time invariant
system.
y(t) =
Xt h(t ? k)x(k)
(3)
k=0
The output signal y can be calculated very easily
from this equation. But usually the systems behaviour
is characterized by a dierence equation. Equation 4
shows the general form of such a dierence equation.
y(t) + a1 y(t ? 1) + : : : + am y(t ? m) =
b0x(t) + b1x(t ? 1) + : : : + bnx(t ? n) (4)
Thus, the dierence equation has to be transformed
into the representation of Equation 3 which is a rule
for the direct calculation of the output signal from the
input signal. For the necessary determination of the
coecients h(t) the Z{transform given in Equation 5
can be used, which denes an innite sum converging
outside a circle of radius R [CvL85]. In the following
the variable z is interpreted as a time{position marker.
The multiplicationof x(n) with z ?n can be interpreted
as the value of the signal x at the nth time point.
x (z) = X(z) = Z[x(t)] =
1
X
n=?1
The systems regarded here are causal systems, their
response only depends on the past. Thus, if a system is
switched on at a special point of time, lets say at t = 0,
the input is zero before this time leading to a zero
output value (this can always be reached by shifting
the output axis). This simplies the calculation of the
Z{transform. Only the one{sided Z{transform has to
be used leading to Equation 6 for the calculation of
Z[x(t ? l)] (time shift property of the one sided Z{
transform).
Z[x(t ? l)] = z ?l X(z) +
Xl x(?k)zk?l
k=1
With this equation the Z{transform of each term of
the sum of Equation 4 can be calculated getting the
Z{transform of the whole equation. On the other hand
the Z{transform of the transfer function (cf Equation
3) can be expressed by the Z{transform of the input
and output signals. Thus, we get the rational function
of Equation 7 for the calculation of Z[h(t)] = H(z).
Pni=0 biz?i
Y
(z)
(7)
H(z) = X(z) = 1 + Pm a z ?i
i=1 i
The calculation of the inverse Z{transform denes
the values of h(t). Equation 8 shows the recursion
formula for the determination of the values. Inserting
the results into Equation 3 we get a mechanism for
the calculation of the output y(t) of the system.
h(t) = bt ?
Xt a h(t ? l)
l=1
l
x
+
b0
z -1
+
+
a1
x(t-1)
b1
+
+
z -1
x(t-2)
(5)
(8)
This calculation rule can be used to construct a
block diagram for the solution of the original dierence equation of Equation 4. Figure 6 shows the block
diagram of a dierence equation with m = 2 and n = 2
and the following coecients:
h(0) = b0
(9)
h(1) = b1 ? a1 h(0) = b1 ? a1 b0
(10)
h(2) = b2 ? a1 h(1) ? a2 h(0)
= b2 ? a1 b1 ? a21b0 ? a2b0
(11)
a2
x(n)z ?n
(6)
b2
+ +
y
Figure 6: Block diagram for the Z{transform.
From this block diagram a description as a timed
predicate/transition net as introduced in Section 2 can
be constructed. The boxes of the block diagram annotated by a constant and the unlled dot are modelled
by transitions with corresponding annotations. For
the substitution of the remaining boxes which are annotated with z ?1 delay transitions with a delay of 1
are used. Thus, the value reaching the transition is
delayed by one time unit. The resulting net is shown
in Figure 7.
digital
System
p1
<x>
<x>
p2
<y>
y := y0 + y1 + y2
<y0>
<y1>
p7
<b>
<c> b=ext
t5
int
<c>
<b> c:=int
t1 c:=ext
<v>
y1 := w * b1
<w>
<w>
<w>
<x> w := x - v
<w>
<w>
p5
<w>
<z>
<z>
p3
p4
analog
System
<w>
d(t)=1 <w>
d(t)=1 <x >
<w>
<w>
u1 := w * a1
u2 := w * a2
<u1>
<u2>
<u1>
<u2>
v := u1 + u2
<v>
<v>
Figure 7: Net description of the Z{transform.
6 Interface modelling
<z>
t3
<z>
d( t )=1
3
<w>
<w>
<w>
<z>
<y2>
y2 := w * b2
<z> 0 p6
t4
<y2>
<y1>
y0 := w * b0
<z>
<z> b=int
t2 z:=v
<y0>
<b><b>
Within the previous sections the modelling of the
analogue and the digital part of the system is described. To get a model of the whole heterogeneous
system the two dierent models have to be combined.
The coupling of the models has to full several tasks
which have to be modelled with the same technique
as the system parts. The main task of the coupling
is the exchange of data between the dierent subsystems. The model of the physical system needs a valid
input value at each point of time. But if the digital
system is modelled at a high level of abstraction it can
not be guaranteed that such a value can be provided
in time during the simulation of the model. Furthermore, it might be useful for the digital model to know
the input value of the analogue model which belongs
to the current output. Thus, a special coupling module has to realize these tasks. The input part of this
coupling module is shown in Figure 8.
This part of the coupling module has the task to
provide the analogue model of the physical system
with a valid input value at each point of time. This
task can be devided into two subtasks: to feed an incoming input value to the analogue model (transitions
Cascade
Figure 8: Input part of the coupling module.
t1 and t2) and to store the input value so that it can be
used when no new incoming value exists (transitions
t3, t4, and t5). Transition t3 delays a new value for
one time unit. Thus, the value can only be used by t4
and t5 at the next time unit. Furthermore, these transitions are informed by transition t1 if a new value is
provided at this time unit. For this task transition t1
removes the token of p7 and puts the token ext back
into it. This token is used to determine whether t4
or t5 can re. Transition t4 puts the stored value into
place p2 so that it can be fed to the model of the physical system whereas transition t5 removes the stored
value.
If it is necessary for the model of the digital system
to know about the input value belonging to the calculated output value of the physical systems model an
additional part of the coupling module has to be constructed. Therefor, the input value of the analogue
model has to be delayed as many time units as the
model needs for its calculation. This can be reached
by a cascade of delay transitions each with a delay
of one time unit for each delay transition within the
timed predicate/transition net modelling the physical system. Thus, the stored value leaves the cascade
at the same time unit as the corresponding output
value is calculated by the model of the physical system. These two values can then be fed to the digital
model by the output part of the coupling module.
7 Conclusion and future work
In this paper a technique for the common modelling
of computer based systems and physical systems is described. Until now it was only possible to specify the
dierent system parts separately. This caused a lot of
problems especially at the interface between the different parts. These problems can be solved by tools,
which work on a description of the whole system. As
basis for such tools the formal model described in this
paper is used. This formal model is founded on the
theory of predicate/transition nets which are an extension of Petri nets with identifyable tokens. Furthermore, the handling of time had to be introduced
to be able to handle also the physical system parts.
Predicate/transition nets are a frequently used
technique for the modelling of computer based systems. The application of nets for the modelling of
physical systems caused some more problems that are
solved in our approach. Therefore, the abstraction
techniques currently used for the handling of analogue
behaviour were studied and dierential equations were
identied as a frequently used technique. In order to
solve these equations discrete transformations as the
Z{transform are well established mechanisms. In this
paper the Z{transform was used to construct a block
diagram for the calculation of the systems output from
its input. This block diagram was subsequently modelled by timed predicate/transition nets.
Furthermore, some mechanisms for the coupling of
the digital and analogue model were provided by a
so called coupling module, which was modelled with
the same technique as the dierent system parts. The
composition of these three model parts yields a homogeneous model of the whole system. Based on this
model the development of tools for the specication,
evaluation, and simulation of the entire system is possible. The use of such tools leads to far better specications of the computer based system part because
of the early consultation of its interface to the system
parts outside the digital system. Thus, specication
errors can be avoided which would otherwise be detected very late in the design process or even worse
after production of the physical system part.
The formal model described in this paper is used
for the implementation of specication and simulation
tools integrated into the JESSI Common Framework
[Ste92]. The use of this framework allows the realization of control activites of simulation ows from
within the specication editor. Thus, arising conicts,
a typical problem during the simulation of concurrent
systems, can be solved interactively by the system designer leading to far more realistic simulation results.
References
[Can67] Robert H. Cannon. Dynamics of Physical Systems. McGraw{Hill, 1967.
[Can88] James V. Candy. Signal processing: the modern
approach. McGraw{Hill series in electrical engineering, 1988.
[CC89] J. Carlier and P. Chretienne. Timed petri net
schedules. In G. Rozenberg, editor, Advances in
Petri Nets, pages 62{84. Springer{Verlag, 1989.
[CvL85] James A. Cadzow and Hugh F. van Landighan.
Signals, Systems, and Transforms. Prentice{
Hall, 1985.
[DD89] Werner Damm and Gert Dohmen. AADL: A
net{based specication method for computer ar-
[Gen86]
[GL81]
[HJS91]
[Jen91]
[Pet62]
[Ram77]
[Ram80]
[Rei87]
[Sif77]
[Ste92]
[Tac92]
[Zub80]
chitecture design. In J. de Bakker, editor, Languages for Parallel Architectures : Design, Semantics, and Information Models, chapter 2. Wiley & Sons, 1989.
Hartmann J. Genrich. Predicate/transition nets.
In G. Rozenberg, editor, Advances in Petri Nets,
pages 207{247. Springer{Verlag, 1986.
Hartmann J. Genrich and K. Lautenbach. System modelling with high{level petri nets. Theoretical Computer Science, 13:109{136, 1981.
Peter Huber, Kurt Jensen, and Robert M.
Shapiro. Hierarchies in Coloured Petri Nets,
chapter 7, pages 215{243. Springer Verlag, 1991.
Kurt Jensen. Coloured Petri Nets: A High Level
Language for System Design and Analysis. In
G. Rozenberg, editor, Advances in Petri Nets
1990, volume 483 of Lecture Notes in Computer
Science. Springer-Verlag, 1991.
C.A. Petri. Kommunikation mit Automaten.
Schriften des IIM 2, Institut fur Instrumentelle
Mathematik, Bonn, 1962. English translation:
Technical Report RADC-TR-65-377, Griss Air
Force Base, New York, Vol. 1, Suppl. 1, 1966.
F.J. Rammig. Petri net based description, analysis and simulation of concurrent processes. ACM
SIGDA Newsletters, 7(2), 1977.
C.V. Ramamoorthy. Performance evaluation
of asynchronous concurrent systems using petri
nets. IEEE Transactions on Software Engineering, 6(5):440{449, September 1980.
W. Reisig. Petri Nets in Software Engeneering.
In W. Brauer, W. Reisig, and G. Rozenberg, editors, Advances in Petri Nets 1986, Petri Nets:
Application and Relationships to Other Models
of Concurrency, volume 255 of Lecture Notes in
Computer Science. Springer-Verlag, 1987. Part
II.
J. Sifakis. Use of petri nets for performance evaluation. In H. Beilner and E. Gelenbe, editors,
Measuring, Modelling, and Evaluating Computer
Systems, pages 75{93. North{Holland, 1977.
B. Steinmuller. The JESSI{COMMON{FRAME
Project - A Project Overview. In M. Newman
and T. Rhyne, editors, Proceedings of the 3rd International Workshop on Electronic Design Automation Frameworks, 1992.
J. Tacken.
Steuerung und U berwachung von Entwurfssystemen mit Hilfe von Pradikat/Transitions{Netzen.
Diplomarbeit, Universitat Paderborn, 1992.
W.M. Zuberek. Timed petri nets and preliminary performance evaluation. In 7th Annual
Symposium on Computer Architecture, pages 88{
96, 1980.