Modsim Simulation Notes, Lecture notes of Mathematical Modeling and Simulation

Simulation and Modelling Lecture Notes

Typology: Lecture notes

2018/2019

Uploaded on 05/25/2019

owenmagas
owenmagas 🇿🇼

2 documents

1 / 65

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Modelling and Simulation IND-MFG ENG-NUST (2007) S Mhlanga
1
1.0 Introduction
1.1 What is simulation?
to feign; to have or to assume a false appearance of; to mimic; to recreate conditions of, for the purpose of training or
experimentation
Harrell and Tummy (1997) “simulation is an activity whereby one can draw conclusions about the behaviour of a given
system by studying the behaviour of a system whose cause and effect relationships an the same as ( or similar to) those
of the original.”
Pedgen et al (1995) simulation modelling is an experimental and applied methodology that seeks to accomplish the
following:
x describe the behaviour of systems
x construct theories or hypothesis that account for th e observed behaviour
x use the model to predict future behaviour that is the effects produced by changes in the system or in its
method of operation
Simulation is a modelling and analysis tool widely used for the purpose of designing, planning and control of systems
(manufacturing or services). A simulation model may provide information within a few minutes for an analysis of long
term implications of a change in maintenance policy.
1.2 Types of models
A Model is defined as a representation of a system for the purpose of studying the system.
1.2.1 Physical models
Scale models of the actual system. They are static and do not show interactions. Highly specific and cannot be
easily altered
1.2.2 Mathematical models
Uses equations to represent important factors of a system
1.2.3 Conceptual
Concepts and beliefs in the analyst’s mind
1.3 Classification of methods
x prescriptive or descriptive,
x discrete or continuous
x stochastic or deterministic
x static or dynamic
x open loop or closed loop
1.3.1 Prescriptive or Descriptive
Prescriptive models are those in which a problem is analytically formulated and optimised to give a best solution. On the
other hand, descriptive models are those which merely describe the system behaviour with the optimisation process left
to the analyst. The model to be used in this study is descriptive since the experimentation and optimisation has to be left
open to enable use of various policies.
1.3.2 Discrete or Continuous
The discrete event or continuous classification refers to the model variables. Discrete event simulation products are used
for modelling systems that change state at discrete points in time as a result of specific events. This includes most
manufacturing and services systems. If alterations to the model occurs continuously as time varies, then the model is
classified as continuous.
1.3.3 Stochastic or Deterministic
The difference between stochastic and deterministic models is on the model variables. Models that are based on one or
more variables that are random in nature are referred to as stochastic models. These models produce output that is itself
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41

Partial preview of the text

Download Modsim Simulation Notes and more Lecture notes Mathematical Modeling and Simulation in PDF only on Docsity!

1.0 Introduction

1.1 What is simulation?

to feign; to have or to assume a false appearance of; to mimic; to recreate conditions of, for the purpose of training or experimentation ” Harrell and Tummy (1997) “ simulation is an activity whereby one can draw conclusions about the behaviour of a given system by studying the behaviour of a system whose cause and effect relationships an the same as ( or similar to) those of the original .” Pedgen et al (1995) “ simulation modelling is an experimental and applied methodology that seeks to accomplish the following: x describe the behaviour of systems x construct theories or hypothesis that account for the observed behaviour x use the model to predict future behaviour that is the effects produced by changes in the system or in its method of operation Simulation is a modelling and analysis tool widely used for the purpose of designing, planning and control of systems (manufacturing or services). A simulation model may provide information within a few minutes for an analysis of long term implications of a change in maintenance policy.

1.2 Types of models

A Model is defined as a representation of a system for the purpose of studying the system.

1.2.1 Physical models

Scale models of the actual system. They are static and do not show interactions. Highly specific and cannot be easily altered

1.2.2 Mathematical models

Uses equations to represent important factors of a system

1.2.3 Conceptual

Concepts and beliefs in the analyst’s mind

1.3 Classification of methods

x prescriptive or descriptive, x discrete or continuous x stochastic or deterministic x static or dynamic x open loop or closed loop

1.3.1 Prescriptive or Descriptive

