Quantized State Based Simulation of Time Invariant and Time Varying Continuous Systems

Continuous system can be discretized for computer simulation. Quantized state systems (QSS) method has been used to discretize time invariant systems based on the discretization of the state space. AHLA based QSSmethod is proposed in this paper to address issues of real-time advancements in simulation and an aircraft control example was introduced to illustrate our method. Moreover, to simulate time varying systems, a novel approach is also proposed and exemplified with a practical case.


Introduction
Continuous system simulation is a topic which has advanced significantly with the appearance of modern computers.Based on classic methods for numerical resolution of ordinary differential equation (ODE) such as Euler and Runge-Kutta, several variable steps and implicit ODE solver methods were developed.These modern methods which usually make use of iteration rules and symbolic manipulation allow the efficient simulation of complex systems, including differential algebraic equation (DAE) and variable structure systems.
Although there are several differences between the mentioned ODE solver algorithms, all of them share a property: they are based on time discretization.That is, they give a solution obtained from a difference equation system (i.e., a discrete-time model) which is only defined in some discrete instants.
A completely different approach for ODE numerical simulation has been being developed since the end of the 90s.In this new approach, the time discretization is replaced by the state variables quantization and a discrete event simulation model (within the DEVS formalism framework) is obtained instead of a discrete-time one.
Discrete event system specification (DEVS) [1][2][3] is a formalism which allows representing and simulating any system having a finite number of changes in a finite interval of time.In that way, systems modelled by petri nets, state charts, event graphs, and even difference equations can be seen as particular cases of DEVS models.
The origin of the quantization based integration methods can be found in the definition of quantized systems and their representation in terms of DEVS models [4].This idea was reformulated with the addition of hysteresis and it was formalized as a simulation method for ODEs in [5,6] where the quantized state systems (QSS) were defined.Moreover, there exist some other approaches such as Backward QSS and Centered QSS [7][8][9].But all the previous works using QSS to simulate continuous systems did not address the issue how to implement QSS in real-time distributed simulations such as high level architecture (HLA) and distributed interactive simulation (DIS).They did not mention the approach to extend QSS to time varying simulations either.As such, this paper proposes QSS based researches on both real-time and time varying simulation methods, where QSS must be extended for simulation.To accomplish this, we develop a way to keep the real-time synchronization in high level architecture (HLA) distributed simulation environment and propose a method to simulate time varying system.
The paper is structured as follows.In Section 2, key technologies of QSS are introduced and analyzed.Section 3 introduces the proposed distributed QSS framework to address real-time systems and a validation example is designed and results are shown and analyzed.In Section 4, a new method of time varying case is proposed and illustrated with a practical 2 Mathematical Problems in Engineering example.Finally, conclusions are drawn and future works are discussed.
To deduce quantization function, let  = { 0 ,  1 , . . .,   } be a set of real numbers, where  −1 <   , 1 ≤  ≤ .Let Ω be the set of piecewise continuous real valued trajectories and  ∈ Ω is a continuous trajectory.Let  : Ω → Ω be a mapping and let  = (), where the trajectory  satisfies Then the map  is hysteretic quantization function [2].() is a set of quantized state variables used to simulate () of ( 1), where the discrete values   are called quantization levels and the distance Δ ≜  +1 −  is defined as quantum, which is usually constant.The width of the hysteresis window is .The values  0 and   are the lower and upper saturation values.

Real-Time Simulation of Time Invariant System in HLA
Although previous works [7][8][9] introduced hysteretic quantization function above, they did not address the issue how to fulfill time management in real-time distributed simulations such as DIS and HLA systems.To tackle this problem, we propose using RTFederate in distributed simulations such as HLA and DIS systems.This method is about real-time management and is generic to all distributed simulations.Therefore we will use HLA as our example system in this section.

RTFederate: A Time Control Member. As shown in
Figure 1, RTFederate mainly has three components: Time

Real-Time Simulation.
Each of the subsystems would be discretized with QSS method and be treated as a federate in HLA.The time management mode of all the federates should be set as "both Constrained and Regulating".Also, RTFederate module needs to be set with the same mode.In HLA, Runtime Infrastructure (RTI) software would allow time advance only if all of the federates request to advance and the least requested time step would be allowed.Figure 2 shows the procedure of time advance.
Only if RTFederate especially requests to advance, RTI would allow its time advancement.So the simulation speed would be controlled by RTFederate module and then it would support real-time simulation.

