A Numerical Study of Quantization-Based Integrators

Adaptive step size solvers are nowadays considered fundamental to achieve efficient ODE integration. While, traditionally, ODE solvers have been designed based on discrete time machines, new approaches based on discrete event systems have been proposed. Quantization provides an efficient integration technique based on signal threshold crossing, leading to independent and modular solvers communicating through discrete events. These solvers can benefit from the large body of knowledge on discrete event simulation techniques, like parallelization, to obtain efficient numerical integration. In this paper we introduce new solvers based on quantization and adaptive sampling techniques. Preliminary numerical results comparing these solvers are presented.


Introduction
Nowadays, it is considered that the efficient integration of ordinary differential equations (ODEs) requires adaptive step-size solvers [1].In conventional adaptive solvers the integration step is adjusted to keep numerical stability and accuracy at some desired level, and the same step size, although variable, is used in all ODEs.These methods are thus synchronous since the smallest step size required by an ODE is imposed to all others.Alternative solutions based on asynchronous techniques have been developed based on quantization [2], and generalized sampling [3].These approaches enable each ODE to be solved by an integrator that can advance time independently from the others, making these methods asynchronous, and not driven by any particular ODE.
Quantization, is a discrete event technique based on the partitioning of signals into levels separated by a fixed interval (quanta).Step size is controlled by the time to reach the a new quantization level, making it an adaptive step-size integrator [2].Asynchronicity is introduced by considering that an integrator I only affects its influencees, i.e., other integrators directly depending on the output signal (discrete event) of I.An approximation to the input value is made in quantized integrators.Since values are only sent when there is a change in the output signal quantization level, only that value is exact, while the others are considered to be constant.This approximation, however, enables to improve method efficiency.In particular, in distributed simulation, where values can be locally kept, quantized integrators require no communication to obtain the current input value.Quantization levels, need thus, to be chosen in order to make this approximation valid, keeping method stability and the error bounded.
Generalized sampling is an alternative technique that enables the description of asynchronous sampled-based systems, where each component can have its own sampling rate, while keeping the a e-mail: barros@dei.uc.pt ability to modify component sampling rate [3].These features enable asynchronous methods, where ODEs are assigned to integrators that can control their sampling rate based, for example, on local error.Conventional synchronous solvers can also be represented through the use of synchronous influenceers, enabling the representation of a wide range of integration solvers [4].Given these two approaches for representing asynchronous solvers we consider that the development of new methods exploiting synergies may lead to improved numerical solvers.We consider here the representation of the quantized solvers in the Heterogeneous Flow System Specification (HFSS) and we develop two new solvers based on quantization and generalized sampling concepts.The first solver, uses sampling to provide the current value for all variables when an integration step is made.An improved accuracy is expected, while the computation is also increased to obtain the exact input values.A second integrator was developed to exploit the exact input value used in each integration step.Since each transition uses now the current input value and not an approximation, we study an alternative quantization-based method that sets dynamically the next quantization level based on the current output value, as opposed to fixed quantization levels used in the original method.Our preliminary results point that this new approach presents a good balance between accuracy and efficiency leading to fewer transitions than the original method, for an improved accuracy.In these comparisons energy have been used for assessing integration error.

The HFSS Formalism
The Heterogeneous Flow System Specification (HFSS) is a formalism aimed to represent piecewise constant partial state systems.This characteristic enables its implementation on digital computers.HFSS achieves the representation of continuous variables using the concept of generalized sampling [5], while the representation of discrete events is based on the Discrete Event System Specification (DEVS) [6].HFSS has two types of models: basic and network.Basic models provide state representation and state transition functions.Network models are a composition of basic models and/or other network models.Given its definition, a network provides an abstraction for representing hierarchical systems.

HFSS Basic Model
We consider B as the set of names corresponding to basic HFSS models.A HFSS basic model associated with name B ∈ B is defined by

Continuous Flow Generator
Function generation plays an important role in the representation of many continuous systems.Entity trajectories or forces be described with the help of a HFSS function generator.For example, a force described by the function f : R −→ R can be represented by the HFSS model: where , where e std is the standard part of the hyperreal e λ(∅) = ∅ This model can represent arbitrary continuous functions.For example, an exponential signal can be described by the function f (t) = αe −βt .This generator uses only continuous flows to describe the signal.The generator is a passive component with no autonomous behavior, and where all information is retrieved through sampling.

