Documente Academic
Documente Profesional
Documente Cultură
Spring 2016
GroupMember:
Joseph Kujawa
[jdk277]
Imran Khan
[iak26]
Stephen Lee
[sjl345]
Bob(Kunhe) Chen
[kc853]
Cornell University
Table of Content
ExecutiveSummary
1.AirTrafficControl
Section1.1ProblemDescription
1.1.1STATESANDEVENTS
1.1.2SIMULATIONMODEL
Section1.2ResultDiscussion
Section1.3CaseComparison
Case110%ReducedMeanandSDLandingTime
Case210%ReducedMeanandSDRecircleTime
Case310%ReducedMeanandSDQueueSeparationDistance
SUMMARY
2.ReliabilityAnalysis
2.1ProblemDescription
2.2AnalysisandResults
2.3Summary
3.CargoOperations
3.1OptimizationModel
3.1.1Background
3.1.2SystemDescription
3.1.3OptimizationObjective
3.1.4SystemModel
3.2Simulation
3.2.1Optimization
3.2.2Solver
3.3Analysis
1/45
3.3.1Results
3.3.2SystemAnalysis
4.Conclusion
AppendixA
AppendixB
AppendixC
AppendixD
AppendixE
2/45
Executive Summary
This reportfocussesonsomeofthe challengesintheairtransportationandtheaircraftindustry,
providesadetailedanalysisofthesechallenges,andproposessolutionsandrecommendations.
Section 1 talks about air traffic control, focussing more on the landing queue system. Owingto
the safety measures of maintaining a certain separation distance in the queue, there are
challenges that the aircraft industry faces in terms of avoiding flight delays and better
management of air traffic. A discrete event simulation (DES) model is used and it is found that
the average queue length is between 2.48 and 3.13.Thisprovidesroomforimprovementsince
itisdesirabletohaveshorterqueuelengths.Amoredetailedanalysis foundthatabout17.4%to
23% of the time, the queue is clogged, which is defined as more than 5 planes in the queue.
This is far from ideal because a clogged queue means flight delays and bad customer ratings.
Moreover, the total number of planes in a system for a given system requirement is
approximately 14 planes, which is again is far from ideal. The average number of planes in
recircles are also high. Thus, there is significant challenge in terms of reducing queue length,
reducing clogged queue time, number of planes in the system, number of planes in recircles,
andavarietyofadditionalissues.
Followingastaticanalysis,thereportdiscussestheimpactofadecrease inmeanandspreadof
landing times by 10%, which may be because of relaxation of stringent safety rules. It is found
that all the statistics improve to a great extent because of such a small change. Hence, it
becomes only advisable to research further on whether this 10% can be incorporated without
compromising on safety standards. Another static analysis wasconductedtoassesstheimpact
of a decrease in recircle distance by 10%. This analysis does not show a significant
improvement in the overall air traffic control system and hence can be reduced in priority. The
third static analysis was conducted to determine the impact of the change in plane separation
withadecrease of10%.Thisresultsina dramaticimprovementtotheamountoftimethequeue
is clogged. Hence, this change should definitely be considered by the managementwithahigh
priority. We believe that the first and the third change are highly feasible and should be
implemented following final safety tests. These recommendations can help to ensure effective
airtrafficcontrol.
3/45
Section 2 focuses on the reliability analysis in the same setup of aircraft industry. Emotionally
driven customers give a lotofimportancetosafety. Itiscriticaltounderstandtherisksandhow
those risks interact with one anotherandaffectthesystemasawhole. Theoveralllikelihoodof
an accident is extremely small however with increasing air traffic, this probability grows in
likelihood and becomes even more important to the industry. Giving pilots a new dynamic
control system, which will limit their response time in the event of an inflight separation
violation, has the potential to reduce thisoverallrisk.Thus,moreerrorscanbeabsorbed bythe
system. Section 1 discussed that the inflight separation distance can be reduced for effective
air traffic control. However, if inflight separation distance is reduced, then the new dynamic
controlsystemhasademeritbecauseitactuallyresultsinmoreaccidents.Pilotsthinkthatthere
is more room for error with this system, when analysis proves that it is not the case. The
benefits from the new dynamic control system are more than offset by thenegativesofaltering
the inflight separation distance. It is recommended that these two options be considered in
disjunctioninordertomaintainhighsafetystandardsandfromthereliabilitypointofview.
Section 3 deviates from air traffic control and focusses on the cargo operations that takeplace
in an airport network. We built an optimization model to ensure smooth and costeffective
management of cargo operations. There are often carrier capacities at each given airport, and
there is cost associated with transporting cargoes from one airport to the other. Having an
optimization model which minimizes costfortheaircraftcompanyisalwaysdesirablebecauseit
would mean more profit and insights intoimprovingmanagement.Theanalysisdoneshowsthe
complexity of such a problem, which can be seen from thefacttheExcelfailstogiveafeasible
solution. With regards to thecurrentsystem,theconclusionis thatthecurrentcarriercapacityis
insufficient to achieve global optimum in a week. This is because of sudden peak influx of
cargoes at the airports which can be handledforonlyashortperiodoftime.Nothavingenough
carriers increases the cost by 17%. In addition to purchase more carrier. The recommendation
is that weekly demand distribution be smoothened by keeping some extra cargos on the
weekends. If total carrier capacity is increased by 16%, global optimum can be achieved. It is
also recommended that the management charge the cargosnotonlyonthedistancebutonthe
origindestinationpairaswell.
4/45
5/45
simulation determines a negative interarrival time, it will simply continue finding random
numbersuntilitsettlesonanonnegativenumber.
6/45
7/45
While the average length of the queue is important, a clogged queue is a significant time sink
and safety problem. We define a clogged queue as a queue with five or more planes in it.The
proportion of time that the queue is clogged is [17.4%, 23%], which is higher than ideal. We
expecttoseethesamechangesinthisaswedowithaveragequeuelength.
The total number of planes in the system for the given system specifications is [13.39,14.19].
This number is far from ideal, and along with the proportion of time with five or more planes in
the queue are the two statistics that we wish to decrease. Decreasing the average number of
planes in the system would allow for an easier workload for air traffic controllers, and could
potentially lead to fewer controllers, saving the airport money. With our averages of number of
planes in queue and number of planes in system there are approximately 11 planes either
travelling to the queue, landing, or recircling to the beginning of the queue. Trimmingdownthe
recircle time would have the greatest effect in decreasing this number, and we expect both
decreasing queue separation and decreased landing time to resultinsmallerdecreasestototal
planesinsystem.
Other significant statistics tracked are the percentage of time that the landing zone is blocked,
theaveragetimethatoneplanespendsinqueue,theaveragetimethatoneplanespendsinthe
system, and the average number of recircles by a plane. We expect the average time spent in
queue and system to trend the same way as the average length of queue or numberofplanes
in system. We would like to have a low percent of time that the landing zone is blocked, such
that planes arriving at the threshold point have the opportunity to land more frequently. This
percentage is a driver to the number of planes in the queue and proportion of time that the
queue is clogged. The other major driver to reducing number of planes in the queue is the
average numberofrecirclesbyaplane.Implementingchangesthataffectthese drivers allowus
to reduce the number of planes in the queue and system. All confidence intervals for these
statistics can be found in
Figure 1.1 below. A larger,clearerversioncanbefoundin
Appendix
E
.
8/45
Figure1.1FinalResultsfromDES.Alargerversionisattachedintheappendix.
9/45
team strongly recommends that this case be considered for further research due to the
disproportionateimprovementinallmajorstatisticsforsuchasmallimprovement.
SUMMARY
The current regulations for queue separation are lackluster and lead to long wait times both in
the system and in the queue itself. In addition, the highaveragenumberofplanesinthequeue
and highproportionoftimethat thequeueiscloggedarefartoohighandcanleadtodangerous
situations. The suggested change to mandatory queue separation distance is a good change
that has been proven to be feasible and safe, and would allow for significantly decreased
average length of queue,butdoesnothaveasignificanteffectontimespentinthesystem. The
team suggests a different change, one wherein the landing time is decreased. This leads to
significant changes in both queuetimeandsystemtime,andisbetteracrosstheboardthanthe
same change applied to queue separation time. However, because the team came up withthe
change recently, we do not know whether or not this change is possible potential safety,
technology, or logisticissuescouldexist.Therefore,theteamrecommendsthatfurtherresearch
be done into potential improvements to landing timeandspreadwhilethesafer,provenchange
to queue separation requirements are put into place immediately. While this queue separation
change does nothavethesamelevelorscope ofimprovementsasthelandingtimechange,we
knowitisbothsafeandpossible.
11/45
2. Reliability Analysis
2.1 Problem Description
As new technologies develop and standard operating procedures change, the primary thing all
organizations focus on is safety. This is especially true in the emotionally stressful and
customer driven market of air travel. There are several factors that can affect safety and the
publicsopinionastothemostreliableairportsandairlines. Thesefactorsrangeanywherefrom
weather delays, congestion backups, and most importantly serious accidents. In this section,
we will analyze the potential benefits associated with a new technology, as well astheexisting
risks that exists within the landing sequence for arriving aircraft. Our analysis will provide an
assessment of the overall reliability of the system with regards to risk of incident and a
recommendationastotheimplantationofanewdynamicspeedcontrolsystem.
One of the biggest issues facing arriving aircraft and the corresponding air traffic controllers is
inflight separation. Thegoalofanysuccessfulairtrafficcontrolleristomaximizethenumberof
aircraft that can flow through the airport in a given day. This willleadtomoreairlinesproviding
more flights in and out of the airport, which will correlate to more profit for the airport and
ultimately its employees. However, the Federal Aviation Administration (FAA) places specific
restrictions when it comes to the space that can exist between arriving aircraft because of the
increased likelihood for incidents as a result of what is known as wake vortex. Depending on
the size and payload of the leading aircraft, a wake vortex of varying significance is created.
Theseveritycanbeseenbelow.
Table2.1:Probabilitiesofvortexcreatingdangeroussituation.
These probabilities serve as a rough estimate for the likelihood an accident taking place
however, they are not the only factor to consider when developing a method for approximating
the likelihood of an accident taking place. In order to accomplish that task, we developed a
12/45
cause and effect diagram to assess, model, and generate an approximate solution for the
likelihoodofanaccidenttakingplace.
Table2.2:Summaryofviolations.
13/45
This equation takes into account all the given information that could result in a violation
occurring. As you can see from the above table, all of these individual probabilities are
relatively small. This is due to the significant innovations made in aircraft and airtrafficcontrol
safety procedures over recent years. These innovations lead us to the conclusion that the
14/45
Table2.3:Simultaneousoccupancy
After analysis of the situation, we made the assumption that similar to the probability of an
accident, multiple events had to occur for a simultaneous occupation to occur. However, this
situation is significantly different. For an accident to occur, several event have to happen in
sequence, which leads us to calculate the joint probability for that event as the product of the
probabilities of the contributing events. Simultaneous occupation is theresultof anyoneofthe
given probabilities occurring, which leads us to calculate this as the sum of the individual
probabilitiesofthecontributingevents.Thisconceptprovideduswiththefollowingequation:
numbers the following table shows the correlation with the number of flights and the
correspondingprobabilityofanaccidentoccurring.
Table2.4:Flightstatistics.
2.3 Summary
As the above table highlights, the likelihood of an accident increases as the number of flights
increases, resulting in a higher probabilityof anaccidentandseriousinjuryoccurring. TheFAA
and air traffic controllers are making every necessary attempt toimprovehowaccidentscanbe
avoided,includingtestingnewdynamicspeedcontrolsystem.
The new dynamic speed control system will give pilots morecontrolandlimittheresponsetime
requiredtoexecuteagoaroundandreattemptthelandingprocedureifaviolationoccurs. What
this means for the pilots and air trafficcontrollersisthatthattheynowhave moreroomforerror
in terms of preventing a simultaneous occupation. However, this new technology does have
some negatives associated with it. Even though thepilotnowhasmore control overhisspeed,
the probability that a go around cannot be initiated increases if reductions to the safe inflight
separationdistancearemade.Ananalysisofthesetradeoffscanbeseeninthetablebelow.
Table2.5:Newtechnologyanalysis.
This analysis highlights that although there may be a perceived benefit for the new system,
altering the safe inflight separation distance negates any potential benefits and will actually
16/45
increase the probability of an accident slightly. This new technology hopes to accomplish two
major objectives increased safety and allow more aircraft to move through the airport.
Unfortunately, you cannot have one without making concessions in aspects of the other. It is
our recommendation that thenewtechnologybeconsidered,butthattherecommendedinflight
separationdistanceremainunchanged.
3. Cargo Operations
3.1 Optimization Model
3.1.1 Background
An express package carrier transports cargos between three airports (A, B and C). The
interairport transportation cost and demand are fixed over aweeklycycle.Thecarrierwillincur
a fixed amount of cost per weight to reposition itself, regardless of the amount of cargo it
carries, as long as itsmaximumcapacityisnotexceeded.Therepositioningcostissummarized
infigure3.1.
At the beginning of each day, the airport management can decide how many carriers fly from
origin i to destination j, as well as how muchcargothe carriershavewiththemintheflight.The
amount of cargo on board must not exceed thecarryingcapacity,whichislimitedbyhowmany
carriersstayatsourceionthedaybefore.
Figure3.1:Fixedcostforinterairporttransportationofthecarrier.The
costisperkiloton(1,000tons),measuredcarryingcapacity.
17/45
Thetransportationcostfromoriginitodestinationj.
Theholdingcostforcargosthatarenotmovedonthesamedayofarrival.
Thepenaltycosttorepositioncarriersattheendofeachweek.
Theoptimizationobjectiveistominimizethetotalcostbythethreeparts.
vijt isthetransportationofemptycarrierondaytfromairportitoairportj.
xijt is the cargo at the end of day t from airport i to airport j. In this case, 0 t 5.
Everyday,newcargo bijt arrivesatairportibeforetheshipment.
yit isthecarriercapacityattheendofdaytatairporti.
cij isthecosttotransportcarriersfromairportitoairportj.
d isholdingcost.
Theobjectiveasdescribedaboveis1
5
t=1 i,j
ij
A more involved discussion is needed to write out the constraints, but we sketch out the
motivation and results, while leaving the derivation details in the Appendix for review. The
followingconstraintsareconsidered:
On each day, the total cargo carried from airport i to airport j must not exceed the total
cargo:
uijt xt1
+ bijt
ij
On each day, the total carrier leaving airport i must not exceed the total carriers
available:
Theterminalcostisimplicitlyincludedusingconstraints.
19/45
i
j
Thestatevariableschangeaccordingtothetransportation:
t+1
xt+1
= xijt + bt+1
ij uij
ij
yt+1
= yit (ut+1
+ vt+1
) + (ut+1
+ ut+1
)
i
ij
ij
ji
ji
Thetotalcapacityofcarriersinthesystemis120kilotons:
yk0 = 120
k
Tocompletetheweeklycycle,thefollowingperiodicconditionisenforced:
xij0 = xij5 = 0
y0i = y5i
By recognizing that the state variables can be condensedintoanexpressionthatisdetermined
by their initial conditions ( xij0 and y0i ),
we can simplify the constraints and write the system as
linearprogrammingproblem:
t
t
t
min ( cij(uij + vij) d uij )
ij =1
t=1 i,j
5
Subjectto
=1
=1
uij bij
t1
=1 j
=1
=1
uij = bij
=1 j
Despitethecomplexform,thisisinmatrixform:
min cT x
Subjectto
20/45
Ax b
x 0
3.2 Simulation
3.2.1 Optimization
Given this model discussed in section 3.1.4, we can use the data given by figure 3.1andtable
3.2tocomputetheoptimalweeklycycle.
Table3.2:Amountofcargos(inkilotons)betweeneach
origindestinationpaironeachdayoftheweek.
The results will tell us how to best manage the transportation on each day in a weeklycycle.It
shouldalsogiveustheglobalminimumofthetotalcost.
3.2.2 Solver
In the actual implementation of solver, the periodic condition is relaxed toguaranteeasolution.
5
=1 j
21/45
Figure3.3:AscreenshotoftheExcelsolverforouroptimizationmodel.
Thecontrolvariablesarehighlightedontheleft.Thetotalcostconsistsof
holdingcost,transportationcostandthepenalty.TheExcelsolveris
assignedtominimizethetotalcostunderconstraints,usingGRG
Nonlinearsolver.
3.3 Analysis
3.3.1 Results
There is no feasible solution from our solver. In this case, the solver is limited by the total
number of carriers available andcannotgetaglobalminimum.This,however,doesnotindicate
that a better weekly schedule does not exist. The solver gives us a schedule that costs
3528.5=0+3254.2+274.3(hold,transport,penalty)tooperatecontinuously.
Theschedulefulfillssomeoftherequirementswewantfromthesystem:
22/45
All the cargos are transported at latest on Friday. In this case, no cargo is stored. This
makes sense because holding is more expensive than transporting anywhere. If the
systemhasanycarriers,itwillsendthecargoonthesameday.
Figure3.4:TwopeaksshowuponThursdayandFriday.Thesystemis
incapableofhandlingthetwodemandsintime.
23/45
Toseeitmoreclearly,weincreasedthecapacityto140andthesystemachievesitsminimum
costat3480.0=0+3276.6+203.4.Thisvalueremainsaconstantaswefurtherincreasethe
capacity.And140isroughlytheminimumrequirementforthesystemtocompletetheweekly
cycle.
Sinceweknowtheproblemexistsbecauseoftheunevendistributionofcargogoingtoairport
B,wecantrytorelaxthesituationbyhavingthecargosstayingovertheweekend.Wepayfor
threedaystorageinexchangeforamoreevendistributionofthecargotransportationdemand.
Wekept10cargosfromairportAtoBand10cargosfromairportCtoB.Theminimumcostis
4080=600+3395.3+84.7.Notethatthiscostis3480+600,anditisonly600(holdingcost)more
thantheminimumcostwhenthereareenoughcarriers.
Figure3.5:Optimizationsolverresultsfromhavingcargosstayingatthe
airportovertheweekend.Thestrategyallowsustohaveamoreevenly
distributedcargotransportdemandandthereforehavinganoptimal
weeklycycleatlowcarriercapacity.Wereferourreadertotheattached
excelfileforfurtherinspectionoftheaboveresults.
24/45
25/45
Lastly, we recommend the management charge the cargo deliver based on origindestination
pair instead of on distance alone. The goal is to create a price differential that can motivate
consumptionandmitigatethespatialimbalancewediscussedin3.3.2.
4. Conclusion
We conclude that the air traffic control and cargo operation management are two of the most
important and complex challenges faced by the aircraft industry. There are multiple issues in
terms of queue clogging, delay in landing higher number of planes in recircles and in the
system,limitstocarriercapacity.
Increased flights delay and compromise on safety standards result in loss in customersforany
airline because of customerdissatisfactionand discontentment.Thus,itis necessaryforairlines
to make an effort, invest in research and development to come up with plausible solutions,
make the variableslessstringentwhereveritispossible,andatthesametimeensurefullsafety
especiallysothattheydontlosecustomers.
It is also profitable for the industry to reduce cost wherever it can. Cost reduction in cargo
operations is possible if it is managed effectively.Thus,timeshouldbespentondevisingbetter
management of cargooperationsandincreasingcargocapacitiessothatoperationsdonotface
anyproblemsandcostisalsominimized.
26/45
Appendix A
27/45
28/45
Appendix B
29/45
Appendix C
NOTE: This is fully commentedMatlabcodeoftheDES.TheactualMatlab
filewillbesubmitteddigitally.
function[Outputs]=PlaneQueue()
%%RunsaDiscreteEventSimulationforPart1ofProject
%Initializeourtracking(state)variables.Becausewestartatsomevery
%earlytimewheretheairportisempty,allofthesetrackingvariables
%willbezero.NOTEIcouldrunforashortamountoftimewithout
%trackingstatsvariables,thenstartaftersometime.Liketheinitial
%transientproblem.
B=0N=0S=0F=0RCCount=0
%Storetheinitialcontactandtimetoqueuestats
ICMu=180ICSD=60
QMu=600QSD=150
%Storethetimefromenteringqueuetothresholdpointinmatrices.Itis
%thesameformatasTable1intheprojectdocumentation.
%WillfindvalueofmufromThreshMU(PlaneType2,PlaneType1)becausethe
%leadplane(1)determinesthecolumnofthematrix,thefollowingplane(2)
%determinestherowofthematrix.
ThreshMu=[64,64,64108,86,64130,130,64]
ThreshSD=[30,30,3040,40,3050,50,30]
%%Case3ReducedQueueSeparationCommentoutfororiginalrecipe
%ThreshMu=ThreshMu.*.9ThreshSD=ThreshSD.*.9
30/45
%Thiswillbeusedtofindplanetypeusedasacdf.SoifU[0,1]less
%than.33,heavy.Iflessthan.79butbiggerthan.33,large.Else,small.
ThreshP=[.33,.79,1]
%Storethetimefromthresholdpointtolandingongroundandtimefrom
%thresholdpointtoinitialcontactpoint(recircletime)
LandMu=120LandSD=30
%%Case1ReducedLandingTimes.Commentoutfororiginalrecipe
%LandMu=LandMu*.9LandSD=LandSD*.9
CircleMu=750CircleSD=150
%%Case2ReducedRecircleTimes.Commentoutfororiginalrecipe
%CircleMu=CircleMu*.9CircleSD=CircleSD*.9
%Initializetheoutputvectorofourdiscretetimessteppedto
TimeOut=0
%Nowwecreateaninterarrivaltimeforaninitialcontactevent,which
%willbethefirsteventcalledsincetheairportisemptyattime0
%Rememberthatweonlyacceptinitialcontactinterarrivaltimesofgreater
%thanzero.Thiscodedoesthat.
ICtime=0
whileICtime<=0
ICtime=normrnd(ICMu,ICSD)
end
%Nowwegenerateaplanetypeusingourfunctionwaybelowhere.This
31/45
%planetypeisthenincludedinourinitialcontacteventlist.Thethird
%valueineachinitialcontacteventinthelistisabinary0or1.A0
%meansthatthisisanewplanetothesystem,anda1meansthatthisisa
%recircledplane.ThesearetreateddifferentlyintheICeventbelow.
[Type]=PlaneType(ThreshP)
IC(:,1)=[ICtime,Type,0]'
%Initializeallstatisticsandstatevariableshereaszerothisincludes
%theQueue,Threshold,Landedeventlists,thecurrenttime,thequeue
%variableusedtotrackplanetypes,thenumberinandoutofthesystem,
%andthetotaltimeLZblockedandfullqueue,theintegralofnumberin
%systemovertime,andintegralofnumberinqueueovertime
%Inaddition,theendingtimeissetup(E)
Q=[]T=[]L=[]E=86400*2t=0
Queue=[]NumOut=0NumIn=0
IntB=0IntS=0IntQ=0IntF=0
%%%Nowwebeginthesimulation.Herewego.Werunthesimulationuntilthe
%%%currenttimehassurpassedthetotalruntime
whilet<E
%Herewefindtheshortesteventineachofthefoureventlists.The
%functioncalledreturnstheshortesttimevalueandtheindexofthat
%valuewithinthegiveneventlist.Ifthereisnoeventinthelist
%thenwereturnsomenonsensevaluelargerthanEsothatnoeventfrom
%thatlistwillbeused
[Qs,Qi]=Shortest(Q,E)
[Ts,Ti]=Shortest(T,E)
[Ls,Li]=Shortest(L,E)
32/45
[ICs,ICi]=Shortest(IC,E)
%Thiswilltelluswhicheventissoonestanindexreturnedof1is
%anICevent,index2isQueueevent,3isThreshholdevent,4is
%Landedevent.Basically,thepreviousfoureventsfoundthesoonest
%eventineachindividualeventlist,andthiscallofthefunction
%findsthesoonesteventtotalthesoonestofthesoonest.
[Newt,NewEv]=Shortest([ICs,Qs,Ts,Ls],E)
%HerewemakesurethatifalleventsoccurafterE,noeventissimulated.
ifNewt>E
NewEv=0
Newt=E
end
%calculationsofstatisticsvariables.ItfollowsthenormalDESmethod
%ofaddingthetimestepmultipliedbythegivenstatisticvariable
IntB=IntB+((Newtt)*B)
IntQ=IntQ+((Newtt)*N)
IntS=IntS+((Newtt)*S)
IntF=IntF+((Newtt)*F)
%Nowweupdatethecurrenttimevariabletothecurrenteventtime.
t=Newt
%ThisistheInitialContactEvent
ifNewEv==1
%Thischeckswhetherornottheplaneisnewinthesystemanew
%ICeventhasitsthirdindexas0,arecircleplanehasitsthird
%indexof1.
ifIC(3,ICi)==0
33/45
%Anewplaneincreasesthenumberofplanesinthesystemand
%numberofplanesintothesystembyone
S=S+1
NumIn=NumIn+1
%GeneratenewInitialContactEvent.Sameprocedureasthe
%firstICeventgeneratedabovetofindinterarrivaltimeand
%planetype
ICtime=0
whileICtime<=0
ICtime=normrnd(ICMu,ICSD)
end
[Type]=PlaneType(ThreshP)
%NowweaddthenewICeventtotheICeventlist.Forsome
%reasonthecodescrewsupeverysooftenwithoutthisif
%statement.Thus,wesaythatiftheICeventlistisempty,we
%createitbrandnewratherthanappendingthecurrentlistto
%it.
iflength(IC)>0
IC=[IC,[(Newt+ICtime)Type0]]
else
IC=[Newt+ICtimeType0]
end
end
%GeneratenewQueueingeventthisoccursinboththenewplane
%andrecircledplanecase
34/45
Qtime=0
whileQtime<=0
Qtime=normrnd(QMu,QSD)
end
%Samemethodasbefore,eithercreatethequeueeventlistor
%appendtheneweventtothepreviouslyestablishedeventlist.
iflength(Q)>0
Q=[Q,[(Newt+Qtime)IC(2,ICi)]]
else
Q=[(Newt+Qtime)IC(2,ICi)]
end
%NowwecleartheICeventthatwejustranthrough.This
%eliminatedthateventandmovesallothersuptheeventlist.
IC(:,ICi)=[]
end
%NowcomestheQueueingEvent
ifNewEv==2
%Thenumberinthesystemincreasesbyone,andthequeuevariable
%updates.Thequeuevariablecontainsthetimeofeachqueueevent
%andthetypeofeachplane.Thiswillbeusedtofindthe
%separationtimesforeachplaneinthequeue.
N=N+1
Queue(:,N)=Q(:,Qi)
%Ifthenumberofplanesinthequeueisone,thenthetimetothe
%endofthequeueis40seconds.Weusethattimesteptosetup
%thethresholdeventforthisplane.
35/45
ifN==1
iflength(T)>0
T=[T,[(t+40)Q(2,Qi)]]
else
T=[(t+40)Q(2,Qi)]
end
else
%Thisisthehardpart.Weneedtocomparetwotypesofplanes
%clashinginthequeuetoseewhattheseparationdistancefor
%thresholdeventis.
%Wesavethetypeofeachplaneinthequeuetobecompared
%here.Type1isfortheleader,Type2isthefollower
Type1=Queue(2,N1)Type2=Queue(2,N)
%WegetthemuandsigmafromTable1intheproject
%documentationusingtheplanetypessavedabove
SepMu=ThreshMu(Type2,Type1)
SepSD=ThreshSD(Type2,Type1)
%Thetimestatswefoundaretheseparationdistancesoon
%averagethefollowershouldarriveatthethresholdatagiven
%mufromthetimetheleaderarrivedatthethreshold.Thus,we
%savetheleadersarrivaltimehere.
LeadArriveTime=T(1,N1)
%ThisgivesusaseparationtimebasedonTable1.
Sept=0
whileSept<=0
36/45
Sept=normrnd(SepMu,SepSD)
end
%Herewesetupthenewthresholdeventfortheplanethatjust
%arrivedinthequeue.
iflength(T)>0
T=[T,[(LeadArriveTime+Sept)Q(2,Qi)]]
else
T=[(LeadArriveTime+Sept)Q(2,Qi)]
end
end
%Ifthequeueis5planesorlonger,thenwetriggeratracking
%variable.Thisisusedtotracktheproportionoftimethatwe
%havealongqueue.
ifN>=5
F=1
end
%Becausetheeventhasbeencompleted,wedeleteitfromthe
%eventlist.
Q(:,Qi)=[]
end
%Nowcomesthethresholdevent
ifNewEv==3
%Thereisonelessplaneinthequeue(itwilleitherproceedto
%landingorrecircle)
N=N1
%WhentheLZiscurrentlyblocked,werecircletothebeginning
37/45
ifB==1
%Herewegenerateaninterarrivaltimeforarecircle.
RCtime=0
whileRCtime<=0
RCtime=normrnd(CircleMu,CircleSD)
end
%Wesetupaninitialcontacteventatthetimeofthe
%recircle,withathirdvalueof1.Thisindicatesthatitis
%notanewarrivaltothesystem,butarecircleplanewhichis
%treateddifferentlyintheICeventsectionofthecode.
iflength(IC)>0
IC=[IC,[Newt+RCtimeT(2,Ti)1]]
else
IC=[Newt+RCtimeT(2,Ti)1]
end
%Weaddonetothecounterofnumberofrecircles
RCCount=RCCount+1
%WhentheLZiscurrentlyopen,weproceedtoland
else
%Herewegeneratealandingtime,anduseittosetupalanded
%event.AtthattimeiswhentheLZisdeclaredclear.
Ltime=0
whileLtime<=0
Ltime=normrnd(LandMu,LandSD)
end
%Settinguplandedevent,sameasalways
38/45
iflength(L)>0
L=[L,[Newt+LtimeT(2,Ti)]]
else
L=[Newt+LtimeT(2,Ti)]
end
%NowtheLZisblocked,asaplaneislanding...soblocked
%trackingvariableissettoone.
B=1
end
%Eitherway,theplanehasleftthequeue,sowedeleteitfromthe
%queuevariable.
Queue(:,1)=[]
%werecheckifthequeueislongandupdatethetrackingvariable
%ifthathaschanged.
ifN<5
F=0
end
%Theeventiscomplete,soweeliminatethiseventfromtheevent
%list.
T(:,Ti)=[]
end
%Finally,theLandedEvent
ifNewEv==4
%Thereisonelessplaneinthesystemnow,sodecreasethat
%variable.
S=S1
39/45
%TheLZisnolongerblocked,sochangethetrackingvariable.
B=0
%Aplanehasleftthesystem,sothenumberofplanesthroughthe
%systemincreasesbyone.
NumOut=NumOut+1
%Thiseventiscomplete,deleteitfromtheeventlist.
L(:,Li)=[]
end
%Weupdatethetimeoutput,whichjusttellsusallofthetimesthat
%theDESsteppedto.Wasusedfortestingandtroubleshooting.
TimeOut=[TimeOut,t]
end
%%Doallendingcalculationshere,simulationisover
%Thisistheaveragelengthofthequeue
AvgQueue=IntQ/E
%Thisistheaveragenumberofplanesinthesystem
AvgSystem=IntS/E
%Thisistheproportionoftimethatthequeuehas5ormoreplanesinit
PercentMoreFive=IntF/E
%ThisisthepercentoftimethattheLZisblocked
PercentBlocked=IntB/E
%Thisistheaveragetimespentinthequeuebyasingleplane
TimeInQ=IntQ/NumIn
%Thisistheaveragetimespentinthesystembyasingleplane
TimeInS=IntS/NumIn
40/45
%Thisistheaveragenumberofrecirclesperplane
RCAvg=RCCount/NumIn
%Thisisthetotalnumberofplanesthroughthesystem
NumOut
%Thisisthetotalnumberofplanesintothesystem
NumIn
%Nowwecompilealloutputsintoasinglevectorforeasierdatahandling
%inotherprograms.
Outputs=[AvgQueue,AvgSystem,PercentMoreFive,PercentBlocked,TimeInQ,TimeInS,RCAvg,N
umOut,NumIn]
end
function[t]=PlaneType(p)
%%Thisfunctiontakesintheprobabilitylistofaplanebeingagiventype
%%(heavy,large,small)andgeneratesaplanetypefortheincomingplane.
%Thisgeneratesauniformrandomvariablefrom0to1.
type=rand
%Ifthatgeneratedrvislessthantheprobabilityofbeingtype1,this
%planeistype1.Else,ifitislessthantheprobabilityofbeingtype2,
%it'stype2.Else,itistypethree.
%NOTE:Rememberthatweuseacdfprobabilitylisthere,soifthe
%percentagesaresay303040,thenanrvbetween.3and.6istype2and
%between.6and1istype3.
iftype<p(1)
t=1
41/45
elseiftype<p(2)
t=2
else
t=3
end
end
function[S2,Ind]=Shortest(I,E)
%%Thisfunctionfindstheshortesttimeandindexofthattimeofoneof
%%oureventlists.Isthelengthofthatevenlistis0,thenweoutputan
%%eventtimeoffartherthantheendofoursimulationsonoeventfrom
%%thislistcanbechosen.
iflength(I)>0
[S2,Ind]=min(I(1,:))
else
%Somenonsenselargenumbersoitwillneverbethesoonestevent,
%becauseaneventdoesn'texisthere
S2=E+100
Ind=0
end
end
42/45
Appendix D
NOTE: This is fully commented Matlab code used to generateConfidence
IntervalswithDESinputs.TheactualMatlabfilewillbesubmitteddigitally.
function[CILow,CIHigh]=QueueReps()
%%ThisfunctionrunsNrepetitionswithZscoreZinordertocreate
%%ConfidenceIntervalsofalloftheimportantDESstatistics.Allformulas
%%usedarethesameasalwaysinthiscourse.
N=75
Z=2.325
AvgQ=zeros(1,N)AvgS=zeros(1,N)PM5=zeros(1,N)
PBL=zeros(1,N)TimeNQ=zeros(1,N)TimeNS=zeros(1,N)
RCAvg=zeros(1,N)NumOut=zeros(1,N)NumIn=zeros(1,N)
fori=1:N
[Out]=PlaneQueue()
AvgQ(i)=Out(1)AvgS(i)=Out(2)PM5(i)=Out(3)
PBL(i)=Out(4)TimeNQ(i)=Out(5)TimeNS(i)=Out(6)
RCAvg(i)=Out(7)NumOut(i)=Out(8)NumIn(i)=Out(9)
end
Mu=mean([AvgQ',AvgS',PM5',PBL',TimeNQ',TimeNS',RCAvg',NumOut',NumIn'])
SD=std([AvgQ',AvgS',PM5',PBL',TimeNQ',TimeNS',RCAvg',NumOut',NumIn'])
CILow=Mu(Z.*((SD)./(N^.5)))
CIHigh=Mu+(Z.*((SD)./(N^.5)))
end
43/45
Appendix E
44/45