[go: up one dir, main page]

0% found this document useful (0 votes)
36 views10 pages

Simulation Techniques in IT Applications

This chapter discusses simulation techniques used in IT applications for modeling, analyzing, and predicting system behavior, emphasizing their role in optimizing performance and reducing costs. Key methods include Discrete-Event Simulation (DES) and Continuous Simulation (CS), each suited for different types of systems, alongside Monte Carlo Simulation for risk analysis. The chapter outlines fundamental concepts, advantages, challenges, and practical applications of these techniques in various scenarios.

Uploaded by

Rica Guiuo
Copyright
© © All Rights Reserved
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)
36 views10 pages

Simulation Techniques in IT Applications

This chapter discusses simulation techniques used in IT applications for modeling, analyzing, and predicting system behavior, emphasizing their role in optimizing performance and reducing costs. Key methods include Discrete-Event Simulation (DES) and Continuous Simulation (CS), each suited for different types of systems, alongside Monte Carlo Simulation for risk analysis. The chapter outlines fundamental concepts, advantages, challenges, and practical applications of these techniques in various scenarios.

Uploaded by

Rica Guiuo
Copyright
© © All Rights Reserved
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

CHAPTER

Simulation Techniques for IT Applications


4
Simulation techniques are widely used in IT applications to model, analyze, and predict
system behavior. These techniques help in optimizing performance, testing systems before
deployment, and reducing costs. In this chapter, various simulation techniques used in IT
applications were introduced.

Learning Outcomes
At the end of this chapter, you are expected to:
1. Demonstrate an understanding of the concepts of simulation modeling.
2. Apply different simulation techniques for IT applications.

Learning Content
Simulation modeling is a technique used to create a digital representation (model) of a
real system, allowing IT professionals, engineers, and businesses to test and optimize processes
in a virtual environment. These models are constructed using mathematical and computational
representations that define both the static and dynamic aspects of the system.
Simulation modeling is a powerful tool for analyzing complex systems and optimizing
decisions. This approach saves time, cost, and resources by avoiding direct interaction with the
real-world system.
Key Features of Simulation Modelling
• Mimics real-world processes without the risks of physical experimentation.
• Uses mathematical and computational techniques to analyze system behavior.
• Enables scenario testing to predict outcomes under various conditions.
• Improves decision-making by providing insights into system performance.
Key Components of Simulation Modeling
1. System: The real-world entity being modeled.
2. Model: A mathematical or computational representation of the system.
3. Parameters: Fixed values that define system characteristics.
4. Variables: Elements that change over time and affect system behavior.
5. Events: Specific occurrences that lead to changes in the system state.
6. Constraints: Conditions or limitations within which the system operates.
7. Simulation Software: A program that mimics a system, allowing you to see how a process
works without performing it in real life (e.g., MATLAB, AnyLogic, or CloudSim).

1
Discrete-Event Simulation (DES)
Discrete-event simulation is a method of modeling systems that change state at discrete
points in time, such as arrivals, departures, failures, or repairs. DES tracks the events that occur in
the system and updates the system state accordingly. For example, you can use DES to model
a queueing system, job scheduling in operating systems, or network traffic simulation.
Characteristics of Discrete-Event Simulation
• Events occurring at specific points in time
• Emphasis on events
• Time skipping (next-event time advance)
• Heavy use of queueing theory
Thus, simply put, DES could be defined as “a system designed to process some sort
of entities with some kind of resources” (Choi, & Kang, 2013. p. 43).

Fundamental Concepts of DES


According to Stamatti (2024), DES revolves around entities, events, the
simulation clock, and queues
• Entities represent the objects or elements within the system under observation.
• Events, triggered by entities, denote occurrences that affect the system’s state or
condition.
• The simulation clock marks discrete instances when these events transpire, driving
the progression of time within the simulated environment.
• Queues play a pivotal role in managing and processing entities, representing
waiting lines or buffers where entities await processing or service.
Common DES components can be classified into:
• Sources are responsible of producing entities and inserting them into the simulating
system. Times between arrival and amount of entities per arrival are common
parameters of sources.
• Servers (with or without queues) are in charge of delaying entities in the system for
a given time period defined usually as a processing time.
• Sinks are used to remove entities from the simulating system and are useful to
collect information about times spend by entities and performance of the overall
system.

