Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic...

103
Stochastic Simulation Performance and Dependability Paulo Maciel Centro de Informática - UFPE

Transcript of Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic...

Page 1: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Stochastic SimulationPerformance and Dependability

Paulo Maciel

Centro de Informática - UFPE

Page 2: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Objective

To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability problems.

Page 3: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Program

Introduction

Problems and Mistakes in Simulation

System and Model

Classification of Models

Types of Simulation

Discrete Event Simulation: an Overview

Random Number Generation

Random Variates Generation

Output Analysis – Steady State Simulation

Output Analysis – Transient Simulation

Verification and Validation

Page 4: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Methodology

Expositive classes

Practical classes

Page 5: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Evaluation

List resolutions

Write a draft paper

Page 6: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Basic References

Art of Computer Systems Performance Analysis Techniques For Experimental Design Measurements Simulation And Modelingm, Raj Jain, Wiley Computer Publishing, John Wiley & Sons, Inc,1991.

Simulation modeling handbook : a practical approach, Christopher A. Chung. 2003.

Stochastic Simulation: Algorithms and Analysis, Søren Asmussen, Peter W. Glynn. Springer, 2007.

Introduction to Discrete Event Systems, Christos G. Cassandras, Stéphane Lafortune. Springer. 2008

Page 7: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Introduction

Simulation

Analysis

Evaluation

Page 8: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Introduction

When is simulation

an interesting option?

Page 9: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Introduction

Common mistakes in simulation projects:

Not considering numerical or analytical methods as possible alternative

Inappropriate level of detail

Not taking into account the modeling and coding costs

Unverified and invalid models

Improperly handled initial conditions

Results without confidence level and error margin

Poor random-number generators

Poor interpretation of results

Page 10: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

System and Model

The Concept of System

An aggregation or assemblage of things so combined by nature or man as to form an integral or complex whole (Encyclopedia Americana).

An interacting or interdependent group of items forming a unified whole (Webster’s Dictionary)

A combination of components that act together to perform a function (IEEE Standard Dictionary).

There are two features in these definitions: 1. a system consists of interacting “components”, and

2. a system is associated with a “function”.

Page 11: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

System and Model

Model

Abstraction level

Perspective

Page 12: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

System and Model

Model

Page 13: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

System and Model

State and state variable

Page 14: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

System and Model

Event

An event may be identified with a specific action taken by a person or system or

It may be viewed as a spontaneous occurrence dictated by nature or

it may be the result of several conditions which are suddenly all met.

Page 15: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

System classification

Page 16: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Types of Simulation

Static vs Dynamic Simulation

Static simulation is adopted for representing a system in which time does not play a role or to describe a system at a particular time.

Dynamic simulation is used for depicting a system that evolves over time.

Page 17: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Types of Simulation

Deterministic vs Stochastic Simulation

Deterministic simulation considers models that do not contain any random variable, that is, the output is determined once the input quantities and the model relations are defined.

Stochastic simulation adopts models that have at least one random variable.

Page 18: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Types of Simulation

Continuous vs Discrete Model Simulation

Continuous model simulation relies on continuous models for representing the system whereas discrete model simulation is supported by discrete models.

Page 19: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Types of Simulation

Trace driven (Deterministic simulation)

Monte Carlo (Stochastic static model simulation)

Discrete event (Stochastic dynamic discrete model

simulation)

Page 20: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Trace-Driven Simulation

Trace-driven simulation uses traces (time-ordered record of events on a real system) as its input applied to the simulation model which depicts the system behavior. This sort of simulation strategy has been applied for evaluating resource management algorithms, such as paging algorithms, cache analysis, CPU scheduling algorithms, and algorithms for dynamic allocation of storage.

Page 21: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Monte Carlo simulations are used to model probabilistic phenomena that do not change characteristics over time.

Monte Carlo simulations are also used for evaluating non-probabilistic expressions using probabilistic methods.

Page 22: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Page 23: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Integration

Excel

Mathematica

Page 24: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Estimating - Model

Minitab Mathematica

Model

Input parameters

Excel

0.2 0.4 0.6 0.8 1.0

0.2

0.4

0.6

0.8

1.0

Mathematica

V2

Page 25: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Piston pump

Page 26: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Cont.

Page 27: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Model

Monte Carlo Simulation

Page 28: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Input data parameters

Page 29: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Create random input data

