Modeling Dr. Anis Koubâa CS433 Modeling and Simulation

advertisement
Al-Imam Mohammad Ibn Saud University
CS433
Modeling and Simulation
Lecture 02
Modeling
http://10.2.230.10:4040/akoubaa/cs433/
20 Oct 2008
Dr. Anis Koubâa
1
What is modelling?
2
 A Model is a simplification of a real system
 Modelling is the process of representing a system
with a specific tool to study its behaviour
 A model can be
 Analytic when a mathematical approach is
feasible (e.g. Queuing Model)
 A simulation model used for complex systems
2
http://en.wikipedia.org/wiki/Model
Model (as defined in Wikipedia)
3
 A Model is a pattern, plan, representation (especially in
miniature), or description designed to show the main
object or workings of an object, system, or concept.
 Model may also refer to:
 Abstractions, concepts, and theories
 representations of objects
 human and animal behavior
 occupations
 history and culture
 lighting
 In geography …
3
Examples
4
 In general, modelling is used for systems with some
sort of uncertainty
 Waiting time in a restaurant/Aiport
 Time to go from home to the University
 Response time and Throughput of a web server
 The productivity of manufacturing systems
 Design of multi-processor machine
 Performance of MAC protocols (e.g.
CSMA/CA)
4
Examples: Movement
5
 Consider a system when a given object move
 This system can be modelled by the equation
S= V * t
Where S is the distance run through
V is the speed of the object
t is the time that has been observed.
 This is simplification of the real world
 Another model can take into account the direction of
movement, or the three dimension coordinate …
 It is therefore to study the behaviour of the system based
on a specific model
5
Examples: Model of a particle in a potential-field (Physics)
source: http://en.wikipedia.org/wiki/Mathematical_model
6
 In this model we consider a particle as being a point of
mass m which describes a trajectory
 The trajectory is modeled by a function x : R → R3 given
its coordinates in space as a function of time.
 The potential field is given by a function V:R3 → R and
the trajectory is a solution of the differential equation
 Note this model assumes the particle is a point mass,
which is certainly known to be false in many cases we use
this model, for example, as a model of planetary motion.
6
Example: MAC Protocol (e.g. CSMA/CA)
7
Source: HE et al.: AN ACCURATE MARKOV MODEL FOR SLOTTED
CSMA/CA ALGORITHM IN IEEE 802.15.4 NETWORKS, IEEE
COMMUNICATIONS LETTERS, VOL. 12, NO. 6, JUNE 2008
A. Koubâa, M. Alves, E. Tovar
A Comprehensive Simulation Study of Slotted CSMA/CA
for IEEE 802.15.4 Wireless Sensor Networks
In IEEE WFCS 2006, Torino (Italy), June 2006.
Jelena Miˇsi´c∗ Vojislav B. Miˇsi´c
Shairmina Shafi,
Performance of IEEE 802.15.4
beacon enabled PAN with uplink
transmissions in non-saturation
mode – access delay for finite
buffers, Proceedings of the First
International Conference on
Broadband Networks
(BROADNETS’04)
7
Examples: Radio Propagation Model
Source: http://en.wikipedia.org/wiki/Radio_propagation_model
8


A radio propagation model is an
empirical mathematical formulation for
the characterization of radio wave
propagation as a function of frequency,
distance and other conditions.
Different types of models



Models for outdoor environments: Ground
wave, Sky wave, Environmental Attenuation,
Point-to-Point propagation models, Terrain
models, City Models
Models for indoor environments
Empirical Model of Radio Channel
Source: Kannan Srinivasan and Philip Levis,
RSSI is Under Appreciated, ACM Workshop on
Embedded Networked Sensors (EmNets 2006),
Free Path Loss Model (Mathematical Model)
8
Characteristics of a Model
9
 A model is never equal to the real system, because it is
always simpler than the reality
 The accuracy of a model is determined by its tendency
to approach the real system
 Is that a problem?
 Yes, if the model ignore important parameters of the
real system (over simplification)
 No, if the model takes into account the important
parameters (ignoring some details is sometimes not
problematic)
9
Performance Evaluation of a System
A SYSTEM is a collection of entities (e.g., people or machines) that act and interact together
toward the accomplishment of some logical end.
SYSTEM
Experiment with the
Actual System
Experiment with a
Model of the System
There is always the question
of whether it
actually reflects the system.
Too costly or disruptive
Not appropriate for the design
Mathematical Model
Analytical Solution
If the model is simple enough. E.g., calculus,
algebra, probability theory
Make assumptions that take the form
of mathematical or logical
relationships
Simulation
Highly complex systems
10
Simulation versus Analytical Modeling