Square Wave Generator
Hybrid generators can also be represented in HFSS.A square wave can be described by an autonomous model without no inputs and two outputs: a discrete flow to signal a new output value and a continuous flow holding the last output value.The generator of a square wave of amplitudes -1, +1 and period π is given by: Typical generator trajectories are depicted in Figure 1.The discrete flow signals a discontinuity, while the wave value is described by the continuous output flow.Models can sample this value and they can also be aware of value change.We note that a DEVS models can produce discrete events but they cannot hold these values as piecewise constant signals.The persistence of the output values are used in Section 3 to represent quantized-based integrators, removing the need to store event values, required by discrete event implementations of quantized systems [6].

HFSS Network Model
HFSS networks models are compositions of HFSS models (basic or other HFSS networks models).Let N be the set of names corresponding to HFSS network models, with N ∩ B = {}.Formally, a HFSS network model associated with name N ∈ N is defined by where N is the network name X = X × Ẍ is the set of network input flows X is the set of network continuous input flows Ẍ is the set of network discrete input flows Executives are uniquely assigned to network models, i.e., ∀ i, j∈ N,i j η i η j with The model of the executive is a modified HFSS model, defined by where Σ is the set of network topologies γ : P −→ Σ is the topology function The network topology Σ α ∈ Σ, corresponding to the p-state p α ∈ P, is given by the 4-tuple where C α is the set of names associated with the executive state p α for all i ∈ C α ∪ {η} I i,α is the sequence of asynchronous influencers of i E i,α is the sequence of synchronous influencers of i ACTIMS 2014 F i,α is the input function of i I N,α is the sequence of asynchronous network influencers E N,α is the sequence of synchronous network influencers F N,α is the network output function Variables are subjected to the following constraints for every These two last constraints are characteristics of discrete systems and impose that non-null values cannot be created from a sequence composed exclusively by null values.
Contrarily, to other modeling hybrid formalisms [6], HFSS uses the set of influenceers and not the set of influencees to describe model interaction.This choice enables the interoperabilty and reuse of models having different interfaces.In this paper we exploit the ability to combine several output values into a single value required by integrators, making them reusable since they are independent on the set of influencers and the specific ODE.This is not the case for the integrators described by DEVS that need to be modified according the these parameters [6].

Quantization-Based Integrators
The efficient integration of ODEs requires the use of adaptive step size solvers that adjust the step in order to keep error within some bound.Conventional solvers adjust the sampling rate, performing an integration step when any of the equations exceeds the maximum allowed error.This type of integrator is synchronous, since all equations are integrated at the same (although variable) time step.Discrete event integrators are based on the concept of quantization, that independently sets the integration step to each equation based on the variation of integrator output value.A quantized-integrator (QI) computes the time to reach the next quantization level and at that time then it sends the output value as a discrete event value.When a QI receives a value it uses the remaining stored input values to compute the new time to reach the next quantization value.Given this algorithm we provide now its description in the HFSS formalism [5].HFSS provides two main advantages over a conventional discrete event implementation.First, there is no need to store input values in the integrator, and second, the integrator can be made independent of the ODE.Let us take as an example the ODE ẏ = cos(x)+z 3 , that depends on variables x and z, that are computed by components X and Y, respectively.When x crosses its own quantization value, component X sends a discrete event to Y, that performs the computation cos(x new ) + z 3 curr , where x new is the new value of x and z curr the last received value of z.A discrete event representation requires the integrator to be aware of the ODE, limiting its reuse.This kind of representation needs also to store the last value of each received input.A HFSS version of the integrator enables a simplification of this procedure.Since HFSS components have continuous output flows, if we design integrator outputs as piecewise constant flows, we can remove the need for local storage of input values.We can also exploit HFSS input function to describe ODE functions, making integrators domain independent an fully reusable.

Classical Quantized Integrator (QI-1)
We start our description by the classical quantized integrator [2].The HFSS model of an integrator associated with quantum Q can be defined by: otherwise where y = y + x • e std and where q is the last discrete event output sent, and used to compute the time interval for the next quantum cross.To obtain quantization semantics, we need also to combine events with the piecewise constant values from the unchanged integrators.This can be achieved by component input function, that needs to replace the continuous output flow of a changing component by its discrete output value.

Quantized Integrator based on Exact Inputs (QI-2)
Another possibility is to use the concept of quantization while providing a continuous output flow to the solvers.The new integrator can be described by: otherwise where y = y + e std • x and The difference from the previous integrator is in the continuous output function, that now provides a continuous output, as opposed to the piecewise constant value of the previous version.This integrator does not require any replacement in the input value set since all values, including the one corresponding to the active integrator, are exact.

