An n – th Order Generalization of the Activity Measure for Continuous Systems

In this work we present an analytical expression that generalizes the definition of activity measure in continuous time signals. We define the activity of order n and show that it allows to estimate the number of sections of polinomials up to order n that are needed to represent that signal with certain accuracy. We apply this concept to obtain a lower bound for the number of steps performed by quantization–based integration algorithms in the simulation of ordinary differential equations. We performed a practical analysis over a first order example system, computing the activity of order n and comparing it with the number of steps required integration methods of different orders. We corroborated the theoretical predictions, which indicate that the activity measure can be used as a reference for assessing the suitability of different algorithms depending on how close they perform in comparison with the theoretical lower bound. Finally, a discussion is provided which indicates that further research is needed in order to test the results presented in this work in the context of stiff systems.


Introduction
The concept of activity associated to a signal was introduced by Zeigler and Jammalamadaka [1] in order to measure the rate of change of a signal, which in turn allows to estimate the number of steps performed by quantization-based integration methods in the simulation of continuous time systems [2].
The original definition of activity takes only into account the change in the signal value.Thus, for a monotonically increasing or decreasing signal, the activity only measures the distance between the final and the initial value, without using at all the information about how it goes from the initial to the final value.Using this formulation, a signal that growth with a straight ramp contains the same activity than a signal that grows with more complex functions of time.
When the signals are not monotonic, the activity can be computed as the sum of the activity of the different monotonic sections.
In either case, the formal definition of the activity for a signal x i (t) between an initial time t 0 and a final time t f is given by a e-mail: rcastro@dc.uba.arb e-mail: kofman@cifasis-conicet.gov.ar When a continuous time signal x i (t) is the input of a zero-order quantization function, the corresponding output trajectory q i (t) results piecewise constant as shown in Figure 1.The number of discontinuities of the output trajectory q i (t) is closely related to the activity of the input x i (t).Notice that for each interval of time at which x i (t) is monotonic, the number of quantum crossings is about A j /ΔQ i , where A j is the amplitude (i.e., the activity) of the segment and ΔQ i is the quantum size.
Thus, the total number of discontinuities in q i (t) can be directly computed as Zero-order quantization functions like that of Fig. 1 are used in some Quantized State Systems (QSS) numerical integration algorithms, such as the first order accurate QSS1 method [3], the Backward QSS (BQSS) method [4], and the first order accurate Linearly Implicit QSS (LIQSS1) algorithm [5].
Thus, Eqs.( 1)-( 2) can be used to establish a lower bound for the number of steps needed by those methods to simulate a given system with a given quantum.That way, the concept of activity can predict the minimal computational costs required to simulate a system with a given accuracy.
However, there exist higher order quantization functions that are also used in QSS methods of higher order.For instance, the QSS2 method [6] uses first order quantization functions that produce piecewise linear output trajectories as shown in Fig. 2.
In these cases, nor Eq.(1) neither Eq.( 2) provide any help to estimate the number of discontinuities in the output trajectory.
Firstly, as it was already mentioned, the activity definition of Eq.( 1) obtains the same result for a straight ramp than for a more complex increasing signal provided that both signals have the same amplitude.However, a straight ramp can be represented by a single section of a piecewise linear trajectory while a more complex signal, depending on the quantum, would require more segments.Evidently, this difference is not captured by Eq.( 1) Secondly, it is known that in second order accurate methods like QSS2 the number of steps varies with the square root of the quantum ΔQ i [5,6].However, Equation (2) shows a linear dependence, which is clearly wrong.
These facts motivated the need of generalizing the concept of activity so that it can be still applied in presence of higher order quantization.
In this work we study and develop the idea of activity of order n.The paper is organized as follows.In Section 2 we provide a review of quantization schemes up to order three, and synthesize how they are used in algorithms for quantization-based simulation of continuous systems.In Section 3 we first derive the expression for n-th order quantization, and based on that, we introduce the definition of activity of order n.Then, in Section 4 we apply the new definitions in a first order (non-stiff) system.We then analyse the correlation between theoretical and practical results obtained through simulation, including a discussion about stiff systems.Finally, in Section 5 we present the conclusions and provide hints about follow up steps stemming from the concepts introduced in this work.

