Presentation is loading. Please wait.

Presentation is loading. Please wait.

10CS82 SYSTEM MODELING AND SIMULATION

Similar presentations


Presentation on theme: "10CS82 SYSTEM MODELING AND SIMULATION"— Presentation transcript:

1 10CS82 SYSTEM MODELING AND SIMULATION
Engineered for Tomorrow

2 UNIT 3 STATISTICAL MODELS IN SIMULATION
Engineered for Tomorrow

3 Simplex Method Simplex: a linear-programming algorithm that can solve problems having more than two decision variables. The simplex technique involves generating a series of solutions in tabular form, called tableaus. By inspecting the bottom row of each tableau, one can immediately tell if it represents the optimal solution. Each tableau corresponds to a corner point of the feasible solution space. The first tableau corresponds to the origin. Subsequent tableaus are developed by shifting to an adjacent corner point in the direction that yields the highest (smallest) rate of profit (cost). This process continues as long as a positive (negative) rate of profit (cost) exists. Subject Name: System Modeling and Simulation Subject Code:10CS82 Prepared By: Mrs.Prameladevi,Mrs.Sanchari saha,Mrs.Praveena Department: CSE & ISE Date:

4 Simplex Method Simplex: a linear-programming algorithm that can solve problems having more than two decision variables. The simplex technique involves generating a series of solutions in tabular form, called tableaus. By inspecting the bottom row of each tableau, one can immediately tell if it represents the optimal solution. Each tableau corresponds to a corner point of the feasible solution space. The first tableau corresponds to the origin. Subsequent tableaus are developed by shifting to an adjacent corner point in the direction that yields the highest (smallest) rate of profit (cost). This process continues as long as a positive (negative) rate of profit (cost) exists. TOPICS COVERED Review of Terminology and Concepts Useful statistical models Discrete Distributions Continuous Distribution Poisson Process Empirical Distributions

5 Review Terminology and Concepts 1.1Discrete Random variable
X is a discrete random variable if the number of possible values of X is finite, or countably infinite. Example: Consider jobs arriving at a job shop. Let X be the number of jobs arriving each week at a job shop. Rx = possible values of X (range space of X) = {0,1,2,…} p(xi) = probability the random variable is xi = P(X = xi) p(xi), i = 1,2, … must satisfy: The collection of pairs [xi, p(xi)], i = 1,2,…, is called the probability distribution of X, and p(xi) is called the probability mass function (pmf) of X.

6 1.2Continuous Random Variable
X is a continuous random variable if its range space Rx is an interval or a collection of intervals. The probability that X lies in the interval [a,b] is given by: f(x), denoted as the pdf of X, satisfies: Properties

7 Cumulative Distribution Function [Probability Review]
Example: An inspection device has cdf: The probability that the device lasts for less than 2 years: The probability that it lasts between 2 and 3 years:

8 Expectation [Probability Review]
The expected value of X is denoted by E(X) If X is discrete If X is continuous a.k.a the mean, m, or the 1st moment of X A measure of the central tendency The variance of X is denoted by V(X) or var(X) or s2 Definition: V(X) = E[(X – E[X])2] Also, V(X) = E(X2) – [E(x)]2 A measure of the spread or variation of the possible values of X around the mean The standard deviation of X is denoted by s Definition: square root of V(X) Expressed in the same units as the mean

9 Expectations [Probability Review]
Example: The mean of life of the previous inspection device is: To compute variance of X, we first compute E(X2): Hence, the variance and standard deviation of the device’s life are:

10 Useful Statistical Models
In this section, statistical models appropriate to some application areas are presented. The areas include: Queueing systems Inventory and supply-chain systems Reliability and maintainability Limited data