Prescriptive models are those in which a problem is analytically formulated and optimised to give a best solution. On the other hand, descriptive models are those which merely describe the system behaviour with the optimisation process left to the analyst. The model to be used in this study is descriptive since the experimentation and optimisation has to be left open to enable use of various policies.

1.3.2 Discrete or Continuous

The discrete event or continuous classification refers to the model variables. Discrete event simulation products are used for modelling systems that change state at discrete points in time as a result of specific events. This includes most manufacturing and services systems. If alterations to the model occurs continuously as time varies, then the model is classified as continuous.

1.3.3 Stochastic or Deterministic

The difference between stochastic and deterministic models is on the model variables. Models that are based on one or more variables that are random in nature are referred to as stochastic models. These models produce output that is itself

random and therefore only an estimate of the true behaviour of the model. The model for the investigation uses operation times which are probabilistic hence it is a stochastic model. Deterministic models are those that have no input components that are random. In this model the behaviour of the model is determined once the input data has been defined.

1.3.4 Static or Dynamic

Models are classified as either static or dynamic depending on whether or not the model variables change over time. In this study the aim is to study the effect of loading on the performance of MRP system, this implies a variation of loading (queue length) as model execution progresses. The model is therefore dynamic.

1.3.5 Open Loop or Closed Loop

The notion of an open loop or closed loop model is defined by the structure of the model rather than by the variables. Open loop models have no provision for the output of the model to fed back as inputs to modify subsequent outputs. A closed loop model is one in which output fed back and compared with some desired level or goal to alter the system such that it remains the desired value.

1.4 Steps in a Simulation Study

include the plans for the study in terms of the number of people involved and the cost of the study and the number of days required to accomplish each phase of the work with the anticipated results at the end of each stage.

1.4.3 Model Conceptualization

Construction of the model of a system which involves ability to abstract the essential features of a problem, to select and modify basic assumptions that characterize the system and then to enrich and elaborate the model until a useful approximation results. It is not necessary to have a one-to-one mapping between the model and the real system. Only the essence of the real system is needed. Involvement of model users is advisable at this stage to enhance quality of resulting model and increase confidence in application of model by user.

1.4.4 Data Collection

There is a constant interplay between the construction of the model and collection of the needed input data. This may take a lot of time thus it is necessary to begin early as possible.

1.4.5 Model translation

