2014년 2월 25일 화요일

Simulation of Emergency Department using Promoel

For SHS student case study competition, my team had to come up with improved Emergency Department design and do an analysis on costs, wait time, and sensitivity analysis.
I was in charge of modeling a simulation of and do a analysis on various different number of input parameters using Promodel.
Below is an example showing wait time and estimated annual labor cost depend on different combination of nurses and doctor. This is done by changing its attribute quantity in promodel

Here is the code for the simulation :

********************************************************************************
*                                                                              *
*                         Formatted Listing of Model:                          *
*                    C:\Users\Administrator\Desktop\SHS.MOD                    *
*                                                                              *
********************************************************************************

  Time Units:                        Minutes
  Distance Units:                    Feet


********************************************************************************
*                                  Locations                                   *
********************************************************************************

  Name       Cap Units Stats       Rules      Cost      
  ---------- --- ----- ----------- ---------- ------------
  enterance  inf 1     Time Series Oldest, ,            
  k1         4   1     Time Series Oldest, ,            
  h1         2   1     Time Series Oldest, ,            
  f1         6   1     Time Series Oldest, ,            
  i1         2   1     Time Series Oldest, ,            
  p1         2   1     Time Series Oldest, ,            
  lobby      inf 1     Time Series Oldest, ,            
  ambulance  inf 1     Time Series Oldest, ,            
  walkin     inf 1     Time Series Oldest, ,            


********************************************************************************
*                                   Entities                                   *
********************************************************************************

  Name       Speed (fpm)  Stats       Cost      
  ---------- ------------ ----------- ------------
  Patient    150          Time Series            


********************************************************************************
*                                  Resources                                   *
********************************************************************************

                             Res    Ent                                        
  Name        Units Stats    Search Search Path       Motion         Cost      
  ----------- ----- -------- ------ ------ ---------- -------------- ------------
  nurse       5     By Unit  None   Oldest            Empty: 150 fpm            
                                                      Full: 150 fpm            

  doctor      2     By Unit  None   Oldest            Empty: 150 fpm            
                                                      Full: 150 fpm            

  triagedoc   1     By Unit  None   Oldest            Empty: 150 fpm            
                                                      Full: 150 fpm            

  triagenurse 1     By Unit  None   Oldest            Empty: 150 fpm            
                                                      Full: 150 fpm            


