{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HW6_sol - IEOR 4404 Simulation Assignment 6 Solution Jing...

This preview shows pages 1–3. Sign up to view the full content.

IEOR 4404 Simulation Assignment 6 Solution Jing Dong 1. λ ( t ) = 4 + 3 t for 0 t < 5 and λ ( t ) = 34 - 3 t for 5 t < 10 λ ( t ) = λ ( t - 10) for t 10 λ ( t ) 19 for all t 0 Using the third method outlined in the lecture notes for simulating nonhomegeneous Pois- son process, we have: %Simulate the next arrival of the nonhomogeneous Poisson process %t is the current time function T=ATime(t) lambda=19; I=0; while (I==0) T0=-log(rand)/lambda; t=t+T0; %lambda(t+10)=lambda(t) t0=t-floor(t/10)*10; if t0 < 5 lambda_t=4+3*t0; else lambda_t=34-3*t0; end C=lambda_t/lambda; U=rand; if U<=C I=1; T=t; end end We then simulate the expected amount of time that the server is on break: %Qn1 mu=25; n=500; Id=zeros(1,n); for i=1:n t=0; SS=0; V=0.3*rand; Id(i)=V; tD=V; tA=ATime(t); t=min([tA,tD]); while t <= 100 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
if t==tA SS=SS+1; tA=ATime(t); else if SS==0 V=0.3*rand; tD=t+V; if tD <= 100 Id(i)=I(i)+V; else Id(i)=I(i)+100-t; end else SS=SS-1; tD=t-log(rand)/mu; end end t=min([tA,tD]); end end B=mean(Id) B = 54.1716 2. t : time variable N A : the number of arrivals N : the number of lost W t : waiting time of a new arrival. It is the time it takes to serve all the customers before the arriving customer.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

HW6_sol - IEOR 4404 Simulation Assignment 6 Solution Jing...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online