Unit I: Introduction to Modeling and Simulation - Simulation and Modeling - BCA Notes (Pokhara University)

## System Concept:

The term system is derived from the Greek word Systema, which means an organized relationship between functioning units or components. It is aggregation or association of objects joined in some regular manner/interactions or independence. The interaction/independence between the objects causes a change in the system. The system exists because it is designed to achieve one or more objectives. There are more than a hundred definitions of the word system, but most seem to have a common thread that suggests that a system is an orderly grouping of interdependent components linked together according to a plan to achieve a specific objective. Fig: A Factory System

As shown in the above figure, two major components of the systems are the fabrication department making the parts and the assembly department producing the products. A purchasing department maintains a supply of raw materials and a shipping department dispatches the finished products. A production control department receives orders and assigns work to the other departments.

### Components of System:

#### 1. Entity:

An entity is an object of interest in a system. Example: In the factory system, departments, orders, parts, and products are the entities.

#### 2. Attribute:

An attribute denotes the property of an entity. Example: Quantities for each order, type of part, or several machines in a Department are attributes of the factory system.

#### 3. Activity:

Any process causing changes in a system is called an activity. Example: Manufacturing process of the department.

#### 4. State of the System:

The state of a system is defined as the collection of variables necessary to describe a system at any time, relative to the objective of study. In other words, the state of the system means a description of all the entities, attributes and activities as they exist at one point in time.

#### 5. Event:

An event is defined as an instantaneous occurrence that may change the state of the system.

 System Entities Attributes Activities Events State Variables Bank Customers Balance, Credit Status Depositing, Withdrawal Arrival, Departure No. of busy tellers, No. of customers waiting Production Machines Speed, Capacity Welding, Stamping Breakdown Status of machine (busy, idle or down) Communication Messages Length, Destination Transmitting Arrival at destination Number waiting to be transmitted

#### Other Examples Of System Are:

a. Traffic System
b. Telephone System
c. Supermarket System
d. Transportation Operation System
e. Hospital Facilities System and so on.

### System Environment:

Everything that remains outside of the system under Consideration is called system environment. The system is often affected by change occurring outside the environment. Some system activity may also produce changes that don’t react on the system (but react outside the system). Such changes occurring outside the system is said to occur in the system environment.

When we are going to model the system, we must decide the boundary between the system and the environment. This decision depends on the purpose of the system study. In the case of the factory system, factors controlling the arrival of the order may be considered to be the influence of the factory (i.e. part of the environment). However, if the effect of the supply and demand is to be considered, there will be a relationship between the factory output and arrival of the order and this relationship must be considered as the activity of the system. ### System Types:

#### 1. Closed System:

If any system shows endogenous activity then the system is said to be a closed system. A closed system is one where there is no interaction between the environment and the system components.

#### 2. Open System:

If any system shows exogenous activity then the system is said to be an open system. The term exogenous is used to describe the activity in the environment that affects the system.

#### 3. Isolated System:

The system, which is isolated from the external world (environment) is called an isolated system.

### System Activities:

#### 1. Endogenous Vs. Exogenous Activity:

The term endogenous is used to describe the activity that occurs within the system (activity occurs within an entity of system). And if there is only endogenous activity then the system is said to be a closed system. The term exogenous is used to describe the activity in an environment that affects the system. Hence system, where there is an exogenous activity, is called an open system.

#### 2. Deterministic Vs. Stochastic Activity:

If the outcome of the activity/system can be described in terms of the input (in terms of some mathematical function/formulae) then the activity is deterministic activity. When the effect of (outcome) of the activity vary over possible outcomes (can’t be predicted using some mathematical function) then the activity is called stochastic activity. The randomness of the stochastic activity is the part of the system environment because the exact outcome at any time is unknown. However, the random output can be measured and described in a probability distribution.

### Discrete and Continuous System:

#### 1. Discrete System:

Those systems whose state variable changes instantly at separate points in time is a discrete system. Example: Bank System. State variable: Number of customers.

##### Conclusion:
Due to these reasons in a bank, the number of customers may arrive only when a new customer arrives or leaves the bank. Here, the changes in the number of customers are in discrete time. Therefore, a bank can be taken as an example of a discrete system. #### 2. Continuous System:

