devs for continuous system simulation: application to asynchonous machine
DESCRIPTION
Modeling and Simulation of Complex Systems Using DEVS formalism: application to Asynchonous MachineTRANSCRIPT
![Page 1: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/1.jpg)
French University of EgyptFaculty of EngineeringComputer Department
Modeling and Simulation of Complex Systems Using
DEVS Formalism :
Application to Asynchronous Machine.
Graduation project
2010
Prepared bySamuel TOMA
Supervised byLaurent CAPOCCHI
1
![Page 2: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/2.jpg)
Acknowledgments
I want to thank in the first place my internship director Mr. Laurent Capocchi
for his time, patience, encouragement, instigating me to do my best and his precious
advice.
Also I want to thank the director of the CNRS UMR 6134 lab. Prof. Paul-
Antoine Bisgambiglia for the chance he gave me to secure this internship and for his
help throw all administration work.
I want to say a special thanks to Mr. Fabien Flori who gave me great moral
support throughout this internship and for his help and availability at any time during
this period.
Finally I want to thank my family who sacrificed much morally and materially
for me during the period of this internship.
2II
![Page 3: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/3.jpg)
Table of Contents
Introduction................................................................................................1
The report organization:................................................................................3
Chapter 1
State of Arts.................................................................................................4
1.1 DEVS formalism.......................................................................................4
1.1.1 DEVS modeling:.........................................................................................4
A. Atomic model:..............................................................................................5
Example 1:.....................................................................................................6
B. Coupled model:..............................................................................................7
Example 2:.....................................................................................................9
1.1.2 DEVS simulation:....................................................................................10
1.1.3 DEVS tools:...............................................................................................11
1.2 Quantized State Systems (QSS):...........................................................13
1.2.1 State quantization....................................................................................13
1.2.2 Second-order quantization (QSS2):.......................................................14
1.2.3 Third-order quantization (QSS3):.........................................................15
1.3 DEVS, QSS and continuous system simulation:..................................16
1.3.1 Integrator:................................................................................................16
1.3.2. Low pass filter:........................................................................................16
3III
![Page 4: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/4.jpg)
A. Mathematical model:...................................................................................16
B. Implementation:...........................................................................................18
C. Results..........................................................................................................19
1.4 Conclusion:.............................................................................................20
Chapter 2
Asynchronous Electrical Machine..........................................................21
2.1 Mathematical model:.............................................................................21
2.1.1. Stator model:..........................................................................................22
2.1.2. Rotor model:............................................................................................23
2.1.3. Electromotive force model:...................................................................24
2.1.4 The electromagnetic and mechanical couples:......................................25
2.2 Implementation by Matlab/Simulink©:...............................................27
2.2.1Simulink©:................................................................................................27
Simulation Results:...........................................................................................29
A. Time Domain:.........................................................................................29
B. Frequency domain:..................................................................................30
Chapter 3
AEM DEVS Implementation..................................................................31
3.1 DEVSimPy..............................................................................................31
3.1.1 Requirements:..........................................................................................31
3.1.2 Features:...................................................................................................32
4IV
![Page 5: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/5.jpg)
3.1.2 Demonstration of DEVSimPy:................................................................32
A. How to create the CPU models:...................................................................34
B. Start a simulation:........................................................................................38
C. View results:.................................................................................................39
3.2 DEVSimPy machine model:..................................................................40
3.2.1 Full model:................................................................................................40
3.2.2 Detailed model:........................................................................................42
A.Inputs/Outputs:.............................................................................................42
I.Inputs:.......................................................................................................42
II.Outputs:...................................................................................................42
B.Stator and Rotor:..........................................................................................43
I.Stator.........................................................................................................43
II.Rotor........................................................................................................44
C.Electromotive force: ....................................................................................45
D.Coupling:.....................................................................................................46
I.Electric-coupling:.....................................................................................46
II. Mechanic-Coupling:...............................................................................46
E.The Algebraic Loop break:...........................................................................46
3.3 Simulation results...................................................................................47
3.3.1. Safe operation:........................................................................................47
3.3.2. Unbalanced machine:.............................................................................50
A.Unbalanced stator:.......................................................................................50
B.Unbalanced rotor:.........................................................................................52
C.Unbalanced rotor and stator:........................................................................53
Chapter 4
Analysis and Conclusion..........................................................................54
5V
![Page 6: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/6.jpg)
4.1 DEVS and QSS Analysis........................................................................54
4.1.1 Points of interests.....................................................................................55
A. Time.............................................................................................................55
B. Quantum value ............................................................................................55
C. algebraic loop breaking................................................................................55
4.1.2 Perspectives..............................................................................................56
4.2 Conclusion...............................................................................................57
Annex.........................................................................................................58
A. DEVSimPy RQ atomic model code:......................................................58
B. DEVSimPy PC atomic model code:........................................................60
6VI
![Page 7: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/7.jpg)
List of Tables
Table 1: DEVS tools.......................................................................................................12
Table 2 Machine Parameters...........................................................................................28
Table 3: CPU input.........................................................................................................38
Table 4: Stator coefficients.............................................................................................44
Table 5: Rotor coefficients..............................................................................................44
7VII
![Page 8: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/8.jpg)
List of Figures
Figure 1: DEVS Generator trajectory...............................................................................7
Figure 2: Couplings in DEVS coupled models.................................................................8
Figure 3: PC DEVS modeling..........................................................................................9
Figure 4: Computer coupled model................................................................................10
Figure 5: Simulation model............................................................................................11
Figure 6: QSS1...............................................................................................................13
Figure 7: QSS2...............................................................................................................14
Figure 8: QSS3...............................................................................................................15
Figure 9: DEVS model implements the QSS.................................................................16
Figure 10: Circuit model of a low pass filter..................................................................16
Figure 11: Low pass filter, Bode diagram.......................................................................17
Figure 12: low pass filter model on DEVSimPy............................................................18
Figure 13: DEVSimPy comparison model.....................................................................18
Figure 14 Simulation results...........................................................................................19
Figure 15: Circuit oriented model...................................................................................21
Figure 16: Stator circuit model.......................................................................................22
Figure 17: Rotor circuit..................................................................................................23
Figure 18: Simulink© model..........................................................................................28
Figure 19: Velocity.........................................................................................................29
Figure 20: Rotor time scope...........................................................................................30
Figure 21: Stator time scope...........................................................................................30
Figure 22: Stator spectrum..............................................................................................30
Figure 23: Rotor spectrum..............................................................................................30
Figure 24: DEVSimPy main window.............................................................................33
Figure 25: New model wizard........................................................................................34
Figure 26: Library...........................................................................................................35
Figure 27: Properties.......................................................................................................35
Figure 28: Model code....................................................................................................36
Figure 29: Coupled model in DEVSimPy......................................................................37
Figure 30: Simulation bar...............................................................................................38
8VIII
![Page 9: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/9.jpg)
Figure 31: Output Spread Sheet......................................................................................39
Figure 32: Full model (AEM).........................................................................................41
Figure 33: Stator model..................................................................................................43
Figure 34: Electromotive force model............................................................................45
Figure 35: Electric-coupling...........................................................................................46
Figure 36: Mechanical coupling.....................................................................................46
Figure 37: stator currents................................................................................................47
Figure 38: rotor currents.................................................................................................47
Figure 39: stator currents (Simulink©)...........................................................................48
Figure 40: rotor currents (Simulink©)............................................................................48
Figure 41: stator spectrum..............................................................................................48
Figure 42: rotor spectrum...............................................................................................48
Figure 43: rotor spectrum(Simulink©)...........................................................................49
Figure 44: stator spectrum(Simulink©)..........................................................................49
Figure 45: Velocity (Simulink©)....................................................................................49
Figure 46: Velocity ( DEVSimPy ).................................................................................49
Figure 47: Electrical machine.........................................................................................50
Figure 48: stator (unbalanced stator)..............................................................................51
Figure 49: rotor (unbalanced rotor)................................................................................51
Figure 50: stator (unbalanced stator) Simulink©...........................................................51
Figure 51: rotor (unbalanced stator) Simulink©.............................................................51
Figure 52: rotor (unbalanced rotor)................................................................................52
Figure 53: stator (unbalanced rotor)...............................................................................52
Figure 54: stator (unbalanced rotor) Simulink©.............................................................52
Figure 55: rotor (unbalanced rotor) Simulink©..............................................................52
Figure 56: rotor (unbalanced stator rotor)......................................................................53
Figure 57: stator (unbalanced stator rotor).....................................................................53
Figure 58: stator (unbalanced stator rotor) Simulink©...................................................53
Figure 59: rotor (unbalanced stator rotor) Simulink©....................................................53
9IX
![Page 10: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/10.jpg)
Abstract
Modeling and simulation for a long time have used time discretization, a new
approach is taking place now called discrete event system (DEVS) . This new
approach uses a state quantization (QSS) to transform continuous system into discrete
event system. The aim of this study is to prove that the combination between DEVS
and QSS is capable to simulate a continuous system presented with differential
equations. This work shows very interesting results but still need more research work to
be able to compete with other approaches.
10X
![Page 11: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/11.jpg)
Résumé
Pour une longue durée la simulation et la modélisation utilisaient la
discrétisation en temps, mains maintenant un nouveau formalisme vient d'apparaitre qui
s'appelle DEVS ( Discret EVent system Specification). Ce formalisme utilise la
méthode QSS qui de son tour transforme les systèmes continues en un autre système
discret. Le but de ce projet est de prouver que la combinaison entre DEVS et QSS est
capable de simuler un système continue présenté par des équations différentiels. Ce
travail a des résultats très intéressante mais toujours a besoins du travail de recherche
pour être capable de ce combattre contre les autres méthodes.
11XI
![Page 12: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/12.jpg)
Introduction
The renewable energies systems are taking nowadays a big part of our daily
lives. Whatever it is the solar energy, the wind energy or the hydraulic energy, we have
to use these form of energies in the next decades through advanced equipment requiring
inevitably maintenance.
The windmills are machines that use the motive wind force and transform the
mechanical energy into electrical energy. To do this transformation they use three-phase
asynchronous machines where different models exist mixing electronics coupled and
mechanics. although this type of system is known for its robustness. There is many
types of failure that can affect the motor behavior and leads to the machine breakdown.
The asynchronous machine diagnostic is a research domain. Around the world many
researchers works on the fault detection model of these machines in order to prevent
the machine malfunctioning in real time if it is possible.
The three-phase electric machine model based on non-linear differential
equations was accepted by the scientific domain community for several years now for
its simplicity and representation accuracy. Generally this model is implemented by
Matlab/Simulink© and the fault diagnostic simulations take place with the famous
MathWork© program. The integration methods are used by Matlab/Simulink© are
based on time quantization using methods like Runge/Kutta. Those methods are well
known and kept as references for resolving differential equation. However, a new
integration approach depends on the state quantization begins to take place and produce
interesting results. This method is based on the modeling with discrete-event systems
(DEVS) coupled to the new theory of the quantization state (QSS). This report has a
main goal to prove this new approach using the modeling of asynchronous machines.
At the beginning of eighties DEVS (Discrete EVent system Specification) was
introduced by the professor B.P. Zeigler [2]. This formalism gives us the option to
represent the systems behavior using discrete events. The QSS (Quantized State
System) method allows to quantize the states of a system [10]. More specifically, QSS
leads us to a new integration approach for continuous systems. Indeed, the integration
1
![Page 13: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/13.jpg)
does not use with the time discretization but state quantization. This quantifiable nature
presented by QSS is surely presentable with DEVS. So, we can find DEVS models that
implements the integration methods of QSS [2]. In this report we will present some of
these models that will be used to implement the asynchronous machine.
Although, we can find a good number of programs that gives us the option to
model and simulate systems with DEVS formalism and we will choose DEVSimPy
(DEVS simulator in Python). DEVSimPy is a program coded in Python language and
present in form of libraries of components.
2
![Page 14: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/14.jpg)
The report organization:
This report begins with an explanation of DEVS formalism , that presents the
two main models of it. Then talks about the simulation algorithms, and how DEVS go
throw a simulation using a hierarchical and modular way. We use some examples that
shows how to model any discrete event system using DEVS.
Second part of the first chapter talk about the quantized state system. The QSS
as a new approach to integrate systems using the state quantization and not the time
discretization. Combining both QSS and DEVS gives us the opportunity to show you
an implementation of a low pass filter which is based on the integration of a signal that
will be quantized by the state quantization.
Before starting to implement the asynchronous machine machine we will study
the mathematical model and divide it into blocks so we can implement it as different
models using DEVS formalism. After this abstract part we will introduce our reference
that we will be compared to our results with which will be Matlab/Simulink©. This
program represents a reference to us because it uses time discretization which have
been studied for a long time now and we are sure that it is correct because it is
compared before to a real system.
After presenting all the tools, we will introduce DEVSimPy as the environment
that will help to implement the DEVS formalism onto the machine. After then we will
present the machine model on DEVSimPy and then we will present its results.
The last section will show a comparison between the results obtained by DEVS
and QSS using DEVSimPy and the Matlab/Simulink© results. Then we will show the
points that might need more study and analysis.
3
![Page 15: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/15.jpg)
Chapter 1
State of Arts
1.1 DEVS formalism
The Discrete Event System Specification (DEVS) is a formalism introduced by
Zeigler (1976) to describe discrete event system in a hierarchical and modular manner
[11]. A manner way means that the system has input and output ports that allows it to
interact with the external environment. Models in DEVS are presented as boxes that
receive and transmit messages using their input output ports. This formalism is a
distincter between the simulation approach and the modeling approach. The DEVS
modeling approach captures dynamic behavior with atomic models. The formalism
DEVS defines two model categories: the atomic and the coupled model. The atomic
models can be coupled together in a well-defined way to produce more complex
coupled models whose behavior is described by its atomic model and a set of a relation
between those models. The simulation approach is responsible for the automatic
generation of the simulation algorithms.
1.1.1 DEVS modeling:
Starting with the modeling approach divided into two categories will let us to
understand and know how can a real system transform into a DEVS model. Any real
system can be modeled using Discrete Event System into a collection of atomic models
and coupled models. Atomic models are responsible of the model behavior and the
coupled models are responsible to represent the relations and the couplings between
sub-models that could be atomic or another coupled model.
4
![Page 16: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/16.jpg)
A. Atomic model:
An atomic model is a model for a system that has a set of inputs, outputs, states,
transitions functions, a time advance function and an output function [2]. Any atomic
model can be defined by this structure:
M atomic=⟨X ,Y ,S ,ext , i n t , , t a⟩
Where:
• X is a set of inputs
• Y is a set of outputs
• S is a set of states
• i n t : S→S is the internal transition function.
• ext : Q×X →S is the external transition function
◦ Where Q = {(s, e) | s ∈ S , 0 ≤ e ≤ t a (s)} is the set of total states,
◦ e is the time elapsed since the last transition.
• : S→Y is the output function
• t a : S→ R+0,∞ is the time advance function.
The internal transition function describes state changes that occur over time in the
absence of the input.
The external transition function changes the system’s state as a response to input.
The output function produces an output event based on the current state.
The time advance function determines the amount of time that will elapse before the
next internal state transition takes place, assuming no input arrives in the interim.
The models react to two type of events: the external events and the internal
events. The external events come from another models in form of messages. These
messages triggers the external function of the model and update the life time. The
internal functions react for the state changes of the model that represents the internal
events. Then the model calculates the date for the next internal event using the time
advance function. In every moment the system (“the atomic model”) is a state (s). If
there is not any event intervenes so the the system will stay at this state (s) for the time
defined by the time advance function ( t a s ). when the life time of the system is
5
![Page 17: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/17.jpg)
elapsed witch mean that e = t a s the output function ( s ) is activated and
changes its state. But if any event arrives before the end of the system life time (e <
t a s ) so the state changes because of the activation of the external function (
ext s , e , x ). In both cases the system goes to a new state (s') with a new life time
t a s ' and so on.
The life time of the system can be either zero or infinity. When it is zero that
means that the life time of the current state is too small so no external event can arrive
before the next change of state, in this case we call it the transitory state. When the life
time is infinity, the system stays forever at the same state until the arrival of an external
event. This case is called a passive state.
For a better understanding we will see an example to show how can an atomic
model is defined by this structure, Using input and output sets, internal, external,output
and time advance functions.
Example 1:
In this example we have a pulse generator, so it will not react with any inputs
but it will generate a pulse with a unity amplitude. The generator has two basic
variables, phase and σ. The generator is on the “active” phase during the period of the
signal, then at the end period the internal transition function updates the phase and the
σ , so it assigns for the σ the next time to call the internal function and consequently the
output function “λ”.
M atomic=⟨X ,Y , S ,ext ,i n t , , t a⟩
Where:
• X = {}
• Y = {1}
• S = {“passive”, “active”} × R+
• i n t (phase,σ) = (“active”, period)
• ext = Ф
• (“active”,σ) = 1
6
![Page 18: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/18.jpg)
In our Generator example as illustrated in the model and [Figure 1] there is no
inputs but when started in phase “active”, it generates outputs with a specific period.
The generator has the two basic state variables, phase and sigma. Note that the
generator remains in phase “active”, for the period, after which the output function
generates a unity output and the internal transition function resets the phase to “active”,
and sigma to period.
B. Coupled model:
As mentioned before DEVS use the hierarchical notation to describe coupled
model that are consisted of a set of sub-models. A coupled model consists of a set of sub-
models and their couplings [14]. The component can be atomic models or other coupled
models. The coupled model’s behavior is defined by the behavior of its components and the
relation between them. Coupling between those sub-models can be one of the next three
relations:
• External input coupling for coupling between the input ports of the coupled
model and the sub-models inputs.
• External output coupling for coupling between the outputs of the sub-models
and the output of the coupled model.
• Internal coupling for the coupling between outputs of the sub-models and the
7
Figure 1: DEVS Generator trajectory
![Page 19: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/19.jpg)
input of other sub-models inside the coupled model.
[Figure 2] shows two components that might be either an atomic or a coupled model
and the three different types of relation that we can find in a coupled model.
A coupled model is a model for a system that has a set of inputs, outputs, states, a set of
sub-model, influence between those sub-models and the three different types of
coupling between models. Any coupled model can be defined by this structure:
M coupled=⟨ X ,Y , D , {M i} ,{I i} ,{Z i , j}⟩
Where:
• X is a set of inputs
• Y is a set of outputs
• D is a set of sub-component references (names)
• {M i} is a set of sub-component where for each i ∈ D, M i can be either an
atomic DEVS model or a coupled DEVS model.
• {I i} : is set of components influences of i for all
i ∈ D ∪ {M coupled }
• Z i , j is the i-to-j output translation function
◦ Z self , j : X self X j is the external input coupling function (EIC)
◦ Z i , self : Y jY self is the external output coupling function (EOC)
◦ Z i , j : Y iY j is the internal coupling function (IC)
The next example will show how can a coupled model can be defined with the previous
structure.
8
Figure 2: Couplings in DEVS coupled models
![Page 20: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/20.jpg)
Example 2:
In this example we have a CPU model. A CPU is a processor that can execute
on job at a time, which requires a buffer “Ready Queue” to keep the jobs that needs to
be executed by the processor. The Ready Queue keeps the jobs in order until the
processor sends it a done message. When a message arrives while the processor is busy
it is kept into the buffer in a queue. The block diagram shown in [Figure 3] represents
the coupled model, its sub-models and the 3 different coupling types necessary for a
coupled model to take place.
M coupled=⟨ X ,Y , D , {M i} ,{I i} ,{Z i , j}⟩
Where:
• X = {in}
• Y = {out}
• D = {RQ,PC}
• M i = { MRQ(atomic),MPC(atomic)}
• I = Ii are the influences of I
• Z = {
(EOC) = {(PC.in,RQ.in)}
(EIC) = {(CPU.out,PC.out)}
(IC) = {(RQ.out, CPU.in),(CPU.done,RQ.ready)}
}
Like this we have our model for the coupled model. To make sure that this model
will work, implementing it on a DEVS tool will be a great to show how can DEVS
represent this model and simulate it. This implementation shown in [chapter 3] uses
9
Figure 3: PC DEVS modeling
out
PC (coupled model)
RQ CPUout
doneout
in
ready
![Page 21: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/21.jpg)
DEVSimPy as the implementation tool witch is described in [ 3.1 DEVSimPy] .
After showing how can we transform a physical behavior into a model that
describes that behavior into a DEVS model, we will see how can a simulation takes
place using this model.
1.1.2 DEVS simulation:
Every DEVS model is consisted of one and only one coupled model. This
coupled model can be composed of one atomic model as it can be composed of
multiple coupled and atomic model coupled together. As this formalism is based on
a hierarchical manner so we can easily differentiate between the modulation part
and the simulation part. Then the simulation is divided as the modulation into two
categories: coordinator and simulator. Using this hierarchy DEVS is capable to
simulate any DEVS model without implementing a special simulator.
Using the previous coupled model of the processor in [Example 2:] we will
explain the hierarchical form of DEVS as shown in [Figure 4]
10
Figure 4: Computer coupled model
![Page 22: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/22.jpg)
Every coupled model is associated with one coordinator. This last is
responsible of the temporal synchronization between it and its sub-models. Every
coordinator may have under his control a simulator or another smaller coordinator.
All the models are controlled by special coordinator called “Root” [2]. Every
atomic model is associated with one simulator witch is responsible to manage its
behavior.
1.1.3 DEVS tools:
The next table presents the most common tools that are developed in
universities laboratories. So all of them are implemented to help the research
domain.
Nowadays the number of tools implemented for DEVS formalism is growing
too quickly, but still a very few of them uses a simple graphic interface. In this
project we decided to use DEVSimPy for all implementation that needs to be done
here to verify that DEVS formalism is capable to simulate an ordinary differential
equation.
11
Figure 5: Simulation model
![Page 23: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/23.jpg)
Tool CommentsDEVS/C++ ADEVS is a C++ library for developing discrete event simulations
based on the Parallel DEVS and DSDEVS formalisms. It includes support for standard, sequential simulation and conservative, parallel simulation on shared memory machines with POSIX threads. Developed by Jim Nutaro (University of Arizona, U.S.A ).
DEVSJAVA Modeling and Simulation environment for developing DEVS-based models. The software is written in Java and supports parallel execution on a uni-processor. It supports higher-level, application specific modeling. Models in DEVSJAVA can also be readily mapped to DEVS/HLA and DEVS/CORBA for distributed execution in combined logical/real-time settings. Developed by Hessam Sarjoughian (Arizona State University, U.S.A ) and Bernard Zeigler (University of Arizona, U.S.A ).
JDEVS JDEVS enables discrete-event, general purpose, object-oriented, component based, GIS connected, collaborative, visual simulation model development and execution .Developed by Jean-Baptiste Filippi (University of Corsica, France ).
Python DEVS ATOM3 is a tool for multi-paradigm modeling, by Juan De Lara (Autonomous University of Madrid, UAM, ) and Hans Vangheluwe (Mc. Gill University, Canada ). ATOM3-DEVS is a tool for constructing DEVS models and generating Python code for the PyDEVS simulator by Jean-Sebastien Bolduc, developed in ATOM3.
DEVSimPy DEVSimPy is an advanced wxPython GUI for the modeling and simulation of systems based on the DEVS (Discrete EVent system Specification) formalism. Features include powerful built-in editor, advanced modeling approach, powerful discrete event simulation algorithm, import/export DEVS components library and more (University of Corsica, France) [4].
PowerDEVS PowerDEVS is an integrated tool for hybrid systems modeling and simulation based on the DEVS formalism. It runs under Windows 95 or later. The distribution is free and it includes the GNU GCC compiler.The software was developed by Marcelo Lapadula, Esteban Pagliero, Ernesto Kofman, Federico Bergero, Rafael Namias and Gustavo Migoni.
Table 1: DEVS tools
12
![Page 24: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/24.jpg)
1.2 Quantized State Systems (QSS):
The discrete time approach is widely used for quantization of linear and non-linear
ordinary differentials equations (ODE) long time ago. In any advanced software used to
perform the integration of differential equations, many algorithms have been
implemented being explicit, implicit, fixed-time step or variable-time step. However,
all these methods are based on discrete time system and it is very difficult to meet one
specific state without changing the time step (division, multiplication) and increasing
the simulation time. For non-linear systems, since the integration is nothing else than an
approximation, the error evaluation or its boundaries are very important for the choice
of the algorithm and most of the software are offering this capability.
1.2.1 State quantization
In order to perform accurate state evaluation, another approach has been
proposed by E. Kofman in 2001 [9] which is called discrete state quantization (QSS).
QSS, instead of using a discrete time approach it based on discrete event method. The
state quantization has been used in a satisfactory way to integrate simple differential
equations with stable results coming from the choice of a state quantum. Instead of
having a problem of time scale, it is reported to the magnitude scale [Figure 6].
According to the traditional methods, the integration of ODE is always performed by
using time discretization. With QSS algorithms, the discretization is performed using
13
Figure 6: QSS1
![Page 25: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/25.jpg)
the events or more exactly the state variable magnitudes and also a hysteresis function
insures that the model carries out a number of finite states transition during a finite time
set [Figure 6].
The use of the hysteresis avoids the oscillation phenomenon which occurs when the
simulation time step is unique [9],[10]. In general, the QSS method chooses a
quantization step equal to the width of the hysteresis window. When the quantization is
performed, the QSS method gives the time step corresponding with the slope adapted to
the smallest time constant of the ODE.
Unfortunately this QSS method is only first-order, which makes our result
unable to be accurate. To improve the situation, a new QSS method is posted, called
QSS2 (second-order quantized stat systems method).
1.2.2 Second-order quantization (QSS2):
The main difference between QSS and QSS2 is the usage of a first-order
quantization function, the second difference is that a new value is calculated which is
the input slope that wasn't calculated before in the old QSS [8]. By using this first-order
quantization function, makes the output a linear trajectory having some kind of
discontinuities. When difference reaches the quantum (dq)a new line with a different
slope is generated to reach the original form of the signal [Figure 7].
In both QSS and QSS2, the choice of the quantization step is not easy because
it's value is reverse proportional to the simulation time and directly proportional to the
quantization error, so making the quantization accurate will increase the simulation
14
Figure 7: QSS2
![Page 26: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/26.jpg)
time and reduce the simulation error and vice verse.
In order to obtain a third order approximation, we need to obtain not only the sloop of
the input as we did in QSS2 but also a second derivation of the system trajectory.
1.2.3 Third-order quantization (QSS3):
Similar to the upgrade done in the quantization-function, in QSS3 we will
upgrade the quantization-function to be a second-order function [7].
Having thing second-order quantizer makes the output a parabolic lines having some
kind of discontinuities equal to the quantum (dq) [Figure 8].
Using this third order method reduces the simulation time as it reduces the
quantization error by having those parabolic segments. Having 3 different orders for
quantization leave us the choice between them to get the best witch is the third order
method. As said before it reduce the quantization error as the simulation time, which
gives more freedom for choosing the quantization step (dq).[7]
15
Figure 8: QSS3
![Page 27: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/27.jpg)
1.3 DEVS, QSS and continuous system simulation:
The quantization methods described in the previous part is only a simple idea
witch transforms continuous trajectory into a sequence of events depending on their
magnitudes. This simple idea is the basic idea of discrete event simulation (DEVS).
DEVS model can represent the behavior of a static function with piecewise constant
input trajectories. In the next example we will see how an integration equations is
implemented using QSS method with DEVS [10].
1.3.1 Integrator:
integration using QSS method can be represented into two blocks. First one is
the integration itself using the discrete event approach and then the second block is an
hysteresis function to prevent the oscillation of the system. [Figure 9].
this representation can be implemented into only one atomic DEVS model. A full
implementation can be found in [9]
Using this powerful combination between DEVS and the Quantization State
System we can model and simulate differential equations with different orders so
simply.
1.3.2. Low pass filter:
A. Mathematical model:
a low pass filter is generally used to in
electronic circuit but also has some usage in
16
Figure 10: Circuit model of a
low pass filter
Figure 9: DEVS model implements the QSS
![Page 28: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/28.jpg)
simulation as will be shown in [equation 9]. this figure [low pass filter) represents a
first-order low pass filter. This circuit can be represented with a first-order differential
equation as follows:
equation 1
The cut-off frequency known as can be f0 represented as 2π * f 0=w0 and
w0=1
R C where R is the resistance in OHM and C is the capacitance in FARAD.
Trying to make this equation better to use it in DEVS formalism:
equation 2
those two equations are in the time domain, to transform it to the frequency domain it
will be as shown in [equation 3].
using a Bode Plot to explain the behavior:
17
Figure 11: Low pass filter, Bode diagram
equation 3
vou t
v i n= 1
1 j ww0
d vou t t d t
1R C
vou t t =1
RCv i n t
d vo u t t d t
=w0 v i n t −w0 vo u t t
![Page 29: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/29.jpg)
This behavior explains that the low pass filter doesn't affect any signal with a frequency
below the cutoff frequency, while it stops any signal with a higher frequency.
B. Implementation:
Using the integrator shown before in [1.3.1 Integrator] we can implement this
equation so easily with two atomic blocks. The first is a Sum, which can make the sum
in [equation 2] and multiply the entries with the coefficients [w0 ,−w0 ] . The second
is the integrator that integrates d vou t t d t
to obtain only V o u t.
Using DEVSimPy as a tool I developed n SPE Laboratory will help us to model and
simulate our Low Pass Filter.
Like this we have the Low Pass Filter as a coupled model in DEVS formalism
[Figure 12]. Then to run a simulation we will need two Sine waves [100Hz, 10Hz)
generator to be the input and an QuickScope [Figure 13) to see the output.
18
Figure 13: DEVSimPy comparison model
Figure 12: low pass filter model on DEVSimPy
![Page 30: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/30.jpg)
Choosing our w0=300 that means that our cutoff frequency will be
f 0=3002 π
=47.8H z . To test out LPF we will have two sine signals as input with the
same amplitude equal to 1 volt.
C. Results
As we show on [Figure 14], the LPF will affect on the 100 Hz signal because
its frequency is higher than the cut off frequency, but because 100 Hz is lower than 10*
f 0 so we still have an output with a phase near −π / 4 and with a medium
attenuation . If we use a signal with much higher frequency we won't see an output
because of the high attenuation, adding a note that this is only a first-order low pass
filter.
Using QSS as a method to quantize continuous signals and implement models such as
integrators is an approach to minimize the number of points and add to accelerate
simulation using discrete events approach. As shown in the this chapter [1.1 DEVS
formalism] that DEVS is a formalism that is based on two kinds of events: external and
internal. This makes DEVS an object oriented QSS formalism, because both are based
on an event system. Using QSS as a quantization technique and DEVS for its
implementation makes a good simulation technique. We will take benefit of this
association to implement an Asynchronous Electrical Machine.[3.2.1 Full model:]
19
Figure 14 Simulation results
![Page 31: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/31.jpg)
1.4 Conclusion:
This chapter, shows three sections. First the DEVS formalism and its capability
to simulate any event phenomenon as shown in the PC example. Second the QSS
(Quantization State System specification) method which is a quantization method is
based on the quantization of the magnitude. Mixing both DEVS and QSS, and using
QSS to convert from the continuous signals to quantized and transformed to an event
form used by DEVS. Before showing the work done in this project we present the
mathematical model and the tool that will be used to compare the results with
DEVSimPy.
20
![Page 32: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/32.jpg)
Chapter 2
Asynchronous Electrical Machine
Power systems and electrical machines are both generators and consumers of
energy. Predicting the system behavior is necessary during transients or during faults.
In this way, efficient simulation tools are very important for those physicals machines.
This section shows the mathematical model and simulation results of a three
phase asynchronous machine [13]. Simulation is taking place with Matlab/Simulink
program. The mathematical model is obtained by presenting the stator and rotor
currents by differentials equations. This equations are consisted of six first order linear
differential equations with six unknowns.
This simulation will help us to compare its results with DEVS formalism that is
implemented using DEVSimPy tool.
2.1 Mathematical model:
The simplified circuit model of a three-phase induction asynchronous electric
machine is show in [Figure 15]. This model is separated into three different models,
first the rotor, second the stator and third the magnetic coupling between them.
21
Figure 15: Circuit oriented model
![Page 33: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/33.jpg)
The input of the Stator is a balanced three-phase system composed of three sine wave
vast , vbst , vcst :
equation 4: Input Voltage
These composed voltage are calibrated in the three-phase system in advance to
have 6 phase shift on the simple voltage system and an amplitude of 3 times
higher. Every phase is characterized by it own resistance r s and induction L s . The
magnetic interactions between different phases are function of mutual induction Lms
and the other stator currents.
2.1.1. Stator model:
To show how a mathematical model can be implemented, the stator will be a
good example.
Without taking into consideration the magnetic coupling the next [Figure 16] will show
a simple circuit oriented model.
In this model a simplification is taking place by considering that r as=r bs=r cs=Rs
and the same for inductance Las=Lbs=Lcs=Ls .
Applying both Kirchhoff Voltage Low (KVL) and Kirchhoff Current Low
(KCL) to this electric circuit presented in [Figure 16] , a set of ordinary differential
equations (ODE) can be obtained [Equation 5,6).
22
Figure 16: Stator circuit model
v i t=V msin 2 ft−i−1 23
i=1,2ou3
![Page 34: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/34.jpg)
Because of the magnetic coupling between the stator and the rotor there another
factor added to the [equation 6] which is ( EMF as , EMFbs , EMFcs ) that represents
this coupling. This coupling is caused of the mutual induction between the stator and
the rotor and the angle between them.
2.1.2. Rotor model:
Similarly to the rotor witch has an input of a
balanced three-phase system composed of three sine
wave var t , vbr t , vcr t .
Each phase has a characteristic resistance
r r and an inductance L r .The magnetic
interactions between different phases are function of
mutual induction Lmr and the other rotor's
currents. The complete mathematical model for the
Rotor passing by the same steps as the Stator we will
have [equation 7].
23
Figure 17: Rotor circuit
equation 6:
vas=Rr . iasLsddt
ias−Lms
2 [ ddt
ibsddt
i cs]EMFas
vbs=Rr . iasLsddt
ibs−Lms
2 [ ddt
iasddt
i cs]EMFbs
vcs=Rr . iasLsddt
ics−Lms
2 [ ddt
i asddt
ibs]EMFcs
Equation 5:
vas=Rr . iasLsddt
ias−Lms
2 [ ddt
ibsddt
i cs]vbs=Rr . iasLs
ddt
ibs−Lms
2 [ ddt
iasddt
i cs]vcs=R r . iasLs
ddt
ics−Lms
2 [ ddt
i asddt
ibs]
![Page 35: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/35.jpg)
equation 7:
2.1.3. Electromotive force model:
The electromotive force between the stator and the rotor is composed by the
mutual induction Lsr and L rs , the stator and the rotor currents and the electrical
position r .
The equation development of the electromotive force for all phases of the stator
and the rotor ( EMF as , EMF bs , EMF cs , EMF ar , EMFbr , EMF cr ) is giving by the
[equation 8].
equation 8:
[equation 6,7,8] allow to develop the complete mathematical model for the
Stator and the rotor without taking into consideration the temperature influence on the
resistance witch is a classical approximation.
24
var=R r .i arLsddt
iar−Lms
2 [ ddt
i brddt
i cr]EMF ar
vbs=Rr .i arLsddt
ibr−Lms
2 [ ddt
iarddt
icr ]EMFbr
vcs=Rr .i arLsddt
icr−Lms
2 [ ddt
iarddt
i br]EMFcr
EMF as=Lsrddt[ iar cos ribr .cos r
23
i cr .cos r−23
]
EMF bs=Lsrddt[ iar cos r−
23
i br .cos ri cr .cos r23
]
EMF cs=Lsrddt
[i ar cos r23
ibr .cos r−23
i cr .cos r]
EMF ar=Lrsddt
[i ascos ribs .cos r−23
ics .cos r23
]
EMF br=Lrsddt
[i ascos r23
i bs .cos rics .cos r−23
]
EMF cr=Lrsddt [ ias cos r−
23 ibs .cos r
23 i cs .cos r]
![Page 36: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/36.jpg)
this is a non-linear and presents algebraic loops which are coming from coupled
terms
After having the mathematical model for the rotor and the stator with coupling
parts, the mechanical velocity part must be described [3]. The mechanical velocity is
calculated from external torque, and it controls the position between the rotor and the
stator.
2.1.4 The electromagnetic and mechanical couples:
The mechanical velocity t is the solution of two first-order differentials
equations with 2 coefficients, the first is the friction force f and the second is the
inertia J . This equation is not homogeneous because it is equal to the difference
between the electromagnetic couple T e and the mechanical couple T l .
25
equation 10:
T e t −T l=J. ddt
t f.t
t = ddt
r t
equation 9:
v as=Rr . iasLsddt
ias−Lms
2 [ ddt
ibsddt
i cs]Lsrddt
[i ar cos r ibr . cos r23
icr . cosr−23
]
vbs=Rr . iasLsddt
ibs−Lms
2 [ ddt
iasddt
i cs]Lsrddt
[i ar cos r−23
ibr . cos ricr . cosr23
]
vcs=Rr . iasLsddt
ics−Lms
2 [ ddt
i asddt
ibs]Lsrddt
[i ar cos r23
ibr . cos r−23
i cr . cos r ]
var=Rr .i arLsddt
iar−Lms
2 [ ddt
i brddt
icr ]Lrsddt[ ias cosri bs . cos r−
23
i cs . cos r23
]
vbs=Rr . iarLsddt
i br−Lms
2 [ ddt
iarddt
icr]Lrsddt
[i as cos r23
ibs .cos ri cs .cos r−23
]
vcs=Rr . iarLsddt
i cr−Lms
2 [ ddt
i arddt
ibr]L rsddt
[i as cos r−23
i bs . cos r23
i cs . cosr]
![Page 37: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/37.jpg)
The couple T e can be calculated as follows:
As a conclusion all of these equations describe the physical behavior of the
asynchronous electrical machine in a collection of differential equations witch can be
used in several simulator like Matlab/Simulink© to simulate behavior and the faults of
this machine.
26
equation 11:
T e t =−iast . p . Lsr [ i art .sin p.ribr t .sin p.r23
i cr t . sin p.r−23
]
−ibs t . p . L sr [ iar t .sin p.r−23
i br t .sin p.r i crt . sin p.r23
]
−ics t . p . L sr [ iart . sin p.r23
ibr t .sin p.r−23
i cr t . sin p.r]
![Page 38: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/38.jpg)
2.2 Implementation by Matlab/Simulink©:
The very first version of Matlab©, written at the University of New Mexico and
Stanford University in the late 1970s was intended for use in Matrix theory, Linear
algebra and Numerical analysis. Later and with the addition of several toolboxes the
capabilities of Matlab© were expanded and today it is a very powerful tool at the hands
of an engineer. Matlab© is an interactive system whose basic data element is an
ARRAY. Perhaps the easiest way to visualize Matlab© is to think it as a full-featured
calculator. Like a basic calculator, it does simple math like addition, subtraction,
multiplication and division. Like a scientific calculator it handles square roots, complex
numbers, logarithms and trigonometric operations such as sine, cosine and tangent.
Like a programmable calculator, it can be used to store and retrieve data; you can
create, execute and save sequence of commands, also you can make comparisons and
control the order in which the commands are executed. And finally as a powerful
calculator it allows you to perform matrix algebra, to manipulate polynomials and to
plot data.
2.2.1Simulink©:
Simulink© is a graphical extension for Matlab© that gives the ability to
represent the mathematical function in form of block diagram. Simulink© contains a
collection of different libraries, in every library there is group of blocks that represent
different mathematical functions. By dragging and dropping those models from many
libraries and by connecting them one to the other we will have our mathematical model
or our mathematical equation on a form of block diagram .After building the model, the
simulation parameter are taking our attention. Because Simulink© is using time
quantization so a time quantum must be specified, also as any other simulator the
simulation time must be specified too. To Simulate the Asynchronous Electrical
Machine that is described in the previous section a quantum of 10e-5 second must take
place because a bigger quantum will give non accurate results. Then the parameters of
the equation system that describes the machine in [equations: 9,10,11] are given in
[Table 2].
27
![Page 39: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/39.jpg)
Voltage ( V m ) 380 Volts
Frequency ( f ) 50 Hz
Poles ( p ) 4
Inertia coefficient ( J ) 0.1 Kg.m2
Attenuation coefficient ( f ) 0.0001 Nm.s /radNominal couple charge ( T l n ) 73 Nm
Stator resistance ( r s ) 0.528
Rotor resistance ( r r ) 0.282
Stator inductance ( L s ) 0.04732 H
Rotor inductance ( L r ) 0.01452 H
Stator magnetic inductance ( Lms ) 0.01732 H
Stator magnetic inductance ( Lmr ) 0.01732 H
Mutual induction ( L sr = L rs ) 0.02259 H
Table 2 Machine Parameters
28
Figure 18: Simulink© model
![Page 40: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/40.jpg)
Simulation Results:
In this section we will only see the result of one simulation which is the
simulation of the complete machine without faults. Which will help just to see the
output form of the machine and the type of analysis that can be done on it.
After implementing the machine on Simulink©, we capture all the output
graphs. With those graphs we can know the behavior of the machine. That will help to
compare between different simulation tool. In this report we will use a well know
simulator (Simulink©) as a reference of a good simulator and then compare its results
with the output of our simulator that uses DEVS formalism (DEVSimPy) and
implements QSS method. Having a transient phase and a permanent one will help to
have good comparison view, because not having different transient form doesn't tell
that the simulation is wrong. Having different transient phase and one permanent phase
show the difference of the tools used (using a time quantization (Matlab©) and a state
quantization (DEVS,QSS)).
A. Time Domain:
With an initial velocity zero and a charge of 75 Nm we started simulation.
Velocity goes to a permanent state of 75.5 rad/sec at 0.14 sec.
The velocity is the . This represents the rotation between the rotor and the stator.
29
Figure 19: Velocity
![Page 41: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/41.jpg)
The stator has a permanent phase with an oscillation between 24/-24 Ampere. The rotor
has a current oscillation too but with a frequency of 1.9Hz so we can recognize them
from the time domain, but the frequency domain [13].
B. Frequency domain:
Simulations are made to see the faults that can be found a machine. Until
now nothing about the simulation of a fault machine is shown yet, that is because this
section shows only the mathematical models and the tool that is used to compare our
results (Simulink©). The results of Simulink© are fetched from a simulation done by
SPE laboratory. The mathematical models are taken from previous equations.
Mathematical models will be used to implement the machine using DEVS, and the
Simulink© results will be used to compare results.
30
Figure 23: Rotor spectrumFigure 22: Stator spectrum
Figure 20: Rotor time scopeFigure 21: Stator time scope
![Page 42: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/42.jpg)
Chapter 3
AEM DEVS Implementation
The environment chosen for this implementation is DEVSimPy. It allows a
simple graphical interface to create and use models. Using this tool we will be able to
simulate the Asynchronous Electrical Machine and compare the results obtained by
Matlab/Simulink©.
3.1 DEVSimPy
DEVSimPy is an WxPython based environment for the simulation of complex
systems defined by (1.1 DEVS formalism). Its development is supported by the SPE
[ref SPE] research laboratory team. The main goal of this environment is to facilitate
the modeling of DEVS systems using the GUI library and the drag and drop approach.
3.1.1 Requirements:
The use of DEVSimPy requires:
1. Python version 2.4+
2. wxPython version 2.6+ ansi/unicode (unicode recommended),
http://www.wxpython.org/
3. Scipy (http://www.scipy.org/) and Numpy (http://numpy.scipy.org/)
(optional, for spectrum analysis)
31
![Page 43: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/43.jpg)
3.1.2 Features:
With DEVSimPy we can:
• model a DEVS system and save or export it into a library,
• edit the code of DEVS model to modify behavior's also during the
simulation,
• import existing library of models (python code or DEVSimPy specific
models) which allows the specific domain modeling (Power system,
continuous, etc),
• automatically simulate the system and perform its analysis during the
simulation (with the suspend option),
• and more over.
3.1.2 Demonstration of DEVSimPy:
The interface of this program is designed to help the implementation of DEVS
model in form of blocks. This chapter shows how this program works and will show the
implementation of the Asynchronous electric machine. This will begin with the
introduction of the main window and the main tools inside it. As shown in [Figure 24]
we can see that DEVSimPy is divided into four main parts [6].
1. The main bar that contains the main functionality for the program:
(a) File contains: New window, open file, save file, print, Quit, …
(b) Diagram contains all the option for a diagram (3): New, simulate, detach,
zoom, …
(c) Show is responsible for the interface and the option displayed for the user.
(d) Perspectives to add new perspectives. (under construction)
(e) Options helps to change the language and the unable and disable some
plugins.
(f) Help used to contact the author, about DEVSimPy, help (under
construction).
32
![Page 44: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/44.jpg)
2. The tool bar contains just some shortcuts from the main bar that helps to
accelerate the usage of the program:
(a) New diagram, open file.
(b) Save, save as.
(c) Zoom in and out.
(d) Simulate, priority of the models.
(e) Connection type between model: strait connection or Z form connection.
3. The Diagram is the main part of the program because it contains the
model that we want to simulate. This diagram is called the master model
or can be called as the main coupled model. We can have many tabs of
this Diagram each one represents one model.
4. Libraries are very important to save model to be reused in the future with other
simulations and models. Like this time and work are saved and can be shared
very easily. Libraries are in form of packages, and packages are divided into
folders. As shown in [Figure 24] there is package called PowerSystem and this
is divided into many folders like: sink, Source, Continuous, PowerMachine.
Every folder contains models that can either be coupled or atomic models.
Those models can be drag and dropped into the diagram so we can compose our
model.
33
Figure 24: DEVSimPy main window
![Page 45: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/45.jpg)
Using this simple powerful interface we will see how to simulate a PC as a coupled
model that is composed of two atomic models: Ready Queue and the Processor.
A. How to create the CPU models:
To create a new atomic model using
DEVSimPy right click on the Diagram
window [number 3 Figure.24] and then
choose new from the menu. A new window
will appear to choose what type of model
do you need to create [Figure.25]. In this
case we will choose an atomic model, click
Next. Choose a name for your model,
“RQ” for the ready queue of the processor.
Then we can choose how many inputs and
outputs for the system, with the RQ we
will make it two inputs and one output [Figure.26]. After you must choose the library
folder to place your model so we can used it after. Here we will put “RQ” in Processor
in PowerSystem [number 1 Figure.26].
After we finish the creation of the model we will see the model created with two inputs
and one output and the library is automatically refreshed and we can see the model can
appear in the folder that we saved it in [number 1 Figure.26]. With the model that is
created in the library we can drag and drop it in the Diagram like this we have our
model created with its default parameters [number 2 Figure.26]. When the model is
created it is automatically selected. After any model is selected (by a click) we can
change its properties by 2 different ways. The first right click on the model and choose
properties. Second is to click on Properties beside the Library [number 3 Figure.26]. In
both cases we will see a menu [Figure. 27] the display all the properties.
34
Figure 25: New model wizard
![Page 46: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/46.jpg)
We can change:
• the label: “RQ” for our model.
• The font color and size of the
model.
• The color of the model.
• Number of inputs.
• Number of outputs.
• The python file that describes the
behavior of the model, we have a
small window that displays the
functions and we can choose
between different function using
this drop down list.
• We can initialize any parameters
that is used in the constructor of the model in the python file, but in the case of
the RQ we don't have one.
35
Figure 27: Properties
Figure 26: Library
![Page 47: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/47.jpg)
So as we can see DEVSimPy has a good graphic interface that helps to combine
between the interface and the code. By default in DEVSimPy for the new atomic
models, all function are created but with an empty body. To edit this code just select the
model and then right click and choose “edit”. At that point a new editor window will
appear [Figure.28]. After editing the code, we can save the file by clicking on “Ctrl+S”
or by clicking on the save icon. While saving this editor will compile the file, and if
there is any compilation errors it will appear instantly. Then your model is ready for
work and being simulated. With the same steps that we did to build the “RQ” we are
going to build the “Proc” atomic model. Just right click, new atomic model, choose the
number of inputs and outputs, choose the library to save the model and then edit the
code to write the behavior of the “Proc”. After doing this we have 2 atomic models that
are the two model to describe the Processor.
To make it easier and faster to use we
will put those two models together
into one coupled model, so we can
see it as one box. Doing the same
processor that we used to create an
atomic model we will create a
coupled model just with choosing
from the “New” list a coupled model.
After creating the model just double
click on it and a new diagram will be
open. In this new diagram we will
build our models inside [Figure.29].
After doing this we will export our
coupled model (save it) to be saved
into the library so we can use the
model after. Into the diagram we must
connect models to each other, to do
so, we can right click on the model
and then choose “connect to” from
36
Figure 28: Model code
![Page 48: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/48.jpg)
the list and then it will show the list of model that are available to connect, make your
choice and your model is connected. Another method is to drag the output port of the
model you want to connect to the input of the other model and then it is connected
[Figure.29].
After building our coupled model, we will use as input a file [Table 3] which contains a
list of processes that needs to be executed, the arrival time of each process and the
execution time the it needs (time need to be spent into the processor). To read this file
and use it as an input to the “PC” we will use the atomic model “ExternalGen” [number
3 Figure.29] that is found in DEVSimPy built in library. To save the output of the “PC”
which is a file that contains the time of the spent in the processor and the that time that
it ends we will use a “To_Disk”[number 4 Figure.29] atomic model which DEVSimPy
offers from its built-in library.
37
Figure 29: Coupled model in DEVSimPy
![Page 49: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/49.jpg)
Arrival time CPU time needed0 5
0.5 24 18 310 1
Table 3: CPU input
B. Start a simulation:
Before starting the simulation, an option is given by DEVS that we can change
the priority of the model. Which means that if at one time two different model has a
collision which means they need to be executed at the same time. With this option we
can give a model the priority to be executed before another model. In DEVSimPy we
can find this priority option in [number 2 Figure.24]
To set the simulation settings is is enough to just click on the simulation button
[number 1 Figure.29] that will lunch a small window that is responsible of the
simulation [Figure.30]. We have to set
the time that we want the simulation.
Click on run after choosing the
simulation time to start simulation. At
this moment a progress bar appear to
show you the progress of your
simulation, a percentage of the
completed simulation appear in the
information bar and a timer that count
the time elapsed for this simulation.
Because DEVS and of course DEVSimPy is not a black box, we can see all the
steps of the simulation and the messages that are transmitted from a model to the other,
we can see also the choice of the root about the priority of execution of models. In
DEVSimPy seeing all of thees details is done by enabling a plug-in called “verbose”
which allows us to see the details of the simulation on a new window by writing a
detailed text with all the details mentioned before.
38
Figure 30: Simulation bar
![Page 50: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/50.jpg)
C. View results:
Two ways are available to see the output of any model. First by having a text
file written by an atomic model called “To_disk”. This model only reacts when a new
message arrives on one of his inputs ports. Its reaction is to add to a text file the new
message that has just been received. With “To_disk” we have always access to its
created files even after we close DEVSimPy. We can have access to those files during
the simulation time by double clicking on the “To_Disk” model. A new window with
the output of the PC will appear on it [Figure. 31. If this output need to be drawn on as
a graph, just click on the graph icon [pointed Figure.31]. The output of the “PC”
[Figure.31] shows in column A the time that the process is done, in column B the
entrance time into the “Proc” so difference between column A and B is the CPU time.
As we can see there is a small delay of 0.1 sec at every processor, this delay because we
assumed that the “Ready Queue(RQ)” cause this small delay to put the process into the
processor.
39
Figure 31: Output Spread Sheet
![Page 51: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/51.jpg)
3.2 DEVSimPy machine model:
The DEVS model of the Asynchronous Electrical Machine, is divided into several
coupled models. Using DEVSimPy to create coupled model is so easy as shown in the
previous chapter .
3.2.1 Full model:
DEVS formalism can easily transform differential equations into a block
diagram [Figure.32]. [Equations 9,10,11] that represents the behavior of the stator and
the rotor, will be represented by the four different blocks.
First, taking the left part of [Equation 9] will construct the stator block, which is the
behavior of the stator alone without any magnetic coupling from the rotor and of course
without any influence from the mechanical position with the rotor which is defined by
the mechanical [equation 11].
Second, the right part of the stator and rotor equations will construct the magnetic
coupling between both of them. This coupling is expressed by two different blocks, one
for each model (stator, rotor).
Third, we have the mechanical part which represents the velocity ( t ) , and then
the last block will represent torque (Te).
This Asynchronous Electric Machine can be represented by those six main blocks
[Figure.32], but every block (or can be said models of DEVS) represent a differential
equation which is calculated inside the model by other coupled models or atomic
models.
40
![Page 52: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/52.jpg)
41
Figure 32: Full model (AEM)
![Page 53: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/53.jpg)
3.2.2 Detailed model:
The model of the Asynchronous Electric Machine can be detailed into five parts [1]:
A. Inputs/Outputs:
Inputs and outputs can be found in the previous figure [Figure.32] in blue.
I. Inputs:
a. We can see on the left of the figure “SinGen” blocks, those block are the
sin wave generators, that generates the input for the stator model. The
idea of using three different blocks is to generate three sin waves with a
phase of 120 degrees between each one.
b. On the opposite side of the “SinGen” we can find “ConstGen”. Those
blocks represents the input of the rotor which is a constant signal that
generates Zero volts as input (Note: int his case we could use only one
model).
c. At the bottom of the model we can find a model called “Tl”. This model
represents the output charge of the machine.
II.Outputs:
In this case of the machine there is no specific output, because the input is a
voltage and the output is mechanical ( rotation of the machine). But we can
call it not outputs but monitoring points. To monitor any point of the
machine we can just add a “To_disk” model which is responsible of
capturing the output and save it on the disk.
a. The stator and the rotor currents are a good point to monitor because this
represents the behavior of the machine and it can be used to analyze the
rotation of the machine because the current is a result of the rotation
movement. So we can know the rotation frequencies and to notice the
faults in the machine.
b. The velocities is very important to monitor, to know what is the rotation
speed and to see of the machine is stable or not.
42
![Page 54: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/54.jpg)
B. Stator and Rotor:
The stator and the rotor model are colored with red in the previous figure
[Figure 32]
I. Stator
The stator [Figure 33] is a coupled model that is build to implement the first
part of the differential equation of the stator seen in [equation 9].
The Stator model is composed of three “Wsum” and three “Integrator” and
three “LPF” (low pass filter).
a. The “Wsum” is responsible of addition of all the equation variables and
the multiplication of each variable with its coefficient. The coefficient
are preset in the “Wsum” by setting its “K”. The coefficient of the first
“Wsum” are given by [table 4].
43
Figure 33: Stator model
![Page 55: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/55.jpg)
Coefficient for: valuecurrent (Ia) -11.16
Input voltage (Va) 21.13current (Ib) 0.36current (Ic) 0.36
EMFas -21.13
Table 4: Stator coefficients
b. The integrators are responsible of the integration of d I
dt to give us
I. Using these “Integrators” and the “Wsum” can represent the equation
[equation 2] in a perfect way, but as we mentioned before in [1.3.2.
Low pass filter:] these equations represents an algebraic loop. Which
will be cut with the third component of the stator which is the “LPF”.
c. The “LPF” are just a simple low pass filter with a big cut-off frequency,
so it doesn't affect the signal and at the same time cut the loop that is
created from the differential equations.
II.Rotor
The rotor is the same as the stator in blocks, because of the similarity in the
equations of the rotor and the stator. The only difference between them is the values of
“K” which is the values of the coefficients of the differentials equations.
Coefficient for valuecurrent (Ia) -11.16
Input voltage (Va) 21.13Current (Ib) 0.36current (Ic) 0.36
EMFar -21.13
Table 5: Rotor coefficients
44
![Page 56: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/56.jpg)
C. Electromotive force:
This part is composed of the two model and are represented in [Figure.32] in
red. In the equation models [equations 11,10] are implemented into those 2
models.. We use two different model because we have different coefficients
between the rotor-stator coupling and the stator-rotor coupling. Every model in
composed of three main models. Every small model one equation is processed.
To simplify this model the velocity is integrated inside the mechanical part and
not inside the “EMF” models. As input of the stator “EMF” we have the three
currents of the rotor and there derivatives that influence on the stator, then the
velocity of the machine as its derivative (the current angle). Every one of these
inputs is part of each equation, so all are connected to each block that represent
the calculation of the equation.
45
Figure 34: Electromotive force model
![Page 57: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/57.jpg)
D. Coupling:
I. Electric-coupling:
The electric-coupling is only
composed of one “NLFunction”
that calculates the equation of
the electric-coupling which has
as output the “Te” (Torque), and
as input it has the stator, rotor
currents and the velocity of the
machine.
II. Mechanic-Coupling:
The mechanic-coupling is
one block that calculates the velocity of the machine using the Torque (Te)
and the charge (Tl) . and after calculating the velocity of th machine by
integrating the velocity we will obtain the position of the machine.
E. The Algebraic Loop break:
We talked before about how to build the low pass filter using DEVSimPy in
[1.3.2. Low pass filter:]. Here we will just say that the low pass filter cuts the
algebraic loops. So without affecting the signal values, it just make some
unnoticed delay to break the loop.
46
Figure 36: Mechanical coupling
Figure 35: Electric-coupling
![Page 58: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/58.jpg)
3.3 Simulation results
In this section we will start to simulate the machine with DEVSimPy. This is a
three-phase machine with an output power of 5.5 KW. This section will present four
different configuration of the machine: first the sage operation then three (stator,rotor,
stator+rotor) winding unbalances operations. The observed output of the machine will
be in both domains (time domain, frequency domain). The frequency domain is
obtained by the application of the fast Fourier transform (FFT) and it is visualized
using the basic frequency spectrum.
Using DEVSimPy and Matlab/Simulink© the next results are presented.
3.3.1. Safe operation:
1st case is the Safe operation. Safe operation means that the machine is in the
normal conditions. Knowing the normal results will help to diagnostic the faults or the
unbalanced behavior of the machine later [3].
First the results of DEVSimPy will be presented and then Matlab/Simulink© results to
do the comparison. The result that we are observing [Figure.37,38] are the result of
DEVSimPy using integrator for the stator and the rotor with a quantization step equal
to (0.1). and for the low pass filters a quantization step equal to 5, we have chosen 5
because the interval of value that the low pass filter cuts it loop is about 20,000 so a
47
Figure 38: rotor currentsFigure 37: stator currents
![Page 59: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/59.jpg)
quantization step equal to 5 is enough to have the precision and reduce the simulation
time too.
Showing the previous result (Figure.39,40) simulated by Simulink© shows that
the permanent phase in the stator current is an oscillation between -24/24 Ampere, and
for the rotor currents there is an oscillation with a very small frequency that will be
shown in the frequency analysis. The comparison between results obtained by
DEVSimPy and Simulink© shows that the transitory phase might be slightly different
but the permanent phase is the same.
The frequency domain is a domain that is commonly used in the electrical
systems for diagnostics and analysis. DEVSimPy has an FFT (Fast Fourier Transform)
48
Figure 42: rotor spectrumFigure 41: stator spectrum
Figure 40: rotor currents (Simulink©)Figure 39: stator currents (Simulink©)
![Page 60: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/60.jpg)
option can be used to analyze output or input signals. Figure 41,42,43,44 shows the
frequency analysis for the output of the rotor and stator signals. The stator current
analysis shows that one main frequency of a 50Hz is dominating the frequency domain.
The rotor current FFT shows a peek on 1,9Hz [12].
The Matlab/Simulink© result that are shown in (Figure.43,44) shows that the main
peeks are at the same frequencies (50 Hz for the stator and 1.9Hz for the rotor) but then
it shows some small peeks on other frequencies that will be important in the next
section.
The frequencies of the currents are the result of its velocity. Being sure that the
velocity is converge correctly that means that definitely the correct peeks will appear.
49
Figure 45: Velocity (Simulink©) Figure 46: Velocity ( DEVSimPy )
Figure 44: stator spectrum(Simulink©) Figure 43: rotor spectrum(Simulink©)
![Page 61: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/61.jpg)
As said before that we might have some differences in the transitory phase but
always the permanent phase is the same. With the velocity, Matlab/Simulink© present a
convergence to 75.5 rad/sec as DEVSimPy do it.
As a conclusion for this sub-section, we can say that DEVS formalism
combined with QSS method for quantization is able to simulate correctly the
Asynchronous Electrical Machine in time domain as in frequency domain. But still this
is only the machine without any fault simulation. The main interest to simulate an
electric machine like this one is to detect its abnormal behavior. In the next sub-section
a simulation of the fault behavior of such a machine will be presented.
3.3.2. Unbalanced machine:
It is well know that the frequency
domain is often used in order to perform
an accurate and early electrical fault
detection in the three-phase AC
machinery. Three ways can be used to
detect faults of the machine. First radiant
flux or radiant power is the measure of
the total power of electromagnetic
radiation (including infrared, ultraviolet,
and visible light). Second the velocity
analysis of the machine. Third the current absorbed to the electric network. Using the
third method as the cheapest way to analyze the faults. The two first ones requires a
very expensive detectors to detect the Flux or the speed of the machine. [Figure 47]
shows those three possibilities. So If any fault is present in any part of the machine it is
presented by a new frequency component. of course the magnitude of the spectrum
represents the fault severity [12].
A. Unbalanced stator:
An unbalanced stator could represent a broken part of the stator for example.
This fault can be represented as an additional resistance of 0.6Ω with one phase of the
50
Figure 47: Electrical machine
![Page 62: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/62.jpg)
stator resistance. Because of the broken part we must find a new peek that appears in
the rotor currents frequency domain. The rotor speed has a value of 776 rpm. As
mentioned before the speed is the main parameter that can be analyses to detect faults
but it is so expensive to get the sensors for it.
Because of the unbalanced stator the new peeks of 98.1Hz and 101.9Hz appears
on the the spectrum of the rotor currents [Figure.48,49]. These frequencies are present
beside the old ones that describe the normal behavior.
Comparing both results shows the same spectrum of the stator that shows that
there is no change in its peeks, but the rotor spectrum shows that a peek at 101.9Hz and
a peek at 98.1Hz. Those two peeks are the sign that the stator is in an unbalanced state.
51
Figure 50: stator (unbalanced stator)
Simulink©Figure 51: rotor (unbalanced stator)
Simulink©
Figure 49: rotor (unbalanced rotor)Figure 48: stator (unbalanced stator)
![Page 63: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/63.jpg)
B. Unbalanced rotor:
The same failure of the stator will be simulated with a failure of the rotor. With
an asynchronous electrical machine the probability of the rotor failure is much more
probable than the failure of the rotor [12]. This makes the simulation of the machine
with the rotor failure more used and much more common than the stator failure. To
simulate this phenomenon we add in series a resistance of 3.6Ω to one phase of the
rotor.
Some new peeks have appeared on the stator spectrum. These new peeks are the
result of the rotor unbalance. An equation can define those frequencies that are created
because of the rotor velocity oscillation fs = ( 1 ± 2s ) F. Where F is the fundamental
52
Figure 52: rotor (unbalanced rotor)Figure 53: stator (unbalanced rotor)
Figure 54: stator (unbalanced rotor)
Simulink©
Figure 55: rotor (unbalanced rotor)
Simulink©
![Page 64: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/64.jpg)
frequency, and s is the the actual machine slip . This equation is explaining why we
have so many peeks around the 50Hz peek on the stator's spectrum.
C. Unbalanced rotor and stator:
Using both faults in the rotor and the stator which means adding the the series
resistances that used before to simulate faults in rotor or stator will be both used at the
same time.
Having fault in the stator and the rotor at the same time is like combining the
two previous spectrum together and having a combination of the stator spectrum when
a unbalanced rotor and the rotor spectrum when an unbalanced stator.
53
Figure 59: rotor (unbalanced stator rotor)
Simulink©
Figure 58: stator (unbalanced stator rotor)
Simulink©
Figure 56: rotor (unbalanced stator
rotor)
Figure 57: stator (unbalanced stator
rotor)
![Page 65: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/65.jpg)
Chapter 4
Analysis and Conclusion
4.1 DEVS and QSS Analysis
DEVS is a formalism to model and simulate a discrete-event system and
nothing but a discrete-event systems. So we must use a another formalism or a
quantization method so we can transform the continuous systems into discrete-event
systems. So presenting QSS method as a quantization method that depends on the
systems values makes this method with DEVS formalism a good combination that
is capable to deal with all continuous system that are presented into differential
equations.
As all simulation systems there is some advantages and at the same time
inconvenient, after taking in test this combination that theoretically it must work
perfectly, I have some analysis. The analysis that will be present in the next section
is based on the experience of simulating an asynchronous electric machine. This
experience can be a model to all systems that can presented by differential
equations. To have a good analysis it will be divided into two main parts. First part
is to clarify the attractive points that can make a change in the way we use those
formalisms, even if they are good or bad points. Second part will discuss what is the
future work that can be done using those formalisms to enhance their performance.
54
![Page 66: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/66.jpg)
4.1.1 Points of interests
A. Time
First point of interest is the simulation time using DEVS. This point is very
important because to preform a good accurate simulation and a small simulation
time will be a great simulator. But this is not the case for DEVS. For now the
simulation time is huge compared to Simulink©. This could be a hundred time
slower with almost the same accuracy. This depends on many parameters, one of
them is the quantization method used to quantize the continuous system. The
hierarchical simulation algorithm that DEVS is built on makes that too much
message are transmitted between coordinators until they arrive to the simulators.
B. Quantum value
Second point of interest is not related to DEVS formalism but to the
quantization method (QSS). The amplitude quantum is one of the most important
points that must be studied before starting the simulation. The amplitude values
must be at a calculated percentage of the quantum to make accurate results. If we
decided to choose a very small quantum to have accurate results it will slows down
the simulation. A good point to study is how to choose a quantum that doesn't affect
the results and at the same time to accelerate the simulation [9].
C. algebraic loop breaking
The algebraic loop breaking for DEVS is one of the research domains. Tow
methods have been proposed one by E. Kofman [9] and the other one is by SPE
laboratory. E. Kofman proposed a model to cut the loop with a block that make a
slight change in the signal that passes throw and the SPE laboratory proposed a low
pass filter to cut it. A comparison is done in the lab to see if that gives the same
results or not. Fortunately we have almost the same but still a study needed to
calculate the low pass filter parameters [13].
55
![Page 67: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/67.jpg)
4.1.2 Perspectives
Throw the work done we can figure out some perspectives, this can be
presented with the following priorities:
• The fault simulation is done one by one in our current systems and
then the results must be analyzed frequency domain. The SPE lab has
some recent studies about the concurrent and comparative simulations
(CCS) of the faults in digital systems. One long term perspective will
be to transpose the electric model of the asynchronous machine in
order to apply the CCS algorithms. Of course we must think about
realistic digital fault models. In this case, we will never need to work
in the time domain because the processing and diagnostic will only be
done in the digital domain [14],[6].
• The simulation time being too long for the discrete event simulation,
we can implement some improved simulation algorithms based on
converting DEVS simulation tree into a flat model. Furthermore some
algorithms excite that are based on the modeling that transforms the
complete models ( eventually composed of atomic models and
coupled models ) into only one atomic model. Like this the
simulation tree is simplified and the simulation management by the
root is much lighter [15],.
56
![Page 68: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/68.jpg)
4.2 Conclusion
DEVS is a formalism that is used to simulate discrete event systems.
Quantization State System is a quantization method that transforms the continuous
systems. Combining both make it possible to model and simulate continuous system.
Implementation of an Asynchronous Electric Machine is a great test to do because it is
a continuous system that can be presented by differential equations. Comparing the
result with another system that uses the time quantization is very important so we can
the advantages and the disadvantages of our implementation. After comparison we
realize that until now there is a good points to use this approach but still not enough to
be better. Doing the future work proposed in the report is necessary to make this
approach better, so it can compete with the time domain quantization.
By resuming this report we can say that the simulation domain is very wide and
can be improved by different manner. Sometimes the theories say that one method is
better than the other but when we go to the implementation we find more parameters
that counts and then we go to study the new positions and make new theories. It is
always like this the research domain.
57
![Page 69: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/69.jpg)
Annex
A. DEVSimPy RQ atomic model code:
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: <RQ.py>
#
# Model: <Buffer Queue>
# Author: <Samuel TOMA>
#
# Created: <2010-03-24>
#-------------------------------------------------------------------------------
from DomainInterface.DomainBehavior import DomainBehavior
from Object import Message
### Model class ----------------------------------------------------------------
class RQ(DomainBehavior):
def __init__(self):
DomainBehavior.__init__(self)
self.state = {'status': 'INACTIF', 'sigma': INFINITY}
self.phase = 'Free'
self.jobsList = []
def intTransition(self):
self.state['sigma'] = INFINITY
self.state['status'] = 'IDLE'
def extTransition(self):
58
![Page 70: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/70.jpg)
np=0
self.msg= self.peek(self.IPorts[np])
while(self.msg == None):
np+=1
self.msg= self.peek(self.IPorts[np])
if np == 0 :
# we add to the job list a new job that is formed of the arrival time and the time that it needs to be executed in the CPU
self.jobsList.insert(0,[self.msg.value,self.msg.time])
if self.phase == 'Free':
self.state['status'] = 'ACTIF'
self.state['sigma'] = 0.01
else:
self.phase = 'Free'
self.state['status'] = 'ACTIF'
self.state['sigma'] = 0.01
def outputFnc(self):
# we verify that we have a job and CPU is free then we send a message that contains the execution time and the sent time
if (len(self.jobsList) > 0 and self.phase == 'Free'):
job = self.jobsList.pop()
job[1] = self.timeNext
self.poke(self.OPorts[0],Message(job[0],job[1]))
self.phase = 'Busy'
def timeAdvance(self):
return self.state['sigma']
59
![Page 71: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/71.jpg)
B. DEVSimPy PC atomic model code:
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: <Proc.py>
#
# Model: <Processeur>
# Author: <Samuel TOMA>
#
# Created: <2010-03-24>
#-------------------------------------------------------------------------------
from DomainInterface.DomainBehavior import DomainBehavior
from Object import Message
### Model class ----------------------------------------------------------------
class Proc(DomainBehavior):
def __init__(self):
DomainBehavior.__init__(self)
self.state = {'status': 'INACTIF', 'sigma': INFINITY}
def extTransition(self):
self.msg= self.peek(self.IPorts[0])
self.state['status'] = 'ACTIF'
self.state['sigma'] = float(self.msg.value[0])
def outputFnc(self):
# as an output we have the entrance time and the finished time and from port 1 a done message to the buffer
self.poke(self.OPorts[0],Message([self.msg.time],self.timeNext))
60
![Page 72: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/72.jpg)
self.poke(self.OPorts[1],Message([0],self.timeNext))
def intTransition(self):
self.state['status'] = 'IDLE'
self.state['sigma'] = INFINITY
def timeAdvance(self):
return self.state['sigma']
61
![Page 73: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/73.jpg)
Bibliography:
[1] A. Bellini, F. Filippetti, C. Tassoni and G. A Capolino, “Advances in diagnostic techniques for induction machines”, Journal: (IEEE) Transactions on Industrial Electronic,pp.4109–4126, 2003.
[2] Bernard P. Zeigler and Hessam S. Sarjoughian, “Introduction to DEVS Modeling & Simulation with JAVA: Developing Component-based Simulation models”, By Authors, August 2003.
[3] C. J. Verucchi, G. G. Acosta and F. A. Benger, “A review on fault diagnosis of induction machines”, journal: Latin American applied research, pp.113–121, 2008.
[4] DEVSimPy,url= http://code.google.com/p/devsimpy/
[5] Discrete Event System Specification,url= http://en.wikipedia.org/wiki/DEVS.
[6] Ernst G. Ulrich, Ishwani D. Agrawal and Jack H. Arabian, “Concurrent and Comparative Discrete Event Simulation”, Springer, 1994.
[7] E. Kofman, “A third order discrete event method for continuous system simulation”, in Proceeding of RPIC'05, 2005.
[8] E. Kofman, “A second-order approximation for (DEVS) simulation of continuous systems”, Trans. Soc. Comput. Simul. Int., vol. 78, no. 2, pp.76-89, 2002.
[9] E. Kofman, “Discrete event based simulation and control of continuous systems”,PhD’s thesis. Facultad de Ciencias Exactas, Ingeniería y Agrimensura-Universidad Nacional de Rosario, 2003.
[10] François E. Cellier and Ernesto Kofman, “Continuous system simulation”, Springer, 2006, pp. 519-629.
[11] F. J Barros, B. P Zeigler and P. A Fishwick, “Multimodels and dynamic structure models: an integration of (DSDE/DEVS) and (OOPM)”, Proceedings of the 30th conference on Winter simulation, pp.413–420, 1998.
62
![Page 74: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/74.jpg)
[12] G. Dédier and H. Razik, “Sur la détection d'un défaut au rotor des moteurs asynchrones” , In 3EI, Numero 27 of December 2001.
[13] L. Capocchi, D. Federici, A. Yazidi, H. Henao and G. A. Capolino, “Asymmetrical Behavior of a Double-Fed Induction Generator: Modeling, Discrete Event Simulation and Validation”, in proceedings of IEE-
MELCON'08, pp. 456-471, May 2008.
[14] L. Capocchi, “Simulation concurrente de fautes comportementales pour des systèmes à événements discrets :Application aux circuits digitaux”, PhD’s Thesis, University of Corsica, France, November 2005.
[15] W. B Lee and T. G Kim, “Simulation speedup for (DEVS) models by composition-based compilation”, Summer Computer Simulation Conference pp.395–400, 2003.
63
![Page 75: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/75.jpg)
الفرنسية فى مصرجامعة السةدالهن كلية
قسم الحاسبات
للنظم المعقدةلنمذجة والمحاكاة ا
تطبيق علي الماكينة اللمتزامنة
جرختالروع شم الوريوسكقدم ضمن متطلبات درجة الب
إعداد صموئيل توما
إشراف
كابوكي لوران/ الستاذ
64
![Page 76: DEVS for continuous system simulation: application to asynchonous machine](https://reader033.vdocuments.us/reader033/viewer/2022051819/551699dd4979591d538b5194/html5/thumbnails/76.jpg)
لخصم
�مى . قد استخدمت النمذجة و المحاكة لفترة طويلة تفرض الوقت��دا� يس��ا� جدي��ر الن نهج��و DEVSولكن يظه� وه
�ل نس�تخدم طريق�ة الحدث ولتحويل النظم المستمر إلى نظم. يعتمد على تفرض الكم��دف م�ن. QSSالمنفص� و اله
يستطيع أن محاكاة نظم مستمر يمكن تمثل في معدلت QSS-و DEVSهذا المشروع هو إثبات أن المزج بين
�ذا. تفاضلية� هذا المشروع يظهر نتائج مثيرة للهتمام للغاية ولكن هناك حاجة إلى ال مزيد من البحث لكي يكن ه
النظم قادر على المنافسة مع باقي النظم ال أخرى
65