Entering model into computer recognizable format. The modeler must decide whether to program the model in a simulation language such as GPSS/H, SIMAN V, SIMSCRIPT II. 5 or SLAM SYSTEM or using special purpose simulation software (ARENA, WITNESS, PRO-Model, Auto Mod. Simulation languages are usually more powerful and more flexible than the special-purpose software which on the other hand reduce development time.

1.4.6 Verification

Pertains to the computer program prepared for the simulation model whether it is performing properly. This is through checking of input parameter and logical structure of the model through a number of iterative debugging.

1.4.7 Validation

Determination whether model is accurate representation of a real system. This can be done through calibration of the model, and iterative process of comparing the model to actual system behaviour and using the discrepancies between the two and the insights gained to improve the model.

1.4.8 Experimental Design

Alternatives that are to be simulated must be determined as a of this to be completed and analyzed. For each system design that is simulated decisions need to be made concerning the length of the initialization period, the length, and the number of replications to be made of each run.

1.4.9 Production Runs and Analysis

Used to estimate measures of performance of the system design

1.4.10 More Runs?

Based on the analysis of the runs that have been completed, the analyst determines if additional runs are needed and what design those additional experiments should follow.

1.4.11 Documentation and Reporting

It is necessary to understand how the program operates which enhances confidence in the program so model users and policy makers can make decisions based on the analysis. The other reason for documenting a model is so that model user can change parameters of the model at will in an effort to determine the relationship between input parameters and output measures of performance.

1.4.12 Implementation

1.4.1 Problem Formulation

x Identify decisions and uncontrollable variables x specify constraints on the decision variables x define measures of system performance x develop a preliminary model structure to interrelate the system variables and the measures of performance

1.5 Process of Making Decisions

Simulation is a tool to assist the making decision making process.

A number of different approaches exist in making decisions. x Intuitive x Analytical x Experimental

1.5.1 Intuitive

The intuitive approach is often used when little time is available and where non-critical decisions are being considered. ü Decision based on past experience. ü Can often be difficulty as the size and level of complexity in the system increases. The factors affecting systems involve: i Complex interactions (many conditions) i Uncertainty i Conflicting objectives; x customer satisfaction x efficient utilisation x reduction in WIP i Diffusion of authority, and differing priorities i Technology ü Can lead to expensive mistakes being made

MUST TACKLE THE CAUSE NOT THE SYMPTOM.

1.5.2 Analytical

Where time and understanding allows a scientific analysis can sometimes be justified. This often the case when cost of a mistake is high. Precise mathematical formulation is required.

Possible techniques include: ü Queuing Theory ü Linear Programming

HOWEVER, quite often the process of the model (mathematical) formulation is unfeasible, even if a model can be made, solution techniques may not be sufficiently developed.

BECAUSE , Assumptions have to be made and these tend to be unrealistic. The solutions therefore are perceived to be of little practical use.

1.5.3 Experimental

Experimentation on the real system is ü Impractical -we need to be able to control the experiment, but it is very difficult to do this on the shop floor. Time scales are inadequate, an experiment might take months to complete ü Expensive -One cannot purchase equipment simply on the wish to evaluate whether it is needed or not. One cannot hire labour without training them and paying them, and this is expensive if they are subsequently found not to be required. ü Disruptive -A company must still satisfy existing customers and can only do this by continuing to operate normally. This is difficult if resources are taken away to perform an experiment, or if layouts are re- organised during normal working hours. Changes to work patterns and tasks are disruptive, both operationally and in terms of their effect on morale

1.6 We Need A Model Of Real System

The ‘Simulation’ approach is an experimental approach. It allows the user to conduct TRIAL & ERROR experiments

1.10 Benefits Of The Simulation Approach

ü Better utilisation of resources ü Feasibility studies can be carried out ü Improved understanding of the system behaviour ü Confidence in decisions taken ü Improved communication of objectives and constraints ü Training tool

1.11 When is Simulation the Appropriate Tool?

  1. Simulation enables the study of, and experimentation with, the internal interactions of a complex system, or of a subsystem within a complex system.
  2. Informational, organizational and environmental changes can be simulated and the effect of these alterations on the model’s behaviour can be observed.
  3. The knowledge gained in designing a simulation model may be of great value toward suggesting improvement in the system under investigation.
  4. By changing simulation inputs and observing the resulting outputs, valuable insight may be obtained into which variables are most important and how variables interact.
  5. Simulation can be used as a pedagogical device to reinforce analytic solution methodologies.
  6. Simulation can be used to experiment with new designs or policies ’prior to implementation, so as to prepare for what may happen.
  7. Simulation can be used to verify analytic solutions.

ü BEFORE THE INSTALLATION OF A SYSTEM ü AFTER THE INSTALLATION OF A SYSTEM i Identifying bottlenecks and improving performance i Guidance on actions to be taken under changed circumstances i Operational Planning

To be successful it needs:- ü User commitment ü Free interaction between user and expert (if any) ü Availability of accurate data ü An understanding of how individual elements of the system behave

1.12 Advantages of Simulation

  1. New policies, operating procedures, decision rules, information flows, organizational procedures, and so on can be explored without disrupting ongoing operations of the real system.
  2. New hardware designs, physical layouts, transportation systems, and so on, can be tested without committing resources for their acquisition.
  3. Hypotheses about how or why certain phenomena occur can be tested for feasibility.
  4. Time can be compressed or expanded allowing for a speed up or slow down of the phenomena under investigation.
  5. Insight can be obtained about the interaction of variables.
  6. Insight can be obtained about the importance of variables on the performance of the system.
  7. Bottleneck analysis can be performed indicating where work in process, information, materials, and so on are being excessively delayed.
  8. A simulation study can help in understanding how the system operates rather than how individuals think the system operates.
  9. "What if questions can be answered. This is particularly useful in the design of new systems.

1.13 Disadvantages of Simulation

  1. Model building requires special training. It is an art that is learned over time and through experience. Furthermore, if two models are constructed by two competent individuals, they may have similarities, but it is highly unlikely that they will be the same.
  2. Simulation results may be difficult to interpret. Since most simulation outputs are .essentially random variables (they are usually based on random inputs), it may be hard to determine whether an observation is a result of system interrelationships or randomness.
  1. Simulation modelling and analysis can be time consuming and expensive. Skimping on resources for modelling and analysis may result in a simulation model or analysis that is not sufficient for the task.
  2. Simulation is used in some cases when an analytical solution is possible, or even preferable. This is particularly true in the simulation of some waiting lines where closed-form queueing models are available.

1.14 Areas of Application

Manufacturing systems Material handling system design for semiconductor manufacturing

Interoperability for spares inventor) planning