********************************************************************************
*                                  Processing                                  *
********************************************************************************

                              Process                    Routing

 Entity   Location  Operation            Blk  Output   Destination Rule     Move Logic
 -------- --------- ------------------   ---- -------- ----------- -------  ------------
 Patient  enterance if arriving_type=0 then route 1
                    if arriving_type=1 then route 2
                                         1    Patient  walkin      FIRST 1
                                         2    Patient  ambulance   FIRST 1
 Patient  walkin                         1    Patient  lobby       FIRST 1
 Patient  ambulance                      1    Patient  lobby       FIRST 1
 Patient  lobby     if esi=1 then begin route 1 end
                    if esi=2 then begin route 2 end
                    if esi=3 then begin route 3 end
                    if esi=4 then begin route 4 end
                    if esi=5 then begin route 5 end
                    if esi=6 then begin route 3 end
                                         1    Patient  k1,999      FIRST 1  USE nurse, 999 FOR 10 and doctor, 999 for 15 Free all
                                                                            Use nurse, 999 for 10
                                              Patient  h1,999      FIRST    USE nurse, 999 FOR 10 and doctor, 999 for 15 Free all
                                                                            Use nurse, 999 for 10
                                              Patient  f1,999      FIRST    USE nurse, 999 FOR 10 and doctor, 999 for 15 Free all
                                                                            Use nurse, 999 for 10
                                              Patient  i1,999      FIRST    USE nurse, 999 FOR 10 and doctor, 999 for 15 Free all
                                                                            Use nurse, 999 for 10
                                              Patient  p1,999      FIRST    USE nurse, 999 FOR 10 and doctor, 999 for 15 Free all
                                                                            Use nurse, 999 for 10
                                         2    Patient  k1,700      FIRST 1  USE nurse, 700 FOR 10 and doctor, 700 for 15 Free all
                                                                            Use nurse, 700 for 10
                                              Patient  h1,700      FIRST    USE nurse, 700 FOR 10 and doctor, 700 for 15 Free all
                                                                            Use nurse, 700 for 10
                                              Patient  f1,700      FIRST    USE nurse, 700 FOR 10 and doctor, 700 for 15 Free all
                                                                            Use nurse, 700 for 10
                                              Patient  i1,700      FIRST    USE nurse, 700 FOR 10 and doctor, 700 for 15 Free all
                                                                            Use nurse, 700 for 10
                                              Patient  p1,700      FIRST    USE nurse, 700 FOR 10 and doctor, 700 for 15 Free all
                                                                            Use nurse, 700 for 10
                                         3    Patient  f1,500      FIRST 1  USE nurse, 500 FOR 10 and doctor, 500 for 15 Free all
                                                                            Use nurse, 500 for 10
                                              Patient  h1,500      ALT      USE nurse, 500 FOR 10 and doctor, 500 for 15 Free all
                                                                            Use nurse, 500 for 10
                                              Patient  k1,500      FIRST    USE nurse, 500 FOR 10 and doctor, 500 for 15 Free all
                                                                            Use nurse, 500 for 10
                                              Patient  i1,500      ALT      USE nurse, 500 FOR 10 and doctor, 500 for 15 Free all
                                                                            Use nurse, 500 for 10
                                              Patient  p1,500      ALT      USE nurse, 500 FOR 10 and doctor, 500 for 15 Free all
                                                                            Use nurse, 500 for 10
                                         4    Patient  f1,350      FIRST 1  USE nurse, 350 FOR 10 and doctor, 350 for 15 Free all
                                                                            Use nurse, 350 for 10
                                              Patient  k1,350      ALT      USE nurse, 350 FOR 10 and doctor, 350 for 15 Free all
                                                                            Use nurse, 350 for 10
                                              Patient  i1,350      ALT      USE nurse, 350 FOR 10 and doctor, 350 for 15 Free all
                                                                            Use nurse, 350 for 10
                                              Patient  h1,350      ALT      USE nurse, 350 FOR 10 and doctor, 350 for 15 Free all
                                                                            Use nurse, 350 for 10
                                              Patient  p1,350      ALT      USE nurse, 350 FOR 10 and doctor, 350 for 15 Free all
                                                                            Use nurse, 350 for 10
                                         5    Patient  f1,200      FIRST 1  USE nurse, 200 FOR 10 and doctor, 200 for 15 Free all
                                                                            Use nurse, 200 for 10
                                              Patient  k1,200      ALT      USE nurse, 200 FOR 10 and doctor, 200 for 15 Free all
                                                                            Use nurse, 200 for 10
                                              Patient  i1,200      ALT      USE nurse, 200 FOR 10 and doctor, 200 for 15 Free all
                                                                            Use nurse, 200 for 10
                                              Patient  p1,200      ALT      USE nurse, 200 FOR 10 and doctor, 200 for 15 Free all
                                                                            Use nurse, 200 for 10
 Patient  k1        if esi=1 then wait U(127, 30)
                    if esi=2 then wait U(157, 30)
                    if esi=3 then wait U(187, 30)
                    if esi=4 then wait U(217, 30)
                    if esi=5 then wait U(247, 30)
                    if esi=6 then wait U(277, 30)
                                         1    Patient  EXIT        FIRST 1
 Patient  h1        if esi=1 then wait U(127, 30)
                    if esi=2 then wait U(157, 30)
                    if esi=3 then wait U(187, 30)
                    if esi=4 then wait U(217, 30)
                    if esi=5 then wait U(247, 30)
                    if esi=6 then wait U(277, 30)
                                         1    Patient  EXIT        FIRST 1
 Patient  f1        if esi=1 then wait U(127, 30)
                    if esi=2 then wait U(157, 30)
                    if esi=3 then wait U(187, 30)
                    if esi=4 then wait U(217, 30)
                    if esi=5 then wait U(247, 30)
                    if esi=6 then wait U(277, 30)
                                         1    Patient  EXIT        FIRST 1
 Patient  i1        if esi=1 then wait U(127, 30)
                    if esi=2 then wait U(157, 30)
                    if esi=3 then wait U(187, 30)
                    if esi=4 then wait U(217, 30)
                    if esi=5 then wait U(247, 30)
                    if esi=6 then wait U(277, 30)
                                         1    Patient  EXIT        FIRST 1
 Patient  p1        if esi=1 then wait U(127, 30)
                    if esi=2 then wait U(157, 30)
                    if esi=3 then wait U(187, 30)
                    if esi=4 then wait U(217, 30)
                    if esi=5 then wait U(247, 30)
                    if esi=6 then wait U(277, 30)
                                         1    Patient  EXIT        FIRST 1


