Simulation and Modelling Systems
Simulation and Modelling Systems
1
Course Introduction
• Instructor: Cristina Comaniciu
– Office: Burchard 211
– Phone: 216-5606
– E-mail: [email protected]
– Office hours: Monday 1.30 pm – 3.00 pm, or by appointment
– For all information needs to be sent to the class, the pipeline e-mail list
for the class will be used
• Please make sure you check your e-mail for the address listed there
– Course website:
• http://www.ece.stevens-tech.edu/~ccomanic/cpe345_05.html - available
soon
– Some observations
• Make sure you have already installed on your computer MS Visual C++ 6.0,
before installing OMNET++
• For compilation in Windows systems, refer to Chapter 8.3 in the user manual
6
Windows users: Compiling OMNET++
applications from the command line
• Click start button on your computer screen
• Chose run – a small window will open: type cmd and click with the
mouse on OK, a command line window will open
• Change the directory to the current work directory (e.g.
C:\OMNET++\samples\token)
1. Use the OMNET++ utility to create Makefile.vc
– opp_nmakemake –f (will consider all files in the current directory)
2. Add dependencies nmake –f Makefile.vc depend
3. Compile nmake –f Makefile.vc
– An executable program will be created which has the name of the
directory (e.g. nim)
• Every time you make changes to the files, first type
nmake –f Makefile.vc clean, than repeat from 3
• If you add files in the directory, you have to rerun 1, to create
another Makefile
7
Course topics
• Modeling of physical systems
– What are models, when to use them versus when to measure or
analyze
• Simulation
– What it is, when it is doable, when it makes sense
• Event driven simulation
– General principles, and an example of simulator: OMNET++
– Examples for Queueing systems and Communications/Computer
systems
• Queueing models
• Random numbers
– Uses, generation, validation, pitfalls
• Output analysis
8
Course outcomes
• ABET Criteria:
– 1A1 – Recognize mathematical parameters as if they were physical
variables and vice-versa
– 1A2 – Be able to follow general mathematical concepts of derivation of
engineering or scientific result and possess the mathematical skill to
link those concepts
– 1A3 – Be able to understand the relevance of the mathematical results
to physical applications
– 1A4 – Be able to articulate algorithmic thinking through flow charts
– 3B1 – Use software for preparing, transmitting, and displaying
multimedia documents
– 3B2 – Have the ability to use computational tools for finding graphical,
numerical, statistical and analytic solutions to problems
– 3B3 – Have the ability to use systems simulations appropriate to
engineering practice
– 4A2 - Be able to identify input, output, and operating variables as
appropriate in various units
– 4A3 – Be able to identify technical relationships between the input,
output and variables and use the relationships to predict mutual
changes
9
Introduction to simulation
• What is simulation?
– Imitation of the operation of a real-world process or system over
time.
– Generates an artificial history of a system and based on the
observation of that artificial history inferences concerning the
operating characteristics of the real system can be drawn.
– A simulation can be only as good as the simulation model is.
– A simulation model – set of assumptions concerning the
operation of the system, expressed as mathematical, logical and
symbolic expressions between the object of interests (entities) of
the system.
– From the simulation, data are collected as if a real system were
being observed.
– The simulation generated data – used to estimate the measures
of performance for the system.
10
What is a system?
• System: set of objects, joined to accomplish some purpose
12
When is simulation appropriate?
• Allows access to system internals that may otherwise not be
observable.
• Informational, organizational, and environmental changes can be
simulated, and the effect of these changes on the model’s behavior
can be observed.
• Observations based on simulations give great insight into the
system behavior, and it can be determined which variables are most
important and how they interact.
• Analytic solutions can be verified.
• Simulation allows to experiment with new designs or policies prior to
implementation.
• Can be used for training without the cost and disruption of on-the-job
learning.
• Animation shows a system in simulated operation so that the plan
can be visualized
• The simulated system is so complex, that its interactions can be
treated only through simulation
13
When simulation is not appropriate?
14
Advantages and Disadvantages of Simulation
Advantages Disadvantages
• Explore new design options without • Model building may require special
disrupting existing systems training
• Test new hardware, transportation
systems, etc, without investing • Simulation packages may be
resources for their acquisition expensive
• Time scale can be compressed (for • Learning curve to use simulation
slow moving systems) or expanded packages may be longer than the
(for fast moving systems) time available
• Internal variables can be made
observable • Closed form analysis may be
• Sensitivity and interaction of possible
variables can be studied to
understand their impact on the • Results may be difficult to interpret:
system behavior – Do they really represent the
• Bottleneck analysis can be system, or a small set of instances?
performed – Is an observation characteristic for
the system inter-relationships, or is
• Deployment options can be studied: just the result of randomness?
what-if questions may be answered • Usually simulation results are
obtained for random inputs
15
Discrete versus Continuous System
Discrete Systems Continuous Systems
• State variable changes at • State variable changes
discrete points in time (events) continuously, as a function of time
s.v. s.v.
t
Analytical method: use deductive t
Numerical method: use computational
mathematical reasoning to define
procedures to solve mathematical models 16
system and solve
Types of Models
• A simulation model – a particular type of mathematical model of a
system. A mathematical model uses symbolic notations and
mathematical equations to represent the system.
• General classification of simulation models
rlo
Stochastic
a
te C
Mon
Deterministic
Continuous time
Discrete time
Static Dynamic
Analyze results
Sketch out model Collect data
Iterate as needed no no
Complete?
Create simulation
Documentation and
no reporting
Verified?
no no Implement
Valid? system
19
Homework no 1 – due next week in class
• Install Visual C++ 6.0 and OMNET++ and compile the token ring
example, token. Read the readme file for a description of the token
ring protocol. According to today’s lecture define the system model,
specifying all its components (entities, attributes, etc). What type of
simulation model is this (out of the 8 possible described categories),
and why? Is simulation appropriate for this system (Hint: relate to
the criteria discussed in the class)? Provide a list of events for one
particular run of the game.
20