2
Applications and Use Cases
• Workflow Modeling: DES enables modeling complex workflows within systems,
aiding in understanding process dynamics.

Fuel Station
• Process Optimization: DES can be used to optimize manufacturing processes,
supply chain operations, or service systems. By simulating different scenarios, DES
helps identify bottlenecks and inefficiencies, thereby enabling data-driven
process improvements.

Multi-part Manufacturing
• Resource Allocation Analysis: DES aids in analyzing resource allocation strategies.

Logistics Distribution

3
Advantages of DES
• System Performance Evaluation
• Predictive Modeling
• Cost-Effective Experimentation
Challenges and Limitations
• Complexity in Model Construction
• Computational Resource Intensity
• Continuous vs. Discrete Systems

Example: A Single-Server Queue System


A bank has a single teller serving customers. The system operates for a fixed duration (10
minutes), and customers arrive at the bank at specific times. Each customer requires a specific
amount of service time to be completed by the teller. The goal is to simulate the bank's queue
system and compute the following:
1. Customer Waiting Time: The amount of time each customer spends waiting in the
queue before being served.
𝐶𝑢𝑠𝑡𝑜𝑚𝑒𝑟 𝑊𝑎𝑖𝑡𝑖𝑛𝑔 𝑇𝑖𝑚𝑒 = 𝑆𝑒𝑟𝑣𝑖𝑐𝑒 𝑆𝑡𝑎𝑟𝑡 − 𝐴𝑟𝑟𝑖𝑣𝑎𝑙 𝑇𝑖𝑚𝑒
𝑇𝑜𝑡𝑎𝑙 𝑊𝑎𝑖𝑡𝑖𝑛𝑔 𝑇𝑖𝑚𝑒 = ∑(𝑤𝑎𝑖𝑡𝑖𝑛𝑔 𝑡𝑖𝑚𝑒 𝑓𝑜𝑟 𝑒𝑎𝑐ℎ 𝑐𝑢𝑠𝑡𝑜𝑚𝑒𝑟)
𝑇𝑜𝑡𝑎𝑙 𝑊𝑎𝑖𝑡𝑖𝑛𝑔 𝑇𝑖𝑚𝑒
𝐴𝑣𝑒𝑟𝑎𝑔𝑒 𝑊𝑎𝑖𝑡𝑖𝑛𝑔 𝑇𝑖𝑚𝑒 =
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝐶𝑢𝑠𝑡𝑜𝑚𝑒𝑟 𝑆𝑒𝑟𝑣𝑒𝑑
2. Departure Time: The time each customer leaves the system after receiving service.
𝐷𝑒𝑝𝑎𝑟𝑡𝑢𝑟𝑒 𝑇𝑖𝑚𝑒 = 𝑆𝑒𝑟𝑣𝑖𝑐𝑒 𝑆𝑡𝑎𝑟𝑡 + 𝑆𝑒𝑟𝑣𝑖𝑐𝑒 𝑇𝑖𝑚𝑒
3. Total Service Time: The total time spent by the teller servicing customers during the
simulation.
𝑇𝑜𝑡𝑎𝑙 𝑆𝑒𝑟𝑣𝑖𝑐𝑒 𝑇𝑖𝑚𝑒 = ∑(𝑠𝑒𝑟𝑣𝑖𝑐𝑒 𝑡𝑖𝑚𝑒 𝑓𝑜𝑟 𝑒𝑎𝑐ℎ 𝑐𝑢𝑠𝑡𝑜𝑚𝑒𝑟)
4. Server Utilization: The proportion of time the teller is actively serving customers during
the simulation.
𝑇𝑜𝑡𝑎𝑙 𝑆𝑒𝑟𝑣𝑖𝑐𝑒 𝑇𝑖𝑚𝑒
𝑈𝑡𝑖𝑙𝑖𝑧𝑎𝑡𝑖𝑜𝑛 =
𝑆𝑖𝑚𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝐷𝑢𝑟𝑎𝑡𝑖𝑜𝑛
5. Idle Time: The amount of time the teller is idle (not busy), waiting for the next customer
to arrive.
𝐼𝑑𝑙𝑒 𝑇𝑖𝑚𝑒 = 𝑆𝑖𝑚𝑢𝑙𝑎𝑖𝑡𝑜𝑛 𝐷𝑢𝑟𝑎𝑡𝑖𝑜𝑛 − 𝐵𝑢𝑠𝑦 𝑇𝑖𝑚𝑒
Given data:
• Simulation Duration: 10 minutes
• Arrival Times: 0, 2, 5, 7
• Service Times: 3, 2, 4, 3 minutes
• Simulation clock starts at 0
• Customer Queue (FCFS – first come, first serve order)

