# Qualitative Reasoning for Quantitative Simulation

Authors: Mehmet Fatih Hocaoğlu
Journal: Modelling and Simulation in Engineering
 (2018)

---

## Abstract

Qualitative simulation is a well-known reasoning technique that involves the use of simulation technologies. Reasoning is made to determine qualitative values and change directions of system variables, and it is done for each time point and time interval following the time point. Qualitative variables possess continuous qualitative value sets that are discretized by landmark points. Qualitative simulation uses qualitative time representation and its quantitative value is of no interest. The main purpose of this study was to develop a technique to determine time steps for a quantitative simulation under guidance of qualitative information. The proposed technique determined time advances using qualitative and quantitative information together to obtain a robust time step as wide as possible for simulation time advances. For this purpose, sign algebraic properties and derivation roots of quantitative equations and qualitative variable values with their change directions were used to compute time advances. In the approach, qualitative simulation determined landmark points to be advanced, and quantitative simulation calculated the duration required. Using the proposed algorithm, the simulation is advanced instead of iterating simulation time for a predefined time step and checking whether or not there is any activity in the interval, directly to the time points that are qualitatively different.


---

## Body

## 1. Introduction

Qualitative simulation (QS) is defined as a reasoning technique using simulation, and it generates possible value and their change directions that are defined as state on time axis for continuous event systems, using qualitative information of the system being simulated, and the states following each other in time point and time interval sequences constitute behavior trees [1, 2]. Qualitative differential equations (QDEs) utilized by QS represent a function family, not a specific function; they accommodate a set of functions beneath. Time axis in QS is constituted by time points and interval between time points. Qualitative state descriptions are computed for both time points and intervals, and they constitute a simulation trajectory. Because of the incomplete information used by QS, each qualitative variable yields next value set rather than a single value. As a result of this, simulation execution gives possible alternative trajectories.The main motivation of this study is to develop a simulation time management technique that advances simulation steps to system discontinuity points that are discovered by qualitative reasoning and sign algebra. In contrast to the fixed time advance mechanism for continuous event simulation, this approach maps continuous event simulation into discrete event simulation by discovering events and discontinuity points using qualitative information with quantitative functional analysis. It is known that every time step in continuous event time management may possibly not compute a qualitatively distinct state vector. As seen in the bathtub example given in Section5, although different numerical values for each time point in a time interval [t,t+Δt] are calculated, the time interval represents the same qualitative state vector, because all numerical values between t and t+Δt are mapped to the same qualitative interval. For example, qualitative meaning is that water level is between zero and full and it is increasing ((0,full),inc) (different cases for tub problem are given in Table 2). Until a qualitative landmark point is reached, qualitative interpretations and mathematical properties (sign of derivatives, change direction) for the time interval remain the same.In this study, a time advance algorithm is developed based on qualitative state vectors and qualitative algebra. The main idea is to calculate a time step as wide as possible to reach the next qualitative state vector point (named as landmark points) that is close to the current state value of simulation model depending on its change in direction instead of reaching the qualitative value by many small time steps that the quantitative equations are solved for. In some sense, this involves mapping a continuous space into a discrete one and allowing it to reach a state point directly, instead of traversing from one state to another by small time steps.In Section2, qualitative simulation is summarized and Section 3 gives brief information about the solution procedures for continuous event simulation with a time management taxonomy. While Section 4 gives fundamentals of the proposed qualitative time management approach, the approach is clarified by an example in Section 5. In the last section, advantages and disadvantages of the proposed solution are discussed.


## 2. Qualitative Simulation