Those systems whose state variables change continuously concerning time is a continuous system. Example: Aeroplane moving through the air. State variable: position and velocity.

##### Conclusion:
Here, the position of the Aeroplane is changing continuously with time. Therefore, an Aeroplane moving through the air is an example of a continuous system. ## System Modeling:

A Model is defined as a representation of a system to study the system. In simple words, it is also defined as a simplification of reality. The model constructs a conceptual framework that describes a system. It is necessary to consider those aspects of systems that affect the problem under investigation (unnecessary details to be removed).

A model of a system is a set of assumptions and approximations about how the system works and the task of deriving a model of a system is called system model. Since the purpose of the study will determine the nature of the information that is gathered, there is no unique model of a system.

Different model of the same system will be produced by different analysts interested in different aspect of the system or by the same analyst as his understanding of the system changes. Studying a model instead of a real system is usually much easier, faster, cheaper and safer.

### Deriving a Model:

A model of a system can be derived in the following two ways:

#### 1. Establishing A Model Structure:

It determines the system boundary, entities, attributes, activities and state of a system.

#### 2. Supplying Data:

In this phase, the values are provided to the system attributes that can have and relationships involve in the activities are defined.

These 2 jobs of creating a structure and providing the data are the parts of one task rather than as two separate tasks because they are so intimately related neither can be done without others.

The assumption about the system directs the gathering of data, and analysis of the data confirms the assumption. To illustrate this process, we consider the description of a supermarket.

Shoppers needing several items of shopping arrive at a supermarket. They get a basket, if one available, carry out their shopping, and then queue to check-out at one of several counters. After checking out, they return the basket and leave.

Here, in the assumption of the supermarket system, some keywords are made italic to point out the features of a system that must be reflected in the model. In this system, the entities are shopper, basket and counters. The attributes are the number of items, availability, and number of occupancy. The activities are arriving at the supermarket, getting a basket, returning a basket and leaving the supermarket.

### Types of Models:

#### 1. Physical Model:

In a physical model of a system, the system attributes are represented by measurement such as voltages or position of shafts. Here, the system activities are deflected in physical logic that derives a model. For example, the rate at which the shaft of the dc motor turn depends upon voltage applied to the motor. If the applied voltage is used to represent the velocity of the vehicle, then the number of revolution of the shaft is a measure of the distance the vehicle has travelled.

#### 2. Mathematical Model:

This model uses symbolic notation and mathematical equation to represent a system. In this model, attributes are represented by variables and activities are represented by a mathematic function that inter-relates variables.

#### 3. Static Model:

This model can only show the values that system attributes takes when the system is in balance.

#### 4. Dynamic Model:

This model can show the values of the system attributes that changes over time due to the effect of the system attributes.

Once a mathematical model is built, it must be then examined to see how it can be used to answer the question of interest in the system. The two methods that are used to solve the mathematical model are:

##### i. Analytical Methods:
If the model is simple enough, it may be possible to work with its relationship and quantities to get an exact analytical method. This method uses the deductive region of mathematical theory to solve a model. It directly produces a general solution.

Let us consider the , if we know the distance  to be travelled and velocity , then we can work with the model to get as the time that will be required.

#### ii. Numerical Methods (Simulation Method):

If an analytical solution to the mathematical is available and computationally efficient, it is usually desirable to study the model using an analytical method. However, many systems are highly complex, so those valid mathematical models of them are complex. In this case, the model must be studied using simulation i.e. numerically exercising the model for the inputs in questions to see how they affect the outputs measures of performance.

Numerical methods use the computational produces to solve the equation. It produces a solution in steps, each step give a solution for once at a condition and calculation are repeated until a final solution is obtained. ### Principle of Modeling:

It is not possible to provide rules by which mathematical models are built, but several guiding principles can be stated. They do not describe distinct steps carried out in building a model. They describe different viewpoints from which to judge the information to be included in the model.

#### 1. Block Building:

