Algorithms and Data Structures for the Modelling of Dynamical Systems by Means of Stochastic Finite Automata
Total Page:16
File Type:pdf, Size:1020Kb
R . Logozar Algoritmi i podatkovne strukture za modeliranje dinamičkih sustava s pomoću stohastičkih konačnih automata ISSN 1330-3651 UDC/UDK 519.713:004.383 ALGORITHMS AND DATA STRUCTURES FOR THE MODELLING OF DYNAMICAL SYSTEMS BY MEANS OF STOCHASTIC FINITE AUTOMATA Robert Logozar Original scientific paper We elaborate on the design and time-space complexity of data structures and several original algorithms that resulted from the DSA program – a tool that simulates dynamical systems and produces their stochastic finite automata models according to the theory of -machines. An efficient batch iteration algorithm generates the system points and their binary symbols, and stores them in circular buffers realized asclass member arrays. The words extracted from the time series are fed into a dynamically created binary tree of selected height. The tree is then searched for morphologically and stochastically unique subtrees or morphs, by aid of an algorithm that compares (sub)trees by their topology and the descendant nodes' conditional probabilities. The theoretical analysis of algorithms is corroborated by their execution time measurements. The paper exemplifies how an implementation of a scientific modelling tool like the DSA, generates a range of specific algorithmic solutions that can possibly find their broader use. Keywords: algorithms, data structures, time-space complexity, dynamical systems, stochastic finite automata Algoritmi i podatkovne strukture za modeliranje dinamičkih sustava s pomoću stohastičkih konačnih automata Izvorni znanstveni članak Razmatramo dizajn i vremensko-prostornu kompleksnost podatkovnih struktura i originalnih algoritama proisteklih iz DSA programa – alata za modeliranje dinamičkih sustava s pomoću stohastičkih konačnih automata prema teoriji -strojeva . Učinkovita grupna iteracija generira točke sust ava i njihove binarne simbole, te ih pohranjuje ukružne spremnike realizirane s pomoću klasnih članskih poredaka . Riječima ekstrahiranim iz vremenskog niza hrani mo dinamički kreirano stablo odabrane visine. U stablupotom nalazimo morfološki i stohastički jedinstvena p odstabla ili morfo ve, uz pomoć algori t ma koji uspoređuje (pod)stabla prema njihovim topološkim odrednicama i uvjetnim vjerojatnostima čvorova nasljednika. Teorijska analiza algoritama potkrijepljena je mjerenjem vremena njihovogizvođenja. Članak ilustrira kako implementacija znanstveno-programskog alata za modeli ranje kao što je DSA, generira paletu specifičnih algoritamskih rješenja za koje možebitno postoji i šira uporaba. Ključne riječi: algoritmi, podatkovne strukture, vremensko-prostorna kompleksnost, dinamički sustavi, stohastički konačni automati 1 or for details [5, 4]). Being based on the object oriented Introduction programming paradigm, the DSA program's foundations are prepared for easy upgrading, which includes installing Modelling of dynamical systems by means of new dynamical systems, adding new data presentations, and computation automata is introduced by the physicists John providing overall better functionality. P. Crutchfield and his team of collaborators in the theory of Asidefrom the many interesting features and -machinesfrom the area of computational mechanics [1, capabilities of the DSAprogram from the programmer's and 2]. Unlike the common way of solving the system user's aspects, in this paper we take the role of a computer differential (difference) equations numerically, the theory scientist who is interested in the implementation details of uses computing methods to analyse the time series emitted the program, and particularly in the design and efficiency of from a system, and the computational automata to present its core algorithms. This will be the main subject of our the system model. The introduced interdisciplinary work. To physicists interested in the modelling of approach brings in new and challenging problems to be dynamical systems, such analysis can help to understand the analysed by the computational and information-theoretic underlying computing complexity needed to build the tools, and opens a great arena for practical programming. model, and to computer scientists it can offer an insight into This fusion of physics and computer science motivated our several original algorithms that are needed in a work, too, from which in this paper we present a variety of comprehensive programming tool like this. Many of these data structures and several original algorithms that were ideas and solutions can find their application in general use, implemented in ourDynamical Systems Automata (DSA) with little or no adaption. Furthermore, we have equipped program. Programming of a comprehensive modelling tool the program with time measurement functionality for all of like this one requires a detailed knowledge of the theory its key algorithms, so that, besides the modelling task, it can behind it. A more in-depth background of the -machines serve for the performance tests. theory modelling scheme, aimed for the readers from the The article is organized as follows. Sec. 2 is devoted to computing, information-theoretic, and broader area, can be an extra short exposé of the -machines modelling scheme, found in the author's paper [3]. in order to provide an overview of the tasks that needs to be The development of the DSA software started with the done by the main program modules. A brief introduction to work presented in [4]. From the beginning the program was the iterative systems is aimed to illustrate how the time envisioned as more than just a theoretical tool with limited series is obtained from a dynamical system. In Sec. 3 we practical usability. With its graphical user interface (GUI), describe the algorithms of the program module that iterates the DSA program enables interactive investigation of the system orbit points and provides their binary coding. several implemented 1-dimensional dynamical systems, Here the concept of batch iterations– based on the and should serve as a practical and user friendly scientific implementation of a circular buffer– is used to assure tool. It finds out the system's computational models up to the efficient generation of millions and billions of points if so level of the stochastic finite automata, which present the needed. In Sec. 4 we deal with the dynamically created crucial deterministic step of the theory (see the next section, binary parse tree, which is fed with the words extracted Tehnič ki vjesnik 19, 2(2012), 227 -242 227 Algorithms and data structures for the modelling of dynamical systems by means of stochastic finite automata R . Logozar from the time series. The tree-feeding process is time Herexnn is the system orbit point in the discrete time , and consuming if one wants to achieve statistically relevant xnn+1 is the point in the next moment + 1, obtained by the number of substrings. This is followed bya n original action of some mapping functionF . A standard textbook nonrecursive algorithm for the (sub)tree comparison. The example of nonlinear dynamical system with chaotic final stage of the modelling is finding the unique subtrees or behaviour is the famous logistic function: morphs, which is presented in Sec. 5. The theoretical analysis is backed up by the concrete time measurements, and x + = rx (1- x ), x Î[0,1]. (2) concluded inS ec. 6. n 1 n n n Because of the high volume of thisapplied algorithmic ££ odyssey, in several places we shall be forced to skip more For it, the interesting range of parameter is 0r 4. detailed approach in order to round up thesubject . We hope The function can be plotted in thexxnn+1 versus graph, this will be recognized not as a deficiency, but as a prospect yielding the parabola as shown in Fig. 1. The graphical for the future work. Also, we wish that a few original solution of the equation (2) withr = 4,0 is given for the first algorithms and programming solutions that follow will make 13 points of the system orbit. The superimposed identity the rest of the paper an interesting and useful reading. linexxnn+1 = serves to provide the iteration by mapping the function resultxFxnn+1 = ( ) back to the abscissa domain, and 2 to enable finding of the next pointxFxnn+2 = ( +1 ). In the Modelling of dynamical systems – from binary strings to the example shown, we start with theseed point x0 = 0,2 and stochastic finite automata make 12 iterations for the total of 13 points. The last iterated point isx13 0,99993842…. The system progresses further To build computation automata models of dynamical with a fully chaotic behaviour. The "graphical" solution systems, their orbit point coordinates should be encoded in presented in Fig. 1 is in fact drawn after the numerical symbolic presentation. The strings of symbols can then be calculations done by the DSA iteration module with the analysed in a way analogous to the operation of computer standard double floating precision. language processors. Physically and epistemologically we can depict this as ameasuring instrument that is installed by an observer and modell er of a dynamical system. The , instrument measures the point coordinates and encodes them suitably, transforming the orbit into atime series . This is , generally a string of symbols of indefinite length, in which a new symbol is added upon every discrete system iteration. , From the time series we extract the strings of defined length, which shall be called words, and build our automata-based , computational model. In the process we check the model size on different levels and try to makeit minimal. On the other , hand,