Qualitative simulation (QS) is accepted as one of the qualitative reasoning (QR) techniques which are utilized to model human reasoning approach. The aim of QS is to generate possible future qualitative behaviors of any kind of system. During behavior generation, initial states, qualitative constraint set, and qualitative value set that are associated with qualitative state variables of the system are handled as an input set.Several approaches and ontologies are proposed to accomplish this purpose by researchers. Device centered ontology [3], process centered ontology [4], and constraint based approach [2] are well-known methods. QSIM algorithm, as a constraint based approach, is one of the most widely used algorithms in the developed techniques [1]. In constraint based qualitative simulation, qualitative variable values are represented as a discrete value set consisting of landmark points. A landmark point represents a qualitatively distinct model state. QS is performed from time point to time interval and continued. In Table 1, qualitative value transition rules from time point to time interval (P) and time interval to time point (I) are depicted. As seen in the table, a qualitative value of variable v is represented by a value or an interval with a change direction. The QSIM representation was developed, in part, to make the abstraction relationship between the qualitative representations and the theory of differential equations explicit and precise. Qualitative differential equation (QDE) is a tuple of four elements, V,Q,C,T, each of which will be defined below [2], and they are used to filter out spurious behaviors.(i)
V is a set of variables, each of which is a “reasonable” function of time.(ii)
Q is a set of quantity spaces, one for each variable in V.(iii)
C is a set of constraints applied to the variables in V. Each variable in V must appear in some constraint.(iv)
T is a set of transitions which are rules defining the boundary of the domain of applicability of the QDE.Table 1
Qualitative value (QV) transition rules.
P-SuccessorsQV(v,ti)⇒QV(v,ti,ti+1)
I-SuccessorsQV(v,ti,ti+1)⇒QV(v,ti+1)
P.1
〈
l
j
,
s
t
d
〉
〈
l
j
,
s
t
d
〉
I.1
〈
l
j
,
s
t
d
〉
〈
l
j
,
s
t
d
〉
P.2
〈
l
j
,
s
t
d
〉
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
I.2
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
〈
l
j
+
1
,
s
t
d
〉
P.3
〈
l
j
,
s
t
d
〉
〈
(
l
j
-
1
,
l
j
)
,
d
e
c
〉
I.3
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
〈
l
j
+
1
,
i
n
c
〉
P.4
〈
l
j
,
i
n
c
〉
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
I.4
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
P.5
〈
l
j
,
d
e
c
〉
〈
(
l
j
-
1
,
l
j
)
,
d
e
c
〉
I.5
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
〈
l
∗
1
,
s
t
d
〉
P.6
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
I.6
〈
(
l
j
,
l
j
+
1
)
,
d
e
c
〉
〈
l
j
,
s
t
d
〉
P.7
〈
(
l
j
,
l
j
+
1
)
,
d
e
c
〉
〈
(
l
j
,
l
j
+
1
)
,
d
e
c
〉
I.7
〈
(
l
j
,
l
j
+
1
)
,
d
e
c
〉
〈
l
j
,
d
e
c
〉
P.8
〈
(
l
j
,
l
j
+
1
)
,
s
t
d
〉
〈
(
l
j
,
l
j
+
1
)
,
s
t
d
〉
I.8
〈
(
l
j
,
l
j
+
1
)
,
d
e
c
〉
〈
(
l
j
,
l
j
+
1
)
,
d
e
c
〉
P.9
〈
(
l
j
,
l
j
+
1
)
,
s
t
d
〉
〈
(
l
j
,
l
j
+
1
)
,
i
n
c
〉
I.9
〈
(
l
j
,
l
j
+
1
)
,
d
e
c
〉
〈
(
l
j
,
l
j
+
1
)
,
s
t
d
〉
P.10
〈
(
l
j
,
l
j
+
1
)
,
s
t
d
〉
〈
(
l
j
,
l
j
+
1
)
,
d
e
c
〉
I.10
〈
(
l
j
,
l
j
+
1
)
,
s
t
d
〉
〈
(
l
j
,
l
j
+
1
)
,
s
t
d
〉
1
l
∗ is a value between lj and lj+1.Table 2
Differences between cases.
Case1
Case2
Case3
Inflow
Constant
Constant
Function dependent
Outflow
Constant because of constant inflow
Constant because of constant inflow
Function dependent
Interaction with the system
No interaction
Inflow/outflow valve clearance is changed exogenously
No interactionThe variables in a QDE represent time-varying quantities. In order to be possible for qualitative reasoning, variables must be restricted to correspond to functions of time whose behavior is reasonable. First, a reasonable function must be continuously differentiable. Transitions between domains will make it possible to represent isolated discontinuities between regions of continuous behavior. Second, it is convenient to consider each variable, including time, to range over the extended real number line,R∗, which includes the endpoints -∞ and +∞. The function v:[0,∞]→R∗ is defined to be continuous at ∞ exactly if limt→∞v(t) exist. Using extended real number line allows the use of the invariant that the value of a variable always lies in a closed interval defined by landmark values. Third, there will be a need to avoid functions of time whose qualitative properties change infinitely often in a finite interval. All these properties define a reasonable function.Definition 1.
Wherea,b⊆R∗, the function f:[a,b]→R∗ is a reasonable function over [a,b] if (1)
f is continuous on [a,b],(2)
f is continuously differentiable on [a,b],(3)
f has only finitely many critical points in any bounded interval,(4)
the one-sided limitslimt→a+f′(t) and limt→b-f′(t) exist in R∗. f′(a) and f′(b) are defined to be equal to these limits.Proposition 2.
Any reasonable functionf:[a,b]→R∗ defined over a bounded interval [a,b] has a finite set of landmark time points, a=t0<t1<⋯<tn=b, in its domain, and a finite set of landmark values, l1<l2<⋯<lk, in its range. A qualitative variable v and its quantity space l1<l2<⋯<lk define a symbolic language, a finite set of meaningful distinctions, for describing the values of a reasonable function f(t):[a,b]→R∗. At any time t, the qualitative value of f(t) can be defined in terms of its ordinal relationships with the landmarks in its quantity space and its direction of change.Definition 3.
The qualitative value off(t), QV(f,t), with respect to the quantity space, l1<l2<⋯<lk, is the pair qmag,qdir, where (1)qmag=lj,ifft=lj,alandmarkvalue,lj,lj+1,ifft∈lj,lj+1,qdir=inc,iff′t>0,std,iff′t=0,dec,iff′t<0.Qualitative reasoning by simulation, in other words, qualitative simulation is achieved beginning from a time point and inferring qualitative variable values for the time interval following and continuing so. The inference about qualitative values of variables at each simulation step is done using the rules shown in Table 1. P-Successors rule set defines time point to time interval transitions and carries out I-Successors rule set and vice versa. As an example, P.1, P.2, and P.3 rules show a variable value, which is equal to a landmark value and being stable on that point, it keeps its value and change direction, increases through the next landmark point, and decreases through the previous landmark point, respectively, in time interval following that time point.


## 3. Simulation Strategies and Time Management Techniques