Aircraft assembly operations Agile control of aerospace manufacturing Spatial representation and autonomy in material handling systems

Distributed model for computer integrated manufacturing Agent-based flexible routing manufacturing control system

Tool shared flexible manufacturing system

Rapid manufacturing Order release planning in a job shop Finite capacity scheduling system Inventory cost model for ’just-in-time’ production Inventory tracking of a Kanban production system Strain of manual work in manufacturing systems Traditional versus activity-based costing in product mix decisions ’

Public systems

Health care Prediction of pharmaceutical costs and outcomes Cementless hip replacement Reducing the length of stay in emergency departments

Military Issues in operational lest and evaluation Army officer professional development Successful process for military base transition Future theater-level model Theater air command and control Marine air-ground task force tactical warfare Combat modelling-in medium lift replacement cost and effectiveness analysis

Corps battle simulation

Natural resources Solid waste management system Tank waste remediation system Operational efficiency at a nuclear power plant (^) Environmental restoration activities Oil spill modelling

Transportation systems Cargo transfer and personnel launch system Container port operations Demand based toll plaza lane staffing

Construction systems Applications in earthmoving/strip mining Cable-staved bridges

Strengthening the design/construction interface Advanced project planning paradigm

Restaurant and entertainment systems Quick service restaurant traffic analysis Determination of labour requirements Opportunities in amusement parks

Business process reengineering Integrating business process reengineering with image- based work flow

Business process modelling and analysis tool

Food processing Trawler operations in the fish processing industry Capacity expansion for the pistachio hulling process Evaluating international competitiveness in broiler production

Computer system performance

2.1.5 ACTIVITY (ACTIVE STATE)

Represents a time period of specified length or the State in an entity(s) remains some specified operation takes place. (The duration of such a state is DETERMINATE)

2.1.6 QUEUE (IDLE OR PASSIVE STATE)

The state in which a entity(s) is waiting to start some ACTIVITY. (The duration of such a state is INDETERMINATE) From the above definitions we can see that: ENTITIES PROGRESS IN A SIMULATION THROUGH A SUCESSION OF ACTIVE AND PASSIVE STATES

OR: THROUGH A SEQUENCE OF ACTIVITIES AND QUEUES

As the simulation proceeds, the entities co-operate and change state. The following terminology is used to describe these operations and the flow of time in the simulation.

2.1.7 EVENT

An INSTANT in time when a change of state takes place of one or more entities. e.g. Machine finishes cycle, part enters buffer

2.1.8 PROCESS

A sequence of events through which an entity passes, usually in chronological order. A process can represent all or some of the LIFE CYCLE of an entity (usually a temporary entity)

2.1.9 SIMUALTION CLOCK. (“The Clock”)

