THE SIMULATION OF DYNAMIC SYSTEMS USING COMBINED MODELLING

<jats:p>The new approach to the problems of dynamic systems simulation is proposed. The analytical and imitation modelling of non‐linear complex dynamic systems which comprise simulation of continuous and discrete processes with constant and variable parameters, are investigated. The aggregate mathematical modelling scheme [1] and the method of control sequences for discrete systems specification and simulation are used as well as the dynamic mathematical modelling scheme for continuous process formalization and modelling. According to them the investigated systems are presented as the set of interacting piecewise linear aggregates, which can include processes described with differential equations. The above mentioned approach is used in developing software for the construction and research of the models. The modelling of the dynamic systems’ control is also analyzed and developed software for the dynamic systems’ simulation is presented. It is related to the proposed combined modelling methodology. The developed dynamical simulation system ADPRO (Automatic Differentiation PROgram) extends applicability of the system SIMAS (SIMulation of the Aggregate Systems) [2] with dynamical simulation means realized with APL2 (A Programming Language 2) and based on automatic differentiation [3]. The created model of service process and its control can be used as a base for other models of wide class complex dynamics’ systems [4], the parts of which are described with differential equations.</jats:p>

section_content: In order to use and control various dynamic processes, more and more complex control systems are being created. Simulation becomes a main part of hybrid dynamic system (HDS) analysis. Often it is the only possible way t o investigate continuous and discrete system control. There is a need for special simulation systems in which the models of HDS components can be created, interconnected and changed as the system evolves. Such components can have hybrid behavior, consisting of continuous-time phases separated by discreteevent transitions. Components can be developed and evolved independently, or they may i n teract through their inputs and outputs according external and internal events. The low and conditions of dynamic process can be changed in simulation time. 

The simulation can be used for: analysis of system states in di erent c o n trol conditions analysis of discrete events statistic and system states dynamic (in order to estimate reliability, optimize various processes and their control, etc. ) The main problems of HDS simulation are the disadvantages of aggregate mathematical modelling software and its application, the modelling problems of non-linear complex HDS and the disadvantages of simulation of system's control an observe process. 

In order to solve the problems of complex system model construction and realization we use aggregate mathematical modelling scheme (A-scheme) based on the set of interacting piecewise linear aggregates (PLA) and a method of control sequences. The above approach is used in developing software for the construction of models. The simulation system SIMAS (SIMulation of the Aggregate Systems) has been developed at Kaunas University o f T echnology and represents the software of this type. The experience of usage of aggregate mathematical modelling scheme in the development of system models, which separate parts are described by di erential equations or their systems, has demonstrated the disadvantage of this scheme. 

In other case, the dynamic mathematical modelling scheme (D-scheme) based on di erential equations and their systems is more useful for continuous deterministic system modelling. So it needs the tools which could ensure the solution of general m-th order di erential equations and general systems of rst-order di erential equations. For this purpose there is used and developed automatic di erentiation method 3 5], which p r o vides an elegant a n d conceptually simple solution of an ordinary non-linear di erent equation. Automatic di erentiation is an untraditional approach to di erentiation. While symbolic di erentiation uses "the rules" with symbols, automatic di erentiation uses "the rules" with values. Calculations are performed in a system of vectors. 

The ability of APL2 to "think" in terms of vector operators makes it an ideal language for implementation of automatic di erentiation. In contrast to other languages, the APL2 code of automatic di erentiation is very simple. The large and expandable library of operators and functions and the language orientation to the operation with vectors imitate mathematical symbolismin APL2. These mentioned features t in automatic di erentiation very well 6].
section_name: INTRODUCTION

section_content: In the application of the aggregate approach for system speci cation, the system is present e d a s a s e t o f i n teracting PLA. For this part of investigations the theoretical background is PLA formalism, which permits to use the single formal speci cation for the development of the models. It is very important for design of distributed and complex systems 1 2]. 

In practice one of the main steps of complex system aggregate model creation is de ning the model structure. An example is presented in g. 1. A lot imitating complex systems consist of separate autonomous parts, which exchange information without any loss and distort. In such case each part (aggregate in A-scheme) is created separately and independently from mathematical model of other parts. So any aggregate (as example Service Unit in g. 1) can be realized using D-scheme, i. e. using di erential equations. In fact the A-scheme and the method of control sequences for discrete systems speci cation and simulation at the same time are used with the dynamic mathematical modelling scheme for continuous process formalization and modelling. The investigated systems are presented as the set of interacti n g P L A, w h i c h include processes described with di erential equations. The above mentioned approach is used in model speci cation and implementation with developed software. Formal speci cation of each aggregate is used for the construction and research o f s i m ulation programs. Below there is an example of aggregate speci cation, which presents description of one aggregate from analyzed service system with hybrid process of service unit 5 6]. 