There are three available strategy types of discrete event simulation which use discrete event simulation language.(1) Event-scheduling strategy deals with the prescheduling task of the events. Activating events with the help of test on the global state is out of the context of this strategy. (2) Activity scanning strategy is different from event-scheduling strategy because of the fact that the conditions of events are arranged by contingency test. Besides that, the scheduling process is carried out in time as well. (3) Process-oriented strategy is a combination of event-scheduling and activity scanning strategy mentioned above. There is always a distinction between the continuous time of real world and simulation time in the simulation environment. Simulation time can be established either using discrete time of continuous events or discrete events. In a discrete time simulation system, time variable is increased at the level of Δt from the point of t so the last time period is t+Δt. Changes in states are calculated between [t,t+Δt] points at the t+Δt time. In brief, discrete event simulation progress is computed from the occurrence time of one event until the occurrence time of the next event, in other words, from one state change to the next state. That is why discrete event driven simulation is more advantageous due to the fact that simulation model advances from one state to the another state. During this process, computations between inactive periods are not performed [5]. State transition which occurs by an event saves the model features the same state till either an internal transition happens or another event receives [6].In Agent driven Simulation Framework (AdSiF) which is solution based model for the proposed approach, discrete/continuous simulation approach and continuous event simulation approach are developed by scheduling a pseudoevent for each time interval and each time point (Hocaoglu, 2005, 2011). It means that execution is succeeded in the same way with discrete event simulation. By the way, the pseudoevent can be defined as a description of discretization point on a continuous function trajectory. Mentioned points are candidates for event publishing. Time stepΔt is accepted as a dynamic parameter and it changes for each kind of simulation models. Every simulation model can define its own time step according to its time requirement that are based on ODEs or equation set.The related works related combination of qualitative reasoning with quantitative simulation are commonly studied using interval algebra enveloping qualitative state variables with numerical intervals. First studies in this field are performed by means of a specific tool given as follows:(i)
Nsim (H. Kay and Kuipers, 1993; Herbert Kay, 1996)(ii)
Q2 (B. J. Kuipers and Berleant, 1988)(iii)
Q3 (Berleant, 1991)(iv)
SQSIM and MSQUID (Herbert Kay and Ungar, 2000).The essential solution is carried out by integrating landmarks and monotonic functions. Qualitative behaviors created by QSIM perform as a structure in order to represent qualitative information. These behaviors serve by marking both landmark values with real intervals and monotonic function constraints with real functions. The quantitative limits can be enlarged across constraints in order to derive narrower limits or in order to realize a contradiction and separate out the existing behaviors (Benjamin J. Kuipers, 1993). NSim (Numerical Simulator Using Interval Method) is developed by improving some features of QSIM simulation tool which generates a numerical bounding envelope for each parameter in the QSIM model extended with partial quantitative information.The concept of qualitative discrete event simulation was explored by Ingalls [7–9] who developed a simulation methodology that combines discrete event simulation with qualitative simulation using temporal interval as simulation time specification. Temporal interval allows the user to define time as an interval in the simulation. This means that the current state of the simulation can occur at any time during the interval defined by t=[t-,t+]. Temporal intervals are represented by the modeling of their endpoints, assuming, for any interval t, the lesser endpoint is denoted by t- and the greater by t+.The approach allows the modelers to express times symbolically for both situations when timing of events is unknown and when timing is known, though this can vary. The time advance values could be expressed as linear polynomials such as1,2,s,t,2s,t+s,2t-s+9, which must be evaluated to nonnegative real numbers [10]. The time advance in this approach highly depends on time resolution. The interval given is discretized by minimum time step and each step yields a simulation trajectory branch. From this respect, if the interval [t-,t+] is spanned by Δt, it gives the number of (t+-t-)/Δt trajectory branches. It is assumed that there is a state transition or an event occurrence at related time step.QDE and activity-tracking paradigm offer solutions to advance simulation time close to discrete event simulation. QDE solutions are based on discretizing time step byΔt minimum possible time steps and computing the likelihood for each step and finally generating parallel simulation trajectories [9]. Activity-tracking paradigm offers a quantization approach of change of the parameters in the temporal and spatial dimension [5].It is known that the symbolic discrete event system uses the polynomial representation. Since QDEs define neither any quantitative time based relationships nor numerical relationships between qualitative variables, ordinary (quantitative) differential equations (ODEs) are associated with QDEs. Association is achieved by both defining quantitative differential equation of qualitative ones and defining quantitative counterparts of landmark points. In this matching, the first derivation of quantitative equations gives qualitatively distinct time points and the points are taken into consideration as landmark points. QDEs determine which qualitative variable requires time advance and ODEs determine their quantitative values. In this respect, the simulation model has two equation sets. The first one is quantitative differential equations and the other one is QDEs, which guide ODEs. Most studies on qualitative discrete event simulation are based on uncertainty of event occurrence time points. The uncertainty of the event time is represented in a closed time interval inR, which is also known as temporal interval [8]. Because of the uncertain order of events, there would be ties on the future event calendar. If there is a tie, QDEs would not assume a tie breaking strategy. Instead, it creates threads that make up all of the possible ordering of ties. Thus, the future event calendar in QDEs collects all the event notices whose execution order is uncertain and groups them in a set, called the nondeterministically ordered set (NOS). Each of these event notices will be executed in turn and results in a set of threads that will include all of the possible ordering of event sequences. The capability of generating all possible scenarios is achieved with the thread generation algorithm. This distinctive characteristic of QDEs of generating all possible ordering of event sequences is known as coverage [11]. A solution based on event occurrence probability is developed by [9]. The solution provides a means to tie breaking in qualitative discrete event simulation.As another qualitative discrete simulation tool, QMTOOL, which is based on QSIM, has been extended with object-oriented features. The variables used with the important elements in a system or subsystems are input, state, output, and connection. The connection variable describes how the variables in an element are related. Variables can be assigned: an identifier (name), magnitude, sign, maximum, and minimum values (operating range) [12].In the approach proposed here, time advance points are determined by event occurrences. Any landmark point of a system variable and derivation points are taken into consideration as event occurrences and an event occurrence is discovered in the following given cases:(i)
Event occurrences. A time point where a set of events are received is determined as time point to be advanced(ii)
Qualitative landmark points. A qualitative landmark point is determined for system variables. Each landmark point represents a meaningful distinction for the variable. For example, empty and full are two landmark points for a gas tank. Any value between two landmark points represents the same qualitative meaning such as a value between empty and full meaning“there is some gas in the tank.” As shown earlier, a system variable is given as a pair consisting of a value and a direction change. Direction change is used to determine what landmark point is to be reached and how much time is necessary(iii)
Function derivatives. First and second derivatives of a function give distinct time points on simulation trajectory and it is assumed that an event is created at related time points. If the first derivative of a variable is equal to zero at ti, it is interpreted as the fact that the variable reaches a critical point and at the adjacent time interval [ti,ti+1], its direction of change could be inc, dec, or std. If the second derivation of the variable is negative, the variable changes its change direction to dec after std. If the first and the second derivatives are equal to zero and the third derivative is positive or negative, the variable keeps its direction as inc or dec, respectively. If a function is the derivative between value couples defined as [a,b], a and b are defined as landmark points.System variable change directions are driving factors, especially in value movement between landmark points, leaving or approaching from/to a landmark point.


## 4. Managing Simulation by Qualitative Reasoning

The relationship between QS and quantitative simulation is examined in [13]. In this paper, it is contended giving some related issues with time management. While QS enhances quantitative simulation by reasoning techniques and allowing usage of qualitative characteristics of system variables such as derivative signs and dependencies between variables, quantitative simulation alleviates incompleteness and the ambiguity that qualitative models have. Moreover, qualitative information enriches quantitative simulation with deep knowledge that keeps simulation production rules in structure rather than“if-then” rule sets.Qualitative reasoning in simulation is accommodated to manage time and events. QS simulation advances as a reasoning process from time point to time interval, time interval to time point, and so on. The basic idea of QS is to infer values and change of directions that system variables take at next time interval and at time point. Qualitative values taken by system variables are landmark values. In this sense, while QS determines qualitative magnitudes that consist of value and change of direction, quantitative simulation determines when it happens, in other words, duration to be granted.


### 4.1. QR in Time Management