11 Queueing Systems [Useful Models]
In a queueing system, interarrival and service-time patterns can be probablistic For more queueing examples, see Chapter 2; Chapter 6 is all queueing systems Sample statistical models for interarrival or service time distribution: Exponential distribution: if service times are completely random Normal distribution: fairly constant but with some random variability (either positive or negative) Truncated normal distribution: similar to normal distribution but with restricted value. Gamma and Weibull distribution: more general than exponential (involving location of the modes of pdf’s and the shapes of tails.)

12 Inventory and supply chain [Useful Models]
In realistic inventory and supply-chain systems, there are at least three random variables: The number of units demanded per order or per time period The time between demands The lead time Sample statistical models for lead time distribution: Gamma Sample statistical models for demand distribution: Poisson: simple and extensively tabulated. Negative binomial distribution: longer tail than Poisson (more large demands). Geometric: special case of negative binomial given at least one demand has occurred.

13 Reliability and maintainability [Useful Models]
Time to failure (TTF) Exponential: failures are random Gamma: for standby redundancy where each component has an exponential TTF Weibull: failure is due to the most serious of a large number of defects in a system of components Normal: failures are due to wear

14 Other areas [Useful Models]
For cases with limited data, some useful distributions are: Uniform, triangular and beta Other distribution: Bernoulli, binomial and hyperexponential.

15 Discrete Distributions
Discrete random variables are used to describe random phenomena in which only integer values can occur. In this section, we will learn about: Bernoulli trials and Bernoulli distribution Binomial distribution Geometric and negative binomial distribution Poisson distribution

16 Bernoulli Trials and Bernoulli Distribution [Discrete Dist’n]
Consider an experiment consisting of n trials, each can be a success or a failure. Let Xj = 1 if the jth experiment is a success and Xj = 0 if the jth experiment is a failure The Bernoulli distribution (one trial): where E(Xj) = p and V(Xj) = p (1-p) = p q Bernoulli process: The n Bernoulli trials where trails are independent: p(x1,x2,…, xn) = p1(x1) p2(x2) … pn(xn)

17 Binomial Distribution [Discrete Dist’n]
The number of successes in n Bernoulli trials, X, has a binomial distribution. The mean, E(x) = p + p + … + p = n*p The variance, V(X) = pq + pq + … + pq = n*pq The number of outcomes having the required number of successes and failures Probability that there are x successes and (n-x) failures

18 Geometric & Negative Binomial Distribution [Discrete Dist’n]
Geometric distribution The number of Bernoulli trials, X, to achieve the 1st success: E(x) = 1/p, and V(X) = q/p2 Negative binomial distribution The number of Bernoulli trials, X, until the kth success If Y is a negative binomial distribution with parameters p and k, then: E(Y) = k/p, and V(X) = kq/p2

19 Poisson Distribution [Discrete Dist’n]
Poisson distribution describes many random processes quite well and is mathematically quite simple. where a > 0, pdf and cdf are: E(X) = a = V(X)

20 Poisson Distribution [Discrete Dist’n]
Example: A computer repair person is “beeped” each time there is a call for service. The number of beeps per hour ~ Poisson(a = 2 per hour). The probability of three beeps in the next hour: p(3) = e-223/3! = 0.18 also, p(3) = F(3) – F(2) = =0.18 The probability of two or more beeps in a 1-hour period: p(2 or more) = 1 – p(0) – p(1) = 1 – F(1) = 0.594

21 Continuous Distributions
Continuous random variables can be used to describe random phenomena in which the variable can take on any value in some interval. In this section, the distributions studied are: Uniform Exponential Normal Weibull Lognormal

22 Uniform Distribution [Continuous Dist’n]
A random variable X is uniformly distributed on the interval (a,b), U(a,b), if its pdf and cdf are: Properties P(x1 < X < x2) is proportional to the length of the interval [F(x2) – F(x1) = (x2-x1)/(b-a)] E(X) = (a+b)/2 V(X) = (b-a)2/12 U(0,1) provides the means to generate random numbers, from which random variates can be generated.

