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.