********************************************************************************
*                                   Arrivals                                   *
********************************************************************************

  Entity   Location  Qty Each   First Time Occurrences Frequency  Logic
  -------- --------- ---------- ---------- ----------- ---------- ------------
  Patient  enterance 1                     inf         e(15)      symptom=symptom_dist()
                                                                  esi=esi_dist()
                                                                  arriving_type=arriving_dist()
                                                                 


********************************************************************************
*                                  Attributes                                  *
********************************************************************************

  ID            Type         Classification
  ------------- ------------ --------------
#
#0=Cut Contusions(16%)
#1=URI(10.5%)
#2=Sprain Broken Bone(7.9%)
#3=Abdominal GI(6.6%)
#4=Other Pain(6.3%)
#5=Skin infection(6.3%)
#6=Mental Health(4.9%)
#7=Insect bite (4.7%)
#8=Asthma Pulmunary(4.3%)
#9=Other Bacterial Infection(3.5%)
#10=Headache and Neuro(3.5%)
#11=Renal/ UTI(3.5%)
#12=Alcohol Drug(3.5%)
#13=Head Injury concission(3.5%)
#14=Other Injury(15%)
#
  symptom       Integer      Entity      
#
#0=unk(5.6%)
#1=1(1.1%)
#2=2(10.2%)
#3=3(43.4%)
#4=4(32.7%)
#5=5(7%)
  esi           Integer      Entity      
#
#0=walk-in
#1=embulance
  arriving_type Integer      Entity      


********************************************************************************
*                              User Distributions                              *
********************************************************************************

  ID            Type         Cumulative   Percentage   Value      
  ------------- ------------ ------------ ------------ ------------
  symptom_dist  Discrete     No           16           0          
                                          10.5         1          
                                          7.9          2          
                                          6.6          3          
                                          6.3          4          
                                          6.3          5          
                                          4.9          6          
                                          4.7          7          
                                          4.3          8          
                                          3.5          9          
                                          3.5          10        
                                          3.5          11        
                                          3.5          12        
                                          3.5          13        
                                          15           14        
  esi_dist      Discrete     No           5.6          6          
                                          1.1          1          
                                          10.2         2          
                                          43.4         3          
                                          32.7         4          
                                          7            5          
  arriving_dist Discrete     No           85           0          
                                          15           1          

as you can see, we had to research probability distribution on various of different things that could cause different processing time and routes. Because of the limitation of the student version of the program, detailed routing and processing were not accomplished. However, we were able to get close enough theoretical numbers which were very close to numbers that we got from manual queuing theory calculation 

regression analysis example


REGRESSION ANALYSIS
USING BOWLING PIN FACTORY(FACTISM)
IME 435/L DESIGN OF EXPERIMENT
YOUNG KIM
2/25/2014
IME DEPARTMENT
CALIFORNIA STATE POLYTECHNIC UNIVERSITY