Process events in order:


• Arrival event: A customer arrives and either enters service immediately or joins the
queue.

4
• Departure event: A customer completes service, and the next customer (if any) starts.
Customer Arrival Time Service Time Service Start Waiting Time Departure Time
1 0 min 3 min 0 min 0 min 3 min
2 2 min 2 min 3 min 1 min 5 min
3 5 min 4 min 5 min 0 min 9 min
4 7 min 3 min 9 min 2 min 12 min

Interpretation:
• Customer 1: Arrives at 0, starts service immediately, leaves at 3.
• Customer 2: Arrives at 2, waits 1 minute (since teller is busy), starts at 3, leaves at 5.
• Customer 3: Arrives at 5, starts immediately (teller is free), leaves at 9.
• Customer 4: Arrives at 7, waits 2 minutes (teller busy), starts at 9, leaves at 12.

Results:
• Total Waiting Time = 0 + 1 + 0 + 2 = 3 minutes
• Average Waiting Time = (0 + 1 + 0 + 2) / 4 = 3 / 4 = 0.75 minutes
• Total Service Time = 3 + 2 + 4 + 3 = 12 minutes
• Utilization = (12 / 10) = 1.2 ≈120%
Siince the teller worked beyond the 10-minute simulation duration (up to 12
minutes), the utilization exceeds 100%. This means the server was overloaded, and
customers continued beyond the simulation time.
• Idle Time = 0 minutes (since the server was always busy)
The teller was only idle before the first customer arrived. After that, each customer
arrived before or exactly when the previous service ended.

Continuous Simulation (CS)


Continuous simulation is a method of modeling systems that change state continuously
over time, such as fluid flow, temperature, or population. CS uses differential equations to
describe the relationships between the system variables and solves them numerically. For
example, you can use CS to model a data center cooling systems, cybersecurity risk
propagation, AI training models, or internet bandwidth usage.

Example: Patient Flow in an Emergency Room (ER)


A small hospital starts with 10 patients in the emergency room. Every hour, 3 new patients
arrive. Every hour, 1 patient is discharged. Estimate the number of patients after 3 hours using
Euler’s method with a step size of 1 hour assuming that the initial number of patients in the ER is
10.
𝑃 𝑡 + 𝑑𝑡 = 𝑃 𝑡 + 𝜆 − 𝜇 ∗ 𝑑𝑡
where:
• 𝑃 𝑡 = Number of patients at time 𝑡
• λ = 3 patients arriving per hour (rate of arrivals)
• µ = 1 patient leaving per hour (rate of discharges)
• 𝑑𝑡 = 1 hour (time step)

5
Compute Values Step by Step
𝑨𝒕 𝒕 = 𝟎, 𝐼𝑛𝑖𝑡𝑖𝑎𝑙 𝐶𝑜𝑛𝑑𝑖𝑡𝑖𝑜𝑛:
𝑃 0 = 𝟏𝟎 (initial number of patients)
At time t = 0 (which is the start of the observation), the number of patients in the
emergency room is 10. This is the initial condition of the system.
𝑨𝒕 𝒕 = 𝟏 𝒉𝒐𝒖𝒓:
𝑃 1 =𝑃 0 + 3−1 ∗1
𝑃(1) = 10 + 2 ∗ 1 = 𝟏𝟐
After 1 hour, 3 new patients arrive, and 1 patient is discharged. The net change in the
number of patients is 3 – 1 = 2 patients per hour. Therefore, after 1 hour, the number of patients
in the hospital is 10 + 2 = 12.
𝑨𝒕 𝒕 = 𝟐 𝒉𝒐𝒖𝒓𝒔:
𝑃 2 =𝑃 1 + 3−1 ∗1
𝑃(2) = 12 + 2 ∗ 1 = 𝟏𝟒
After another hour, 2 new patients arrive (net increase per hour). The number of patients
increases by 2 again, resulting in 12 + 2 = 14 patients after 2 hours.
𝑨𝒕 𝒕 = 𝟑 𝒉𝒐𝒖𝒓𝒔:
𝑃 3 =𝑃 2 + 3−1 ∗1
𝑃 3 = 14 + 2 ∗ 1 = 𝟏𝟔
After the third hour, another 2 patients are added (net increase per hour). The number
of patients increases again by 2, leading to a total of 14 + 2 =16 patients after 3 hours.
Results:
After 3 hours, the estimated number of patients in the emergency room is 16.