Aggregate: Server 1. Input signal set: X = fx 1 x 2 g SIMAS (see g. 2) is the simulation system, which is using aggregate specications. This system is used for the automatic development o f t h e s i m ulation models and their analysis. SIMAS has been developed on the basis of aggregate mathematical modelling scheme. The simulated system is divided into subsystems. The subsystems are described in accordance with the mathematical aggregate scheme, and their interconnections are described in accordance with the aggregate connection rules. Using those descriptions SIMAS creates the programs of simulation models automatically. Subsystem of execution of experiment executes the tasks using the program written in SIMAS EXPERIMENT language. The subsystem sequentially performs all the aggregated system investigation stages: simulation, data collection, analysis and reporting.
section_name: SIMULATION OF THE AGGREGATE SYSTEMS

section_content: As usually for modelling dynamic continuous process there are used n-order di erential equations. The solution of di erential equations can be various functions. In order to use the general function form it is convenient to get it as Taylor row. In such case the main problem is to calculate the high order derivatives y (k) (x), then k > > n. For solving this problem we use the automatic di erentiation method 3 4 ]. Numerical methods could be used to obtain approximate answer rather quickly, but the di culty of obtaining reasonable accuracy grows with the order of the derivative. Automatic di erentiation is a quite di erent approach that is theoretically exact and easy to use in practical computing. Automatic di erentiation makes it possible to evaluate high-order derivatives of function at a point with accuracy equal to that provided by symbolic di erentiation, but at a fraction of the cost in computer time and memory. So from a practical viewpoint, the method is unmatched in its ability to calculate the value of high-order derivative s a t a p o i n t. 

Automatic di erentiation is interesting in mathematical point of view and, when it is implemented in APL, it is a powerful, accurate, clear, and practical tool for nding the numerical value of derivatives at a point. The main calculations are performed with vectors in following form (y y 0

x y 00 x ::: y (k)

x ). This vector is counted by combining the formal rules of di erentiation with numerical evaluations of derivatives as they are produced step by step. The row elements are being recursively generated and Taylor row is found from them. So for various implementations of automatic di erentiation it is also possible to manipulate with one common expression -the Taylor row coe cients or the derivatives vector of analyzed function (y y 0

x y 00 x : : : y (k)

x ). All above presented features are very useful in implementation and simulation of dynamic process. It is necessary to mention that the using of automatic di erentiation does not give special possibilities to analyze the convergence of counted power row, because in most cases it is impossible to get analytical expression of row n-th element. This method is very proper if exists solution of the di erential equation expressed in power row. Automatic di erentiation can be used very successfully in some calculations of engineer practice and various experimental researches where it is possible to estimate the solution empirically. 

The method of recursive evaluation of higher-order derivatives by using a vector operation is the base for created dynamical simulation tools. The main functions of dynamic simulation system ADPRO are to calculate highorder derivatives of function at a point, solve general m-th order di erential equations and general systems of rst-order di erential equations and generate Taylor polynomial coe cients. All these calculations can be used in other software. For ADPRO i n teraction with user and other simulation systems it is implemented various data exchange means and created special interface. According to the performing functions and distribution of information the structure of simulation system ADPRO can be divided into ve subsystems and three libraries ( g. 3). 

The external task library consists of separate task les. The internal task library is used in order to save the tasks formulated by dialog between system and user. The external result library saves the main results, which can be used as data in other systems. In order to exchange with information among di erent libraries, subsystems and users of the system, there was developed a language DIFLAN. The di erential equations used in ADPRO system are described according to the operators and special rules of this language. The form of m-order di erential equation is: where Y k ] corresponds to k-th function system Y k (X). In order to express function F m there are used the same operators and laws as in expression of di erential equation, but in this case there are used new variables: X Y 1 ] : : : Y m ]. Such form is the same as one dimension APL2 matrix, as the base of DIFLAN rules is APL2 language. In contrast to other languages, the APL2 code of di erential equation solving using automatic di erentiation is not so complicated 6]. A large and expandable library of operators and functions and the language orientation to the operation with vectors t for dynamic process simulation as well as for interface needs. 

As a rule analytical and imitation modelling is used separately. A preliminary decomposition of real system to subsystems and the usage of the most suitably modelling method enables to avoid big generalization or pettiness of the model. Combined (analytical & imitative) modelling joins both methods advantages and avoids many of their disadvantages 5]. 

In this case for modelling there are needs for speci c mathematics methods and software. At rst created aggregate simulation system SIMAS was joined with another simulation system ADPRO ( g. 4). For this purpose at rst their was developed the system of automatic di erentiation 4] which was expanded to the universal dynamic simulation system ADPRO. This system can be managed with dialog or with data les. The results and initial data can be presented directly on the screen in case of dialog regime, or in data and results le, in case of autonomic work regime. The main purpose of autonomic work regime is the integration of system ADPRO to other simulation systems. Subsystem EXEC and AD use this regime. 