Apply the input data to the model

Analyze the output

Minitab Excel Mathematica

Page 30: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Analyze the output

Page 31: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Monte Carlo Simulation

Analyze the output

The average flow rate is pretty close to the specified value, but

the standard deviation far exceed 0.2 ml/min.

Page 32: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 33: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 34: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 35: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 36: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 37: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 38: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 39: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 40: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an Overview

Page 41: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an example

Excel

N/N/1

Page 42: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: an example

C:\Users\Paulo Maciel\Dropbox\Models\Mercury\Mercury 4.4.3\Mercury 4.4.3.2\Examples

Page 43: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: a SPN example

C:\Users\Paulo Maciel\Dropbox\Models\Mercury\Mercury 4.4.3\Mercury 4.4.3.2\Examples\StudyOnSimulation.xml

Page 44: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: a SPN example

C:\Users\Paulo Maciel\Dropbox\Models\Mercury\Mercury 4.4.3\Mercury 4.4.3.2\Examples\StudyOnSimulation.xml

Page 45: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Discrete Event Simulation: a SPN example

C:\Users\Paulo Maciel\Dropbox\Models\Mercury\Mercury 4.4.3\Mercury 4.4.3.2\Examples\StudyOnSimulation.xml

Page 46: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Number Generator

Page 47: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Number Generator

Generation of Uniform Random Numbers

Excel

Page 48: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Number Generator

Generation of Uniform Random Numbers

Excel

Page 49: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Number Generator

Generation of Uniform Random Numbers

Excel

Page 50: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Number Generator

Generation of Uniform Random Numbers

Excel

Page 51: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Number Generator

Generation of Uniform Random Numbers

Excel

Page 52: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Number Generator

Generation of Uniform Random Numbers

Excel

Page 53: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate Generator

A random variable is a function.

A random variate is an outcome provided by a random variable.

Page 54: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate Generator

Basic methods

– Inversion transform

– Convolution

– Composition

– Characterization

– Acceptance-Rejection

Page 55: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorInversion transform

Page 56: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorInversion transform

Generation of Exponential Variate

The sequence of random numbers will not be identical,

but will be statistically equivalent.

Excel

Exponential

Mathematica

Exponential

Page 57: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorInversion transform

Generation of Exponential Variate

Excel

Exponential

Mathematica

Exponential

Page 58: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorInversion transform

Generation of Exponential Variate

Excel

Exponential

Mathematica

Exponential

Page 59: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorInversion transform

Excel

Discrete

Mathematica

Discrete

Page 60: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorInversion transform

Excel

Discrete

Mathematica

Discrete

Page 61: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorInversion transform

Page 62: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorConvolution

Excel

Erlang

Mathematica

Erlang

Page 63: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorConvolution

Excel Erlang

Mathematica

Erlang

Page 64: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorComposition

Excel Hyper-Exponential

MathematicaHyper-Exponential

Page 65: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorComposition

Excel Hyper-Exponential

MathematicaHyper-Exponential

Page 66: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorComposition

Excel Hyper-Exponential

MathematicaHyper-Exponential

Page 67: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorCharacterization

Excel Normal

MathematicaNormal

Page 68: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorCharacterization

Excel Normal

MathematicaNormal

Page 69: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorAcceptance-Rejection

Excel

Page 70: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorAcceptance-Rejection

Excel

Page 71: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorAcceptance-Rejection

Excel

Page 72: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorAcceptance-Rejection

Excel

Page 73: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Random Variate GeneratorDeciding which method to adopt

Excel

Page 74: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 75: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 76: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 77: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Page 78: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Page 79: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Page 80: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

Page 81: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

Page 82: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

Page 83: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 84: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 85: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 86: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 87: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 88: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

Page 89: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

Page 90: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

Page 91: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

Page 92: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

Page 93: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Page 94: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis

<

Excel

Page 95: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Page 96: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 97: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output AnalysisExcel

Page 98: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Correlation

Page 99: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Correlation

Page 100: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Correlation

Page 101: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Correlation

Page 102: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Mathematica

Correlation

Minitab

Correlation

Excel

Correlation

Page 103: Introdução aos Modelos Temporizados · Objective To study the fundaments of stochastic simulation, its methods, and applying simulation for solving performance and dependability

Output Analysis Excel

Mathematica

Correlation

Minitab

Correlation

Excel

Correlation