Title:
Simple regression analysis using bowling pin factory (FACTISM)
Statement of the problem:
How change in pressure in 8 different levels will affect response, weight, will be investigated by performing simple regression analysis. Some of questions to be answered at the end of the experiment are:
a.      If the chosen factor is correlated with the response variable (launch distance) or not.
b.      Is the correlation positive or negative?
c.       Is the correlation strong or weak?
d.      What is the correlation coefficient? What is its significance?
e.      What is the coefficient of determination? What is its significance?
Materials or Tools:
FACTISM
Microsoft Excel
Microsoft Words
Assumptions:
1. Coefficient of correlation with value of less than 0.85 is considered to be insignificant.
2. Coefficient of determination with value of less than 0.723 is considered to be insignificant.
Procedure:
1. Collect responses from Factism by changing pressure value to 80, 81, 82, 83, 84, 85, and 86 with 6 replications for each level.
2. Perform simple linear regression analysis manually and using excel.







Results:
Using manual method:
 


Findings & conclusion:
a.      If the chosen factor is correlated with the response variable (launch distance) or not.
- From the regression analysis we can see that there is no correlation between the pressure and weight. This is supported by the fact that our slope or b_1 is relatively small. Yet, slope by itself does not tell us the strength of the correlation.
b.      Is the correlation positive or negative?
-Since our slope is positive, the relationship is positive relationship.
c.       Is the correlation strong or weak?
-This correlation is said to be very weak due to its small value in coefficient of correlation.
d.      What is the correlation coefficient? What is its significance?
-The correlation coefficient in this particular analysis is 0.069144. From our assumption, we have decided that R value with less than 0.85 is to be insignificant. Hence, it is confident to conclude that pressure does not have any effect on weight.
e.      What is the coefficient of determination? What is its significance?
-The coefficient of determination in this particular analysis is calculated to be 0.004781 by which mean, any variation in weight is caused by pressure only .5% of the time.


Two factor ANOVA example

TWO FACTOR ANOVA
USING BOWLING PIN FACTORY(FACTISM)
IME 435/L DESIGN OF EXPERIMENT
YOUNG KIM
2/19/2014
IME DEPARTMENT
CALIFORNIA STATE POLYTECHNIC UNIVERSITY



Title:
Two Factors ANOVA using bowling pin factory (FACTISM)
Statement of the problem:
Using statistical analysis of variance, ANOVA, using two factors out of 5, temperature and alloy, experiment will be conducted to see if any of those factor contributes to change in response.
Materials or Tools:
FACTISM
Microsoft Excel
Microsoft Words
Assumptions:
1. Other factors other than temperature and alloy will not have effect on response.
2. H_0 =  u1 =  u2  =  u3  =  u4  =  u5, temperature has no effect on weight
    H_a
, temperature does have effect on weight
    H_0 =  u1 =  u2  =  u3  =  u4  =  u5, alloy has no effect on weight
    H_a
, alloy does have effect on weight
    H_0 =  u1 =  u2  =  u3  =  u4  =  u5, interaction has no effect on weight
    H_a
, interaction does have effect on weight
3. Alpha = 0.95
Procedure:
1. Collect responses from Factism by changing temperature and alloy value to 0, 25, 50, 75, 100, and 30, 35, 40, 45, 50 respectively.  Repeat each trial 8 times.
2. Perform two factor ANOVA by both manual and using Megastats.







Results:
Using manual method:

Performing two way ANOVA manually :







Using Megastats:
 
Findings & conclusion:

Since our calculated F value for temperature is less than our critical F value, we fail to reject our null hypothesis. Our p-value from Megastat also indicates that we fail to reject our null hypothesis since 0.2743 is greater than 0.05 which is our alpha value. However, we reject null hypothesis for alloy since its calculated F value is greater than critical F value, yet, without confident since both p values are so close to each other. Finally we can confidently say that we fail to reject our null hypothesis for interaction of temperature and alloy due to greater magnitude in calculated p value from critical p value.


2014년 2월 24일 월요일

DOE+LP

So, for my senior project, we are working on process improvement and standardization on current processes. First, we are investigating what is causing the variation in the weighing process. To do that, I will use design of experiment with 2 factors with 3 levels. Hopefully, with some constraints, I would be able to come up with an objective function, which would be prediction equation for DOE, and apply LP method to maximize or minimize that objective. I will post the results asap I have it. 

2014년 1월 15일 수요일

random thought

Okay.. water level is rising in sea.... we are not getting enough rainfall... oil is getting scarce..