Background
In this section we review a particular family of quantization functions which are used in the context of quantization-based integration of ordinary differential equations (ODEs).
These quantization functions approximate a continuous time input signal x i (t) by a piecewise polynomial output signal q i (t), so that they do not differ more than the quantum ΔQ i .This is, they ensure that.

Zero-order quantization
In zero-order quantization [3,7] the approximating polynomial segments are of order zero, i.e., the quantized signal q i (t) is piecewise constant.Formally, given an input signal x i (t) and a piecewise constant output signal q i (t), we say that they are related by a zero-order quantization function Q 0 with quantum ΔQ i if they satisfy q i (t) = q i (t j ) for t j ≤ t < t j+1 (4a) with the sequence t j defined by Notice that q i (t) follows a piecewise constant trajectory that only changes its value when the difference between q i (t) and x i (t) becomes equal to the quantum.After each recalculation of the quantized variable it results that q i (t) = x i (t).This behavior is depicted in Figure 1.One consequence of this approach is that a regular grid of evenly spaced quantization thresholds can be imagined superimposed to the input and output trajectories offering an intuitive visual perception of the quantization process: new values of q i (t) are produced as x i (t) hits the thresholds that verify Unfortunately, as we shall see shortly after, this grid-oriented hint is only possible in the zero order case; such an evenly spaced set of adjacent thresholds will lack any meaning in higher order schemes, starting already with the first-order quantization case.

First and second order quantization
The same idea presented for zero-order quantization is followed in first-order quantization [6], but this time around resorting to piecewise linear segments for constructing q i (t) rather than piecewise constant as in the preceding case.
Formally, given an input signal x i (t) and a piecewise linear output signal q i (t), we say that they are related by a first-order quantization function Q 1 with quantum ΔQ i if they satisfy with the sequence t j defined by and c 1, j computed as: The result of this approach is that q i (t) follows a piecewise linear trajectory that experiences discontinuities at time instants t = t j when the difference between q i (t j ) and x i (t j ) is equal to que quantum ΔQ i .
Along the same lines, given an input signal x i (t) and a piecewise parabolic output signal q i (t), we say that they are related by a second-order quantization function [8] ITM Web of Conferences with the sequence t j defined by and c 1, j , c 2, j computed as: which results in q i (t) following a piecewise parabolic trajectory, changing their polynomial coefficients only at time instants t = t j when the difference between q i and x i becomes equal to que quantum ΔQ i .
The behaviour of a second order quantization function is depicted in Figure 3.

Quantization-Based Integration
Continuous Time Systems are typically represented by ODEs.Except for very simple cases, these ODEs lack of analytical solutions and they must be approximated by numerical integration algorithms in order to be solved.Classic numerical integration algorithms are based on the discretization of the time variable [7].
In recent years, a new class of ordinary differential equation solvers has been developed that replaces the time discretization by the state quantization [7].These algorithms, based on Zeigler's idea of representing quantized system as DEVS models [9,10], are called Quantized State Systems (QSS) methods.
A QSS numerical solver operates naturally in an asynchronous mode, i.e., the instants t j belong to the set of positive real numbers and are not confined to any synchronized pattern of time instants.
Each state variable carries its own simulation clock.If the states of a subsystem change very little, the model equations capturing the dynamics of that subsystem will be executed rarely (or equivalently, their activity will be very low).
In the context of QSS-based simulations a dormant model does not slow down the simulation, as its equations will not get executed (i.e., it will experience null activity).
The quantization schemes presented above are those employed within QSS methods that shall be described in the next section.

First Order QSS1 Method
Given the system: with analytical solution x a (t), the first order QSS1 method approximates it by Here, q is the quantized state vector.Its entries q i (t) are componentwise related with those of the state vector x i (t) by a hysteretic quantization function, defined as in Eq.(4).

Other First Order QSS Methods
Besides QSS1, the Backward QSS (BQSS) [4], Centered QSS (CQSS) [4] and Linearly Implicit QSS (LIQSS1) [5] perform first order approximations.They differ from QSS1 in the definition of the quantization function given by Eq.( 4), however in all these methods the quantized variables q i (t) follow piecewise constant trajectories.BQSS and LIQSS1 were conceived to efficiently simulate stiff systems, while CQSS was proposed to simulate marginally stable systems.

