Combining SysML and Modelica to Verify the Wireless Sensor Networks
Energy Consumption
Ahmed Hammad, Hassan Mountassir and Samir Chouali
Femto-ST Institute, University of Franche-Comt´e, Besanc¸on, France
Keywords:
Specification, SysML, Modelica, Design, Virtual Verification, Model Transformation, MDA, WSN.
Abstract:
Wireless Sensor Networks (WSN) have large industrial applications. However, the modelisation is still a very
complex task in view of the nature of these networks, namely because they are distributed, embedded and
have strong interactions between the hardware and software parts. In addition, industrials use semi-formal
methods to design their systems and validate behaviours by simulation. In this context, in order to improve the
checking of the WSN properties, we propose a Model Driven Architecture (MDA) approach for modeling and
checking of properties like energy consumption. This approach combines the advantages of SysML and Mod-
elica languages. It is described mainly by two steps. At first, we offer a model transformation by taking into
account static, dynamic and requirement diagrams of SysML in order to specify their corresponding Modelica
model. In the second step, we carried out the virtual verification of WSN energy consumption. This approach
is implemented inside Topcased platform and illustrated through a crossroads monitoring system which aims
the verification of energy consumption.
1 CONTEXT AND MOTIVATION
During the last decade, WSN have been a major suc-
cess in the scientific and the industrial communities
for their broad application fields. However, this kind
of networks is mainly used in the observation of phys-
ical phenomena in a restricted environment. They
are characterized by a simple deployment and a low
production cost. Furthermore, the WSN industry ac-
tors should develop the modeling methods of these
networks in order to maintain the competitiveness of
their products. In addition, modeling WSN is equiv-
alent to modeling distributed and embedded system
at the same time. Moreover, the formal methods are
generally used in the modeling of critical systems that
require rigorous verifications. These methods require
good skills in mathematics. As a result, industrials
have widely adopted semi-formal methods to design
WSN applications. These methods are based mainly
on semi-formal language (text or graphic) for which
is defined a precise syntax and a relatively weak se-
mantics. Besides, semi-formal languages are easy
to understand and provide a rich structuring mecha-
nism allowing the reduction of the design time and
cost. However, in order to improve the checking of
the WSN properties which is done generally by sim-
ulation, we propose an MDA approach to design and
to check the WSN properties. Our approach is based
on the SysML language which will be extended to
an executable language namely Modelica (Modelica,
2009). Considering the Modelica characteristics, we
propose a virtual verification of properties which are
deduced from the SysML requirement diagram. This
approach includes the benefits of the SysML model-
ing and the possibility to simulate and to verify the
modeled system with Modelica. SysML and Modelica
are two complementary languages, their joint use of-
fers the very expressive, formal language for differen-
tial algebraic equations and discrete events of Model-
ica with the very expressive SysML constructs for re-
quirements, structural decomposition, logical behav-
ior and traceabilty of requirements.
We focused our work on the study the WSN energy
consumption which is heavily dependent on the type
of node. These nodes are designed in the aim to max-
imize their life expectancy. In (Halgamuge et al.,
2009), the authors proposed an energy consumption
model for WSN. The major feature of this model is
the accuracy in estimating the energy consumption.
Therefore, this model aims to estimate the overall life-
time of the WSN accurately. For these reasons, we
adopted this energy consumption model in our study.
This paper is structured as follows: first we provide
the existing works relating to the WSN modeling.
198
Hammad A., Mountassir H. and Chouali S..
Combining SysML and Modelica to Verify the Wireless Sensor Networks Energy Consumption.
DOI: 10.5220/0004319601980201
In Proceedings of the 1st International Conference on Model-Driven Engineering and Software Development (MODELSWARD-2013), pages 198-201
ISBN: 978-989-8565-42-6
Copyright
c
2013 SCITEPRESS (Science and Technology Publications, Lda.)
Then, we give brief introductions to WSN, SysML
and Modelica languages. After that, we explain our
approach to design and to verify the WSN energy
consumption property. Finally, we conclude and give
some future works.
2 RELATED WORKS
In the literature, we found several works on the mod-
eling and the verification of the WSN properties.
For example, E. Cheong and al. (Cheong et al.,
2006) developed a Framework that provides a graph-
ical environment for the WSN applications modeling
and simulation using mainly TinyOS. Another similar
work done with Simulink was proposed by M. M. R.
Mozumdar and al. (Mozumdar et al., 2008). They de-
veloped a Framework which provides the ability to
make performance analysis of the designed system
through simulation and it also allows the code gener-
ation which is compatible with TinyOS. S. Villa and
al. (S. Villa, 2011) proposed an approach for mod-
eling WSN using UML and SystemC. They defined
two UML profiles, namely the UML-SystemC profile
which includes the SystemC specific concepts and the
UML-Marte profile which allows hardware-software
modeling (co-design). Then they have designed a
Framework that enables the model transformation be-
tween the UML model and the SystemC model. The
verification of SoC properties is done by the simula-
tion.
Our WSN modeling approach is based on the MDA
standard. It allows a semi-formal modeling with the
SysML language which will be extended by the Mod-
elica in order to verify WSN properties. In other
words, we offer the possibility to design clear mod-
els, to allow also the simulation and the virtual verifi-
cation of designed system properties.
3 PRELIMINARIES
3.1 Wireless Sensor Networks
The WSN modeling is influenced by many factors,
which include fault tolerance, scalability, produc-
tion costs, operating environment, sensor network
topology, hardware constraints, transmission media
and power consumption. These factors are important
because they serve to direct the design of the WSN
protocols and algorithms. In addition, they can
be used to compare different WSN architectures.
Moreover, the prospects of the WSN applications
are promising but the challenges that they present
are not less numerous and not less complex, neither.
Among the crucial issues, which represent the WSN
non-functional properties, we can mention the energy
consumption, the automatic configuration, the com-
munication security.
3.2 SysML Language
SysML (SysML1.3, 2012) has been proposed by the
Object Management Group (OMG) , together with the
International Council on Systems Engineering (IN-
COSE) (INCOSE, 2012) and the AP233 consortium
(AP2, 2012) with the aim to define a general pur-
pose modeling language for systems engineering. It is
based on the actual standard for software engineering,
the Unified Modeling Language (UML) (UML2.4,
2011) version 2.4, with some extensions. It replaces
the class concept in modeling by blocks for a vocabu-
lary more suited to the Systems Engineering (SE). A
block includes any software, hardware, data and pro-
cesses concepts.
3.3 Modelica Language
The Modelica is an object-oriented modeling lan-
guage that allows the modeling of physical systems
which can be complex and heterogeneous. It can be
considered as a multidisciplinary modeling language
(Fritzson and Bunus, 2002). The Modelica is an open
language which is developed and promoted by the
Modelica Association. The Modelica models are de-
scribed mathematically in acausal way through dif-
ferential equations, algebraic equations and discrete
equations. The Modelica solvers contain very effec-
tive algorithms for solving equation systems which
allow the handling of complex models that are de-
scribed by thousands of equations.
4 OUR APPROACH
We propose to transform the SysML models to an ex-
ecutable models in Modelica. The adopted method-
ology is constituted of following steps. In the first
stage, the modeler designs the WSN application with
the SysML language. In the next phase, the designer
is invited to run a check of his model in order to re-
fine it when there are problems reported by the an-
alyzer. Among the problems identified by the ana-
lyzer, we list, the undefined elements (initialization,
typing, etc.) which are generally due to forgetfulness
and the model elements which are not considered by
CombiningSysMLandModelicatoVerifytheWirelessSensorNetworksEnergyConsumption
199
the model transformation (SysML model to Modelica
model) rules. The objective of this analysis is to en-
sure that the generated code at the end of the trans-
formation process is executable by the OpenModelica
compiler. After this check, we can undertake the third
step that defines the transformation from the SysML
model to the Modelica model. The file resulting from
this transformation is in XMI (XML Metadata Inter-
change) format conformed to the proposed Modelica
meta-model. For the last step, we transform the Mod-
elica model to the Modelica code. The input file of
this transformation (model to text) is the XMI file re-
sulting from the last transformation (SysML model to
Modelica model) and the output file is the Modelica
code.
4.1 The Case Study
We present an example for the motorized traffic den-
sity in urban areas. It requires the establishment of
signaling traffic laws to improve the safety and the
fluidity. The toughest traffic problems are at the road
intersection. In fact, the passage priority associated
to eventual changing direction could create bottle-
necks. The solution adopted by traffic operators to
regulate circulation is signalized system(tricolor and
bicolor lights). The traffic lights installed at the in-
tersection are used to adjust the vehicle movements.
They are managed by a system that synchronizes the
color changes of the different junction lights. The
traffic-light colors are managed by a controller which
depends on the number of cars waiting to cross the
junction. The duration of a cycle lights (yellow - red
- green) and the time of each phase is defined by the
traffic center of the city. This center supervizes all
streets intersections.
4.2 Transformation Rules from SysML
to Modelica
In the literature, we found several attempts to define
correspondences between the SysML (or UML2) and
the Modelica languages (Paredis and Johnson, 2008),
(Paredis et al., 2010). These works are based on the
MDA standard, that describes an approach to make
model transformations. The main work is (SysML-
ToModelica, 2012), there is ongoing work by the
OMG on standardization of the model transforma-
tion SysML to Modelica. Our approach takes into ac-
count the requirement, structural and behavioural dia-
grams. The requirement diagram describes functional
and non-functional requirements as well as the trace-
ability of these with the elements of the model. Struc-
tural diagram allows is used to describe the structure
Table 1: Transformation rules from SysML to Modelica.
Elements of SysML
model
Elements of Modelica
model
package, block, abstract-
block
package, block, partial-
class
flow-specification,
value-type
connector, type
flow-property, flow-port property, connector
connector flux(x,y) equation connect(x,y)
constraint property equation
state machine guard ’when’ statement guard
operation without a
value to return
instruction block of
’when’ statement
operation with a value to
return
function
requirement boolean expression (in-
variant or safety con-
straint)
of the target model and the parametric diagram allows
us to consider the mathematical models which repre-
sent the behaviour of the real system. Finally, state
machine diagrams are used to describe the behaviour
of each component of the system under study. The
below table 1 provides a list of correspondences be-
tween the elements of the SysML and the Modelica
metamodels.
5 VERIFICATION WITH Modelica
5.1 Virtual Verification
The Modelica language enables simulation and veri-
fication through the tests. In this context, the seminal
work is presented by W. Schamai and al. (Schamai
et al., 2011) which shows an approach to verify the
properties of Modelica model. This approach relies
on the MBSE (Model Based Systems Engineering).
This model will be executed and checked against the
system requirements in the early stages of the de-
velopment cycle. Furthermore, in the MBSE ap-
proach requirements are connected with model ele-
ments which allows traceability.
5.2 Energy Consumption Verification
In our approach, we rely on the SysML requirement
diagrams. The designer selects a checkable require-
ments by linking them with boolean expression (con-
straint) that represents invariant or safety constraint
of system. To ensure traceability, the designer must
connect each checkable requirement with one or more
blocks that will satisfy this requirement. In this way,
MODELSWARD2013-InternationalConferenceonModel-DrivenEngineeringandSoftwareDevelopment
200
we ensure the reusability and the traceability of re-
quirements. During the simulation of our system, we
adopted a random scenario of execution. The number
of vehicles on each lane will be randomly generated
every five seconds. After these steps, we specified a
simulation time which must be greater than the WSN
desired lifetime in the order to analyze all the criti-
cal durations of time (minimal WSN lifetime). Oth-
erwise, after ”19.22” hours of the simulation, the re-
quirement that expresses the WSN desired lifetime is
violated.
6 CONCLUSIONS AND FUTURE
WORKS
This work illustrates an approach to design and to ver-
ify the WSN energy consumption property using the
MDA standard. This approach combines the bene-
fits of the SysML and the Modelica languages. We
proposed a model transformation from the SysML
model to the Modelica model taking into account the
static diagrams, dynamic diagrams and also the re-
quirement diagram of the SysML in order to spec-
ify the matching Modelica model. In addition, we
have done virtual verification and requirement trac-
ing. These operations are allowed by the mapping
between the SysML requirements and the Modelica
properties (constraints). We also indicate that our
methodology is implemented in the TopCased envi-
ronment.
The next phase of this work is to introduce sequence
and activity diagrams in the action descriptions of the
state machine. The purpose of this step is to pro-
vide opportunities for designers who do not master
the Modelica programming to work with our Frame-
work. Furthermore, we intend to validate our model
transformation from SysML to Modelica by unit test-
ing and/or formal proofs.
ACKNOWLEDGEMENTS
We would like to acknowledge the support of the Re-
gional Council of Franche-Comt´e with the SyVad
1
project.
REFERENCES
AP2 (2012). http://ap233.eurostep.com.
1
(http://syvad.univ-fcomte.fr)
Cheong, E., Lee, E. A., and Zhao, Y. (2006). ‘Joint
Modeling and Design of Wireless Networks and Sen-
sor Node Software. Technical Report UCB/EECS-
2006-150, EECS Department, University of Califor-
nia, Berkeley.
Fritzson, P. and Bunus, P. (2002). ‘Modelica-A Gen-
eral Object-Oriented Language for Continuous and
Discrete-Event System Modeling and Simulation.
Simulation Symposium, Annual, pages 0–365.
Halgamuge, M. N., Zukerman, M., Ramamohanarao, K.,
and Vu, H. L. (2009). ‘An Estimation of Sensor En-
ergy Consumption. Progress In Electromagnetics Re-
search B (PIERB), 12:259–295.
INCOSE (2012). http://www.incose.org.
Modelica (2009). Modelica Standard Library 3.1. http://
www.modelica.org/libraries/Modelica/.
Mozumdar, M. M. R., Gregoretti, F., Lavagno, L., Vanzago,
L., and Olivieri, S. (2008). A Framework for Mod-
eling, Simulation and Automatic Code Generation of
Sensor Network Application. In SECON, pages 515–
522.
Paredis, C. J., Bernard, Y., Burkhart, R. M., de Koning,
H.-P., Friedenthal, S., Fritzson, P., Rouquette, N. F.,
and Schamai, W. (2010). An Overview of the Sysml-
Modelica Transformation Specification. In 2010 IN-
COSE International Symposium.
Paredis, C. J. J. and Johnson, T. (2008). Using OMG’s
SysML to support simulation. In Proceedings of the
40th Conference on Winter Simulation, WSC ’08,
pages 2350–2352. Winter Simulation Conference.
S. Villa, D. Serna, J. A. (2011). Systemc Code Generation
from UML for Wireless Sensor Networks Design. In
International conference on modeling, simulation and
visualization methods, MSV ’11, pages 53–60.
Schamai, W., Helle, P., Fritzson, P., and Paredis, C. J. J.
(2011). Virtual Verification of System Designs against
system Requirements. In Proceedings of the 2010 in-
ternational conference on Models in software engi-
neering, MODELS’10, pages 75–89, Berlin, Heidel-
berg. Springer-Verlag.
SysML1.3 (2012). http://www.omg.org/spec/SysML/1.3/.
SysMLToModelica (2012). SysML-Modelica transforma-
tion(SyM) specification. http://www.omg.org/SyM/
1.0/.
UML2.4 (2011). http://www.omg.org/spec/UML/2.4.1/ In-
frastructure.
CombiningSysMLandModelicatoVerifytheWirelessSensorNetworksEnergyConsumption
201