This is the value of simulated time

  • System
    • A collection of entities (eg people and machines) that interact together over time to accomplish one or more goals
  • Model
    • An abstract representation of a system, usually containing structural, logical or mathematical relationships which describe a system in terms of state, entities and their attributes, sets, processed, events, activities, and delays
  • System State
    • A collection of variables that contain all the information necessary to describe the system at any time
  • Entity
    • Any object or component in the system which requires explicit representation in the model ( eg server, a customer, a machine)
  • Attributes
    • The properties of a given entity (eg priority of a waiting customer, routing of a job through a job shop)
  • List
    • A collection of (permanent or temporarily) associated entities, ordered in some logical fashion (such as all customers currently in a waiting line, ordered by first come, first served or by priority)
  • Event
    • An instantaneous occurrence that changes the state of a system ( such as an arrival of a new customer)
  • Event Notice
    • A record of an event to occur at the current or some future time along with any associated data necessary to execute the event; at a minimum, record includes the event type and event time
  • Event list
    • A list of event notices for future events, ordered by time of occurrence; also known as the future event list (FEL)
  • Activity
    • A duration of time of specified length (eg service time, or interarrival time) which is known when it begins (although it may be defined in terms of a statistical distribution)
  • Delay
    • A duration of time of unspecified indefinite length, which is not known until it ends (eg a customers’s delay in a last in, first out waiting line which, when it begins depend on future arrivals)
  • Clock
    • A variable representing simulated time called CLOCK

2.2 THE LIFE CYCLE OF AN ENTITY.

The complete sequence of state an entity passes through during the course of a simulation e.g. A coffee drinker entity Drink coffee Wait for refill Drink coffee Wait for refill etc.

A waiter: Fill cup Wait for empty cup Fill cup Wait for empty cup etc.

A Cup: ? - What classes of entity are these?

The life cycle can be represented graphically using a directed network diagram

LIFE CYCLE DIAGRAM

2.3 A COMMON SENSE APPROACH TO MODELLING

In all but the simplest of situations the complexity and scale of the interactions that may take place between entities (the sequence of activities and queues through which they pass) requires the modeller to formalise the process of model specification.

Three stages of modelling can be identified:

Identify entities

Identify each entity’s life cycle

Identify the interactions between the entity life cycles.

2.5.2.3 PROCESS BASED (“Process Interaction”). This is a combination of activity and event based approaches and is particularly easy to apply when considering batch type environments. It is common in the United States.

A fourth approach, THE THREE PHASE APPROACH developed by Toacher (1963) also combines activity and event based methods. It is more common in the United Kingdom.

2.5.2.4 THE THREE PHASE APPROACH

This is a description of the algorithm which forms the basis of the executive program or “ Executive” for short.

START PHASE For each activity in turn test to see if it can start. If it can, move all participating entities from their respective queues into the activity and determine the time it will end. This is known as the Conditional or activity can start. Testing is needed because the activation time cannot be predicted in advance; the time spent in a queue is indeterminate.

TIME PHASE Advance the Simulation Clock time to the earliest activity end time. This is known as the ‘A’ phase.

END PHASE End all activities due to end at the current simulation Clock time and send all participating entities to their destination queues. This is also known as the Bound or ‘B’ phase, because these activities are bound to end at this time. The activities had determinate duration.

3.0 MODELLING

3.1 THE ACTIVITY CYCLE DIAGRAM

The activity cycle diagram (ACD) is formed from the combination of individual life cycle diagrams. The details of combination represent the logic of entity interaction.

3.1.1 RULES & CONVENTIONS IN ACDs.

x Queues and Activities must Alternate x The diagram must be closed loop x Queues are represented diagrammatically by circles. x Activities are represented diagrammatically by rectangles. x The direction of the life cycle sequence is represented with a directed arrow.

3.2 Problem 1

There are three machines and one mechanic. When any one of the machines is broken down it is repaired by the mechanic. After repair the machine runs until it breaks down again.

The company involved, wants to determine the average waiting time of the machine before it is repaired and the percentage of time the mechanic is idle. The objective of such an exercise may be to determine if the mechanic could be put in charge of a fourth machine (or conversely there is a need for a second mechanic)

Specify a model using an activity cycle diagram.

3.3 PROBLEM 2

As an extension to the previous machine maintenance problem (Problem 1), suppose that the repair of a machine can be broken down into the following activities:-

-An electrician disconnects the supply. -A sub-contractor removes/re-sites the machine. -A fitter repairs the machine.

There is one mechanic, one fitter and three persons in the sub-contracting team.

(i) Draw the Activity Cycle diagram for this system. (ii) The following priority rules are applied:- -Reconnection of the electricity supply has priority over disconnection. -Re-siting a machine is more important than removal. How can these priorities be reglected in the Activity cycle diagram? (iii) There is a shortage of floor space and only two machines can be removed from their mountings at any one time. How can this be represented on the Activity Cycle Diagram?