Higher Order QSS Methods
The accuracy of the simulation is directly related to the quantum ΔQ i [6].Thus, if we want to improve the accuracy by a factor of e.g.100, the quantum must be reduced 100 times.Then, any first order QSS method will perform 100 times more steps.This is a serious limitation of first order schemes, since accurate results require performing lots of steps with the corresponding increment in the computational costs.
To overcome this difficulty, higher order methods were developed like the second order QSS (QSS2) [6] and the third order QSS (QSS3) [8].
The QSS2 method is based on the same principles as QSS1, approximating Eq.( 7) by Eq.( 8).However, it replaces the zero-order quantization function of Eq.( 4) and Figure 1 by a first-order quantization function of Eq.( 5) and Figure 2.
Consequently, the quantized state trajectories q i (t) are piecewise linear and each segment starts with a value and slope equal to those of the corresponding state x i (t).When both trajectories differ by ΔQ i , a new segment of q i (t) starts.
It was shown that in QSS2, the number of steps grows with the square root of the accuracy.Thus, if we want to improve the accuracy by a factor of 100, QSS2 performs only 10 times more steps.
The third order QSS3 method is identical to QSS2, except that it replaces the first order quantization functionby the second order quantization function of Eq.( 6) and Figure 3.
A second order quantization function generates an output piecewise parabolic trajectory , whose value, slope and second slope change when the difference between the output and input of the function becomes bigger than the quantum.Each output segment starts with the same value, slope and quadratic slope than the input.

ITM Web of Conferences
It was shown that in QSS3, the number of steps grows with the cubic root of the accuracy.Thus, if we want to improve the accuracy by a factor of 1000, QSS3 performs only 10 times more steps.
Besides QSS2 and QSS3, there exist linearly implicit QSS methods of orders 2 (LIQSS2) and 3 (LIQSS3) which are particularly suitable to simulate stiff systems [5], while having definitions very similar to those of QSS2 and QSS3.

Activity of Order n
In this section we generalize the concept of activity so that it can be applied in the context of higher order quantization functions like those used in QSS2 and QSS3 methods.
Before introducing the new definition of activity of order n, we present a definition of n-th order quantization.

n-th order quantization
The ideas behind first and second order quantization functions can be generalized to define the n-th order quantization function Q n (t).
Given an input signal x i (t) and a piecewise polynomial output signal q i (t), we say that they are related by a n-th-order quantization function Q n with quantum ΔQ i if they satisfy with the sequence t j defined by and the coefficients c m, j computed as: The latter requires all derivatives of x i (t) to exist at least up the order of the quantization scheme, i.e., n.

Activity of Order n
The original definition of activity [1] given by Eq.( 1) integrates the rate of change dx i (t) dt experienced by a continuous time signal x i (t) in a given interval of time.
When q i (t) is a piecewise constant approximation of x i (t), the rate of change dx i (t) dt is also the rate at which the difference |q i (t) − x i (t)| grows while q i (t) remains constant.
However, if q i (t) is obtained from a quantization function of order n − 1 with n ≥ 2, the rate at which the difference |q i (t) − x i (t)| grows follows a different law: where t j is the time of the last discontinuity of q i (t).
ACTIMS 2014 Replacing x i (t) by its Taylor series expansion: When the difference t − t j is small or when the n-th derivative of x(t) is constant (as it happens in QSSn methods) the difference between q i (t) and x i (t) results: After t = t j , the next discontinuity in q i (t) occurs at t = t j+1 , where |Δx i (t)| = ΔQ i .Then, from Eq.( 10) it results that Dividing the latter by ΔQ i and computing the 1/n power at both sides, it results This equation holds for j = 0, • • • , k − 1 in the interval (t 0 , t k ).Then, we can compute the summatory for j at both sides: and approximating the summatory by the integral, we finally obtain dτ which provides an expression for the number of discontinuities in q i (t) on the interval (t 0 , t k ).From this last expression, it makes sense to define the n-th order activity of the signal x i (t) on the interval (t 0 , t f ) as In that way, given a continuous time signal x i (t) we can estimate the number of discontinuities for an approximation of order n using a quantum ΔQ i as: Notice that when n = 1 Eq.( 11) coincides with the original definition of activity of Eq.( 1) and the formulae for estimating the number of discontinuities given by Equations ( 12) and (2) become identical.With Eqs.(11) we also extended to the n-order the concept that the activity measure is a property inherent to a signal, in contrast to the number of discontinuities computed by Eq.( 12), wich depends on choices of the quantum size according the required accuracy. 02001-p.8

