0% found this document useful (0 votes)
214 views

Simulation and Modelling Systems

This document provides an overview of the CPE 345 Modeling and Simulation course. The instructor is Cristina Comaniciu and the course will use the OMNET++ simulation software. Topics covered include modeling physical systems, event-driven simulation, queueing models, random numbers, and output analysis. Students will complete homework, a midterm, final, and group project involving building a simulation in OMNET++. The goals are for students to understand simulation concepts and be able to apply computational tools like OMNET++ to solve engineering problems.

Uploaded by

Ganesan Ramu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
214 views

Simulation and Modelling Systems

This document provides an overview of the CPE 345 Modeling and Simulation course. The instructor is Cristina Comaniciu and the course will use the OMNET++ simulation software. Topics covered include modeling physical systems, event-driven simulation, queueing models, random numbers, and output analysis. Students will complete homework, a midterm, final, and group project involving building a simulation in OMNET++. The goals are for students to understand simulation concepts and be able to apply computational tools like OMNET++ to solve engineering problems.

Uploaded by

Ganesan Ramu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

CPE 345

Modeling and Simulation


Lecture 1

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

• Course requirements and grading


– Homework: 20% - individual effort
– Midterm 30% - individual effort
– Final 30% - individual effort
– Project 20% - group effort – small groups 2-4 students encouraged
2
Course requirements
• Homework:
– Generally due one week after it was assigned
– Problem solutions will be posted on line – no late homework will
be accepted after the solution was posted
– Must be printed hardcopy, or electronic (not handwritten)
• If electronic submission by e–mail attachment:
– The file should explicitly contain your name
– No executable attachments or macroviruses
– Include the problem statement with your solution
– Keep a copy of your homework – it will probably not be returned
– For programming submissions, make sure you include all the
required files (e.g. .h, initialization files, etc.) so that the program
can be built and run
– Try to solve the homework correctly and concisely (limit your
results to a few pages)
3
Textbook and software
• Textbook:
– Banks, Carson, Nelson & Nicol, “Discrete Event System Simulation,
Prentice Hall, 2001.
– Supplemental: OMNET++ user manual, available on line, as a part of
the free software package:
http://www.omnetpp.org/
• Software: OMNET++: event driven simulator - required
– Free software for academic use, download from
http://www.omnetpp.org/, use the quick download link on the right hand
side of the web page (currently version 3.0)
• Download from pipeline web page for class, version 2.3.
– MS. Visual C++ 6.0: you can obtain a copy from Stevens which has a
license for undergraduates. Installation of OMNET++, requires that you
have previously installed MS. Visual C++ 6.0.
– Matlab may also be used occasionally to plot various results – not
required – examples may be presented in class, that are generated
with Matlab
• Free similar program: Euler Software: - not personally tested
http://mathsrv.ku-eichstaett.de/MGF/homes/grothman/euler/index.html
• Matlab compatible free software: Octave – not personally tested
http://www.octave.org
4
5
Project and OMNET++ simulator
• The project will be an example of an event driven simulation and will
be implemented using OMNET++ (probably starting from the
examples that are already implemented)
• OMNET++ comes with a set of examples, a tutorial and a manual.
– Please install the program, and try to compile and run the token ring
example: token
– Class examples: related to computer networks: queueing
– Homework problems in OMNET++ will help you build the basic blocks
for your project simulation

– 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

Entity – object of interest in the system


Entities
Attribute: property of an entity

Activity: predefined set of actions in a


System
specified time period
Event
State of system: collection of variables
that describes the system at any
State time

Event: Instantaneous occurrence that


may be associated with change
of system state
Parameters
System Environment System Environment: region outside
the system that influences system
behavior. 11
How to choose the boundary?
Simulation Model

• A simulation model will consider a system model and an


environment model instead of the actual physical system
• What is a system model?
– Abstraction of a real system
• Simplifying assumptions capture only important behaviors, may
even make analysis tractable in some cases
• Outputs of the model will represent an estimate of the real outputs
for the physical system
• In the simulation, time scale may be also altered as
needed
– Capture rare events – compress time
– Simulate rapidly occurring events – expand time

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?

• Would common sense suffice?


• Is there an analytical solution?
• Is it easier to perform direct measurements on a physical system?
• Is the cost exceeding savings?
• Is there a shortage of resources for implementing the simulation
(funds are lacking to purchase simulation tools, designing and
conducting the simulation)?
• Is there a shortage of time for getting the desired results?
• Is data lacking for modeling the system and beginning a simulation
study?
• Is there enough time and personnel to verify and validate the
model?
• Are the managers’ expectations unrealistic?
• Is the system to complex to be modeled?

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

Static simulation – Monte Carlo simulation: represents a system at a particular point


in time.
Dynamic simulation: represents systems as they change over time.
Deterministic simulation: contains no random variables. Known set of inputs will result
in a unique set of outputs
Stochastic simulation: random inputs -> random outputs
17
outputs – estimates of the true characteristics of the model.
Couple of examples of simulation systems
• Banking system: waiting time performance for customers.
– State variables: number of busy tellers, number of waiting customers (in
the line)
– What kind of model? Ans: discrete, stochastic, dynamic
• Production: factory performance
– State variables: status of machines: busy, idle, down
– What kind of model? Ans: discrete, stochastic, dynamic
• Memory-less coin flipping experiment
– State variable: head or tail
– What kind of model? Ans: discrete, stochastic, static
• Noise in an electronic circuit
– State variable: current noise level
– What kind of model? Ans: continuous, stochastic, static
• Steam engine simulation:
– State variable: pressure
– What kind of model? Ans: continuous, deterministic, dynamic
18
Steps in a simulation study
Define the problem
Design experiment

Set objectives for simulations


Exercise simulation
Define overall approach

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

You might also like