Download Discrete Models-Mathematical Modeling and Simulation-Lecture Slides and more Slides Mathematical Modeling and Simulation in PDF only on Docsity!
Lecture Slides
on
Modeling and Simulation
Lecture : Discrete Models
Discrete Mathematical Models
- There are two important types of discrete systems. The first type
is a discrete system having distinct objects or components and/or
discrete properties and relations associated with them.
- The objects of a discrete system are usually known as entities.
These entities possess attributes that are properties, qualities or
characteristics.
- Entities may be in two kinds of states: either they are busy in
some activity or they are idle and waiting in a queue. The queue
means the common state in which various entities are present
before they move to a next state.
Algorithms/Flow Charts for Discrete Models
- Generally discrete models are developed as a result of logical sequence of steps. These steps can be converted into an algorithm or a flow chart.
- An algorithm is a list of instructions for carrying out a process in some number of steps. We may consider a recipe for cooking a dish as a process to illustrate an algorithm.
- A flow chart is a diagram to represent an algorithm of a process. This has start and stop buttons. They signify the start of the process and after certain number of steps when the process is complete the system stops.
- For example, the rectangular box contains the instruction where some action is being taken.
- When there are decisions between two types of actions, we introduce a new shape of frame in the flow chart. It is a decision box containing the question or an assertion. This box has two exits labeled true and false.
- Then we may improve upon this scheme by adding decisions and possible loops. The complexity of loops will depend on details and decisions being made at each step.
Algorithms/Flow Charts for Discrete Models
This emphasizes the Entities entering the model environment.
It is concerned with following the progress of entities throughout the model. It
will record all changes, delays, waiting times and working times.
Statistics are gathered for averaging the waiting times, number of entities
processed by the model and for use of facilities in the model.
Figure shows a model for telephone queue. The people arrive, join the end of
queue, move up towards booth make calls and leave the model.
The facility is the Telephone booth, which is always in the model.
The length of time in queue for each is recorded and length of time in booth is
also recorded and then averaged.
Entity Oriented Discrete Models
Arrival block
Join Queue
Leave Queue
Make Call
Departure Block
Figure: Public Telephone queue ā entity ā oriented model.
Entity Oriented Discrete Models
Figure: Public Telephone queue ā Event-based model.
EVENT ARRIVAL BEGIN CALL LEAVE
PROCESS THE EVENT
Generate caller to join the queue
Extract caller from the queue to begin call
Extract caller from the booth
SCHEDULE ANY OTHER EVENTS
- Next arrival
- Beginning of call
Leave at the end of call
Begin next call
Event ā based Discrete Model
Example of event-based models
- Here, the telephone booth queue is modeled in an event-based manner. Figure shows that the event starting the system is the arrival of a customer to join the queue.
- Figure above shows the telephone queue modeled from an event-processing point of view.
- The events that 'drive' the system are the ARRIVALs of would-be callers to join the queue. From knowledge of the average rate of arrival, a random sequence of ARRIVALs is generated as a series of events.
Table 1 An Event-Based Model of Telephone booth Queue
Event Arrival Begin Search Leave
Process
the Event
Generate a caller to join the queue
Extract a caller from the queue to begin the call. Set booth BUSY
Extract the caller from booth; Then set booth as IDLE
Schedule
any Other
Event
1. Next _arrival
- Beginning_ of call
Leave the booth at the end of call
Beginning of next call (if queue exists).
Example of event-based models
Activity Scanning Based Models
- It is centered around activity or process of system, which may be defined as a
busy state of the entities bounded by two events.
- There are start-activity events and stop-activity events in this model.
- Since an activity is a busy state of entities, this implies that it cannot take
place unless all the entities required are available.
- Furthermore, it also implies that the entities involved in an activity cannot be
released until that activity has ceased. At each event time, the activities are scanned to make sure if any are in a position to start.
- We may infer from the occasion of the start-activity event that a change of
state takes place in the associated entities, from idle to busy.
- The same may be said about the stop-activity event, where a change takes
place from busy to idle.
The telephone model has following activities:
- MAKE CALL is conditional activity.
- Activity LEAVE is a bound activity that will start as soon as MAKE
CALL is finished.
- Queue between these two is dummy.
- The ARRIVE activity is treated as activity of zero duration.
- The cycle for BOOTH is a closed cyce connecting caller to MAKE
CALL activity.
Activity Scanning Based Models
Figure: Public Telephone queue ā activity life cycles
Activity Life Cycle in a Discrete Model
Arrival MAKECALL LEAVE
Outside World WAIT^ QUEUE^
Outside World
Idle
Random Numbers
- Random numbers form an essential part of the
Discrete Stochastic method.
- The term random number is generally used for
uniform random number.
- Many techniques for generating random numbers
have been suggested, tested, and used in recent years.
- Some of these are based on random phenomena,
others on deterministic recurrence procedures.
Random Numbers
- Initially, manual methods were employed, including coin
flipping, dice rolling, card shuffling, and roulette wheels.
- It was believed that only mechanical (or electronic) devices
could yield "truly" random numbers.
- These methods were too slow for general use and sequences
generated by them could not be reproduced.
- Shortly following the development of fast digital computers it
became possible to obtain random numbers with its aid.
- One method of generating random numbers on a digital
computer was based on preparing a table and storing it in the
memory of the computer.