3.4 IMPLEMENTATION ON A COMPUTER

The Activity Cycle Diagram (ACD) is one formalism for representing the logic of entity interaction in a discrete event system. It in effective when the system comprises alternating queues and activities. The ACD cannot be directly implemented in a computer model without the addition of a World Set; this provides a reusable pool of entities (memory locations) that prevents the gradual exhaustion of computer resource that would otherwise occur.

THE OUTSIDE WORLD (World queue or World Set) The Outside World is a conceptual idea that allows us to restrict the scope or boundaries of a model. By doing so it provides a means of dealing with the problem of allowing a model to run for very long periods of simulated time.

The Outside World provides a (limited) source of temporary entities.

When the simulation system has finished with a temporary entity it returns it to the Outside World so that it can be reused.

We can incorporate the Outside World as a Queue in the ACD. This is an acceptable approach as by definition we cannot predict when external (exogenous) events will occur. Note: We do however, usually ally the world set with an arrival mechanism that stimulates entities to enter a model under programmer’ s control.

3.5 MODELLING ARRIVALS FROM THE OUTSIDE WORLD

There is a potential problem when modelling entity arrival from the Outside world; the computer can become trapped in a ‘loop’.

The World Set may contain many thousands or millions (with increasing RAM and disk space on modern computers) of as yet unused entities that may enter a model. A naive modeller could quite easily be led to build an ACD that allowed all of these entities to enter a model at time zero:

This problem can be prevented by the use of a dummy resource in two ways depending onthe availability of material and whether we are modelling a PUSH or PULL system:

4.0 SIMULATION AND EXPERIMENTATION

4.1 THE THREE PHASE APPROACH

This is a description of the algorithm which forms the basis of the executive program or “ Executive” for short.

START PHASE For each activity in turn test to see if it can start. If it can, move all participating entities from their respective queues into the activity and determine the time it will end. This is known as the Conditional or ‘C’ phase, because it involves a test to see if an activity can start. Testing is needed because the activation time cannot be predicted in advance; the time spent in a queue is in determinate.

TIME PHASE Advance the simulation clock time to the earliest activity end time. This is known as the ‘A’ phase.

END PHASE End all activities due to end at the current Simulation Clock time and send all participating entities to their destination queues. This is also known as the Bound or ‘B’ phase, because these activities are bound to end at this time. The activities had determinate duration.

4.2 SAMPLING

Many systems behave stochastically (governed by probability) and must therefore before simulated by a model with stochastic elements.

4.2.1 PROBABILITY DISTRIBUTIONS.

To illustrate the concept of a probability distribution, consider the historical data relating to the breakdown of a particular machine.

Days since last repaired

Number of observations

Prob. Of failure

Cumulative failure probabilities 1 5 0.05 0. 2 15 0.15 0. 3 20 0.2 0. 4 30 0.3 0. 5 20 0.2 0. 6 10 0.1 1

6 0 0 1

Histogram of failure probabilities

0

1 2 3 4 5 6 > days

Histogram of cumulative failure probabilities

0

1

1 2 3 4 5 6 > days since repair

For the purpose of sampling, the individual failure probabilities need to be accumulated into a cumulative probability distribution -an illustrative example using histogram is used here.

4.2.2 RANDOM SAMPLING

There are two requirements for random sampling in discrete event simulation. x A sequence of random numbers inthe range 0 to 1. “Random Number Stream” x A method of converting these into samples from an appropriate distribution.

4.2.3 RANDOM NUMBER GENERATION

True random number streams cannot be generated by a computer, however a aproximate method can be employed.

The computer implementation of random number is achieved using a PSEUDO RANDOM NUMBER GENERATOR.

In simulation we need to be able to providemore than one steam of random numbers, each stream representing an independant stochastic element.

This is achieved by providing the pseudo random number generator with a” SEED”.

Eg. RANDOM(N) where N=1..99 say

RANDOM(1) => .22, .45, .9, .03, .45, .37, .81, .31.......

RANDOM(2) => .77, .65, .45, .22, .02, .88, .47, .29........