Qualitative reasoning in time management is used to compute the time to be granted to pass from one time point to the following spanning time interval between these two time points for a continuous event system. Time step is calculated using variable values at two adjacent time points, not at time interval defined by qualitative transition rules. The main purpose to do this is to get as big as and as accurate as time step that is enough to reach next landmark point depending on variable value and direction of change. As seen in Figure1, the variable X has a value v that is between landmark L0 and L1 and its change of direction is toward L1. We aim to find a time step that the variable needs to reach value represented by landmark L1. The change amount on the variable value is equal to distance=L1-V.Figure 1
Time step calculation for a variable.Having an accurate time advance is important for a faster simulation execution and minimized round-off error and truncation error in computations [14]. It is clear that smaller time step size than necessary yields double precision error and bigger time step size than necessary yields two important problems. The first one is truncation error and the other one is ignoring qualitatively important function points, such as first-order derivative, second order derivative, and qualitatively distinguished points.Quantitative time advance is computed under the guidance of qualitative simulation. To be able to calculate time advance size, time requirement for each state variable is found and the minimum value is set as time to advance. Qualitative analysis by discovering state transitions of state variables using both landmark point transitions and sign algebra gives qualitatively distinct points to advance. Quantitative analysis computes the time advance size to reach these points.State variables start at timet0 with values and change of directions constituting initial state. All values at time t0 are known as quantitative and qualitative. The qualitative variable values for time interval [t0–t1] following t0 are generated using qualitative simulation (Table 1 rule set). Filtering applied to the result is computed using rule set given in Table 1. In quantitative simulation, interest is in time points and time interval is used to reach the next time point. In this respect, [ti,ti+1] time interval is seen as time step with size (ti+1-ti) to advance time point ti+1 from ti. The five fundamental rules of time inference depending on value and change direction of a qualitative variable are given below.Time Rule  1. A variable insists keeping its change direction the same for infinite time unless receiving an event interrupting time interval or reaching a landmark point.Time Rule  2. A received event causes an external transition and it creates a new critical (landmark) point in value set of related qualitative variable and the time that the event is received is a candidate time point to be advanced.Time Rule  3. A dependent variable time request is determined by minimum time request of independent variables that it depends on.Time Rule  4. A variable with increased or decreased change direction requests a duration enough to reach first landmark point at its direction path.Time Rule  5. A variable with std change direction (stable in time interval) requires infinite time.Under these general rules, durations necessary to succeed in qualitative value transitions given in Table1 are interpreted as follows. Quantitative time advance is determined based on interval to point transitions. The following interpretations show why reasoning is done on time intervals and not on time points. I.1 says a value lj,std at [ti,ti+1] is kept at time ti+1. Because of the fact that it does not change its value, the variable aims to keep its value for infinite time. When a value increasing in a landmark interval (I.2) reaches landmark upper bound of the interval it is in and changes its change direction to std at time point following the time interval, the variable requests a limited duration (computable using quantitative equations) and it changes its change direction to std because of either an event received or the success of a condition that disturbs it. Time request in I.3 gives the same result with I.2 but the change direction of the variable remains the same because there is no received event and successful condition. I.4 does not request any time step. A system variable that has a value given in I.4 consumes time step determined by any other variables. I.5 and I.9 are an external transition case and it happens if and only if an event is received or a condition that changes its value succeeds. Time step is defined as the time that the event is received. I.6 and I.7 are computed in a similar way with I.2 and I.3, respectively. A dual interpretation of I.4 and I.1 is valid for I.8 and I.10, respectively.External transition defines state transition forced by an event received. In this case, differently from internal transition in which the simulation model transits its state by consuming the time assigned to the state it is in, external transition interrupts the current state at the event received time without consuming the whole state time. The duration consumed is equal to the difference between the event received time and state entry time.


### 4.2. QR in Event Handling and Detecting Event Occurrences

A continuous system receives and sends events. A received event may affect change directions of qualitative values and this determines the time point to advance. A qualitative variable reaching one of its landmark points makes an internal state transition and sends events attached to the state. In this sense, QSim representation is extended by event attachments to the landmark points. The rules regarding receiving an event are summarized below.Event Rule  1. A qualitative variable may change its change direction if and only if the system receives an event interrupting it (related rules are I.2, I.5, and I.9).Event Rule  2. A received event determines the time point to advance and causes an external transition.The rule regarding sending an event is summarized below.Event Rule  3. First and second derivation time points are candidate event of creation points.Event Rule  4. An event may be created at a landmark point discovered by an external transition.


### 4.3. Transitions

QDE and related ODE are defined for a specific region. The transitions associated with a QDE define the limits of the region of applicability of the QDE and optionally specify a transition to a new QDE if that limit is reached.Definition 4.
A transition is a rule of the form condition → transition function, where(i)
the condition is a pattern of the form (variable (qmag, qdir)), or a Boolean combination of such patterns,(ii)
the transition function is applied to the current state if the condition succeeds. It returns a new qualitative state, perhaps defined with respect to a new QDE, from which simulation can resume.Qualitative time management is done using currently active QDEs. The algorithms and rules developed are generic and valid for all QDEs and there is no domain dependency.


### 4.4. Abstracting Structure from ODE to QDE

To be able to use qualitative simulation for time management, two folded models are required: quantitative model (Ordinary Differential Equations (ODE)) and qualitative model (QDEs). It is possible to abstract QDE set using ODE set, given that a suitable ODE is decomposed into an equivalent set of simultaneous equations by introducing terms for each subexpression. Abstraction gives a weaker QDE set than ODE. “Weaker” means that any behavior that satisfies the ODE must satisfy the QDE, but not necessarily vice versa. Qualitative reasoning dictates the point qualitatively distinct to be reached in mathematical space of system variables. In this sense, qualitative simulation serves what state vector landmark points are to be reached and quantitative simulation computes when they are reached.


## 4.1. QR in Time Management

Qualitative reasoning in time management is used to compute the time to be granted to pass from one time point to the following spanning time interval between these two time points for a continuous event system. Time step is calculated using variable values at two adjacent time points, not at time interval defined by qualitative transition rules. The main purpose to do this is to get as big as and as accurate as time step that is enough to reach next landmark point depending on variable value and direction of change. As seen in Figure1, the variable X has a value v that is between landmark L0 and L1 and its change of direction is toward L1. We aim to find a time step that the variable needs to reach value represented by landmark L1. The change amount on the variable value is equal to distance=L1-V.Figure 1
Time step calculation for a variable.Having an accurate time advance is important for a faster simulation execution and minimized round-off error and truncation error in computations [14]. It is clear that smaller time step size than necessary yields double precision error and bigger time step size than necessary yields two important problems. The first one is truncation error and the other one is ignoring qualitatively important function points, such as first-order derivative, second order derivative, and qualitatively distinguished points.Quantitative time advance is computed under the guidance of qualitative simulation. To be able to calculate time advance size, time requirement for each state variable is found and the minimum value is set as time to advance. Qualitative analysis by discovering state transitions of state variables using both landmark point transitions and sign algebra gives qualitatively distinct points to advance. Quantitative analysis computes the time advance size to reach these points.State variables start at timet0 with values and change of directions constituting initial state. All values at time t0 are known as quantitative and qualitative. The qualitative variable values for time interval [t0–t1] following t0 are generated using qualitative simulation (Table 1 rule set). Filtering applied to the result is computed using rule set given in Table 1. In quantitative simulation, interest is in time points and time interval is used to reach the next time point. In this respect, [ti,ti+1] time interval is seen as time step with size (ti+1-ti) to advance time point ti+1 from ti. The five fundamental rules of time inference depending on value and change direction of a qualitative variable are given below.Time Rule  1. A variable insists keeping its change direction the same for infinite time unless receiving an event interrupting time interval or reaching a landmark point.Time Rule  2. A received event causes an external transition and it creates a new critical (landmark) point in value set of related qualitative variable and the time that the event is received is a candidate time point to be advanced.Time Rule  3. A dependent variable time request is determined by minimum time request of independent variables that it depends on.Time Rule  4. A variable with increased or decreased change direction requests a duration enough to reach first landmark point at its direction path.Time Rule  5. A variable with std change direction (stable in time interval) requires infinite time.Under these general rules, durations necessary to succeed in qualitative value transitions given in Table1 are interpreted as follows. Quantitative time advance is determined based on interval to point transitions. The following interpretations show why reasoning is done on time intervals and not on time points. I.1 says a value lj,std at [ti,ti+1] is kept at time ti+1. Because of the fact that it does not change its value, the variable aims to keep its value for infinite time. When a value increasing in a landmark interval (I.2) reaches landmark upper bound of the interval it is in and changes its change direction to std at time point following the time interval, the variable requests a limited duration (computable using quantitative equations) and it changes its change direction to std because of either an event received or the success of a condition that disturbs it. Time request in I.3 gives the same result with I.2 but the change direction of the variable remains the same because there is no received event and successful condition. I.4 does not request any time step. A system variable that has a value given in I.4 consumes time step determined by any other variables. I.5 and I.9 are an external transition case and it happens if and only if an event is received or a condition that changes its value succeeds. Time step is defined as the time that the event is received. I.6 and I.7 are computed in a similar way with I.2 and I.3, respectively. A dual interpretation of I.4 and I.1 is valid for I.8 and I.10, respectively.External transition defines state transition forced by an event received. In this case, differently from internal transition in which the simulation model transits its state by consuming the time assigned to the state it is in, external transition interrupts the current state at the event received time without consuming the whole state time. The duration consumed is equal to the difference between the event received time and state entry time.