Example of Time Invariant
System.Consider a vertical control system of a plane as the following equation shows: The symbols in the equation are listed below.
The Symbols in (4) The system is discretized with QSS method, the quantum unit is  = 0.001 and so as the hysteresis, and the initial conditions are ΔV = Δ = Δ = Δ = 0, Δ  = 2 ∘ , Δ  = 0 ∘ .The changes of velocity  Figure 3 shows the response of ΔV, which is a long period transition process.
As seen from Figure 3, the step intervals became smaller when ΔV gets close to peak values, where the values change severely.On the other hand, the step intervals get bigger when ΔV reaches a relatively stable status, where the value does not change much.
Table 1 shows the step interval around the first peak value, and Table 2 shows the step intervals in relative stable status.The results indicate that the QSS method reduces the redundant calculation and improves the simulation efficiency.
To be simulated in distributed environment each of the state variables would be treated as a federate and in addition to RTFederate module it has five federates in total.Considering the procedure of time advance shown in Figure 4, we have the following time advance equations for these federates:

QSS for Time Varying System
4.1.QSS Method for Time Varying System.In the previous section, a QSS method of time invariant system is proposed.However, in practical systems, there exist time varying state variables.And in this section, we proceed to propose a QSS approach of time varying system (TVS).
Consider the TVS as follows: When  =   ( ≥ 0), (5) follows to be Equation ( 9) is an instance of TVS, with the initial conditions: The analytical solution of ( 9) is and Figure 5 shows the trajectories of (9) produced by QSS method and the analytical solution, respectively.As we can see, they are almost identical with each other, except the difference in step intervals.The QSS method is more computationally efficient.The trajectory values at some time points are listed in Table 3.We can also get the conclusion that the result of our method corresponds to analytic curve with minor errors.

Conclusions and Future Work
The paper discretizes the continuous system using QSS method which is based on the quantization of the state space to improve the simulation efficiency.QSS method transforms the continuous system to the discrete event model.The paper introduces both time invariant and time varying methods to support different system simulations.QSS method guarantees the stability and convergence under some conditions and it is not adapted to all the continuous system simulations yet.We need to extend the application range in the future.

Figure 3 :
Figure 3: Curve of ΔV in the simulation with QSS method.
For the component of Time Memory, it needs to set a minimum time step denoted as  min ; it would be a positive integer.RTFederate module would get the allowed advance time from RTI through RTI Interface and then add it to the Time Memory.If the value  in Time Memory is smaller than  min , Time Memory would request time advance with  min through RTI Interface.Otherwise, Time Memory would transfer the value  to Real Timer and then reset the value  to zero.Real Timer would count ⌊⌋ of unit time.⌊⌋ means the largest integer which is smaller than .At the end of the count, Real Timer would request time advance with  min through RTI Interface.
Figure 2: The procedure of time advance.Memory, Real Timer and RTI Interface.They are designed to ensure that the time scale in simulation is identical with that of real world time.RTFederate would be an independent federate in HLA, and its time management strategy is set as both Constrained and Regulation.
: derivative coefficient of -axis force (body axis) caused by the deflection of elevator;  V : derivative coefficient of rolling moment caused by velocity;   : derivative coefficient of rolling moment caused by attack angle;  α : derivative coefficient of rolling moment caused by changing rate of attack angle;   : the derivative coefficient of rolling moment caused by pitch rate;    : the derivative coefficient of rolling moment caused by throttle control lever;    : the derivative coefficient of rolling moment caused by the deflection of elevator; Δ . The symbols are as follows: ΔV: change value of plane velocity, state variable; Δ: change value of attack angle, state variable; Δ: change value of pitch angle, state variable; Δ: change value of pitch rate, state variable;  V : derivative coefficient of -axis force (body axis) caused by velocity;   : derivative coefficient of -axis force (body axis) caused by attack angle;   : derivative coefficient of axis force (body axis) caused by pitch angle;    : derivative coefficient of -axis force (body axis) caused by throttle control lever;  V : derivative coefficient of -axis force (body axis) caused by velocity;   : derivative coefficient of -axis force (body axis) caused by attack angle;  : change of deflection angle of elevator; and Δ  : changes of the position of thrust lever.

Table 1 :
The step intervals around the first peak value.

Table 2 :
The step intervals around the relative stable region.
+1 .Otherwise the advance time is shortened half again until the two state variables have the same signs.

Table 3 :
Comparing QSS with analytic result.