Comparison Between DES and CS


Feature Discrete-Event Simulation (DES) Continuous Simulation (CS)
Time Progression Jumps from event to event Advances smoothly over time
Nature of Change Instantaneous, at specific times Gradual, continuous changes
Best for Queueing systems, networks, Physical processes, AI training
transactions
Examples Network traffic, cloud computing, Data center cooling, bandwidth
cybersecurity events usage
Mathematical Basis Event scheduling, probability Differential equations, calculus
distributions

Monte Carlo Simulation


Monte Carlo Simulation is a probabilistic simulation technique that uses random sampling
to estimate uncertain outcomes. It is widely used in risk analysis, decision-making, and
optimization in various IT applications.

6
How Monte Carlo Simulation Works
1. Define the Problem: Identify the uncertain variables and the system being
modeled.
2. Assign Probability Distributions: Model the uncertainty using statistical distributions
(e.g., Normal, Uniform, Exponential).
3. Generate Random Samples: Use random sampling techniques to create multiple
scenarios.
4. Run Simulations: Perform thousands or millions of iterations.
5. Analyze Results: Calculate probabilities, mean values, confidence intervals, and
risk factors.

Example: Estimating the Probability of a Successful Cyber Attack


A company experiences random attack attempts per year, with each attack
having random chance of success. The company wants to estimate the probability that
at least one attack succeeds within a year.

Step 1: Define variables


Assume:
• 𝑁 = Number of attack attempts per year (random uniform distribution between 1
and 5)
• 𝑃 = Success probability per attack (random uniform distribution between 10%
(0.10) and 30% (0.30))
• 𝑋d = Random outcome of attack 𝑖, where:
1, 𝑖𝑓 𝑈d < 𝑃
𝑋d =
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
where 𝑈d ~𝑈𝑛𝑖𝑓𝑜𝑟𝑚(0,1) is a random number.
• 𝑌 = Indicator of at least one successful attack in a year:
1, 𝑖𝑓 hdij 𝑋d > 0
𝑌=
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
• 𝑃lmnopq = Estimated probability of a successful breach:
t
suv rs
𝑃lmnopq =
w

where 𝑀 is the number of Monte Carlo simulations.


Step 2: Simulate 5 years
Year Number of Attacks (N) Success Probability (P) Attack Outcomes (𝑋d ) Breach? (Y)
1 3 [0.5, 0.15, 0.8] 0.20 (20%)
2 2 [0.3, 0.6] 0.25 (25%)
3 4 [0.2, 0.5, 0.1, 0.7] 0.15 (15%)
4 1 [0.25] 0.30 (30%)
5 5 [0.5, 0.7, 0.9, 0.5, 0.6] 0.10 (10%)

Year 1:
• Random number of attacks: N = 3
• Success probability per attack: P = 0.20 (20%)