## 4.2. QR in Event Handling and Detecting Event Occurrences

A continuous system receives and sends events. A received event may affect change directions of qualitative values and this determines the time point to advance. A qualitative variable reaching one of its landmark points makes an internal state transition and sends events attached to the state. In this sense, QSim representation is extended by event attachments to the landmark points. The rules regarding receiving an event are summarized below.Event Rule  1. A qualitative variable may change its change direction if and only if the system receives an event interrupting it (related rules are I.2, I.5, and I.9).Event Rule  2. A received event determines the time point to advance and causes an external transition.The rule regarding sending an event is summarized below.Event Rule  3. First and second derivation time points are candidate event of creation points.Event Rule  4. An event may be created at a landmark point discovered by an external transition.


## 4.3. Transitions

QDE and related ODE are defined for a specific region. The transitions associated with a QDE define the limits of the region of applicability of the QDE and optionally specify a transition to a new QDE if that limit is reached.Definition 4.
A transition is a rule of the form condition → transition function, where(i)
the condition is a pattern of the form (variable (qmag, qdir)), or a Boolean combination of such patterns,(ii)
the transition function is applied to the current state if the condition succeeds. It returns a new qualitative state, perhaps defined with respect to a new QDE, from which simulation can resume.Qualitative time management is done using currently active QDEs. The algorithms and rules developed are generic and valid for all QDEs and there is no domain dependency.


## 4.4. Abstracting Structure from ODE to QDE

To be able to use qualitative simulation for time management, two folded models are required: quantitative model (Ordinary Differential Equations (ODE)) and qualitative model (QDEs). It is possible to abstract QDE set using ODE set, given that a suitable ODE is decomposed into an equivalent set of simultaneous equations by introducing terms for each subexpression. Abstraction gives a weaker QDE set than ODE. “Weaker” means that any behavior that satisfies the ODE must satisfy the QDE, but not necessarily vice versa. Qualitative reasoning dictates the point qualitatively distinct to be reached in mathematical space of system variables. In this sense, qualitative simulation serves what state vector landmark points are to be reached and quantitative simulation computes when they are reached.


## 5. Example: Bathtub Problem