Because the generator is a mathematical algorithm, each time we tell the computer to use RANDOM(1) say, it will return the same stream of numbers.

4.2.4 RANDOM SAMPLING ON A COMPUTER

By generating random numbers on the computer we can apply these to a probability distribution to return the expected observed values: The samples. Using the previous example, if we use N=2, the computer will return the following values: .77,.65,.45,.22,.02,.88,.47,. The first value .77 falls within the range 0.70 to 0.899 on the cumulative probability histogram for the machine. This corresponds to a failure interval of 5 days. We can use this to schedule a machine breakdown using the three phase approach.

Waiting line

Figure 5.2: Queuing system

In this system the calling population is infinite i.e. if a unit leaves the calling population and joins the waiting line or enters service there is no change in the arrival rate of other units that may need service. In this, system arrivals for service occur one at a time in a random fashion and once they join the waiting line, they are eventually served. In addition, service times are of some random length according to a probability distribution, which does not change overtime. In addition, the system capacity is unlimited. Callers are served in the order of their arrival (FIFO) by a single server or channel.

Arrivals and services are described by the distributions of time between arrivals and service times. The overall effective arrival rate must be less than the maximum service rate or the waiting line will grow without bound.

The state of the system is the number of units in the system and the status of the server, busy or idle.

An event is a set of circumstances that causes an instantaneous change in the state of the system. In a single-channel queueing system, there are only two possible events that can affect the state of the system. They are the entry of a unit into the system (the arrival event) or the completion of service on a unit (the departure event). The queuing system includes the server, the unit being serviced and units in the queue.

If service has just been completed, the simulation proceeds in the manner shown in the flow diagram of Figure 5.3. Note that the server has only two possible conditions. It is either busy or idle.

No another Yes Unit waiting

Figure 5.3: Service just completed flow diagram. Second event occurs where a unit enters system as illustrated by Figure 5.

No Server Yes busy

Figure 5.4: Unit entering system flow diagram

Queue Status Not empty Empty Server Busy Enter queue Enter queue Outcomes (^) Idle Impossible Enter service

Calling Population

Departure Event

Begin server idle time

Remove the waiting unit from queue

Begin servicing the nut

Arrival event

Unit enters Service

Unit enters queue For service

Server

Figure5.5 potential into actions upon arrival

Queue Status Not empty Empty Server Busy Enter queue Outcomes Idle Impossible Figure 5.6: Server outcomes after service completion

The next step is maintaining of event list which indicates the times at which the different types of events occur for each unit in the queuing system. The times are kept on a “ clock” which marks the occurrences of events in time. In simulation, the events usually occur at random. The randomness imitates real life to portray uncertainty.

The randomness needed to imitate real life is made possible using “ random numbers” Random numbers are distributed uniformly and independently on the interval (0,1). Random digits are uniformly distributed onto the set {0,1,2 ---,9). Random digits can be used to form random numbers by selecting the proper number of digits for each random number and placing a decimal point to the left of the value selected. The proper number of digits is dictated by the accuracy of the data being used for input purposes. If the input distribution has values with two decimal places, two digits are taken from a random digits table (Table A.1) and the decimal point is placed to the left to form a random number.

Random numbers can also be generated using a set procedure and this is referred to as pseudo-random numbers.

Table 5.2 contains a set of five inter-arrival times generated from rolling a die five times and recording the up face. These are used to compute the arrival times of six customers at the queuing system.

Table 5.2: Interarrival and clock times. Customer Interarrival Time Arrival Time on Clock 1 - 0 2 2 2 3 4 6 4 1 7 5 2 9 6 6 15

Service times are generated assuming that the service times are in the range {1…4} This can be done by placing chips and picking with replacement in a hat while recording the numbers selected.

Table 5.3: Service Time Customer Service Time 1 2 2 1 3 3 4 2 5 1 6 4

Table 5.4: Simulation table emphasizing clock time Customer Number

Arrival Time (clock)

Time Service Begins(clock)

Service Time (Duration)

Time Service Ends (Clock) 1 0 0 2 2 2 2 2 1 3 3 6 6 3 9 4 7 9 2 11 5 9 11 1 12 6 15 15 4 19