The description of the system should be organized in a series of blocks. The aim of constructing the blocks is to simplify the specification of the interactions within the system. Each block describes a part of the system that depends upon a few, preferably one, input variables and results in a few output variables. The system as a whole can then be described in terms of the interconnections between the blocks. Correspondingly, the system can be represented graphically as a simple block diagram.

#### 2. Relevance:

The model should only include those aspects of the system that are relevant to the study objectives. As an example, if the factory system the study aims to compare the effects of different operating rules on efficiency, it is not relevant to consider the hiring of employees as an activity. While irrelevant information in the model may not do any harm, it should be excluded because it increases the complexity of the model and causes more work in solving the model.

#### 3. Accuracy:

The accuracy of the information gathered for the model should be considered. In an aircraft system, the accuracy with which the movement of aircraft is described depends upon the representation of the airframe. If these are not accurate it gives a false result while testing a system for output.

#### 4. Aggregation:

A further factor to be considered is the extent to which several individual entities can be grouped together into larger entities.

### Areas of Application:

System simulation is a technique, which finds application in almost each and every field. Some of the areas in which it can be successfully employed are listed below:

#### 1. Manufacturing:

Design analysis and optimization of the productions system, materials management, capacity planning, layout planning and performance evaluation, evaluation of process quality.

Market analysis, prediction of consumer behaviour, optimization of marketing strategy and logistics, comparative evaluation of marketing campaigns.

#### 3. Military:

Testing of alternative combat strategies, air operations, sea operations, simulated war exercises, practising ordinance effectiveness, and inventory management.

#### 4. Healthcare Application:

Such as planning health services, expected patient density, facilities requirement, hospital staffing, estimating the effectiveness of a health care program.

#### 5. Communication Application:

Such as network design and optimization, evaluating network reliability, manpower planning, sizing of message buffers.

#### 6. Computer Application:

Such as designing hardware configuration and operating systems protocols, sharing, and networking.

#### 7. Economic Application:

Such as portfolio management, forecasting the impact of Govt. Policies and internal market fluctuations on the economy, budgeting and forecasting market fluctuation.

#### 8. Transport Application:

Design and testing of alternative transportation policy, transportation network- road, railways, airways, etc., evaluation of timetables, traffic and planning.

#### 9. Environmental Application:

Solid waste management, performance evaluation of environmental program, evaluation of population control systems.

#### 10. Biological Application:

Such as population genetics and the spread of epidemics.

## Verification, Validation, and Calibration of Model:

After the development of a model is functionally complete, we should ask “does it work correctly”. There are two paths to this question:
i. First does it operate the way the analyst intended?
ii. Does it behave the way the real system works?

### Verification:

Verification focuses on the internal consistency of a model. Verification checks that the implementation of the simulation model (program) corresponds to the model. It concerns with the building the model right. It is utilized in the comparison of the conceptual model to the computer representation that implements the conception. It asks the question, is the model implemented correctly in the computer? Are the input parameters and logical structure of the model correctly represented? It is the process of comparing the computer code with the model to ensure that the code is a correct implementation of the model.

### Validation:

Validation is concerned with the correspondence between the model and the reality. Its concern with building the right model. It is utilized to determine that a model is an accurate representation of the real system. Validation is usually achieved through the calibration of the model, an iterative process of comparing the model to actual system behaviour and using discrepancies between two and the insight gained to improve the model. This process is repeated until model accuracy is a judge to be acceptable. It is the process of comparing the model's output with the behaviour of the phenomenon. In other words: comparing model execution to reality (physical or otherwise).

Three steps approach in the validation process are:
i. Build a model that has a high face validity
ii. Validate model assumption
iii. Compare the model input and output transformation to correspond input-output transformation of the real system.

### Calibration:

It is an iterative process of comparing the model to the real system, making adjustments or major changes to the model, comparing the revised model to reality, making additional adjustments, comparing again and so on. It Checks that the data generated by the simulation matches real (observed) data. The process of parameter estimation for a model. Calibration is a tweaking/tuning of existing parameters and usually does not involve the introduction of new ones, changing the model structure. In the context of optimization, calibration is an optimization procedure involved in system identification or during experimental design. 