Bathtub problem is a simple but clear enough step to show both quantitative and qualitative simulation procedures and time management and event handling using qualitative reasoning. The system basically has two valves to fill and drain. The qualitative model of problem is given below.(2)M+amount,outflowamount=netflow∗ΔtAddnetflow,outflow,inflowdinflow/dt=0Derivamount,netflowTransitionsConstantinflowamountfull,inc⟶tGraphical representation of the system and qualitative equations set are depicted in Figures 2(a) and 2(b), respectively. Figure 2(c) shows the relation between components. Valve-F and Valve-D have relation with tub namedFills andDrains, respectively.Figure 2
Bathtub problem graphical representation.
(a)
Tub system
(b)
Model variable relations
(c)
RelationM+ represents a monotonic increasing function and it is bidirectional function but the causality flows in one direction. In model representation, higher water amount is correlated with higher outflow. (3)AddX,Y,ZisequaltoX+Y=Z,DerivX,Y:dXdt=Y.Transitions section in qualitative model represents model transition. That means the simulation uses another set of equations representing the system. In this case, after transition the pouring amount of water is calculated, amount of water in the tub is equal to full, and it does not change.The cases given below are not alternative qualitative behaviors of the system being simulated. Rather, they are alternative scenario designs. At each case, qualitative simulation generates total envision (whole alternative behaviors) of the system being simulated. While each behavior consists of current qualitative values, landmarks to be reached, and change of direction at time points and time intervals, quantitative simulation calculates the time span to reach those landmark points if it is possible. This allows us to advance simulation over qualitative landmark points. A landmark point is reached at each simulation step or a landmark point is created at the time point that an event is received and sent by any other simulation components. This makes simulation execution faster than stepping byΔt time step and calculating a state vector and more accurate because qualitatively distinct landmark points are calculated directly instead of approaching the values by slicing time.Case 1 (constant flow).
In this type, inflow variable has a constant numeric value and maintains the same qualitative value. The value is determined as “if” that is placed between zero and ∞. It does not change during simulation. Qualitative value set for qualitative variables is given below:(4)amount=0,full,∞,inflow=0,if,∞,outflow=0,∞,netflow=-∞,0,∞.Initial state (t0) is seen in Table 3. The only variable that is known is inflow and it is equal toif. The other variables are determined by propagating its value using qualitative equations. After completing qualitative variables at t0, the prediction of its successor state describing the open interval [t0,t1] is given in Table 3.
From[t0,t1] interval to t1 point, for amount, the rules I.2, I.3, I.4, and I.5 are applied (in Table 3 the rules and time point values for each rule are given for the variable amount, resp. For I.5 a value f∗ is discovered). It is possible to calculate a duration for I.2 and I.3 to find an answer for the question“How much time is required to reach the full level starting from the value att0?” The variable amount, which has zero value at t0, reaches full at t1 according to both rules. The quantitative value change is equal to (full-0) and the duration it takes is calculated as tamount=(full-0)/netflow. The rule P.7 is the only rule to be applied for the variablenetflow and it gives the same qualitative value for the time interval following t0. For the other variables, the rules applied and their qualitative values in the time interval [t0,t1] are given in Table 3.Table 3
Qualitative behavior trajectory for Case1.
t
0
P-Successors ([t0,t1])
I-Successors (t1)
Amount
〈
0
,
↑
〉
P.4:〈(0,full),↑〉
I.2:〈full,ϴ〉, I.3: 〈full,↑〉, I.4: 〈(0,full),↑〉, I.5: 〈f∗,ϴ〉
Outflow
〈
0
,
↑
〉
P.4:〈(0,∞),↑〉
I.2:〈∞,ϴ〉, I.3: 〈∞,↑〉, I.4: 〈(0,∞),↑〉, I.5: 〈of,ϴ〉
Inflow
〈
i
f
,
ϴ
〉
P.1:〈if,ϴ〉
I.1:〈if,ϴ〉
Netflow
〈
(
0
,
∞
)
,
↓
〉
P.7:〈(0,∞),↓〉
I.6:〈0,ϴ〉, I.7: 〈0,↓〉, I.8: 〈(0,∞),↓〉, I.9: 〈(0,∞),ϴ〉The answer to the question att1 is sought whether or not the amount will keep its direction as inc or it will be stable atfull value or a value in the interval [0, full]. The answer is given by the variables to which the variable amount is connected. There are inflow and outflow variables that determine the variablenetflow. Ifnetflow is greater than zero, then the change direction of the variable amount is known as increase (inc) and if it is equal to zero, its change direction is known as std. It is necessary to check if there is an event scheduled for t1 to change to inflow or outflow or both of the valves, so thatnetflow is equal to zero. If there is no event scheduled like these (it is given), the solution accepting amount equal to full,whileϴ is accepted as invalid. Similarly, the value ((0,full),std or f∗,std) represented by I.5 is also not applicable because of the same reason (no event scheduled to change inflow and outflow).At timet1, the value of amount equal to full and direction of change isinc, and this is a transition condition (amount (full, inc) → t). If the simulation is terminated, pouring level of water is calculated depending on passing time after reaching the levelfull and the value ofnetflow. Simulation execution requires infinite duration ([t1,∞]) until scheduling an event. If any event is scheduled to change inflow and/or outflow level between t0 and t1, the time advance is determined as the time that the event is scheduled. Rule I.4 keeps the variable value interval and change direction for t1 the same with [t0,t1] interval. Since it does not give any landmark points, there is no other variable that reached a landmark point in its qualitative value set, and because we aim to calculate a time step I.4 is accepted as not suitable for our purpose. The rules I.2 and I.3 give results that suitable to calculate a time step and both give the same time step and it is a time step necessary to reach the levelfullfrom the level zero. It is possible to filter out spurious qualitative behaviors using the qualitative model constraints [1]. The process is given in Appendix. After filtering qualitative behaviors three behaviors remain. These are shown in Table 4. As mentioned earlier, there is no event scheduled to change inflow or outflow; behavior (2) and behavior (3) are eliminated. If there is an event scheduled to change flows with a time label smaller than the time step necessary to reach level full, the event time is granted as simulation time.Table 4
The behaviors att1.
1
2
3
Amount
〈
f
u
l
l
,
↑
〉
〈
f
u
l
l
,
ϴ
〉
〈
(
0
,
f
u
l
l
)
,
ϴ
〉
Outflow
〈
(
0
,
∞
)
,
↑
〉
〈
o
f
,
ϴ
〉
〈
o
f
,
ϴ
〉
Inflow
〈
i
f
,
ϴ
〉
〈
i
f
,
ϴ
〉
〈
i
f
,
ϴ
〉
Netflow
〈
(
0
,
∞
)
,
↓
〉
〈
0
,
ϴ
〉
〈
0
,
ϴ
〉As seen here, qualitative model gives an answer to where time advance is to be searched and quantitative model gives an answer to how big the time span is. Instead of writing an“if-then” rule to control whether or not the variable amount reaches its maximum full value to switch to pouring model, the control rule, in other words, production rules, is presented as structural information.Case 2 (constant flow and flow change event scheduled).
Inflow has constant values and it is set to zero at timete bychangeFlow event. Time interval [t0,t1] is calculated as in Case 1. If te is in the interval, time request is determined as te; otherwise it is set as t1. When tub model receiveschangeFlow event between t0 and t1, it calculates the amount of water filled until the time event is received. te seems as a new landmark point situated between t0 and t1. The variables have new values at time te. The value set at time te is the same in previous case at time t1. The values ofinflow andoutfloware changed by the eventchangeFlow. A new value for inflow (if∗) and outflow (of∗) is set. The next step is a point to interval transition (from te to [te, t1]). The next value ofamount and the duration required is calculated using newnetflow value. Ifnetflow is zero, infinite duration is required to reach maximum level. If the value is positive it is calculated as before but if it is a negative value (which means outflow is greater than inflow), because ofnetflow direction of change, the amount decreases to zero value. The duration to reach zero water level is calculated depending on newnetflow value.
Simulation execution is completed in two steps. The first step is determined by the event scheduled and the second step is from the point event received to the point that the variable amount reaches itsfull value or zero level.Case 3 (gradually changing flows).
In this case,inflow andoutflow change their values by a function of time (inflow = f(Δt) andoutflow = g(Δt)). It is assumed that an automated valve controller changes exogenous clearance levels of inflow valve and outflow valve. It tries to make a valve clearance level maximum if it is closed or vice versa if the valve is open. Clearance levels for inflow and outflow are determined by a time dependent cos⁡t2 function and cost-sint2/2 function, respectively. At the initial state t0, the inflow valve is openedfull andoutflow valve is closed and qualitative value set of variables is given below.(5)amount=0,full,∞,inflow=0,maxif,outflow=0,maxof,netflow=-maxof,0,maxif.The fact that while in Case 1, inflow is set as a constant, in Case 2 inflow and outflow valve clearances are changed by time dependent functions, and this is the main difference.Outflow obtains its clearance level to full clearance (open) by time from closed state. Since each variable has a time advance request to reach time t1, after [t0,t1] interval computation, transition from the interval to time point t1 is computed using Table 1 as in the earlier cases. At this stage, time advance requirements are computed starting by independent variables and they areinflow andoutflow.The first and the second derivations ofinflow function give (6)-2∗sin⁡t∗cos⁡t,(7)2∗sin2⁡x-cos2⁡xfunctions. Roots of the first derivation in [0,2∗π] are [0,π/2,π,3∗π/2,2∗π] (using (6)). While these points give minimum and maximum clearance for valves, the roots of cos⁡t2 function give minimum clearance for valves and these are π/2 and 3∗π/2   (using (7)). Transition from initial time t0 to the time point t1 passes through time interval [t0, t1]. As seen in Table 3, by applying the rules from rule set at Table 1, the variable values at the interval [t0,t1] are calculated. Inflow reaches its minimum value at π/2 (one of the roots of the first derivative) and at this time point, since the second derivative has a positive value,inflow changes its direction of change from dec to inc (see (8)). (8)inflow′=-2∗sin⁡t∗cos⁡t=0⟶t=π2,Inflow′′=2∗sin2⁡π2-cos2⁡π2=+.Similarly, the calculation for outflow is done. outflow′=sin2⁡(x)-cos2⁡(x)=0→{π/4,3∗π/4,5∗π/4,7∗π/4}, since the closest time point is π/4; the sign of the second derivation at this point is checked. At time points π/4 and 5∗π/4, the second derivation of outflow has positive values (outflow′′=4∗cos⁡x∗sin⁡x=4∗cos⁡π/4∗sin⁡(π/4)=[+] and it is [−] for 3∗π/4 and 7∗π/4). Since the second derivative has a positive value,outflow changes its direction of change from dec to inc at time point π/4 after having a std change of direction. From time zero to π/4, outflow keeps its direction of change as decrease and between π/4 and 5∗π/4 (the root of outflow function) it changes its direction of change to inc after std at π/2 because of its positive second derivative at π. The smallest time step is determined as t1 = π/2. Since the amount at time step t (amountt) is equal to amountt-1+newflow[t-1,t], its quantitative value is calculated using integral value of outflow and inflow for intervals [0, π/2] and [π/2, 0], respectively (9). The simulation advances directly to time π/2. Simulation execution continues stepping through qualitatively distinct time points that are landmark points and roots of functions and their derivatives.(9)outflow=∫0π/2cos⁡t-sin⁡t22=cos2t+t2=π-24,inflow=∫0π/2cos2t=cos⁡tsin⁡t+t2=π2,amount=amout0+inflow-outflow=0+π2-π-24=π-24.In this case, if the value of amount is greater than the landmarkfull, it is thought to be subtracted from the value of amount to calculate the amount of pouring water. But the better way is to determine how much time is necessary to reach the landmarkfull, as seen below. Because, at further iteration of the simulation, the smallest time step may come from the variableamount, this is not the case in the approach to pass any variable landmark value.(10)full=amout0+inflow-outflow.If there is no solution, the time step is assumed to be infinite (at the beginning of the simulation (at time 0) the amount is equal to zero).(11)full=0+cos⁡tsin⁡t+t2-cos2t+t2.Let us assumefull is equal to five (5) and initial value of amount is equal to zero. In this case, there is no real solution for these value sets. It is assumed that the variable amount requires infinite time. For later simulation execution,amount reaches a value of 4.80. The next step size is calculated by the amount required to reach the landmarkfull (it is equal to 5) because of the fact that it gives a smaller time step than the time step required by the valve clearances.We know that any solution for the variable amount is an exact value and it is when the amount reaches itsfullvalue. While there is a possibility of passing the landmark value of a system variable, when the slicing time advance mechanism is used, in this case, since the time is advanced directly to the landmarks points as stepping stones, it ensures that each time advance calculates the exact value of the system variable at the exact time point where it has the value. As seen in Table 5, because of the small valve steps, the variable amount may have a value between 0 and full (I-Successors I.4). The time required for the amount to reach full,ϴ or full,↑ is the time granted to the time step by the variable amount. Until this happens, it is seen as a behavior filtering rule and full,ϴ and full,↑ are filtered.Table 5
Qualitative behavior trajectories.
t
0
P-Successors ([t0,t1])
I-Successors (t1)
Amount
〈
0
,
↑
〉
P.4:〈(0,full),↑〉
I.2:〈full,ϴ〉, I.3: 〈full,↑〉, I.4: 〈(0,full),↑〉
Outflow
〈
0
,
↑
〉
P.4:〈(0,maxOf),↑〉
I.2:〈maxOf,ϴ〉, I.3: 〈maxOf,↑〉
Inflow
〈
m
a
x
I
f
,
↓
〉
P.5:〈(0,maxIf),↓〉
I.6:〈maxIf,ϴ〉, I.7: 〈maxIf,↓〉
Netflow
〈
(
0
,
m
a
x
I
f
)
,
↓
〉
P.7:〈(0,maxIf),↓〉
I.6:〈maxOf,ϴ〉, I.7: 〈maxOf,↓〉Simulation behavior state diagrams covering all cases given here are seen in Figures3 and 4. The behavior diagrams are developed based on AdSiF. Figure 3 shows the behavior of a valve. As seen in the figure, the event “close” closes the valve and the event “open” opens it. If a valve is closed it stays in closed state for infinite duration and it is interpreted as the same way for the event “open” and state “active.” If a valve is opened, it starts at maximum open clearance and activates the behaviorFsa_SetClearence at “Out” phase of the state active. If a valve is for draining, its initial behavior is set asFsa_Close and the clearance is set to zero. The behavior calculates the next clearance level using (6)–(8) and the duration necessary to reach the calculated clearance is computed by the functionValveDuration that is the duration calculator function of the stateCalculate Clearance. It sends an event name setClearence to the tub where the valve is related to the relation known asFills orDrains.Figure 3
Valve behavior diagram.Figure 4
Tub behavior diagram.The tub is in active state for infinite time because of its initial behaviorFsa_Initial. Depending on qualitative value of the variableamount, one of the behaviorsFsa_FullLevelRequest, Fsa_TimeToZero,andFsa_StdLevelis activated because of their activation conditions. Fsa-FullLevelRequest is activated if the variableamounthas an increasing direction (activationCond: val,inc) and activation of other behaviors is interpreted as similar. At any time during simulation, there is an active“Request Duration” state. Anytime the event namedsetClearenceis received, the tub activates the behaviorFsa_LevelCalculatorand it sets clearance level. Since the behaviors that consist of the state“Request Duration” that is entry state of the behavior Fsa_LevelCalculator make external transition, they executeExTrans/CalculateLevel functions for the duration elapsed to calculate the water level in the tub. The stateRequest DurationatFsa_FullLevelRequestcalculates how much time is required to reach the levelfullusingCalculateDuration4Full (10). If it reaches this level, it activates the behaviorFsa_Fullat the state out phase.Fsa_Full stays inFull state for infinite time. Similarly, the state same state at Fsa_TimeToZero calculates the duration necessary to reach landmark level zero. If the tub is infull state and it receivessetClearence event, it activatesFsa_Pouring. State full calculates the pouring water amount up to the event received time.It is seen that the qualitative model supports a quantitative discrete model in two ways:(1) the qualitative model guides quantitative model to find which variable gives time advance and (2) the landmark points work as structural rules, and derivation points work as an inner event creation mechanism for managing execution flow. If the whole system is modeled as a single entity, the first support gets more prominent. In the other cases, it is shown here that each component is modeled as a separate model, and the first support gets weaker but the second support is still available.