The integration subsystems must ensure the links between the system AD-PRO and other programs in PASCAL language (as example the system SIMAS). 

The subsystem AD forms the task for the ADPRO according to the received requirements i. e. AD forms the external task library. Then received results from system ADPRO are written to the external results library. Then if need subsystem AD solves another problems and gives the solutions to initialization program SIMAS.
section_name: SIMULATION OF DYNAMIC PROCESSES

section_content: The general control system can be a part of dynamic systems in which c o n trol is expressed in continues laws -di erential equations. The model of process control often is divided into two separate parts: control subsystem and dynamic process. Currently investigations are performed during speci cation and simulation of complex control systems with continuous and discrete control and process components. When the general control scheme un t, the dynamic processes are observed and managed according to the logical laws. An example, can be a service unit in which the process is stopped in every observation and if the process reaches certain conditions, the manager can change the law of process functioning 6]. The created service unit ( g. 5) is independent aggregate system, which can be an extension of other systems, e. g. the extension of aggregate system presented in g. 1. The structural scheme of whole aggregate model consists of such aggregates: Stream1, Stream2, Server, Manager, Observer and Process. All aggregate relations and corresponding signals are speci ed according to the given method. A conceptual model and the informal description of each aggregate must be presented in terms of aggregate approach. 

For example it is possible to model a service unit, which at rst works according to one law, and after it reaches the de ned state -according to second law. Each l a w o f c o n tinuous process with changeable parameters can be de ned as di erential equation or their systems. The investigated process in the rst part where t 2 (T 0 T 1 ) is described by di erential equation, which depends on the time t and changeable parameter K. The parameter K represents the intensity of service and itself can be dependable on service request Y (as example K = 3 p Y ). 

In order to show the possibilities of combined modelling approach a s the rst part of process we h a ve to use equation dy dt = K t, w h i c h common solution is y = K 2 t 2 + C. Lets analyze the case when C = 0, i. e. it is valid condition: y = 0, when start time moment t = 0. 

The service law m ust be changed at the moment Tx, when service process has been reaches the state y = Y = 2. As example of the law of the second service part could be equation dy dt = K (T x ; t), which common solution is y = K(T x t; t 2 2 ) + C. If again C = 0 and imitation start time moment t = 0, then service process would continue at the same state y(T x ). 

In the investigated system at the time moments T 2 f T 0 T x g the manager change the law of y velocity, i. e. the y 0. The management can delay the random time interval, which is distributed according to the uniform law in some interval, as example 0, 2K/60]. In the service process delay interval, its state leaves the same ( g. 6 left part). The modeled service system with a lot di erent delays in each aggregate can imitate the delay of observing, which also in uences service process prolongation. It is possible to simulate observing intensity, which dependents on current service process state. In this case the observing probability could be p(t) = y(t)= Y. Then observing intensity is as high, as process state is close to the some value Y and at the same time the process delay is as long, as high is observing intensity. 

All processes in service system can be executed as long as we c o n tinue the experiment of the system imitation. The service unit functioning dependents on the intensity o f c l i e n t's streams and server work. So in order to investigate whole service system functioning is necessary to simulate the whole system. According to the aggregate approach there are possibilities for the appropriate aggregates interconnections and analyzes of the whole modeled service states z(t) 2 Z, w h e r e t 2 0 T 1 ]. An example of states graphic, when T 1 = 1 2 0 i s presented in g. 6. Time T 1 is process nish time (T 1 2 T). 

According to the last graph ( g. 6 right part) we can conclude: in the model the service velocity y 0 (slope of curve) dependents on client request Y the process control and observe delay corresponds to provided features. 

In this case the delays between di erent client services dependents on inten-Figure 6. The graphics of modeled service process states in di erent i n terval size. sity of service streams, server queue states and also client requests. So the decomposition of service system structure and functions enables to simulate hybrid dynamic system with detail analysis of its elements and their interconnections. It is possible to conclude that combination of mentioned methods provides an elegant and conceptually simple solution of dynamical systems and their control simulation problems.
section_name: CONTROL AND OBSERVE SIMULATION

section_content: Developed combined modelling method (based on imitative and analytical modelling methods) joins aggregate and dynamic modelling schemes and extends the possibilities of their usage. 

Created simulation software SIMAS+ADPRO using PASCAL and APL2 languages extends modelling of systems with new speci c features, which e nable to model complex systems with non-linear continuous and discrete processes and their control more simply. 

Created service system control model can be used for creation of other models of various complex dynamic systems 4 6], the parts of which are described with di erential equations.
section_name: CONCLUSIONS