ITM Web of Conferences 4 Example: A first order linear system
The first order linear system: The n-th order activity of the solution x(t) is, according to Eq.(11), When a is negative and |a • t f | >> n it results that Notice that the activity in this case is independent on the eigenvalue a.
Using the parameter a = −1, initial condition x(0) = 1 and a final time t f = 5 the activities of order 1, 2, and 3, according to Eq.( 13), result A (1)  x(0,t f ) = 0.993262; A (2)  x(0,t f ) = 1.298128;A (3)  x(0,t f ) = 1.339137 We simulated the system with QSS1, QSS2 and QSS3 methods using in each case quanta from ΔQ = 10 −2 down to ΔQ = 10 −6 with decrements of one order of magnitude.Then, we compared the number of steps performed by each method with the number of steps predicted by Eq.( 12).The results are shown in Table 1.

Analysis of the results
The results agree with the theoretical predictions.There are only two cases in which the results do not match closely: the QSS1 simulation with a small quantum and the QSS3 simulation with a large quantum.
In the first case, the steps are very small (there are more than 980000 steps in 5 seconds).As a consequence, the round-off errors become significative.
In the second case, the difference is due to the fact that QSS3 starts with a first order approximation (in the first step it does not have information about the first derivative) and then it follows with a second order one.Only after the third step it really performs a third order approximation.
It is important to recall that QSS methods may introduce some spurious oscillations which provoke additional steps that can not predicted by the activity of the analytical solution.Thus, it must be remarked that the activity measure only offers a lower bound for the number of steps performed by an algorithm of order n.
A very relevant class of systems exist that strongly affect the number of computational steps performed by a numerical method, which cannot be predicted by the expression of activity presented as presented in this work if special methods are not used.This is the case of so-called stiff systems, which are briefly discussed in the next section.

The case of stiff systems
Stiff systems are a class of dynamical systems where slow and fast dynamics coexist.For stability reasons, stiffness imposes particular difficulties to non-stiff classic numerical solvers.Provided that the step size is adjusted so that the numerical solutions remain stable, they invariably end up performing an excessive number of computation steps for coping with spurious high frequency oscillations which are numerical artifacts introduced by the (non-stiff aware) numerical techniques.
Unfortunately, non-stiff quantization-based algorithms, such as QSS methods, experience similar difficulties.When a stiff system is solved by a QSS method, spurious high frequency oscillations appear in the numerical solution (which are not present at the analytical solution) [4,5,7].
Due to these oscillations, the activity of the numerical solution results much higher than the activity of the analytical solution.Thus, the number of steps performed by non-stiff QSS methods loose any relation with the theoretical figure predicted by (12).
However, a special branch of state-quantization based methods has been recently developed that efficiently simulate many stiff systems.Backward and Linearly Implicit QSS methods (BQSS, LIQSS) [4,5] tend to eliminate the spurious oscillations, yielding a number of practical quantum crossings that, in principle, should match closer theoretical activity figures.
We can reasonably expect that the theoretical estimation provided by the activity of order n can be used as a theoretical lower bound for the number of steps performed by an algorithm of order n.
This lower bound can be compared with the actual number of steps produced by an algorithm.Thus, we could measure how suitable is that algorithm for simulating a given stiff system, not only by comparing raw values against other methods, but also by comparing their relative departures from a common theoretical absolute minimum.

DOI: 10
.1051/ C Owned by the authors, published by EDP Sciences,

Table 1 .
Theoretical and real number of quantum crossings.