23 Exponential Distribution [Continuous Dist’n]
A random variable X is exponentially distributed with parameter l > 0 if its pdf and cdf are: E(X) = 1/l V(X) = 1/l2 Used to model interarrival times when arrivals are completely random, and to model service times that are highly variable For several different exponential pdf’s (see figure), the value of intercept on the vertical axis is l, and all pdf’s eventually intersect.

24 Exponential Distribution [Continuous Dist’n]
Memoryless property For all s and t greater or equal to 0: P(X > s+t | X > s) = P(X > t) Example: A lamp ~ exp(l = 1/3 per hour), hence, on average, 1 failure per 3 hours. The probability that the lamp lasts longer than its mean life is: P(X > 3) = 1-(1-e-3/3) = e-1 = 0.368 The probability that the lamp lasts between 2 to 3 hours is: P(2 <= X <= 3) = F(3) – F(2) = 0.145 The probability that it lasts for another hour given it is operating for 2.5 hours: P(X > 3.5 | X > 2.5) = P(X > 1) = e-1/3 = 0.717

25 Normal Distribution [Continuous Dist’n]
A random variable X is normally distributed has the pdf: Mean: Variance: Denoted as X ~ N(m,s2) Special properties: . f(m-x)=f(m+x); the pdf is symmetric about m. The maximum value of the pdf occurs at x = m; the mean and mode are equal.

26 Normal Distribution [Continuous Dist’n]
Evaluating the distribution: Use numerical methods (no closed form) Independent of m and s, using the standard normal distribution: Z ~ N(0,1) Transformation of variables: let Z = (X - m) / s,

27 Normal Distribution [Continuous Dist’n]
Example: The time required to load an oceangoing vessel, X, is distributed as N(12,4) The probability that the vessel is loaded in less than 10 hours: Using the symmetry property, F(1) is the complement of F (-1)

28 Weibull Distribution [Continuous Dist’n]
A random variable X has a Weibull distribution if its pdf has the form: 3 parameters: Location parameter: u, Scale parameter: b , (b > 0) Shape parameter. a, (> 0) Example: u = 0 and a = 1: When b = 1, X ~ exp(l = 1/a)

29 Lognormal Distribution [Continuous Dist’n]
A random variable X has a lognormal distribution if its pdf has the form: Mean E(X) = em+s2/2 Variance V(X) = e2m+s2/2 (es2 - 1) Relationship with normal distribution When Y ~ N(m, s2), then X = eY ~ lognormal(m, s2) Parameters m and s2 are not the mean and variance of the lognormal m=1, s2=0.5,1,2.

30 Poisson Process Definition: N(t) is a counting function that represents the number of events occurred in [0,t]. A counting process {N(t), t>=0} is a Poisson process with mean rate l if: Arrivals occur one at a time {N(t), t>=0} has stationary increments {N(t), t>=0} has independent increments Properties Equal mean and variance: E[N(t)] = V[N(t)] = lt Stationary increment: The number of arrivals in time s to t is also Poisson-distributed with mean l(t-s)

31 Interarrival Times [Poisson Process]
Consider the interarrival times of a Possion process (A1, A2, …), where Ai is the elapsed time between arrival i and arrival i+1 The 1st arrival occurs after time t iff there are no arrivals in the interval [0,t], hence: P{A1 > t} = P{N(t) = 0} = e-lt P{A1 <= t} = 1 – e-lt [cdf of exp(l)] Interarrival times, A1, A2, …, are exponentially distributed and independent with mean 1/l Arrival counts ~ Poi(l) Interarrival time ~ Exp(1/l) Stationary & Independent Memoryless

32 Splitting and Pooling [Poisson Dist’n]
Suppose each event of a Poisson process can be classified as Type I, with probability p and Type II, with probability 1-p. N(t) = N1(t) + N2(t), where N1(t) and N2(t) are both Poisson processes with rates l p and l (1-p) Pooling: Suppose two Poisson processes are pooled together N1(t) + N2(t) = N(t), where N(t) is a Poisson processes with rates l1 + l2 N(t) ~ Poi(l) N1(t) ~ Poi[lp] N2(t) ~ Poi[l(1-p)] l lp l(1-p) N(t) ~ Poi(l1 + l2) N1(t) ~ Poi[l1] N2(t) ~ Poi[l2] l1 + l2 l1 l2