why don't freaking million's engineer work on a project to convert sea water into fresh water at the same time generate electricity by somehow converting energy created by waves or tides..... so we can sustain our sea water level + save gas + get more source of fresh water.... just charge agricultural people more money for use of those water to fund those project and operation... may sound crazy.. but could be our only option in future :(... I would definitely loved to be involved in such a life changing project like this... :) 

2014년 1월 7일 화요일

sustainability pt1

While I was taking class yesterday, for no reason... this whole scenario came across my mind..

There are two jobs.. each job requires one worker..
Job 1 requires 8 hours... but can be crammed to 7 hours if additional $10 is paid..
Job 2 requires 1 hours...
and hourly wage is $10....

What would you do if you were the boss...

have one worker do both job by cramming Job 1

or 

Have one part time worker to do Job 2.... 




The cost is going to be same in both scenario... which is .. $90... I am sure that there are people who would choose second option because they just can't do simply math and thinks first option would cost them more...
although if you consider all the indirect costs associated with each employees, you will find out that you are actually saving money if you go with first option....

btw...
what you, as an employer, should consider more is the social aspect of sustainability.. which in this case is the motivation of the worker or morale. 

to be continued.... 

2013년 7월 17일 수요일

My WPM

Honestly, I typed way faster when I was in high school playing games all day.
Here is my WPM by the way.


Lean Manufacturing / Improving facility

Okay... I have been trying to find an intern, part/full position during this summer for a company/facility to try my knowledge and skills in lean manufacturing and six sigmas learned at my school and previous works. Although I failed to do so, I am going to virtually share what I am going to do actually if I were to involved in actual project.

Since I was mainly hoping to work at a manufacturing facility, I will use simple manufacturing company as an example.

First, I would have to do some study and evaluate company's current situation. I have to gather data such as time, tasks assigned to each station, number of works, and all other necessary data.

Well, at this step, we need some theoretical standard numbers to compare those recorded data with to see if company is doing below or above the standard. These standards can be calculated using many different techniques such as

  1. time study
  2. motion study
  3. queueing theory
  4. assembly line balancing technique. 


If the company is doing below calculated standards, then management should step in and make some changes to maximize their utilization and reduce wastes.
To achieve this, company may need to redesign their facility more organized and efficient. They may also need to train their workers to do the job in proper way which maximizes their process. The most important thing is that the top management should be willing and able to make this changes even though it may cost them now.
At this step, company may incorporate such techniques as:

  1. Facility redesign
  2. Kaizen - gradual continuous improvement.
  3. Poke-yoke - mostly done by organizing work stations and making somekind of signs.
  4. PDCA/DMAIC - Plan Do Check Act/ Define Measure Analysis Improve Control. Both are for Six Sigma
  5. Simulation(promodel) - to see if the theoretical changes actually improves the system (if used right, helps company save tons money)
  6. 5s - Sort, Set in order, Shine, Standardize, Sustain


Once company made changes and improved their process, the most important thing is to sustain those changes by making check list. It would be nice thing to give rewards to department or people who made most improvements or suggested most realistic and helpful improvement to company to reinforce workers to be actively involved in improvement.


2013년 6월 8일 토요일

The Goal by Goldratt

I read this book mainly because it was assigned as assignment.
Its actually great book teaching you how to minimize the cost and optimize your process using TOC and other concepts. I had to write a book review on this book and here is what I wrote:

The goal by Eli M. Goldratt is a novel focused on Alex Rogo, who is a production manager of a company having hard time. Alex is introduced to a concept of TOC after meeting his old guru Jonah. The intention of theory of constraint, which Goldratt's most famous for, is to improve the system by identifying and eliminate the constraint that is holding back the company's performance hence increases their throughput. TOC states that, running areas with higher capacity will not increase throughput of system. Management should find are with lowest capacity, which is their bottleneck, and try to increase its capacity. Goldratt introduces 5 step models to achieve that. First, company should identify the constraints. Second, decide how to exploit constraints. Third, subordinate everything else to the above decision. Fourth, elevate the system's constraint. Lastly, if the constraint from first step is broken, go back to step 1. Throughout the novel, Goldratt tries to explain and prove the importance of TOC and his principles. In addition to these 5 steps, one should ask these three questions too. What to change? What to change it to? How to cause the change? These three questions should go along with the 5 step model when incorporating theory of constraints in business. Rogo believed that these three questions were essential to managers in order to successfully understand and apply theory of constraints. In the novel, Rogo was successful in fixing company's problem and promoted. These concepts and ideas are really relevant to any type of business and any professions. Because of the economy factors of nowadays, many companies are trying to minimize their costs and resources and I believe "The Goal" is the one of must read book that will help people to achieve it.

