### Notes of Simulation and Modelling [CT 753]

#### Introduction to Simulation

System, Model and Simulation

System:

- System is a simplified representation of a selected components with specified boundaries and predefined time characteristics.
- System generally indicates a real world entity over space and time in generalized and simplified form.
- Each system has a time constant that define the time over which the system may change its state.

Model:

- Model is a computerized program that defines the mechanics of the considered system.
- During system modeling, the focus is on the system components, system structure, relationships among the components of the system and the behavior of the modeled system.
- Model must have state which may change on each time step.
- Model represents the system for the purpose of studying the system.

Simulation:

- Simulation is defined as the process of execution of the model of a considered system.
- The conditions required for the simulation are initial conditions of the system under consideration and the specified sets of parameters.
- Simulation involves the generation of the artificial history of a considered system and their observations to draw inferences concerning the operating characteristics of the real system.

A basic example (Coffee Shop):

Consider a real world system of a coffee shop. It has customers who place orders and staff who process them. At some time, there are few customers and at other time, there are many customers. There are many changes in the system over time, so the time step of 5 minutes will be safer to analyze the system.
A model is generated for the selected system . Customers come and go, orders are placed, coffee is drunk, receipts are paid, messages are received, news is shared, sometimes coffee is spilled. At each time step, the model updates the status of the system.
For simulation, following things should be considered or set:
- When in the day does the modeling start?
- How many customers and staff are already there at that time?
- How much money does the cashier have then?
- What are the prices of the different kinds of coffee?
- What are the rates of inflow and outflow of customers and what determines that?
- What is the rate of inflow of messages?

When Simulation is the appropriate tool?

- To address the dynamic processes.
- To analyze the effect of alterations on the model’s behavior.
- To determine the variables that are most important by changing the simulation inputs and observing the outputs.
- To verify the analytic solutions.
- To experiment new designs before actual implementations.

When Simulation is not appropriate?

- Simulation is not appropriate when the problem can be solved by common sense.
- Simulation should not be used if the problem can be solved analytically.
- Simulation should not be used if it is easier to perform direct implementations.
- Simulation should not be used if the cost exceeds the savings.
- Simulation should not be done if the resources and time are not available.
- Simulation can not be done if no data is available.
- Simulation is not preferred if the system behavior is too complex to be defined.

- New procedures or rules can be explored without hampering the ongoing real time system operations.
- New designs can be tested without acquiring resources.
- The hypotheses about certain phenomena can be tested for feasibility.
- Insights can be obtained about the variable interaction and their credit for system performance.
- It provides the better understanding of the operation of the system in easier way.

- Building model requires specialization which is the art learned through experience.
- In some cases, the results of the simulation may be so complex to interpret.
- It may be time consuming and expensive.

Areas of Application

1. Manufacturing
- Dynamic modeling of continuous manufacturing systems.
- Modeling for quality and productivity.
- Shared resource capacity analysis.

2. Semiconductor Manufacturing
- Constant time interval production planning.
- Design framework for automated material handling systems.
- Making optimal design decisions.

3. Military
- Frequency based design for terminating simulations.
- Support for military based interactive simulations in 3D environments.
- Impact of an automatic logistic system.

4. Transportation Modes
- Simulating aircraft-delay absorption.
- Runway schedule determination.
- Modeling ambulance services.
- Modeling ship arrivals in ports.

- Agent based modeling of store performance.
- Visualization of probabilistic business models.
- Baggage screening at airports.
- Human fatigue risk simulation in continuous operations.
- Optimization of telecommunications billing system.

6. Health Care
- Evaluation of hospital operations.
- Estimating maximum capacity in an emergency room.
- Reducing the length of stay in an emergency department.
- Scheduling emergency room staff.

Discrete and Continuous System

- A system is said to be discrete if the state variable(s) change only at a discrete set of points in time. Eg: A bank system, the number of customers changes only when the customer arrives or when service provided is completed.
- A system is said to be continuous if the state variable(s) change continuously over time. Eg: Water head behind dam.

Steps in Simulation Study

1. Problem Formulation
- To begin any study, there must be statement of problem.
- Problem statement is formulated either by policy makers or analysts. Whoever formulates the statement, it must be understood by both.
- Problems formulated at the beginning of the study may not be complete, so this process is further iterated whenever there arises a new problem and needs attention to solve it during other stages of simulation study.

2. Setting objectives and overall project plan
- Objectives for the simulation must be formulated.
- It indicates what is to be done by the simulation.
- In this phase, it is decided whether or not the simulation is the appropriate tool.
- If simulation is appropriate tool, then the overall project plan should be formulated with alternative systems to be taken into account and methods to evaluate the effectiveness of the alternatives.
- It should also include time, cost and manpower needed along with the expected results of each stage.

3. Model Conceptualization
- Model building is the process of construction of a model of a system.
- There is no necessity of one-to-one mapping between model and real system, only the essential components are used in modeling.
- For modeling, essential features of the system are extracted at first, basic assumptions are made and then the assumptions are modified until approximate results are obtained.
- At initial stage, the model should be simple and over time should develop complexity.
- Excessive complexity should be forbidden to minimize model and computer expenses.

4. Data Collection
- Data plays important role in simulation.
- Data collection is very difficult phase as it requires more time, so it should be started as early as possible.
- The data to be collected depends on the study objectives.

5. Model Translation
- The model of real world generally requires storage, so model must be entered into a computer recognizable format.
- The model programming must be selected by the modeler, whether a simulation language or to use a special purpose simulation software.
- Simulation languages are more powerful and flexible than softwares. But, the choice depends on model complexity.

6. Verified?
- This stage involves verification of the computer program of modeling.
- Verification is successful if the input parameters and the logical structure of the models are correctly represented in the computer.

7. Validated?
- Validation is performed by calibrating the model against the actual system behavior so as to improve the system model.
- This is iterative process which is successful once the model accuracy is acceptable.

8. Experimental Design
- The alternatives to be simulated are determined.
- For each system design, length of initialization period, length of simulation run and number of replications to be made of each run are decided.

9. Production Runs and Analysis
- It is used to estimate measures of performance for the system design being simulated.
10. More Runs?
- After the analysis of the runs, it is decided whether or not more runs are needed.

11. Documentation and Reporting
- Program documentation is the document stating the operation of the program. It is necessary to understand how the program works. It facilitates easy modification and maintenance of the program.
- Progress documentation provides the chronology of work done and decisions made. It helps in tracking the course of project towards success.
- The result of the analysis should be clearly stated in a final report.

12. Implementation
- It involves actual implementation of the model.
- Model implementation depends on how well all the other stages are succeeded.
- Proper success of other stages results in good implementation while improper model on implementation may result in hazards.