33 Nonstationary Poisson Process (NSPP) [Poisson Dist’n]
Poisson Process without the stationary increments, characterized by l(t), the arrival rate at time t. The expected number of arrivals by time t, L(t): Relating stationary Poisson process n(t) with rate l=1 and NSPP N(t) with rate l(t): Let arrival times of a stationary process with rate l = 1 be t1, t2, …, and arrival times of a NSPP with rate l(t) be T1, T2, …, we know: ti = L(Ti) Ti = L-1(ti)

34 Nonstationary Poisson Process (NSPP) [Poisson Dist’n]
Example: Suppose arrivals to a Post Office have rates 2 per minute from 8 am until 12 pm, and then 0.5 per minute until 4 pm. Let t = 0 correspond to 8 am, NSPP N(t) has rate function: Expected number of arrivals by time t: Hence, the probability distribution of the number of arrivals between 11 am and 2 pm. P[N(6) – N(3) = k] = P[N(L(6)) – N(L(3)) = k] = P[N(9) – N(6) = k] = e(9-6)(9-6)k/k! = e3(3)k/k!

35 Empirical Distributions [Poisson Dist’n]
A distribution whose parameters are the observed values in a sample of data. May be used when it is impossible or unnecessary to establish that a random variable has any particular parametric distribution. Advantage: no assumption beyond the observed values in the sample. Disadvantage: sample might not cover the entire range of possible values.

36 Summary The world that the simulation analyst sees is probabilistic, not deterministic. In this chapter: Reviewed several important probability distributions. Showed applications of the probability distributions in a simulation context. Important task in simulation modeling is the collection and analysis of input data, e.g., hypothesize a distributional form for the input data. Reader should know: Difference between discrete, continuous, and empirical distributions. Poisson process and its properties.

37 Cumulative Distribution Function [Probability Review]
Example: An inspection device has cdf: The probability that the device lasts for less than 2 years: The probability that it lasts between 2 and 3 years:

38 4.THE ESSENCE OF SIMPLEX METHOD
The key solution concepts Solution Concept 1: the simplex method focuses on CPF solutions. Solution concept 2: the simplex method is an iterative algorithm (a systematic solution procedure that keeps repeating a fixed series of steps, called, an iteration, until a desired result has been obtained) with the following structure: Initialization: setup to start iterations, including finding an initial CPF solution Optimality test: is the current CPF solution optimal? if no if yes stop Iteration: Perform an iteration to find a better CFP solution

39 Contd… Solution concept 3: whenever possible, the initialization of the simplex method chooses the origin point (all decision variables equal zero) to be the initial CPF solution. Solution concept 4: given a CPF solution, it is much quicker computationally to gather information about its adjacent CPF solutions than about other CPF solutions. Therefore, each time the simplex method performs an iteration to move from the current CPF solution to a better one, it always chooses a CPF solution that is adjacent to the current one. Solution concept 5: After the current CPF solution is identified, the simplex method examines each of the edges of the feasible region that emanate from this CPF solution. Each of these edges leads to an adjacent CPF solution at the other end, but the simplex method doesn’t even take the time to solve for the adjacent CPF solution. Instead it simply identifies the rate of improvement in Z that would be obtained by moving along the edge. And then chooses to move along the one with largest positive rate of improvement.

40 Contd…. Solution concept 6: A positive rate of improvement in Z implies that the adjacent CPF solution is better than the current one, whereas a negative rate of improvement in Z implies that the adjacent CPF solution is worse. Therefore, the optimality test consists simply of checking whether any of the edges give a positive rate of improvement in Z. if none do, then the current CPF solution is optimal.

