p = The steady-state utilitization of a server
L = The steady-state average number of entities in system
W = The steady-state average time in system
Wq = The steady state average time in queue
Lq = The steady-state average number of entities in queue
MD1<-function(mu,lambda){
temp = mu - lambda
rList=list(
p =lambda / mu,
Lq = ( lambda * lambda ) / ( 2 * mu * temp ),
L = ( lambda * lambda ) / ( 2 * mu * temp ) + lambda / mu,
Wq=lambda / ( 2 * mu * temp ),
W=( lambda / ( 2 * mu * temp )) + (1 / mu )
)
return(rList)
}
MM1<-function(mu,lambda){
p.v <- lambda / mu
L.v <- p.v/(1-p.v)
W.v <- L.v/lambda
Wq.v <- W.v-(1/mu)
Lq.v <- lambda*Wq.v
rList=list(
p = p.v,
Lq = Lq.v,
L = L.v,
Wq = Wq.v,
W = W.v
)
return(rList)
}
#arrival rate 1 per minute
#service rate 1/0.9 per minute
MD1((1/0.9),1)
## $p
## [1] 0.9
##
## $Lq
## [1] 4.05
##
## $L
## [1] 4.95
##
## $Wq
## [1] 4.05
##
## $W
## [1] 4.95
Looking at these two results, we can compare by setting a variable to each function return and checking the difference. We notice that queues and times from MM1 exceed that of MD1.
md1Var<-MD1((1/0.9),1)
mm1Var<-MM1((1/0.9),1)
mapply('-',md1Var,mm1Var,SIMPLIFY=FALSE)
## $p
## [1] 0
##
## $Lq
## [1] -4.05
##
## $L
## [1] -4.05
##
## $Wq
## [1] -4.05
##
## $W
## [1] -4.05
Moving into Simio. An experiment was set-up at 10 hours with 10 replications and a 1 hour warm-up period to reduce start-up bias. There is a similarity of values, however a more refined simulation could have used an increased number of replications and length of simulation (days not hours.)
Simio Results