### 5.1. Performance Measurement

The example is executed for five(5) minutes. For time slicing simulation execution all state variables are updated at each second. That means, for Case 1, simulation takes 300 (5∗60) steps, if there is no close event received during execution. In qualitative calculation case, it takes just one step. In Case 2, time slicing simulation approach takes 300 steps plus number of flow change events. In qualitative calculation case, number of simulation steps is equal to two times the number of flow change events.The most complex situation is seen in Case3. Qualitative landmark points are discretized by the values of inflow and outflow function roots and of their derivative roots. The roots are [0, π/2, π, 3∗π/2] for inflow and [π/4, 3∗π/4, 5∗π/4, 7∗π/4] for outflow. Each root value is taken into consideration as a discrete time point in a continuous universe. During simulation execution, in five minutes, we have eight discrete time points in total (4 from inflow and 4 from outflow) because of the discretized movements of the valves. At each step, the system reaches one landmark point and this makes eight steps. In qualitative calculation phase, a qualitative inference overhead is added to processing effort; it takes approximately 0.001 seconds. Processing effort for time slicing is directly related to simulation duration. In the second case, simulation time effort depends on both simulation time and number of events processed. In the third case, the effort is calculated in a similar way. But none of the cases in qualitative calculation and simulation execution effort does not depend on simulation execution duration.