Decision making using decision tree analysis





Decision Tree
And
Analysis
PREPARED BY
Young Kim
IE417 Section 1 Spring 2013


REVISION PAGE:


REVISION
        DATE                           DESCRIPTION
      N/C                        06-05-2013                  Initial Release
1.0  Introduction:

The following report demonstrates decision making analysis using decision tree.

2.0  PROBLEM

CEO of Cerebrosoft, Charlotte Rothstein, is faced with a situation where her company needs to make decision whether to launch the product or abandon it. When decided to launch it, they can go with a price of 3 categories, $50, $40, or $30. Once again, with $50 pricing range, they can choose either to hire researcher or not.

3.0  OBJECTIVE

To use technique of decision tree and probabilities to choose optimal scenario for Cerebrosoft with maximum expected revenue.

4.0  REFERENCE DOCUMENTS:

A. Operational Research Applications and Algorithms 4th Edition, Wayne Winston
B. Lecture slide

5.0  REFERENCE SOFTWARE:

A.      Microsoft Excel
B.      Microsoft Word

6.0  ASSUMPTIONS & RATIONALE:

-          When abandoned, their initial investment of $800000 is lost
-          No marketing, including advertising, or annual support cost of $50000 is encountered in calculation of revenue.

7.0  Decision Tree and Probabilities
Below is embedded file of Decision Tree Diagram and Probabilities Calculation
(I actually have files 4 files embedded in this documents, but its not visible here, hence i will just post it here :))

Without Researcher


-

                         With Researcher



d

EVWPI(expected value with perfect information tree diagram)



Above is the probabilities




 Note: The expected value of node that contains multiple scenarios with probabilities in each tree diagram was calculated by multiplying previous expected value with the corresponding probability.

8.0  Findings

As you can see with the decision tree diagram without researcher, setting product price at $50 will give maximum expected revenue of $715,000 for the first year. If we take in account of support fee of $50,000, then our expected revenue of first year will be $665,000. From the following years, under the assumption that our probabilities stay same, we will have expected revenue of $1,465,000 since our initial investment of $800,000 is made up from first years revenue. The expected revenue from the following year will be

When it comes to decision of whether to hire researcher or not, our expected revenue from hiring researcher is determined to be $705,000.

EVSI is calculated by using equation EVSI = EVWSI – EVWOI which is ($705000+$10,000) - $715,000
EVSI is determined to be = $0.

EVPI is calculated by using equation EVPI = EVWPI – EVWOI

EVWPI is calculated by calculating expected maximum value for each state.
EVWPI = 0.2*$625,000 + 0.7*$725,000 + 0.1*$825,000
EVWPI is determined to be $715,000

EVWOI is calculated from calculation in EVSI which is determined to be $715,000
EVPI = $715,000 - $715,000 = $0


9.0  Conclusion


From the analysis, we can conclude that company should not hire a researcher and set the price of the product at $50 to have maximum expected revenue for first year of $715,000 before support investment of $50,000. This conclusion is drawn from the value of EVSI and EVPI. The minimum desired EVSI value is $10,000 which is the amount that company is willing to pay for the research. The EVSI calculated tells that the amount of research price that company is should pay to have extra expected value is $0, which means that as soon as price of research goes up, the expected profit of company drops by same amount. In other words, unless it is free to conduct the research, it is not worth doing it. The EVPI tells that the amount of money that company is willing to pay to know the trends is $0. Hence, in summary of this analysis, the company should not invest any money on extra information and set the price of product at $50 to maximize their expected profit.