41 5.THE SETTING UP OF SIMPLEX METHOD
Steps: 1. Initialization: a. transform all the constraints to equality by introducing slack, surplus, and artificial variables as follows: Constraint type Variable to be added + slack (s) - Surplus (s) + artificial (A) = + Artificial (A)

42 Contd… b. Construct the initial simplex tableau Basic variable X1 … Xn
…... Sn A1 …. An RHS S Coefficient of the constraints b1 A bm Z Objective function coefficient In different signs Z value

43 Contd… 2. Test for optimality: Case 1: Maximization problem the current BF solution is optimal if every coefficient in the objective function row is nonnegative Case 2: Minimization problem the current BF solution is optimal if every coefficient in the objective function row is non positive 3. Iteration Step 1: determine the entering basic variable by selecting the variable (automatically a non basic variable) with the most negative value (in case of maximization) or with the most positive (in case of minimization) in the last row (Z-row). Put a box around the column below this variable, and call it the “pivot column”

44 Contd… Step 2: Determine the leaving basic variable by applying the minimum ratio test as following: 1. Pick out each coefficient in the pivot column that is strictly positive (>0) 2. Divide each of these coefficients into the right hand side entry for the same row 3. Identify the row that has the smallest of these ratios 4. The basic variable for that row is the leaving variable, so replace that variable by the entering variable in the basic variable column of the next simplex tableau. Put a box around this row and call it the “pivot row” Step 3: Solve for the new BF solution by using elementary row operations (multiply or divide a row by a nonzero constant; add or subtract a multiple of one row to another row) to construct a new simplex tableau, and then return to the optimality test. The specific elementary row operations are:

45 Contd… Divide the pivot row by the “pivot number” (the number in the intersection of the pivot row and pivot column) For each other row that has a negative coefficient in the pivot column, add to this row the product of the absolute value of this coefficient and the new pivot row. For each other row that has a positive coefficient in the pivot column, subtract from this row the product of the absolute value of this coefficient and the new pivot row.

46 5.1 Example Example (All constraints are )
Solve the following problem using the simplex method Maximize Z = 3X1+ 5X2 Subject to X  4 2 X2  12 3X1 +2X2  18 X1 , X2  0

47 Contd… Solution Initialization Standard form Maximize Z, Subject to
Z - 3X1- 5X = 0 X S = 4 2 X S = 12 3X1 +2X S3 = 18 X1 , X2, S1, S2, S3  0 Sometimes it is called the augmented form of the problem because the original form has been augmented by some supplementary variables needed to apply the simplex method

48 Contd… 2. Initial tableau Basic variable X1 X2 S1 S2 S3 RHS 1 4 2 12 3
Entering variable 2. Initial tableau Basic variable X1 X2 S1 S2 S3 RHS 1 4 2 12 3 18 Z -3 -5 Pivot row Leaving variable Pivot column Pivot number

49 Contd… The basic feasible solution at the initial tableau is (0, 0, 4, 12, 18) where: X1 = 0, X2 = 0, S1 = 4, S2 = 12, S3 = 18, and Z = 0 Where S1, S2, and S3 are basic variables X1 and X2 are nonbasic variables The solution at the initial tableau is associated to the origin point at which all the decision variables are zero. Step 1: Determine the entering variable by selecting the variable with the most negative in the last row. From the initial tableau, in the last row (Z row), the coefficient of X1 is -3 and the coefficient of X2 is -5; therefore, the most negative is -5. consequently, X2 is the entering variable. X2 is surrounded by a box and it is called the pivot column

50 Contd… Step 2: Determining the leaving variable by using the minimum ratio test as following: Basic variable Entering variable X2 (1) RHS (2) Ratio (2)(1) S1 4 None S2 Leaving 2 12 6 Smallest ratio S3 18 9

51 Contd… Step 3: solving for the new BF solution by using the eliminatory row operations as following: New pivot row = old pivot row  pivot number Basic variable X1 X2 S1 S2 S3 RHS 1 1/2 6 Z Note that X2 becomes in the basic variables list instead of S2