## 5.1. Performance Measurement

The example is executed for five(5) minutes. For time slicing simulation execution all state variables are updated at each second. That means, for Case 1, simulation takes 300 (5∗60) steps, if there is no close event received during execution. In qualitative calculation case, it takes just one step. In Case 2, time slicing simulation approach takes 300 steps plus number of flow change events. In qualitative calculation case, number of simulation steps is equal to two times the number of flow change events.The most complex situation is seen in Case3. Qualitative landmark points are discretized by the values of inflow and outflow function roots and of their derivative roots. The roots are [0, π/2, π, 3∗π/2] for inflow and [π/4, 3∗π/4, 5∗π/4, 7∗π/4] for outflow. Each root value is taken into consideration as a discrete time point in a continuous universe. During simulation execution, in five minutes, we have eight discrete time points in total (4 from inflow and 4 from outflow) because of the discretized movements of the valves. At each step, the system reaches one landmark point and this makes eight steps. In qualitative calculation phase, a qualitative inference overhead is added to processing effort; it takes approximately 0.001 seconds. Processing effort for time slicing is directly related to simulation duration. In the second case, simulation time effort depends on both simulation time and number of events processed. In the third case, the effort is calculated in a similar way. But none of the cases in qualitative calculation and simulation execution effort does not depend on simulation execution duration.


## 6. Discussions

Combining qualitative and quantitative information for simulation based analysis gives several advantages. In addition to the advantages to cope with the problem in qualitative analysis such as data size to be analyzed, variety of data type, and hardness in generalizing qualitative analysis to particular cases, [15], in this study, how qualitative reasoning provides a fast and accurate simulation execution providing time step mechanism via qualitative meaning of the mathematical properties and qualitative information known prior to discrete event simulation is shown. The simulation is advanced, instead of iterating simulation time for a predefined time step and checking whether or not there is any activity in the interval, directly to the time points that are qualitatively different.As seen from the literature, qualitative discrete event simulation studies are mostly focused on alleviating vagueness on qualitative model and variables by enhancing them using quantitative information such as quantitative intervals. Unlike other approaches, the approach presented here is based on qualitative reasoning and it is used to guide quantitative discrete event simulation determining qualitatively (common sense) meaningful time points.In the approach given here, qualitative simulation is achieved as a parallel processes, it is executed and its filtering rules are applied, and whole process is followed. By this way, total envision (all possible behaviors), in other words, qualitative behavior trajectories, is got. All these behaviors serve quantitative simulation to find which qualitatively distinct point is to be reached for each qualitative variable and using this information quantitative simulation calculates how long it takes. This ensures simulation execution is done by stepping on qualitatively meaningful time points, instead of advancing a continuous simulation step by step and checking the rule set (e.g., if tub is burst or not and checking clearance of valves). The study aims to provide a higher order rule set depending on mathematical properties of the system and qualitative model, not depending on domain specific information.The proposed approach maps continuous event simulation into discrete event simulation by discovering qualitatively distinct time points both in sign algebra (sign of derivatives) and in qualitative value set consisting of landmark points of state variables. Discovered time points are interpreted as event points created by continuous state variables. For a hybrid system, the approach poses events arising from discrete part of the system onto trajectories of continuous state variables. In the approach, looking at discrete event occurrences on continuous state variable trajectories, this is taken into consideration as rare event simulation [16, 17]. The threshold values defined in rare event simulation are seen as landmark point intervals and time interval placed on qualitative simulation trajectories.The approach provides not only faster simulation executions but also allows more accurate computations. Since simulation advances directly to qualitatively meaningful discrete time points computed on a continuous state variable trajectory, the approach alleviates errors that come from truncation and round-off. In other words, each simulation step is as wide as simulation model needed rather than centrally granted time step. Because time step intervals are computed by both taking algebraic characteristics of function sign and qualitative value and function sets with change directions into consideration, this gives an opportunity to advance time points mathematically and qualitatively, in this sense, linguistically reasonable function points during simulation execution without missing any important point and unnecessarily computing qualitatively the same adjacent time points. This makes simulation execution associated with model mathematical properties by making it independent from model parameters. For example, let us take a moving entity from point A to point B with a constant velocityV into consideration. The execution duration of this example case using time slicing execution depends on velocity of the entity and size of simulation step size. It is also known that the bigger the step size (than necessary), the bigger the Fourier error and the smaller the step size, the bigger the double precision error [14]. But the approach proposed is independent from simulation parameters, since it uses model mathematical properties; the execution takes a known number of steps and calculates the exact time points to advance. The approach assumes to use integration methods to solve model equations instead of numerical methods. If it is necessary to use numerical method each simulation entity consumes a wide time step that is calculated using landmark points and/or derivation time point presented in the approach by dividing into the smaller steps. The time saving opportunity allows modelers to change differential equation solution technique from numerical methods to integration methods that give more accurate result but need more computational effort.Since simulation time advances directly to the qualitatively distinguished time points, the concept of time is taken into consideration as 4th dimension in the space. This is explained by space time (relativity). In contrast with this, slicing time advance mechanism is basically Euclidian time definition. There is a time axis that is continuously advancing, the system variables are calculated for each time step, and for each time step there is an activity scanning phase to discover whether or not there are any events to be processed.The approach also provides some important advantages for tracing simulation records. Jumping directly to qualitatively distinct time points on a continuous contour instead of transverse function point (as seen in Table5) and stepwise qualitative computation of the same functional values (not in quantitative manner) at each time step gives less record points for each variable to be recorded. The property makes it unable to record the necessary time points and obtain qualitative records of the same values. In a constant time step simulation, it is possible to miss qualitative meaningful time points. In quantitative function sign algebra based analysis, for the variable, defining the function time advance request is computed depending on the first function and the second derivation solution points. Bringing simulation steps together with common-sense reasoning is another important property provided by the approach. Because at each simulation step a qualitatively meaningful system state is reached, the execution trajectory gives a concise, close to human reasoning, and meaningful result.



---

*Source: 7842402-2018-01-01.xml*