Unit 1: Introduction to Simulation
1. Introduction to Simulation
Simulation is the process of creating a virtual model of a real-world system to understand, analyze,
and predict its behavior under different scenarios. It is widely used in areas like operations research,
computer systems, manufacturing, healthcare, and more.
2. System and System Environment
System:
A system is defined as a collection of interrelated components or entities working together to
achieve a specific goal.
• Examples:
o A hospital: includes doctors, nurses, patients, equipment, etc.
o A banking system: includes tellers, ATMs, customers, queue management.
System Environment:
The environment includes everything outside the system boundary that can affect or be affected by
the system.
• Example: For a supermarket system, the environment might include:
o Weather (affects footfall)
o Competitor pricing
o Supplier reliability
System Boundary:
A notional or conceptual boundary that separates the system from its environment.
3. Components of a System
1. Entities
o The objects (real or abstract) that are of interest in the system.
o Example: Customers in a queueing system.
2. Attributes
o Properties or characteristics of entities.
o Example: Arrival time, service time of a customer.
3. State Variables
o Variables that represent the system’s state at any point in time.
o Example: Number of customers in a queue.
4. Events
o Occurrences that change the state of the system.
o Example: Arrival of a new customer.
5. Activities
o Duration-based events that take time to complete.
o Example: A service taking 5 minutes.
6. Delays
o Passive waiting time with no active processing.
o Example: Time a customer waits before being served.
7. Resources
o Items required for the system to function (people, machines).
o Example: Tellers at a bank.
4. Types of Systems
Type Description Example
Deterministic No randomness; output is predictable Traffic light timers
Stochastic Involves randomness Customer arrival in a store
Static Time does not play a role Inventory snapshot
Dynamic Changes over time Call center operations
Discrete State changes at distinct points Bank queue (customer enters/leaves)
Continuous State changes continuously Water level in a tank
5. Types of Models
Models are simplified representations of real systems. They can be used for analysis, prediction, and
decision-making.
a. Physical Models
• Tangible, scaled-down representations.
• Example: Wind tunnel model of an aircraft.
b. Mathematical Models
• Uses equations, formulas, and logic to describe the system.
• Subtypes:
o Analytical Models (solved mathematically)
o Simulation Models (solved via computer simulation)
c. Simulation Models
• Computer-based models that mimic the behavior of real systems over time.
• Types:
o Discrete Event Simulation (DES): Events occur at discrete points.
o Continuous Simulation: Models changes continuously (e.g., chemical reactions).
o Agent-Based Models: Simulate interactions of autonomous agents.
Comparison Table of Model Types
Model Type Key Feature Example
Physical Tangible, scaled Miniature airplane in wind tunnel
Mathematical Abstract with formulas Supply-demand equations
Simulation Dynamic, time-based Hospital emergency room simulation
6. Steps in Simulation Study
Simulation is not just coding — it's a systematic process that requires structured planning and
execution. Below are the key steps involved in conducting a simulation study:
Step-by-Step Process
Step Description
Clearly define the objective of the simulation. What are you trying to
1. Problem Definition
understand, improve, or predict?
Identify entities, variables, and relationships. Develop a conceptual or
2. Formulate a Model
mathematical model representing the real-world system.
Gather real-world data required for model input — this includes arrival
3. Data Collection
rates, service times, resource availability, etc.
4. Model Translation Translate the conceptual model into a computer model using a simulation
(Coding) language or software (e.g., Arena, SimPy, AnyLogic).
Ensure that the model has been implemented correctly (debugging and
5. Verification
logic testing). Does it behave as expected under known conditions?
Compare model outputs with real system data to ensure it accurately
6. Validation
represents the real world.
Run simulations under different scenarios or configurations. Adjust
7. Experimentation
parameters and observe outcomes.
8. Analysis and Use statistical methods to analyze simulation output. Interpret the results
Interpretation and derive conclusions.
9. Documentation & Prepare detailed documentation of assumptions, model structure,
Reporting simulation results, and recommendations.
Use insights from the simulation to support decision-making or implement
10. Implementation
changes in the real system.
7. Advantages and Disadvantages of Simulation
Advantages of Simulation
Advantage Explanation
1. Flexibility Can model almost any real-world system — whether it's simple or complex.
2. Risk-Free Testing Try out new ideas or configurations without affecting the real system.
Advantage Explanation
3. Time Compression Simulate years of operations in minutes — useful for long-term planning.
4. Cost-Effective Avoids expensive trial-and-error in real systems.
5. Performance Insight Identify bottlenecks, resource utilization, queue lengths, etc.
6. Scenario Analysis Easily test multiple “what-if” scenarios to support decision-making.
Disadvantages of Simulation
Disadvantage Explanation
1. Time-Consuming Building an accurate model can take significant time and effort.
Effective simulation needs knowledge of modeling, statistics, and the system
2. Requires Expertise
being studied.
3. No Optimal Unlike optimization methods, simulation only gives estimates — not
Solution guaranteed optimal answers.
4. Data Dependency Garbage in = Garbage out. Inaccurate data can make the model misleading.
5. Software/Cost
Simulation tools may require licenses and training.
Issues
Part A: General Principles of Discrete Event Simulation (DES)
What is Discrete Event Simulation (DES)?
Discrete Event Simulation (DES) is a modeling approach in which the state of the system changes at
discrete points in time due to specific events.
• Example: In a bank, events like customer arrival or service completion occur at distinct times
and cause state changes.
Key Concepts in DES
Concept Description Example
Entity The item being processed Customers in a queue
An occurrence that changes the
Event Customer arrives, service ends
system state
State A snapshot of system variables Number of customers in queue
Activity Duration-based processes Time taken for a service
Delay Passive waiting period Time customer spends waiting
Clock Keeps track of simulated time Advances from one event to another
Future Event List Customer arrival at 10:00, service ends
List of all scheduled events
(FEL) at 10:05
DES Execution Flow (List Processing)
In DES, a Future Event List (FEL) is maintained — this controls how events are scheduled and
processed.
Steps in Execution Cycle:
1. Initialization
o Set initial clock time to 0.
o Initialize system state and event list.
2. Event Scheduling
o Determine which event is next (i.e., event with the earliest timestamp in FEL).
3. Advance Simulation Clock
o Move clock forward to the time of the next event.
4. Event Execution
o Update system state based on the event.
o Schedule new events (e.g., next customer arrival).
5. Repeat
o Continue until a stopping condition is reached (e.g., time limit, event limit).
Flowchart: Discrete Event Simulation Cycle
Part B: Statistical Models in Simulation
To simulate a system accurately, we often use probability distributions to model uncertainty and
randomness (e.g., arrival time, service time, failure rates).
Useful Statistical Models
Simulation uses different types of statistical distributions based on the system behavior:
1. Discrete Distributions
These are used when the variable takes on specific, separate values (integers, categories).
Distribution Use Case Example
Bernoulli Two outcomes (success/failure) Tossing a coin
Binomial Number of successes in fixed trials Defective items in batch
Geometric Number of trials before first success First success in cold calls
Poisson Count of events in fixed time Customer arrivals per minute
2. Continuous Distributions
Used when variables take any value within a range (e.g., real numbers).
Distribution Use Case Example
Uniform Equal chance in a range Random number generation
Exponential Time between random events Time between arrivals
Normal (Gaussian) Bell-curve shaped data Human heights, errors
Lognormal Positively skewed data Income distribution
3. Poisson Process
A Poisson process models random arrivals over time. It assumes:
• Events occur independently.
• Events occur at a constant average rate.
• Inter-arrival time is exponentially distributed.
Used for:
• Modeling customer arrivals
• Call center calls
• Web traffic
4. Empirical Distribution
When no known theoretical distribution fits the data, we use empirical distributions, i.e., data-
driven:
• Based on historical data
• Builds cumulative frequency tables
• Used for real-world observed patterns
Quick Summary Notes
Concept Purpose
DES Models systems with state changes at discrete time points
FEL Controls event execution timing
Statistical Models Represent randomness in systems
Poisson Process Key for modeling random arrival events
Empirical Dist. Real-world frequency-based modeling
Queueing Models:
Queueing theory is a branch of mathematics that deals with the study of queues or waiting lines. It is
widely used in various fields, including operations research, telecommunications, and computer
science, to analyze and optimize systems involving waiting lines. Below is an overview of the key
concepts you mentioned.
1. Characteristics of Queueing Systems
A queueing system typically involves the following elements:
• Arrival process: Describes how customers or items arrive at the system. This is typically
modeled as a stochastic process.
o Common models: Poisson process (exponentially distributed inter-arrival times), or
deterministic arrivals.
• Service process: Describes how customers or items are served once they are in the system.
o Common models: Exponentially distributed service times (Markovian), or general
service distributions.
• Queue discipline: Defines the order in which customers are served. Common disciplines
include:
o FIFO (First-In-First-Out): The first customer to arrive is the first to be served.
o LIFO (Last-In-First-Out): The last customer to arrive is the first to be served.
o Priority: Customers are given priority based on certain criteria.
• System capacity: The maximum number of customers or items that the system can handle. It
may be infinite or finite.
• Population size: This refers to whether the population from which customers arrive is finite
or infinite.
• Number of servers: The number of servers (or service channels) available to process
customers.
2. Queueing Notations
Queueing systems are often described using a notation called Kendall’s Notation. The typical
notation is:
A/B/C/K/X/Y
Where:
• A: Arrival distribution (e.g., M for Markovian or Poisson process, G for General distribution).
• B: Service distribution (e.g., M for Markovian, G for General).
• C: Number of servers (e.g., 1 for a single server, 2 for two servers).
• K: System capacity (total number of customers the system can hold, including those in the
queue and being served).
• X: Population size (e.g., ∞ for infinite population, N for finite population).
• Y: Queue discipline (e.g., FIFO, LIFO).
Examples:
• M/M/1: A single-server queue with Markovian (exponentially distributed) inter-arrival and
service times, and infinite population.
• M/G/1: A single-server queue with Markovian arrivals and a general service time
distribution.
3. Long-Run Measures of Performance of Queueing Systems
The performance of a queueing system is usually measured in terms of long-run or steady-state
metrics. Key measures include:
• λ (lambda): Arrival rate (the average number of customers arriving per time unit).
• μ (mu): Service rate (the average number of customers a server can serve per time unit).
• ρ (rho): Utilization factor or traffic intensity. It represents the proportion of time the server is
busy.
ρ=λμ\rho = \frac{\lambda}{\mu}
For a stable system, ρ < 1.
• L: Average number of customers in the system (in both the queue and being served).
• Lq: Average number of customers in the queue (not being served).
• W: Average time a customer spends in the system (waiting + service time).
• Wq: Average time a customer spends in the queue.
The formulas for these measures depend on the type of queueing model (e.g., M/M/1, M/G/1, etc.).
4. Steady-State Behavior of Infinite Population Markovian Models
In Markovian models (like M/M/1), the system’s behavior is analyzed in the steady state, meaning
the system has reached equilibrium where arrival rates and service rates have stabilized. Key metrics
include:
• L = λ / (μ - λ): The average number of customers in the system for a single-server queue.
• Lq = λ² / μ(μ - λ): The average number of customers in the queue.
• W = 1 / (μ - λ): The average time a customer spends in the system.
• Wq = λ / μ(μ - λ): The average time a customer spends in the queue.
These formulas hold under the assumption of an infinite population and Markovian arrivals and
services.
5. Steady-State Behavior of Finite Population Models
In finite population models, the arrival process is modified by the finite size of the population. For
example, in an M/M/1/N queueing model, there are N customers in the system, and once the
system reaches this number, no new customers can join. The steady-state behavior is influenced by:
• Finite capacity: The system can hold only a limited number of customers.
• Blocking probability: The probability that a customer is blocked from entering the system
due to full capacity.
6. Network of Queues
In real-world systems, multiple queues are often connected in a network. A queueing network is a
collection of interconnected queues where customers may move from one queue to another. This
can represent systems like manufacturing processes, computer networks, or call centers.
• Open networks: Customers enter the network and leave it.
• Closed networks: A fixed number of customers circulate within the network.
• Cyclic networks: Customers move through a series of queues in a cyclic manner.
The analysis of networked queues is typically more complex because it involves interactions between
queues, but Markovian models can be extended to handle networks using techniques like Jackson
networks or product-form solutions.
Summary
Queueing theory provides powerful tools for analyzing systems where customers or items wait in line
for service. The key characteristics of queueing systems include arrival and service processes, queue
disciplines, and system capacity. Kendall’s notation helps define the structure of these systems, and
performance metrics like utilization, average queue length, and waiting times are essential for
understanding and optimizing such systems. Infinite and finite population models provide different
insights, and networked queues offer an approach to more complex, real-world systems.
Unit 2
Random Number Generation, Random Variate Generation, Input Modeling, and
Output Analysis
1. Introduction to Random Numbers
In simulation, many processes are probabilistic (random in nature), like:
• Customer arrivals
• Machine breakdowns
• Service times
To simulate such events on a computer, we require random numbers,
especially uniformly distributed numbers between 0 and 1.
These numbers form the basis for generating random variates for other
distributions (normal, exponential, etc.).
However, computers are deterministic machines and can’t generate truly
random numbers — instead, they use algorithms to generate pseudo-random
numbers.
2. Characteristics of Good Random Numbers
An ideal random number generator (RNG) should produce numbers that have
the following statistical properties:
2.1 Uniformity
• The numbers should be evenly distributed in the interval (0, 1).
• Each subinterval should have approximately the same number of values.
2.2 Independence
• No predictable pattern or relationship should exist between successive
numbers.
• Each number should be statistically independent of the others.
2.3 Reproducibility
• If the same seed is used, the generator should produce the same
sequence, which helps in testing and debugging.
2.4 Long Period
• A period is the length of the sequence before it starts repeating.
• A good RNG should have a very long period, especially in simulations
with millions of numbers.
2.5 Efficiency
• The generation of each random number should be computationally fast
and require minimal memory.
3. Types of Random Numbers
• True Random Numbers: Generated by unpredictable physical processes
(e.g., radioactive decay). Difficult to implement and slow.
• Pseudo-Random Numbers (PRNs): Generated using mathematical
algorithms. Deterministic but appear random.
Most simulations use pseudo-random numbers.
4. Pseudo-Random Number Generation Techniques
The most common technique is the Linear Congruential Generator (LCG),
but several others exist.
4.1 Linear Congruential Generator (LCG)
One of the oldest and most widely used algorithms.
Formula:
• X0 = seed
• a = multiplier
• c = increment
• m = modulus
• Xi = current random number
• Xi+1 = next random number
To normalize:
Topic Description
PRNG Deterministic methods that generate numbers appearing random
LCG Popular method using modulus arithmetic
Mid-square Obsolete, based on squaring seed
Topic Description
Good PRN Uniform, independent, reproducible, long period
Tests Chi-square, K-S, Runs, Autocorrelation
Built-in tools Python random, MATLAB rand, NumPy
Example 1: Chi-Square Test for Uniformity of Random Numbers
Problem:
You have 20 random numbers between 0 and 1:
0.05, 0.12, 0.18, 0.22, 0.31, 0.35, 0.39, 0.45, 0.48, 0.52,
0.58, 0.63, 0.67, 0.72, 0.75, 0.82, 0.85, 0.90, 0.94, 0.98
You want to test if they follow a uniform distribution using the Chi-Square
test with 5 equal intervals in (0,1). Use significance level α=0.05.
Conclusion:
We fail to reject the null hypothesis.
The random numbers appear to be uniformly distributed over (0,1).
Example 2: Chi-Square Test for Categorical Data
Problem:
A simulation assumes customer arrivals on weekdays are equal (i.e., uniform
across Monday to Friday). In reality, the arrivals are:
Day Mon Tue Wed Thu Fri
Observed 18 22 20 15 25
Are these arrivals uniformly distributed?
Step 1: Hypothesis
• H₀: Arrivals are uniform (expected = equal on all days)
• H₁: Arrivals are not uniform
Step 2: Calculate Expected Frequencies
• Total = 18 + 22 + 20 + 15 + 25 = 100
• Expected for each day E = 100 / 5 = 20
We fail to reject the null hypothesis.
→ No significant evidence that arrivals differ by day. Distribution is uniform.
Solved Example – Runs Test (Test of Independence)
Problem:
Given the following sequence of 20 random numbers between 0 and 1:
0.72, 0.25, 0.89, 0.45, 0.68, 0.36, 0.91, 0.55, 0.29, 0.79,
0.14, 0.82, 0.48, 0.67, 0.35, 0.60, 0.22, 0.84, 0.31, 0.76
Use the Runs Test to check whether the numbers are independent. Use α=0.05.
Step 2: Convert to a Binary Sequence
Assign:
• “L” for < median
• “H” for ≥ median
Original sequence → Binary:
0.72 (H), 0.25 (L), 0.89 (H), 0.45 (L), 0.68 (H), 0.36 (L), 0.91 (H), 0.55 (L),
0.29 (L), 0.79 (H),
0.14 (L), 0.82 (H), 0.48 (L), 0.67 (H), 0.35 (L), 0.60 (H), 0.22 (L), 0.84 (H),
0.31 (L), 0.76 (H)
Binary Sequence:
H, L, H, L, H, L, H, L, L, H, L, H, L, H, L, H, L, H, L, H
Step 3: Count Runs
A run is a sequence of similar letters (H or L). Count transitions.
Sequence:
H|L|H|L|H|L|H|LL|H|L|H|L|H|L|H|L|H|L|H
Number of Runs (R) = 19
Conclusion:
We fail to reject the null hypothesis.
The sequence is independent (random).
Kolmogorov-Smirnov Test (K-S Test)
2 Practice Questions – Kolmogorov-Smirnov Test
2. Random Variate Generation
Simulation models often require random variates that follow specific
probability distributions, not just uniformly distributed random numbers.
Random variates are generated from these distributions to mimic real-world
processes, such as:
• Inter-arrival times
• Service durations
• Failure events
• Decision-making processes
Random variates are typically generated using Uniform(0,1) random numbers
as a base, and then transformed using mathematical methods.
2.1 Common Distributions Used in Simulation
Solved Examples + Practice
Input Modeling in Simulation
Definition:
Input Modeling is the process of analyzing and modeling real-world data that
enters a simulation system. The goal is to identify appropriate probability
distributions that represent random behaviors or inputs like arrival times,
service times, failure rates, etc.
Importance of Input Modeling
Input modeling plays a critical role in simulation because:
• Inputs drive the behavior and variability of the system.
• Accurate input models lead to realistic and reliable simulation results.
• Poor input modeling causes misleading outputs.
Steps in Input Modeling Process
1. Data Collection
Purpose:
To collect representative data that reflect the random inputs of the system.
Guidelines:
• Collect from real-time processes (e.g., production lines, transaction logs).
• Ensure data is clean, complete, and unbiased.
• Record time units precisely (e.g., minutes, seconds).
• Larger data sets generally improve reliability.
2. Data Summarization and Preliminary Analysis
Goal:
Understand the basic nature and structure of the data.
Common Techniques:
• Descriptive statistics (mean, median, variance, skewness)
• Visualization:
o Histograms
o Box plots
o Time series plots
o Empirical CDF
This step helps identify the potential shape of the distribution (e.g., normal,
exponential, skewed).
3. Choosing a Probability Distribution
Purpose:
Fit the collected data to a suitable probability distribution.
Common Distributions:
Type Examples
Discrete Bernoulli, Binomial, Poisson
Continuous Uniform, Normal, Exponential, Weibull, Gamma
Distribution Selection:
• Based on data shape (symmetry, skewness)
• Based on domain knowledge (e.g., exponential for inter-arrival times)
4. Parameter Estimation
After selecting a distribution, estimate the unknown parameters:
Methods:
• Method of Moments
• Maximum Likelihood Estimation (MLE)
• Least Squares Estimation
For example:
• Normal: Estimate mean (μ) and standard deviation (σ)
• Exponential: Estimate rate (λ)
5. Goodness-of-Fit Tests
After fitting a distribution, validate how well it matches the data.
Common Tests:
Test Name Use Case
Chi-Square Test Binned data, large samples
Kolmogorov-Smirnov (K-S) Continuous data, compares CDFs
Anderson-Darling Test More sensitive to tail differences
Q-Q Plot Visual check for distribution fit
These tests return a p-value:
• High p-value → Good fit
• Low p-value (<0.05) → Poor fit
6. Use in Simulation Models
Once the input distribution is verified:
• Use it in the simulation engine to generate random variates.
• These are used to simulate random events like:
o Customer arrivals (e.g., Poisson)
o Service times (e.g., Exponential, Normal)
o Breakdowns (e.g., Weibull, Exponential)
Summary of Input Modeling Steps
Step Description
1. Data Collection Gather real system data
2. Data Summarization Analyze using statistics and visualization
3. Distribution Selection Hypothesize candidate distributions
4. Parameter Estimation Fit parameters using MLE, moments, etc.
5. Goodness-of-Fit Testing Verify if distribution is appropriate
6. Implementation in Use validated input model to simulate random
Simulation events
Key Considerations
• The quality of input data directly affects simulation accuracy.
• Always test multiple candidate distributions.
• Don't assume a distribution without statistical evidence.
• Use software tools like:
o Arena
o MATLAB
o Python (SciPy, NumPy)
o R (fitdistrplus)
o EasyFit
Practice Questions:
1. Define input modeling and explain why it's important in simulation.
2. How do you decide which distribution best fits a dataset?
3. Describe the steps involved in fitting a distribution and validating it.
4. Suppose you have inter-arrival times: [5, 8, 3, 10, 4, 7]. Fit a distribution
and test its validity.
Common Tests:
Test Name Type When to Use Description
Compares observed
vs expected
Chi-Square Test Discrete/continuous Binned data
frequencies in
intervals
Kolmogorov- Compares empirical
Small/moderate
Smirnov (K-S) Continuous CDF to theoretical
samples
Test CDF
Test Name Type When to Use Description
Like K-S, but gives
Anderson-
Continuous Sensitive to tails more weight to tail
Darling Test
regions
Plots quantiles of
Q-Q Plot Graphical All data types data vs quantiles of
distribution
Summary Table
Topic Focus Techniques/Tools
Selection without No real data; use Expert judgment, theoretical
data assumptions models
Multivariate Input Covariance matrix, Cholesky
Correlated inputs
Modeling method
Time Series Input Inputs with autocorrelation AR, MA, ARIMA, SARIMA
Modeling over time models
Practice/Exam Questions:
1. What strategies can be used to model inputs when no data is available?
2. Explain the role of a covariance matrix in multivariate input modeling.
3. Describe how an AR(1) time series model works with an example.
4. Differentiate between AR and MA models in time series input modeling.
Verification and Validation (V&V) of Simulation Models
What is V&V?
Verification and Validation are essential quality assurance processes used to
ensure that a simulation model is:
• Correctly built (verification)
• Accurately represents the real-world system (validation)
These steps are not optional — they are critical to building trustworthy and
reliable simulations.
Why is V&V important in Simulation?
• To ensure that simulation outputs are reliable
• To build confidence in the simulation results for decision-making
• To detect and correct errors or incorrect assumptions
• To avoid costly mistakes based on misleading simulations
Difference Between Verification and Validation
Aspect Verification Validation
Focus Model logic and coding Real-world accuracy
Key “Are we building the model “Are we building the right
Question right?” model?”
Objective Ensure correct implementation Ensure simulation reflects the
Aspect Verification Validation
of the design real-world system
Performed
Developers, simulation analysts Domain experts, analysts
By
Statistical tests, expert
Method Tracing, debugging, animations
judgment, data checks
V&V Process in Simulation Development Lifecycle
A typical simulation model development includes these stages:
1. Problem Definition
2. System Study
3. Conceptual Modeling
4. Model Translation (coding) → Verification
5. Experimental Design & Data Collection
6. Model Calibration (if needed)
7. Model Testing & Comparison with Reality → Validation
8. Documentation and Deployment
So, Verification happens after model coding, and Validation is done after
comparing with real data.
What Happens if V&V is Skipped?
• Simulation may give wrong results even if the logic looks correct
• Misleading conclusions may be drawn
• It undermines trust and usefulness of the model
• Especially harmful in high-stakes systems (e.g., medical, defense, supply
chain)
Example Scenario
Suppose you’re modeling a bank:
• Verification: Is your simulation code correctly simulating customer
arrivals, queueing, and service? Are events triggered properly?
• Validation: Does the average waiting time from simulation match the
actual bank’s waiting time? Does the model mimic peak hours and traffic
patterns?
Summary Points
• Verification ensures the model behaves as intended
• Validation ensures the model mimics reality
• Both must be done iteratively
• Proper documentation and expert input are crucial
Model Building in Simulation
What is Model Building?
Model building is the process of creating a logical, mathematical, or
computational representation of a real-world system to study its behavior
through simulation.
It involves defining how the system works, specifying assumptions, and
designing the structure and behavior of the simulation model.
Objectives of Model Building
• To understand system behavior
• To test hypotheses or improvements
• To support decision-making without disrupting the real system
• To serve as the foundation for Verification and Validation (V&V)
Steps in Model Building
1. Problem Definition
Clearly define the purpose of the model:
• What is being studied?
• What decisions will the model support?
• What are the performance measures (e.g., waiting time, cost,
throughput)?
Example:
“To model customer flow in a hospital OPD and estimate average patient
waiting time.”
2. Define System Boundaries
• Decide what to include and what to exclude from the model.
• Set start/end conditions and limits.
Example:
Include: registration, triage, consultation
Exclude: pharmacy, lab tests
3. Identify Key Elements
Break down the real system into components:
Element Description
Entities Items that move or change in the system (e.g., customers, machines)
Attributes Properties of entities (e.g., arrival time, service time)
Resources Servers, machines, or workers used by entities
Events Triggers that cause changes (e.g., arrival, departure)
Queues Waiting lines when entities compete for limited resources
4. Make Assumptions and Simplifications
All models are simplifications of reality. Some assumptions are necessary to
keep the model manageable:
• Constant or stochastic service time?
• Are arrivals Poisson distributed?
• Are there limits on queue lengths?
Assumptions must be clearly documented and justified.
5. Specify Input Parameters and Distributions
Assign input values and probability distributions to uncertain parameters:
• Interarrival times → Exponential(λ)
• Service times → Normal(μ, σ²) or Triangular(a, b, c)
These inputs are gathered through data collection or expert judgment.
6. Conceptual Modeling
Develop a logical structure of how entities flow and interact. Use:
• Flowcharts
• Block diagrams
• Event graphs
This step acts as a blueprint for the actual implementation.
7. Implement the Model in Simulation Software
Use tools like:
• Arena
• Simul8
• AnyLogic
• MATLAB/Simulink
• Python (e.g., SimPy, Simulacra)
Model behavior is translated into simulation logic using code or visual
modeling blocks.
8. Test and Debug (Initial Verification)
Run the model with test inputs and check whether it behaves logically and
consistently.
Example: Building a Supermarket Checkout Simulation
• Problem: Analyze average waiting time for customers
• Boundaries: From entry to billing
• Entities: Customers
• Resources: Checkout counters
• Inputs: Arrival rate = 10 customers/hr, Service time ~ Triangular(3, 5, 7)
minutes
• Assumptions: FIFO queue, no priority customers
• Conceptual model: Customers arrive → Wait in queue → Get served →
Exit
Best Practices
• Involve domain experts early in the design
• Keep it simple initially — expand complexity as needed
• Document everything: assumptions, rules, distributions
• Use modular design — break down into sub-models
• Ensure traceability between real-world processes and simulation
elements
Summary
Step Goal
Problem Definition Define model purpose and questions
Boundary Specification Limit scope for clarity and efficiency
System Description Identify entities, events, resources
Assumptions Simplify system logically
Input Modeling Assign values and distributions
Conceptual Modeling Create logical structure of the model
Implementation Build using software or programming
Step Goal
Initial Testing Basic debugging and flow testing
Output Analysis for a Single Model
Output analysis involves interpreting the data generated from simulation models
to draw conclusions or make decisions. For a single model, the goal is to
analyze the results of one system configuration or design under study.
1. Types of Simulations with Respect to Output Analysis
Simulation models can be categorized based on how their output is analyzed:
a) Terminating Simulations
• These simulations end after a certain event or time.
• They have well-defined starting and stopping points.
• Examples:
o A bank simulation that ends after simulating a full business day.
o A production line simulated until a batch is completed.
b) Steady-State (Non-Terminating) Simulations
• These simulations run for a long time or indefinitely to capture long-
run behavior.
• Used when interested in the equilibrium (steady-state) performance of
the system.
• Examples:
o Continuous manufacturing plant.
o Long-term performance of a server system.
2. Stochastic Nature of Output Data
• Simulation output is generally stochastic (i.e., probabilistic) due to the
presence of random input variables (like interarrival times, service
times, etc.).
• Running the same simulation multiple times with different random seeds
will result in different outputs.
• Therefore, one needs statistical methods to:
o Estimate true performance.
o Quantify the uncertainty.
3. Measures of Performance and Their Estimation
The performance of a system is evaluated using certain output performance
measures, such as:
Common Measures:
• Average waiting time
• Queue length
• Resource utilization
• Throughput
• System time (response time)
Estimation Techniques:
Since simulation output is random, statistical estimators are used:
a) Point Estimation
• Use sample mean, sample variance, etc.
• Example:
If Y1,Y2,...,YnY_1, Y_2, ..., Y_n are n independent replications:
b) Interval Estimation (Confidence Interval)
• Provides a range within which the true value lies with certain confidence.
• For large n (Central Limit Theorem applies):
c) Replication Method
• Run the simulation multiple times with different seeds.
• Each run gives a performance measure.
• Use the sample of these outputs to perform statistical estimation.
4. Output Analysis of Terminating Simulations
Key Aspects:
• Focus on the entire run from start to the end event.
• Initial conditions are known and important.
• Suitable for short-term analysis.
Steps in Output Analysis:
1. Run multiple independent replications.
2. Collect relevant output variables for each run.
3. Compute sample statistics (mean, variance).
4. Construct confidence intervals to infer the true performance.
5. Output Analysis for Steady-State Simulation
Key Aspects:
• The simulation must run long enough to reach steady-state.
• Initial conditions are less important after the transient phase.
• Objective is to measure long-run average performance.
a) Warm-Up Period (Initial Transient)
• Discard data from the initial phase (warm-up period) to remove bias.
• Helps to focus on steady-state behavior only.
b) Batch Means Method
• Divide a long simulation run into batches of equal size.
• Compute the mean of each batch.
• Use batch means as if they are independent observations to estimate
steady-state parameters.
c) Moving Average / Time Series Smoothing
• Helps identify when the system reaches steady state.
• Plot running averages and monitor for stabilization.
d) Confidence Interval for Steady-State Mean
• Use the batch means or long-run averages to construct confidence
intervals.
Summary Table
Feature Terminating Simulation Steady-State Simulation
Feature Terminating Simulation Steady-State Simulation
Ends at specific
Duration Runs indefinitely (long time)
time/event
Focus Short-term behavior Long-run behavior
Initial State Very important Less important after warm-up
Batch means, warm-up
Techniques Independent replications
removal
Output Analysis Mean performance per
Steady-state average
Goal run
Unit 1 Questions
A. Introduction to Simulation
1. Define simulation. Explain the need and advantages of using
simulation.
2. What are the components of a system? Explain with examples.
3. Differentiate between physical and mathematical models with
examples.
4. What are the different types of systems in simulation? Give examples.
5. Explain the steps involved in conducting a simulation study.
6. Discuss the advantages and disadvantages of simulation.
B. General Principles of Discrete-Event Simulation
7. What is discrete-event simulation? Explain its key characteristics.
8. Describe the concept of list processing in discrete-event simulation.
C. Statistical Models in Simulation
9. Explain the importance of statistical models in simulation.
10.Differentiate between discrete and continuous probability
distributions with suitable examples.
11.Explain the Poisson process. Give one real-world application.
12.What is an empirical distribution? How is it used in simulation?
D. Queueing Models
13.What are the basic characteristics of a queueing system?
14.Explain the Kendall’s notation used in queueing theory with
examples.
15.Write short notes on:
• (a) Steady-state behavior of infinite population Markovian queueing
models
• (b) Steady-state behavior of finite population models
• (c) Network of queues and its significance
Unit 2 Questions
A. Random Number Generation
1. What are the key properties of random numbers? Explain with
examples.
2. Differentiate between true random numbers and pseudo-random
numbers.
3. Explain any two techniques for generating pseudo-random numbers.
4. Describe the mid-square method and linear congruential generator
(LCG).
5. What are the various statistical tests for random numbers? Explain
any two.
B. Random Variate Generation
6. Explain the inverse transform technique for generating random
variates.
7. Describe the convolution method with an example.
8. What is the acceptance-rejection technique? How is it used in
simulation?
C. Input Modeling
9. Explain the process of data collection for input modeling.
10.How do you identify the distribution of input data? List methods
used.
11.Describe parameter estimation in the context of simulation models.
12.Explain any two goodness-of-fit tests used for validating distribution
models.
13.What are the methods to select an input model in the absence of
data?
14.Differentiate between multivariate and time series input models.
Explain with examples.
D. Verification, Validation, and Output Analysis
15.Explain the steps involved in verification and validation of simulation
models.
16.What is the difference between calibration and validation? Give
examples.
17.Explain the output analysis of a terminating simulation.
18.How is output analysis carried out for steady-state simulations?
19.Define and explain the stochastic nature of simulation output.
20.List and explain any three performance measures used in simulation.