Simulation is not used when a suitable mathematical
model exists
Simulations are often complex error-prone pieces of
software
Simulation only produce approximate answers
Simulation can take a LONG time to execute
Mathematical models are less flexible, but they are exact
and efficient
The problem is what model represents
better the real world?
11
Classification of Models
1. Static vs. Dynamic Models:
Represents a system as it evolves over time
(e.g., a conveyor system in a factory)
Time plays no role; represents a system at a particular point in time
(e.g., Monte-Carlo methods)
2. Deterministic vs. Stochastic Models:
Involves random variables, probabilities
(e.g., most queueing and inventory systems)
No probabilistic components
(e.g., worst-case analysis of a system)
12
Classification of Models
3. Continuous vs. Discrete Models:
The state of the system changes only at
discrete points in time.
The state of the system changes continuously
(e.g., chemical processes)
Bit Arrival in a Queue
# of cars in a parking lot
bit
bit
time
Continuous Model
time
Discrete Model
13
Example: Determinitic vs. Stochastic
Queueuing System
Waiting vs. Utilization
0.25
W(sec)
0.2
0.15
0.1
0.05
0
0
0.2
0.4
0.6
0.8
1
1.2
r (%)
Deterministic Performance
Using Network Calculus
Stochastic Performance
Using Queueing Theory
14
The Modeling Process
15
The Modeling Process
16
Goals and Objectives
 Building a model is an iterative (repetitive) process,
 Some steps need to be repeated
 First, define goals and objectives
 What is the objective of building a model for the system?
 What are the properties of the system that need to be
considered to reach the goal?
 Second, collect available information about the system
 gather data by doing some measurement, or assuming empirical data
17
The Conceptual Model
 After studying the available information and with the
goals in mind, we start identifying our system in its three
main dimensions:
 Spatial,
 Temporal and
 Structural
By answering the basic questions about space, time
and structures, we describe the conceptual model of the
system.
18
Goals and Objectives
The Space Dimension
 What is the specific size of the object that we need to
analyze?
 How far spatially does that system extend (scalability)?
 How does the system evolve in space?
Is it static, or dynamic?
19
Goals and Objectives
The Structural Dimension
 What are the elements and processes in our system?
 How much detail about them we need and can afford?
 Do we have enough information about all of them or
some of them are entirely unknown?
 Which are the limiting ones, where are the gaps in our
knowledge?
 What are the interactions between the elements?
20
Goals and Objectives
The Time Dimension
 What is the time duration we should observe the system?
 Are we looking at it over years, days, hours, or seconds?
 Which processes are so slow that they may be considered constant during
the observed time?
 Do we need to see how does the system evolve in time, like in a movie, or we
just need a snapshot of the reality, like on a photo?
 Static or Dynamic ?
 If the system is evolving, how does it change from one state to another?
 Is it a continuous process or a discrete process?
 Is the transition from one state of the system to another stochastic or
deterministic?
21
The Conceptual Model
 A conceptual model may be a mental model, a flow diagram.
 Building the right conceptual model is half the way to success.
 In the conceptual model, you should clearly identify the
following components of the system:
• Boundaries
• Variables
• Parameters
• Forcing functions
• Control functions
22
The Conceptual Model
 Boundaries: specify what elements are included in the system and those
not.
 They distinguish the system from the outside world.
 What material and information flows into and out of the system?
 What processes are internal and which ones are external.
 State Variables: They characterize the elements in the system. These
quantities represent the evolution of the system, that you analyze and
report as a result of the modeling exercise.
 Parameters: They also characterize the elements of the system, but they
are constant throughout the modeling process. Parameters can either be
measured by direct experiments or may be borrowed from analyses of
similar systems performed previously.
23
The Conceptual Model
 Forcing functions: They describe the effect of the outside world
upon your system.
 The forcing functions may change in time, but they do not
respond to changes within the system.
 Control functions: They are actually parameters, except that you
allow them to change to see how their change affects your system
dynamics.
 It is like the tuning button on your radio set. At every time it is dialed to a
certain position, but you know that it may vary and result in different
performance of the system.
24
Mathematical Model
 The conceptual model only represents the real system, but does not enable its
analysis.
 The conceptual model can be analyzed using some mathematical tools
(Probability, Algebra, Differential equations, Queuing theory, etc …)
 The model must be formalized (the formalization step).
 Formalization is finding the adequate mathematical equations/formulation to
represent the real system.
 Instead of concepts, words, images, you need to come up with equations
and formulas.
 Formalization is not always possible and there is no one-to-one
correspondence between a conceptual model and its mathematical formalization.
There are only certain rules and recommendations, but no ultimate procedure
known.
25
Sensitive Analysis
 Sensitivity Analysis: the study of how the variation in the output
of a model can be distributed (qualitatively or quantitatively) to
different sources of input variation.
 Sensitivity Analysis offer valid tools for characterizing the
uncertainty associated with a model.
 Methodology: there are several technique, but the most common is
sampling-based sensitivity analysis.
 With sampling-based sensitivity analysis, the model is executed
repeatedly for combinations of values sampled from the
distribution (assumed known) of the input factors.
26
Calibration
 Calibration is often regarded as including the process of adjusting the output or
indication on a measurement instrument to agree with value of the applied
standard, within a specified accuracy.
After formulization of the model, adjust the behavior of your mathematical
model to fit the behavior of the real system by tuning some parameters of the
model.
 Solving the equations and generate trajectories for the variables.
 The Calibration process consists in adjusting the results of the analysis of the
mathematical model with the data available.
 There are always some parameters that you do not know exactly and
that you can change a little to get a better fit of your model dynamics to
the one observed.
27
Verification and Validation
 Verification is a quality process used to evaluate whether or not a
model complies with the specification of the real system.
 Validation is the process of establishing documented evidence that
provides a high degree of assurance that a model complies with the
real system.
It is sometimes said that validation ensures that ‘you built the right
model’ and verification ensures that ‘you built it right’.
28
Download