52 Substitute this values in the table
Contd… 2. For the other row apply this rule: New row = old row – the coefficient of this row in the pivot column (new pivot row). For S ( /2 0 6) For S ( /2 0 6) for Z ( /2 0 6) /2 0 30 Substitute this values in the table

53 Contd… Basic variable X1 X2 S1 S2 S3 RHS 1 4 1/2 6 3 -1 Z -3 5/2 30
This solution is not optimal, since there is a negative numbers in the last row Basic variable X1 X2 S1 S2 S3 RHS 1 4 1/2 6 3 -1 Z -3 5/2 30 The smallest ratio is 6/3 =2; therefore, S3 is the leaving variable The most negative value; therefore, X1 is the entering variable

54 6.TIE BREAKING IN SIMPLEX METHOD
In the final tableau, if one or more artificial variables (A1, A2, …) still basic and has a nonzero value, then the problem has an infeasible solution If there is a zero under one or more nonbasic variables in the last tableau (optimal solution tableau), then there is a multiple optimal solution. When determining the leaving variable of any tableau, if there is no positive ratio (all the entries in the pivot column are negative and zeroes), then the solution is unbounded. Tie for entering variable: If two variables are tied for largest negative value in obj row, pick one arbitrarily. No problems should result. Tie for leaving basic variable (degeneracy). This is a tie for the minimum ratio. Whichever variable is picked to leave, the other variable will also be driven to zero in the pivot. Problems may ensue.

55 6.2 DEGENERACY If one of the degenerate basic variables (basic variables with a value of zero) retains its zero value until it is chosen at a subsequent iteration to be the leaving basic variable, the corresponding entering variable will be stuck at zero since it can’t be increased without making the degenerate leaving variable negative, so the value of Z won’t change. Simplex may go around in a loop, repeating the same sequence without advancing. Perpetual loops are rare. When they do occur, you can get out of it by picking a different leaving basic variable from the tie. Special rules have been developed for tie breaking so that the loops are avoided.

56 Assignment-2 Explain assumptions required in Linear Programming models. Solve it by using simplex method Maximize Z= 4x1+3x2+6x3 STC 2x1+3x2+2x3<=440 4x1+3x3<=470 2x1+5x2<=430 x1,x2,x3 >=0 Find all the basic solution to the following system of equations, identifying in each case the basic and non- basic variable. 2x1+x2+4x3 =11 3x1+x2+5x3=14 TYOCO assembles three types of toys- trains, trucks and cars using three operations. The daily limits on the available times for the three operation are 430, 460,420 minutes respectively and revenues per unit of toy train truck and car are Rs.3,Rs2, Rs.5 respectively. The assembly times per train at three operations are (1,3,1) respectively . The corresponding times per truck and per car are (2,0,4) and (1,2,0) minutes. Formulate the problem and solve using simplex method

57 Write six key solution concepts of simplex method.
Solve the following LPP using simplex Maximize Z= 5x1+4x2 STC 6x1+4x2<=24 x1+2x2<=6 -x1+x2<=1 x2<=2 x1,x2 >=0 Work through the simplex method step by step to solve the following problem: Minimize Z=x1 - 3x2+3x3 STC 3x1-x2+2x3<=7 2x1+4x2 >=-12 -4x1+3x2 + 8x3<=10 x1,x2,x3 >=0 Explain the special cases that arise in the use of simplex method. Solve the following LPP using simplex Maximize Z= 5x1+3x2 STC 3x1+5x2<=15 5x1+2x2<=10 x1,x2>=0

58 . Solve the following LPP using simplex Maximize Z= 3x1+5x2
STC x1<=4 2x2<=12 3x1+2x2<=18 x1,x2>=0 Why the simplex method is better than graphical method?


Download ppt "10CS82 SYSTEM MODELING AND SIMULATION"

Similar presentations


Ads by Google