Mathmetical Modelling
Mathmetical Modelling
Mathmetical Modelling
5/5/2013
Presented by
PRAGATI RANA 112008 PRAKASH CHANDRA BHARTI 112009 SOHAIL KHAN 112016
OUTLINE
Exordium Historical Background Simulation Tools and Techniques Application Areas of Simulation Classification of Simulation Discrete Event Simulation Features Provided by Language Simulation Language Verification and Validation Input Modelling
2
5/5/2013
CONTENT COVERAGE
5/5/2013
PRAGATI RANA
P. C. BHARTI
Input Modelling
Exordium Historical Background Simulation Tools and Techniques Application Areas of Simulation Classification of Simulation
Discrete Event Simulation Features Provided by Language Simulation Language Verification and Validation
SOHAIL KHAN
EXORDIUM
5/5/2013
o What is Mathematical Modelling? Models describe our belief, how the real world functions. In mathematical modelling we translate those beliefs into the language of beliefs.
Advantage:
Mathematics is very precise language. This helps us to formulate ideas and identify underlying assumptions.
All results that mathematics have proved over hundreds of year are at our disposal.
4
Motivation: An organisation realised that for the improvement in the performance of the system they have to see and experiment with the real system, through the observation and aid to statistics to reach valid conclusion towards future system improvements.
5/5/2013
Improvement can be done by the help of system modelling equations through analytical or numerical methods but the model may be too difficult for the complex system.
In this extreme situation people use simulation technique for the improvement, and now it has become common practice .
6
o Building a computer model that consist of or that describes the behaviour of system. o Experimenting with this model to reach conclusions that support decisions.
o Once we have a computer simulation model of the actual system, we need to generate values for the random quantities that are part of the system input (to the model).
HISTORICAL BACKGROUND
5/5/2013
analog simulator.
Followed by a progression from analog to digital simulator via hybrid analog and digital systems, followed
5/5/2013
o
o o o o
Designing and analyzing manufacturing systems Evaluating military weapons systems or their logistics requirements Determining hardware requirements or protocols for communications networks Determining hardware and software requirements for a computer system Designing and operating transportation systems such as airports, freeways, ports, and subways Evaluating designs for service organizations such as call centers, fast-food restaurants, hospitals, and post offices Reengineering of business processes Determining ordering policies for an inventory system Analyzing financial or economic systems
10
5/5/2013
System:
5/5/2013
In practice, depends on objectives of study Might limit the boundaries (physical and logical) of the system Judgment call: level of detail (e.g., what is an entity?) Usually assume a time element dynamic system
State of a system:
... CONTD.
5/5/2013
Types of systems
Discrete
State variables change instantaneously at separated points in time Bank model: State changes occur only when a customer arrives or departs
Continuous
State variables change continuously as a function of time Airplane flight: State variables like position, velocity change continuously
are
partly
discrete,
partly
12
... CONTD.
5/5/2013
Physical model
Mathematical model
Analytical Solution
Simulation
13
CLASSIFICATION OF SIMULATION
5/5/2013
Most operational models are dynamic, stochastic, and discrete will be called discrete-event
simulation models
14
Advantage:
Disadvantage:
Advantage:
5/5/2013
Control variations
Generally less costly
Disadvantage:
Realism Validity
16
Definition:
static
simulation
model
is
5/5/2013
18
Continuous
event:
Programming:
19
Discrete-event simulation: Modeling of a system as it evolves over time by a representation where the state variables change instantaneously at separated points in time
More precisely, state can change at only a countable number of points in time These points in time are when events occur Programming
5/5/2013
Look at system only when events occur; time is advanced from event to event.
Event: Instantaneous occurrence that may change the state of the system
Sometimes get creative about what an event is e.g., end of simulation, make a decision about a systems operation
20
EXAMPLE
5/5/2013
it.
... CONTD.
Service times are also assumed to be random. After service, all customers return to the calling population.
5/5/2013
For this example, we use the following variables to define the state of the system: (1) the number of
... CONTD.
5/5/2013
All the information about them is maintained in a list called the event list.
We begin this simulation with an empty system and arbitrarily assume that our first event, an arrival, takes place at clock time 0.
... CONTD.
Also, we now schedule the next arrival into the system by randomly generating an inter-arrival time from the inter-arrival time distribution and setting the arrival time as
Arrival time = clock time now + generated inter-arrival time
5/5/2013
Both these events are their scheduled times are maintained on the event list.
This approach of simulation is called the next-event timeadvance mechanism, because of the way the clock time is
... CONTD.
As we move from event to event, we carry out the appropriate actions for each event, including any scheduling of future events.
5/5/2013
The jump to the next event in the next-event mechanism may be a large one or a small one; that is, the jumps in this method are variable in size.
With this method, we advance the simulation clock in increments of t time units, where t is some appropriate time unit, usually 1 time unit.
25
... CONTD.
5/5/2013
Consequently, we use only the next-event approach for the development of the models for the rest of the
chapter.
... CONTD.
5/5/2013
DT = scheduled time of the next departure SS = status of the server (1=busy, 0=idle) WL = length of the waiting line MX = length (in time units) of a simulation run
... CONTD.
5/5/2013
Example: Single-server queue Estimate expected average delay in queue (line, not service) State variables Status of server (idle, busy) needed to decide what to do with an arrival Current length of the queue to know where to store an arrival that must wait in line Time of arrival of each customer now in queue needed to compute time in queue when service starts Events Arrival of a new customer Service completion (and departure) of a customer Maybe end-simulation event (a fake event) whether this is an event depends on how simulation terminates (a modeling decision)
28
VIEWS UNDER WHICH THE SIMULATION IS GUIDED FOR THE DEVELOPMENT OF THE SIMULATION MODEL
Event Orientation defines the changes in state that occur at each event time Process Orientation describes the process through which the entities in the system flow
Activity Scanning Orientation describes the activities in which the entities in the system engage
29
... CONTD.
Event scheduling
Write modules that describe changes in the state of the system at each event Main program advances time One subprogram for each event General purpose programming language
5/5/2013
Process interaction
Write modules that describe the progress of entities through the system As entities move the systems changes state Entities are held to represent activities and delays Pro-model programming language
30
EVENT SCHEDULING
Time is advanced from event to event Future events list ordered list of upcoming events
5/5/2013
As events are scheduled, they are added to the list As events occur they are removed from list
Activities in event ( one / event type) List is required to keep track of entities in a set Statistics Two types
W = (W1 +W2 + +Wn)/n = Total Wait / # of wait L = (0(t1) + 1(t2-t1) + 2(t3-t2) + 1(t4-t3)) / t4
31
ACTIVITY SCANNING
5/5/2013
Activity scanning
Small time increments is inefficient Large time increments may miss activity Describes the activities in which the entities in the
system engage.
32
PROCESS ORIENTED
Process oriented:
5/5/2013
The logic associated with such a system or events can be generalized and
defined by a single statement
A simulation language could then translate such statement into the appropriate sequence of events
describes the processes through which the entities in the system flow.
These statements, define a sequence of events which are automatically executed by the simulation language as the entities move through the process
Conceptual
framework(entities,
attributes,
resource,
queues)
Maintenance of event list Random variable generation Animation Debugging function Output analysis Input analysis Report generation
34
SIMULATION LANGUAGES
5/5/2013
computer programming.
Several special-purpose computer simulation languages have been developed to simplify programming.
Most simulation languages use one of two different modeling approaches or orientations; event scheduling or process interaction.
35
... CONTD.
GPSS uses the process-interaction approach. SLAM allows the modeler to use either approach or even a mixture of the two, whichever is the most appropriate for the model being analyzed.
5/5/2013
In fact, several simulation languages, including GASP IV and SLAM, use a FORTRAN base.
36
... CONTD.
5/5/2013
For the rest of the program, we use the GASP routines. Because of these prewritten routines, GASP IV provides a great deal of programming flexibility.
... CONTD.
5/5/2013
Building a GPSS model then consist of combining these sets of blocks into a flow diagram so that it represents the path an entity takes as it passes through the system.
SLAM was developed by Pritsket and Pegden (1979). It allows us to develop simulation model as network
... CONTD.
5/5/2013
The most important of these is that the specialpurpose languages provide a natural framework for simulation modeling and most of the features needed in programming a simulation model.
39
5/5/2013
Say, total packets = packets sent + packets received If not, can halt or warn
Even if end-simulation will be complicated and non-deterministic, use simple repeatable values (maybe fixed seeds) to debug
40
Continuity tests
Slight change in input should yield slight change in output, otherwise error
Thrput
Thrput
(Undebugged)
(Debugged)
Degeneracy tests
Seed independence random number generator starting value should not affect final conclusion
(maybe
individual
output,
but
not
overall
42
conclusion)
VALIDATION
5/5/2013
Unlike verification, techniques to validate one simulation may be different from one model to another Three key aspects to validate:
Assumptions Input parameter values and distributions Output values and conclusions
Expert intuition Real system measurements Theoretical results
43
... CONTD.
5/5/2013
Most practical, most common Brainstorm with people knowledgeable in area Assumptions validated first, followed soon after by input. Output validated as soon as output is available (and verified), even if preliminary Present measured results and compare to simulated results (can see if experts can tell the difference)
Throughput
0.2
0.4
0.8
But even one or two measurements add an enormous amount to the validity of the simulation
Should
compare
input
values,
output
values,
workload
characterization
Can use statistical techniques (confidence intervals) to determine if simulated values different than measured
May not be useful for sole validation but can be used to complement
measurements or expert intuition
Ex: measurement validates for one processor, while analytic model validates for many processors
Would require too many resources and may be impossible Can only show is invalid
Instead, show validation in a few select cases, to lend confidence to the overall model results
46
INPUT MODELLING
You make custom Widgets How do you model the input process? Is it deterministic? Is it random? Look at some data
5/5/2013
ORDERS
6/4/2004 6/15/2004
47
HISTOGRAM
8
5/5/2013
7 6 5 4 3 2 1 0
[0 ,2 ]
[2 ,4 ]
[4 ,6 ]
[6 ,7 ]
[8 ,1 0]
[1 0, 12 ] [1 2, 14 ] [1 4, 16 ] [1 6, 18 ] [1 8, 20 ]
OTHER OBSERVATIONS
Trend?
Seasonality
20
Use the data directly (trace-driven simulation) Use the data to fit an empirical distribution Use the data to fit a theoretical distribution
ASSUMPTIONS
oTo fit a distribution, the data should be drawn from IID observations oCould it be from more than one distribution? oStatistical test oIs it independent?
49
ABSENCE OF DATA
5/5/2013
Documentation SMEs
50
TRIANGULAR DISTRIBUTION
5/5/2013
51
a=b=5
a=b=10
52
53
Benefits:
Fill in gaps and smooth data Make sure tail behavior is represented
Extreme events are very important to the simulation but may not be represented
A customer places a monthly order. Since the customer keeps inventory of the product, a large order is often followed by a small order
A distributor with several warehouses places monthly orders, and these warehouses can supply the same customers The behavior of customers logging on to a web site depends on
SOLUTIONS
5/5/2013
Customers
Need a random vector model where each component may have a different distribution
Binomial, etc. Normal, gamma, beta, etc. Empirical/Trace-driven Independent binomial Multivariate normal Bivariate-exponential
Cont.-state
Stochastic Processes
Continuous-time
Discrete-state
Cont.-state
IS DATA REALITY
5/5/2013
Data
is often
Distorted
Poorly communicated, mistranslated or recorded Data is always old by definition Some of the data is often missing Often only summaries, or collected at certain times This may all be on purpose!
Dated
Deleted
Dependent
Deceptive
59
reasons
There is rarely a theoretical justification for the distribution. Simulation is often sensitive to the tails and this is where the problem is!
ALTERNATIVE
random
E.g., we have talked about arrival times, service times being drawn from a particular distribution
5/5/2013
We do this by first generating a random number (uniform between [0,1]) and then
transforming it appropriately
THREE ALTERNATIVES
Pseudo-random numbers
Quasi-random numbers
Validity
The simulation model may not be valid due to cycles and dependencies in the model
Precision
PSEUDO-RANDOM NUMBERS
interval
63
Every time we anticipate a new customer arrival (place an arrival even on the events list), we need to generate a realization of of the arrival times
Know how to generate unit uniform. Can we use this to generate exponential? (And other distributions)
64
Direct
Indirect
Acceptance-rejection
65
CONCLUSION
5/5/2013
The historical background, need, and modelling of simulation, simulation tool, technique and input modelling are discussed in this presentation.
66
5/5/2013
THANK YOU
VALUABLE SUGGESTIONS
67