7
• Random values for attack success: 𝑼𝟏 = 𝟎. 𝟓, 𝑼𝟐 = 𝟎. 𝟏𝟓, 𝑼𝟑 = 𝟎. 𝟖
• Check success condition (𝑈d < 𝑃):
o Attack 1: 0.5 > 0.20 → Fail (0)
o Attack 2: 0.15 < 0.20 → Success (1)
o Attack 3: 0.8 > 0.20 → Fail (0)
• At least one attack was successful (𝑋d > 0) → Year 1 is a breach year (Y1 = 1)
𝑌 =0+1+0=1
Year 2:
• Random number of attacks: N = 2
• Success probability per attack: P = 0.25 (25%)
• Random values for attack success: 𝑼𝟏 = 𝟎. 𝟑, 𝑼𝟐 = 𝟎. 𝟔
• Check success condition:
o Attack 1: 0.3 > 0.25 → Fail (0)
o Attack 2: 0.6 > 0.25 → Fail (0)
• No successful attack → No breach this year (Y2 = 0)
𝑌 =0+0=0
Year 3:
• Random number of attacks: N = 4
• Success probability per attack: P = 0.15 (15%)
• Random values for attack success: 𝑼𝟏 = 𝟎. 𝟐, 𝑼𝟐 = 𝟎. 𝟓, 𝑼𝟑 = 𝟎. 𝟏, 𝑼𝟒 = 𝟎. 𝟕
• Check success condition:
o Attack 1: 0.2 > 0.15 → Fail (0)
o Attack 2: 0.5 > 0.15 → Fail (0)
o Attack 3: 0.1 < 0.15 → Success (1)
o Attack 4: 0.7 > 0.15 → Fail (0)
• At least one attack succeeded → Year 3 is a breach (Y3 = 1)
𝑌 =0+0+1+0=1
Year 4:
• Random number of attacks: N = 1
• Success probability per attack: P = 0.3 (30%)
• Random values for attack success: 𝑼𝟏 = 𝟎. 𝟐𝟓
• Check success condition:
o Attack 1: 0.25 < 0.30 → Success (1)
• At least one attack succeeded → Year 3 is a breach (Y3 = 1)
𝑌=1

8
Year 5:
• Random number of attacks: N = 5
• Success probability per attack: P = 0.1 (10%)
• Random values for attack success: 𝑼𝟏 = 𝟎. 𝟓, 𝑼𝟐 = 𝟎. 𝟕, 𝑼𝟑 = 𝟎. 𝟗, 𝑼𝟒 = 𝟎. 𝟒, 𝑼𝟓 = 𝟎. 𝟔
• Check success condition: All attacks fail since 𝑼𝒊 > 𝑷
o Attack 1: 0.5 > 0.10 → Fail (0)
o Attack 1: 0.7 > 0.10 → Fail (0)
o Attack 2: 0.9 > 0.10 → Fail (0)
o Attack 3: 0.5 > 0.10 → Fail (0)
o Attack 4: 0.6 > 0.10 → Fail (0)
• No successful attack → No breach this year (Y5 = 0)
𝑌 =0+0+0+0+0=0
Summary
Year Number of Attacks (N) Success Probability (P) Attack Outcomes (𝑿𝒊 ) Breach? (Y)
1 3 [0.5, 0.15, 0.8] 0.20 (20%) 0, 1, 0 1
2 2 [0.3, 0.6] 0.25 (25%) 0, 0 0
3 4 [0.2, 0.5, 0.1, 0.7] 0.15 (15%) 0, 0, 1, 0 1
4 1 [0.25] 0.30 (30%) 1 1
5 5 [0.5, 0.7, 0.9, 0.5, 0.6] 0.10 (10%) 0, 0, 0, 0, 0 0

Step 3: Compute probability of at least one breach in a year


The probability of at least one breach in a year is:
w
‚ij 𝑌‚
𝑃lmnopq =
𝑀
where:
• 𝑀 = 5 (total years simulated)
• 𝑌‚ = 1 if a breach occurred, 0 otherwise
j„…„j„j„… ‡
𝑃lmnopq = = = 0.6 (60%)
† †

Interpretation: The estimated risk of successful cyberattack per year is 60%.

Learning Activity
1. Read and study the links below about Joe’s Exhaust Parlor Discrete-Event Simulation
problem.
• [Link]
part-i-hern%C3%A1ndez
• [Link]
part-ii-hern%C3%A1ndez?trk=article-ssr-frontend-pulse_little-text-block
• [Link]
part-iii-hern%C3%A1ndez?trk=article-ssr-frontend-pulse_little-text-block

9
2. A water tank initially contains 50 liters of water, Water flows in at a rate of 4 liters per hour.
Water leaks out at a rate of 1% of the current water level per hour. We want to estimate
the water level after 3 hours using Euler’s method with a step size of 1 hour. Using Euler’s
method in Continues Simulation.

3. A company experiences 10 cyberattacks per year. Each attack has a 15% probability
of success. Estimate the probability that at least one attack succeeds in a year using
Monte Carlo simulation.

References
• [Link]
• [Link]
python-3b0cce67f92e
• [Link]
• [Link]
simulation/
• [Link]
screte_system_simulation.htm
• [Link]
• [Link]
• [Link]
[Link]?utm_source=[Link]

10

You might also like