the state variables in a symbolic way. We use a sim-
ple Euler integration since we do not compute exact
numerical values. We model each continuous state
variable by six values: the current (x) and previous
(x
-1
) values of the variable, the current ( ˙x) and previ-
ous ( ˙x
-1
) values of its first derivative, and its current
second derivative ( ¨x). In this new model of execution,
we add the previous second derivative ( ¨x
-1
), which is
needed to integrate the first derivative. The symbolic
integration with the Euler method, assuming a unitary
integration step gives x = x
-1
+ ˙x
-1
, and ˙x = ˙x
-1
+ ¨x
-1
.
With these rules, the qualitative value of a state
variable is controlled by a state machine as illustrated
in Figure 5. A similar automaton controls the change
of the first derivative with respect to its previous value
( ˙x
-1
) and the previous second derivative ( ¨x
-1
). Con-
trary to our previous work, these state machines are
deterministic. For instance, in the > 0 state of x, if ˙x
-1
< 0 and ˙x
-1
= -x
-1
, we go to the = 0 state, if ˙x
-1
> 0 or
˙x
-1
< 0 and - ˙x
-1
< x, we stay in the current state.
Implementation of Our Execution Model in Diver-
sity. This execution model with symbolic integra-
tion relies on five automata: the first one is the sys-
tem automaton in which the user models his system
and specifies the different values of the current second
derivative; the second automaton keeps track of the
qualitative value of the second derivative ( ¨x), which
is driven by the system automaton; the third automa-
ton keeps track of the qualitative value of the first
derivative ( ˙x), which is symbolically integrated from
the previous first and second derivatives; the fourth
automaton keeps track of the qualitative value of the
state variable (x), which is symbolically integrated
from the previous value and first derivative; and fi-
nally, the fifth automaton computes the qualitative
variation of the variable by observing the automata
for the qualitative value of the variable, its derivatives,
and their previous value.
The order in which these automata are executed
is important: we execute the automaton of the sys-
tem first, then the automaton for the second deriva-
tive, then the automaton for the first derivative, then
the automaton for the value of the state variable, and
finally the automaton for the qualitative behavior.
Computing Second Order Qualitative Behaviors.
In our previous work (Medimegh et al., 2016), we
showed how to compute the qualitative behavior of a
state variable by observing the qualitative state of this
variable and its derivatives. For instance, when the
second derivative is Negative and the first derivative
is Null, with a Positive previous derivative, we have
the qualitative behavior Maximum.
With that qualitative model, we identified 13 qual-
itative states of behavior: Constant when ˙x
-1
, ˙x and
¨x are null; FlexStartIncrease when ˙x
-1
= 0, ˙x = 0
and ¨x > 0, so the first derivative is not positive yet,
but the dynamics is transitioning toward an increase;
FlexStartDecrease when ˙x
-1
= 0, ˙x = 0 and ¨x < 0,
which is similar to the previous case when transition-
ing toward a decrease; StartIncrease when ˙x
-1
= 0
and ˙x > 0, the first derivative has just become posi-
tive (notice that there is no condition on the second
derivative, which may have come back to 0); Start-
Decrease when ˙x
-1
= 0 and ˙x < 0; Increase when
˙x
-
1
> 0 and ˙x > 0, the first derivative being positive;
Decrease when ˙x
-1
< 0 and ˙x < 0, the first derivative
being negative; Maximum when ˙x
-1
> 0, ˙x = 0 and
¨x < 0, the three conditions are necessary to distin-
guish this case from other qualitative states such as
inflection points; Minimum when ˙x
-1
< 0, ˙x = 0 and
¨x > 0, same remark as for the Maximum; FlexIn-
crease when ˙x
-1
> 0, ˙x = 0 and ¨x > 0, an inflection
point during an increase; FlexDecrease when ˙x
-1
< 0,
˙x = 0 and ¨x < 0, an inflection point during a decrease;
StopIncrease when ˙x
-1
> 0, ˙x = 0 and ¨x = 0, the state
variable reaches a plateau at the end of an increase;
StopDecrease when ˙x
-1
< 0, ˙x = 0 and ¨x = 0, the state
variable reaches a plateau at the end of a decrease.
By additionally taking into account x
-1
and x, it is
possible to distinguish sub-cases in these qualitative
states, for instance “reaching a null maximum” when
reaching a maximum with x
-1
< 0 and x = 0.
There are impossible cases. Two are due to the
continuity of the variable: the conjunction of x
-1
< 0
and x > 0, and the conjunction of x
-1
> 0 and x < 0 are
impossible. Two others are due to the continuity of
the first derivative (no angular points). Ten others are
due to the fact that each variable change is constrained
by the previous value of its first derivative.
In the new model of execution, we add qualita-
tive states to model higher order qualitative variations,
which qualify the variation of the first derivative: In-
creasingly_Increase, when ˙x
-1
> 0 and ¨x
-1
> 0; De-
creasingly_Increase when ˙x
-1
> 0 and ¨x
-1
< 0; In-
creasingly_Decrease, when ˙x
-1
< 0 and ¨x
-1
< 0; De-
creasingly_Decrease when ˙x
-1
< 0 and ¨x
-1
> 0.
Illustrative Example of the Bouncing Ball. This
technique was applied to the bouncing ball, a typical
example of hybrid system. In this example, we have
only one state variable, the height of the ball above the
ground, noted z. The usual way to model the bouncing
ball is to consider that it has only one state, in which
it is in free fall, with ¨z = −g and g = 9.81m.s
−2
. The
bounce is modeled with a single transition, which is
triggered when the ball hits the ground (z = 0), and
MODELSWARD 2018 - 6th International Conference on Model-Driven Engineering and Software Development
282