Dynamic Quantization Integrator (QI-3)
The last version exploits the exact input used by the previous integrator when it makes a transition.Since all inputs are updated when sampled, we consider that the next threshold crossing level can be also modified.This makes the next quantization level dynamic, depending on the value set by the last transition. where

Comparing Discrete Events and Hybrid Flows
The original integrator QI-1 was mainly designed to offer an efficient implementation in distributed computing environments [2].In this case, a piecewise constant value can be buffered avoiding its transmission to a component that can be located in a different computer, an expensive operation due to communication overhead.This overhead, however, is usually negligible when components are in the same computer.The use of of continuous output values, as provide by HFSS, introduces usually a small overhead, specially when simulations are run on non-distributed computers, enabling the use of exact value instead of approximations.The quantization supported by QI-1 makes it very convenient to a distributed implementation since only one bit (up, down) is required to convey the information.However, this feature can become irrelevant in non-distributed simulations.HFSS obtains the exact output value when a integrator transition is scheduled.This approach my increase integration accuracy when compared to quantization-based solutions that use approximated output values [7].

Numerical Results
To provide a preliminary assessment of the described quantization-based integrators we have used two simple systems: an harmonic oscillator and a pendulum.Comparisons use energy for assessing method accuracy.

Harmonic oscillator
As a first example, we consider the harmonic oscillator described by the equation: ẍ = −x and energy given by Considering x(0) = 0 and v(0) = 4 we have E = 8J.Since this oscillator is an Hamiltonian system, energy should remain constant.Simulation results are depicted in Figure 2 that describes position and velocity.(For simplicity, parameters like elasticity, mass, and gravity, required to characterize this system have been set to one.)Oscillator energy for the three methods is represented in Figure 3, where a quantum size of 0.01 was used.It is well know that general purpose integrators have poor characteristics for simulating  Hamiltonian systems [1], and we expect energy to change.We note however, that integrators error accumulate at different rates, being dependent on the solver.
The number of transitions is given in Table 1.The best accuracy was obtained by QI-2 while QI-3 has fewer transitions and better accuracy than QI-1.

Planar Pendulum
We consider next the pendulum described by the equation:   The number of transitions is given in Table 2. Likewise the previous system, the best accuracy is obtained by QI-2, while QI-3 exhibits fewer transitions and better accuracy than QI-1.

Conclusion and Future Work
Quantized-based integrators have a large potential for reducing computation effort.We have described two new integrators based on quantization that, according to our preliminary results, have a good performance when compared with the original quantization integrator.The HFSS formalism have shown a good degree of flexibility by providing a framework for representing there different types of quantization-based integrators.Additional work is required to confirm our preliminary numerical results.A general proof of the characteristics of the presented quantization-based integrators needs also to be addressed by future research.
flow values X is the set of continuous input flow values Ẍ is the set of discrete input flow values Y = Ȳ × Ÿ is the set of output flow values Ȳ is the set of continuous output flow values Ÿ is the set of discrete output flow values P is the set of partial states (p-states) ρ : P −→ H +∞ 0 is the time-to-input function ITM Web of Conferences ω : P −→ H +∞ 0 is the time-to-output function S = {(p, e)|p ∈ P, 0 ≤ e ≤ ν(p)} is the state set with ν(p) = min{ρ(p), ω(p)}, representing the time to transition function s 0 = (p 0 , e 0 ) ∈ S is the initial state δ : S × X ∅ −→ P is the transition function where X ∅ = X × Ẍ∅ and Ẍ∅ = Ẍ ∪ {∅} and ∅ represents the null value (absence of value) Λ : S −→ Ȳ is the continuous output function λ : P −→ Ÿ is the partial discrete output function HFSS components have their behavior ruled by HFSS models and their semantics are presented in [5].
the set of network output flows Ȳ is the set of network continuous output flows Ÿ is the set of network discrete output flows η ∈ η is the name of the dynamic topology network executive with η ∈ η representing the set of all names associated with HFSS executive models, constrained to η ∩ B = η ∩ N = {} x c , y + e std • x) Λ((α, β, x, y), e) = y + x • e std λ(α, β, x, y) = y ITM Web of Conferences 02002-p.8

Figure 3 .
Figure 3. Energy for the harmonic oscillator.

Figure 4 .
Figure 4. Energy for the pendulum system.

Table 1 .
Number of transitions in harmonic oscillator simulation.

Table 2 .
Number of transitions in pendulum simulation.