Page 60 - Mechatronic Systems Modelling and Simulation with HDLs
P. 60
3.3 MODEL TRANSFORMATION 49
in the transitions t1 and t2. Transition t3 compares the corresponding values. If the
newly calculated a is less than c, then the values are once again entered into places
p1 and p2, which represent the input places of the loop. Otherwise the calculation
of the loop is broken off and further transitions that are not shown can fire. The
diagram on the right-hand side of Figure 3.4 shows a state in which the transition
t1 has already fired for the first time. Accordingly, the new values of a and c
have been entered at place p3 and the new values of d and e have been entered
at place p4. Other constructs of a programming language can be depicted in the
same manner.
Modelling of continuous relationships
Continuous relationships are classically modelled using differential equations that
can be either linear or nonlinear. Let us now model such equations on the basis of
Pr/T nets using the event-oriented modelling introduced in the previous section. A
solution for linear differential equations on the basis of the Z transformation was
proposed by Brielmann and Kleinjohann [46]. In what follows we will, however,
predominantly consider nonlinear systems. This property can have two causes:
firstly, nonlinearity can arise as a result of discontinuities; secondly, it may be
caused by nonlinear functions in the system equations [47]. The first case is very
simple to solve. Here only the current equation has to be activated, which can be
performed by simply distinguishing between cases. The example from Figure 3.4
illustrates this state of affairs. The termination condition at the end of the loop
corresponds with such a case differentiation. More difficult is the realisation of
the other variant. In [47] it is proposed to put the equations together step-by-step
from linear components, meaning that here too a swapping of linear components
would be necessary. Furthermore, the differential equations have to be numerically
integrated, which is achieved using the Euler principle:
x(t + h) − x(t)
˙ x(t) ≈ (3.10)
h
where h is the time step of the integration. Now if the differential equation of
interest is
˙ x(t) = f(x, t) (3.11)
the integration formula is found to be
x(t + h) ≈ h · ˙x(t) + x(t) = h · f(x, t) + x(t) (3.12)
which, along with an additional function g(x,u,t) to determine the outputs, can be
directly represented on a Pr/T net, see Figure 3.5.