02 - Fundamentals fo Queuing Theory - OMT

02 - Fundamentals fo Queuing Theory - OMT

Queues appear when a flow of vehicles, persons or objects wants to receive a service that implies a restriction. Typically, services have a limited capacity or are offered only with some frequency, which may lead to queues, delays and waits.

The subject that studies queues is referred to Queuing Theory (see also [[03. Variabili Aleatorie#Teoria delle code]], [[05. Teoria del Deflusso#Teoria delle code]]).

Most of the complexities of queuing theory come from the stochastic nature of the processes involved.

Components of a queuing system

Server: the restriction
Storage: where the costumer waits
Arrivals: the ones that feed the queue
Departures: the yield after service

Queuing system diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 12.01.37.excalidraw.png
%%🖋 Edit in Excalidraw%%

Server

server

In a queuing system, the server represents the restriction of the system. The server is able to provide the service at a certain rate, μ.

Server symbol - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 12.17.04.excalidraw.png

Server disposition

In any system, there can be more than 1 server. The n servers, can be

Servers in parallel

When the servers are localised in parallel, they can work at the same time. These are differentiated based on how the queue works:

One problem that might arise with parallel service, is that the servers are not positioned in space in an efficient way. It may happen that the queue of one server blocks some other server. This could happen, for example, at a petrol station where two pumps are one after the other and there is not enough space for cars to overtake each other.

Schermata 2024-10-26 alle 12.33.58.png

Decentralised system

In a decentralised system, each server has its own queue.

Decentralized queues diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 12.20.34.excalidraw.png
%%🖋 Edit in Excalidraw%%

Centralised queue

In a centralized queue, there are multiple servers but only 1 queue.

Centralized queue diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 12.22.01.excalidraw.png
%%🖋 Edit in Excalidraw%%

The centralised queue, if well managed, can maximize the capacity and efficiency of the system. In fact, in this case, no server will ever be idle, while there are other servers working.

It also guarantees the [[#First Come First Serves - FCFS]] functioning.

In these kind of systems, it is important to implement adequate information system that assigns customers to servers at due time. This needs to ensure that there is no idle server at any time.

This can be challenging, especially when it takes a long time for the costumer to get to the server from the end of the queue (think of container ships waiting outside a port).

Servers in series
Tandem queues

Tandem Queues diagram02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 12.27.24.excalidraw.png
%%🖋 Edit in Excalidraw%%

In this kind of systems costumers need to undertake several steps to receive a complete service.

For example, in an airport, a passenger has first to check-in, thank go through security, and finally queue to board the plane. Seen as a whole, this is a tandem queue.

In this scenario, the departure from the previous server, is the arrival of the subsequent one.

A better explanation of this kind of systems is provided in the section [[#Tandem queueing system]]

Storage

Arrivals

Departures

Queuing disciplines

Queuing discipline is a non-physical component of a queuing system. It refers to the rules which determine in which order the costumers are served.

The most common ones are:

Sometimes, there can be priorities assigned to some kind of costumers, leading to a new type of discipline:

First Come First Serves - FCFS

This is the most common discipline when dealing with human costumers.

first come first serves (fcfs)

In FCFS discipline, service is provided in the same order of arrivals.

This doesn't mean that the first costumer to enter will also be the first one to exit as, with [[#Servers in parallel]], some server may be faster than another allowing for overtakes in the system.

Last Come First Serves - LCFS

last come first serves (lcfs)

In LCLS discipline, costumers are served in the reversed order of arrival.

This happens when the [[#Storage]] is in a closed space and the entrance and exit are the same "door".

For example an airport shuttle bus will unload first the passengers that boarded the bus at last and viceversa.

Service in Random Order - SIRO

service in random order (siro)

In SIRO discipline there is no preset order and the costumer is selected randomly from the queue.

This system is mostly applied to industrial processes where the costumer are different items in a production line.

Round Robin - RR

round robin - rr

In RR discipline, each costumer is assigned the same amount of service time. If the service is not completed in said time, the costumer returns back into the queue.

This discipline applies in the communication networks.

Early Due Date First - EDDF

Shortest Service Time First - SSTF

Cumulative plot

cumulative plot

A cumulative plot - (N,t) diagram - plots the cumulative number of customers N, to cross a specific location as a function of time t.

Cumulative plot generic - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 15.09.12.excalidraw.png

Properties of the cumulative plot:

The flow of vehicles or passengers q can be calculated starting from the cumulative plot as:

q(T)=N(tj)N(ti)tjti

where

The plot can be obtained in 2 ways:

When a large number of customer is recorded, the jumps of the N(t) function become meaningfulness. So, the function is usually replaced by a continuous interpolation.

Cumulative plot interpolation - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 15.24.01.excalidraw.png
%%🖋 Edit in Excalidraw%%

In this situation, we can calculate the instantaneous flow q(t) as:

q(t)=Nt

Input-output diagram

An input-output diagram is the overlay of 2 [[#Cumulative plot]]:

Input-Output Diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 16.04.28.excalidraw.png
%%🖋 Edit in Excalidraw%%

The diagram above is an input-output diagram.

Notice that the horizontal distance between the 2 curves at a given number of cumulative costumers, n1, is the time spent by that costumer in the system. This time includes:

Instead, the vertical distance between the 2 curves at a given instant t1, is the customer accumulation in the system. This includes:

observation

The D(t) curve can never go above the A(t) curve since, in order to exit, a customer has to have enter first.

It the 2 curves match, it means that the system is empty of customers.

In the diagram above, other than the input-output diagram, the amount of customers in service and in queue at any given time is also shown:

input-output plus service plus queue diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 16.30.06.excalidraw.png
%%🖋 Edit in Excalidraw%%

A logistic curve

We will now consider an [[#Input-output diagram]] with a large number of customers, so that the curves can be seen as continuous functions.

Input-output diagram - continuous - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 17.05.26.excalidraw.png
%%🖋 Edit in Excalidraw%%

In the input-output diagram, the Arrival curve A(t) usually takes the shape of a logistic curve.

The arrival rate is always relatively small at the two extremes while it picks in the middle (the arrival rate, λ, is given by the slope of the arrival curve). This is because, as humans, we tend to want the same service at about the same time. This pick rate is theoretically unbounded.

The departure curve instead, has a fixed maximum rate, μ, equal to the Capacity of the system. So, this slope is always bounded.

From a normal [[#Input-output diagram]] we can easily read the sum of the service time and delay, and the total accumulation (number of customer being served + customers queuing).

It is useful to be able to read directly the delay and the excess accumulation. This can be done through the [[#Virtual Arrivals Curve]]

3D representation of input-output diagram

If we want to visualize both vehicles trajectories and input-output diagram on the same chart, we can do so in a 3D diagram:

Schermata 2024-10-26 alle 16.57.30.png

The projection of this diagram on the (x,t) plane gives the trajectories, while the projection onto the (N,t) plane gives the input-output diagram.

We can also look at the two projection one under the other to visualize everything on a single plane:

Schermata 2024-10-26 alle 16.59.03.png

Virtual Arrivals Curve

virtual arrivals curve (v(t))

The Virtual Arrivals Curve is a curve obtained by moving the arrival curve (A(t)) forward in time of an amount equal to the free flow travel time.

It can also be defined as the [[#Departures]] curve that would be measured in the absence of delay.

Virtual Arrivals curve - 02 - Fundamentals fo Queuing Theory - OMT 2024-10-26 17.14.37.excalidraw.png

What we obtain:

Excess accumulation

excess accumulation ($q$)

Excess accumulation is the number of extra costumer that we have in the system due to the fact that there is a queue forming.

The Excess accumulation can be obtained as the vertical distance in the Nt diagram between the [[#Virtual Arrivals Curve]] and the [[#Departures]] curve.

Excess accumulation N-t diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-11-03 18.14.50.excalidraw.png
%%🖋 Edit in Excalidraw%%

Average excess accumulation

Average excess accumulation on N-t diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-11-03 18.19.33.excalidraw.png
%%🖋 Edit in Excalidraw%%

We define the area

W1[customerstime]

as the total aggregated delay in the period ti,tj

average excess accumulation ($\overline{q}$)

We can calculate Average excess accumulation (Q) in the period ti,tj:
Q=W1tjti

Take some time to think on the meaning of the average excess accumulation:

The average excess accumulation Q is always less or equal to the number of costumers that we see in the physical queue. Watch the example below to better understand this concept.

The diagram shows a stretch of road in 2 scenarios:

  1. No queue: cars move freely at the same speed
    • We count 2 veh in the area of interest (the one in the orange dashed box)
  2. Queue: Some cars are queueing in the area of interest
    • We count 5 cars

02 - Fundamentals fo Queuing Theory - OMT 2024-11-03 18.27.37.excalidraw.png

Notice that, of the 5 cars in the boxed area, even without queue, there would be 2. Meaning, the excess accumulation is NOT 5, but just 3.

Delay

delay ($w$)

The Delay (w) is the extra time a costumer has to spend in the system due to queuing.

Delay can be obtained as the horizontal distance in the Nt diagram between the [[#Virtual Arrivals Curve]] and the [[#Departures]] curve.

02 - Fundamentals fo Queuing Theory - OMT 2024-11-03 18.17.21.excalidraw.png
%%🖋 Edit in Excalidraw%%

Average delay per costumer

Average delay per costumer on N-t diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-11-03 18.23.15.excalidraw.png
%%🖋 Edit in Excalidraw%%

We define the area:$$
W_{2} \quad \rm[costumers]

as the total delay collectively incurred by customers between $n_{i}$ and $n_{j}$. ```ad-Teo title: Average delay per costumer ($\overline{w}$) We calculate the **Average delay per costumer** ($\overline{w}$) in the group between $n_{i}$ and $n_{j}$: $ \overline{w} = \frac{W_{2}}{n_{j}-n_{i}} $ ``` ## Little's Formula ![Little's Formula diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-11-03 18.36.38.excalidraw.png](/img/user/Excalidraw-2/Little's%20Formula%20diagram%20-%2002%20-%20Fundamentals%20fo%20Queuing%20Theory%20-%20OMT%202024-11-03%2018.36.38.excalidraw.png) %%🖋 Edit in Excalidraw%% ```ad-Teo title: Little's Formula $ \overline{\lambda} = \frac{\overline{Q}}{\overline{w}} $ **Proof:** According to the definition, we can write for the #Average delay per costumer: $ \overline{w} = \frac{W}{n_{2}-n_{1}} \quad \Longrightarrow \quad W = \overline{w}(n_{2}-n_{1}) $ Meaning that: $ \overline{Q}(t_{2}-t_{1}) = \overline{w}(n_{2}-n_{1}) $ Therefore: $ \frac{\overline{Q}}{\overline{w}} = \frac{n_{2}-n_{1}}{t_{2}-t_{1}} $ where the ratio on the right-hand side is the ratio of arrival of costumer, $\lambda$. $ \frac{\overline{Q}}{\overline{w}} = \lambda $ *q.e.d.* ``` ## Typical scenario In a typical scenario we only have part of the data:

\begin{align}
\text{Knowns: }&
\begin{cases}
V(t): \text{Measured when there are few people} \
\mu : \text{Max service flow (it's a property of the facility)}
\end{cases} \ \

\text{Unknowns: }&
\begin{cases}
\overline{w}\
\overline{Q}
\end{cases} \quad \Longrightarrow\text{We need the }D(t)
\end

We will describe how we can construct the departure's curve. First, keep in mind these 2 properties: - $\dot{D}(t) = \mu \quad$ if there is queue - $\dot{D}(t) = \min(\dot{V}(t), \mu)\quad$ if there is NO queue Also, the following rules must be followed:

\begin{cases}
D(t) < V(t) \quad \forall t \
\dot{D}(t) < \mu \quad \forall t
\end

You can't use 'macro parameter character #' in math mode ![Constructing a departures curve on N-t diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-11-03 19.24.26.excalidraw.png](/img/user/Excalidraw-2/Constructing%20a%20departures%20curve%20on%20N-t%20diagram%20-%2002%20-%20Fundamentals%20fo%20Queuing%20Theory%20-%20OMT%202024-11-03%2019.24.26.excalidraw.png) %%🖋 Edit in Excalidraw%% Notice how the $D(t)$ curve follows exactly the $V(t)$ curve until the rate of arrival, $\dot{V}(t)$ is greater than the rate of service, $\mu$. From this instance, the $D(t)$ has a constant slope equal to $\mu$, until it meets back the $V(t)$, at which point it goes back to following it. ❗❗❗❗❗❗❗❗❗❗❗❗ ❗❗❗ COMPLETARE ❗❗❗ How to take average ❗❗❗❗❗❗❗❗❗❗❗❗ ## On-off queueing system ```ad-Definizione title: On-off queueing system **On-off queueing systems** are systems where the service rate has 2 values, depending on wether the system is on or off: $ \text{Service rate} = \begin{cases} \mu \quad \text{when on}\\ 0 \quad \text{when off} \end{cases} $ ``` A typical example of on-off queuing system is the **traffic light**. For simplicity, the following paragraph will assume the system is a traffic light with 2 states: <mark style="background: #BBFABBA6;">Geen</mark> and <mark style="background: #FF5582A6;">Red</mark>. The traffic light alternates between an on state, green, for a time $G$ and an off-state, red, for a time $R$. The green and red phases together make a *cycle*, lasting $C$. The system has a steady demand, $\lambda$, and a maximum constant on-state rate of service equal to $\mu$. A traffic signal defined as such, can work in 3 different conditions: - 🖋 Edit in Excalidraw%% We can get the total cumulated 🖋 Edit in Excalidraw%% Notice how the $D(t)$ curve follows exactly the $V(t)$ curve until the rate of arrival, $\dot{V}(t)$ is greater than the rate of service, $\mu$. From this instance, the $D(t)$ has a constant slope equal to $\mu$, until it meets back the $V(t)$, at which point it goes back to following it. ❗❗❗❗❗❗❗❗❗❗❗❗ ❗❗❗ COMPLETARE ❗❗❗ How to take average ❗❗❗❗❗❗❗❗❗❗❗❗ ## On-off queueing system ```ad-Definizione title: On-off queueing system **On-off queueing systems** are systems where the service rate has 2 values, depending on wether the system is on or off: $ \text{Service rate} = \begin{cases} \mu \quad \text{when on}\\ 0 \quad \text{when off} \end{cases} $ ``` A typical example of on-off queuing system is the **traffic light**. For simplicity, the following paragraph will assume the system is a traffic light with 2 states: <mark style="background: #BBFABBA6;">Geen</mark> and <mark style="background: #FF5582A6;">Red</mark>. The traffic light alternates between an on state, green, for a time $G$ and an off-state, red, for a time $R$. The green and red phases together make a *cycle*, lasting $C$. The system has a steady demand, $\lambda$, and a maximum constant on-state rate of service equal to $\mu$. A traffic signal defined as such, can work in 3 different conditions: - 🖋 Edit in Excalidraw%% We can get the total cumulated [[#Delay]] as the area in purple, $W$. Let $t^{*}$ be the time at which the queue completely dissipates, the total amount of customers that were in a queue and that were completely served in the time $t^{*}$ is equal to:

n = \begin{cases}
\lambda t^{} \
\mu (t^{
}-R)
\end

Thistellsusthat:

\lambda t^{} = \mu (t^{} -R)

therefore

\begin{align}
\lambda t^{} &= \mu (t^{} -R) \
\lambda t^{} &= \mu t^{} - \mu R \
(\lambda -\mu )t^{} &= -\mu R \
(\mu - \lambda )t^{
} &= \mu R \
t^{*} &= \frac{\mu R}{\mu -\lambda }
\end

Wecannowcalculate$n$:

n = \lambda t^{*} = \frac{\mu \lambda R}{\mu -\lambda }

Finally,thetotalcumulateddelayistheareaofthetriangleofbase$R$andheight$n$:

W = \frac{1}{2} Rn = \frac{1}{2} \frac{\mu \lambda R^{2}}{\mu -\lambda }

The [[#Average delay per costumer]] is the total delay dived by the total amount of customers served during 1 cycle, $n'$, where $n' = \lambda(R+G)$.

\overline{w} = \frac{W}{n'} = \frac{\frac{1}{2} \frac{\mu \lambda R^{2}}{\mu -\lambda }}{\lambda (R+G)} = \frac{1}{2} \frac{\mu R^{2}}{(\mu -\lambda)(R+G) }

adTeotitle:ConditionofundesaturationAtrafficlightisundersaturatedifallthecustomersarrivinginonecycleareservedinthesamecycleandstillthereremainssometimeforothercustomerstoarrive.Giventhatwecanwrite:$λ(R+G):$thetotalamountofcustomersthatcanarriveinonecycle$μG:$themaximumamountofcustomersthatcanbeservedinonecyclewewantthecondition:

\lambda (R+G) < \mu G

thatcanbewrittenas

\frac{\lambda}{\mu} < \frac{G}

You can't use 'macro parameter character #' in math modeIn the particular case that $\frac{\lambda}{\mu} = \frac{G}{R+G}$, we have an 🖋 Edit in Excalidraw%% Now the 🖋 Edit in Excalidraw%% Now the [[#Average delay per costumer]] can be obtained as:

\overline{w} = \frac{W}

### Overly Saturated system In **Overly saturated** systems, *NOT all* the costumers that arrive at the traffic light when it's red are served. Some will have to wait for the next cycle. In this scenario, the queue keeps growing. ![Overly saturated system - 02 - Fundamentals fo Queuing Theory - OMT 2024-11-17 16.09.14.excalidraw.png](/img/user/Universit%C3%A0/Magistrale/1%C2%B0%20Anno/Operation%20&%20Management%20of%20Transport%20Systems/Notes/Allegati/Overly%20saturated%20system%20-%2002%20-%20Fundamentals%20fo%20Queuing%20Theory%20-%20OMT%202024-11-17%2016.09.14.excalidraw.png) %%🖋 Edit in Excalidraw%% In this case it's not possible to define a unique servers before exiting the system. We call $n$ the number of servers. ``` For simplicity, we now consider a system of 3 servers: ![02 - Fundamentals fo Queuing Theory - OMT 2024-11-17 16.20.39.excalidraw.png](/img/user/Universit%C3%A0/Magistrale/1%C2%B0%20Anno/Operation%20&%20Management%20of%20Transport%20Systems/Notes/Allegati/02%20-%20Fundamentals%20fo%20Queuing%20Theory%20-%20OMT%202024-11-17%2016.20.39.excalidraw.png) %%🖋 Edit in Excalidraw%% In the specific case shown in the figure above, the arrival and departure rates are related as follows:

\lambda > \mu_{2} > \mu_

Let's get to a more realistic case, where the arrival curve is actually 🖋 Edit in Excalidraw%% Also in this case, the following condition is true:

\mu_{1} > \mu_{2} > \mu_

The purple area, is the total cumulated delay for service 3. That is, the delay of all passengers between service 2 and service 3. The total delay in the system would be the total area included between $\color{red} V(t)$ and $\color{orange} D(t)$. ```ad-note title: What's the best way to improve the system In general, it's to improve the service rate of the slowest server. In this case, $\mu_{3}$ is the smallest rate. The first course of action should be to improve this one. This can only be improved to the point $\mu_{3} = \mu_{2}$. After that, both need to be improved at the same time, otherwise the faster server doesn't actually allow for less queueing. ___ It is **NOT** recommended to design a system so that $\mu_{1}=\mu_{2} = \cdots = mu_{n}$. Designing like this would mean assuming there will not be queues. If, for whatever reason, one server happened to be slower than the others (or one is faster), the system wouldn't be able to accomodate these people. ``` ### Diverging systems A particular case of a servers. ## Stochastic queuing ❗❗❗❗❗❗❗❗❗❗❗❗ ❗❗❗ COMPLETARE ❗❗❗ ❗❗❗❗❗❗❗❗❗❗❗❗ ### Relaxation time ## Centralisation A queuing system with $n$ 🖋 Edit in Excalidraw%% ```ad-Teo title: Centralisation is better than decentralised A centralised system require less resources to offer the same level of service (or equivalently, with the same resources centralised systems provide better level of service). ___ *Proof* The resources ($R_{C}, R_{D}$) needed to serve the system at a given level of service will be proportional to the fluctuations experienced by the demand. We can characterize these fluctuations with the Standard Deviation of the arrival rates ($\sigma_{A}$). The 2 statement are therefore true: $ R_{C} \propto \sigma_{A}; \qquad R_{D} \propto \sum\limits_{i=1}^{n}\sigma_{a} = n \sigma_{a} $ We can relate the standard deviation of the single decentralized queues ($\sigma_{a}$) to that of the centralized one ($\sigma_{A}$). Remember that, by definition $ \sigma_{i} = \sqrt{\text{Var}{(i)}} $ Remember also that the Variance is a linear operator: $ \text{Var}(nA+B) = n\text{Var}(A) + \text{Var}(B) $ In our case: $ \text{Var}(A) = \text{Var}\left(\sum\limits_{i=1}^{n}a \right) = n \text{Var}(a) $ Applying the square root at both members of the equation: $ \begin{align} \sqrt{\text{Var}(A)} &= \sqrt{n \text{Var}(a)} \\ \sigma_{A} &= \sqrt{n}\sigma_{a} \end{align} $ Therefore, if the resources are proportional to the variances: $ R_{D} \propto n \sigma_{a} = n \frac{\sigma_{A}}{\sqrt{n}} = \sqrt{n}\sigma_{A} \propto \sqrt{n} R_{C} $ The conclusion is: $ R_{D} \propto \sqrt{n}R_{C} $ Given that $\sqrt{n} \ge 1$, this means that the resources for a decentralized system are always greater than those for a centralized one. *q.e.d.* ``` ## Optimisation In a transportation system, there are always at least the two following costs to keep in mind: - $Z_A:$ **Operator or Agency cost:** costs undergone by the operator of the transportation system (investments, operation, ...) - $Z_{u}:$ **User cost:** costs undergone by the users using the system (tickets, time, delays,...) The optimal level of service is obtained when the total cost is minimized. ![Optimization introduction diagram - 02 - Fundamentals fo Queuing Theory - OMT 2024-11-17 19.16.46.excalidraw.png](/img/user/Universit%C3%A0/Magistrale/1%C2%B0%20Anno/Operation%20&%20Management%20of%20Transport%20Systems/Notes/Allegati/Optimization%20introduction%20diagram%20-%2002%20-%20Fundamentals%20fo%20Queuing%20Theory%20-%20OMT%202024-11-17%2019.16.46.excalidraw.png) %%🖋 Edit in Excalidraw%% We have an optimisation problem, where the objective function is:

Z_{tot} = Z_{A} + Z_

Thedecisionvariableistherateofservice(measureofthelevelofservice),$μ$:

\min_\mu Z = \min_\mu (Z_{A}+ Z_{u})

Wecandothisanalyticallyimposingthefirstderivativeequalto0:

\frac{\partial Z}{\partial \mu} \stackrel{!}{=}0

You can't use 'macro parameter character #' in math modeand solving for $\mu$. ```ad-example Optimization example Imagine we have a bus service that we want to optimize. It means we want to define what is the best headway, $h$. The headway is the *decision variable*. To solve the problem, we need to define the agency and the user costs. **Agency costs:** - $\beta:$ Cost of operating 1 bus for 1 day (includes everything) - $\frac{C}{h}:$ Number of buses in use ($C=$ cycle time) The total agency cost is: $ Z_{A} = \frac{\beta C}{h} $ **User costs:** - $\overline{w}:$ headway, $h$. The headway is the *decision variable*. To solve the problem, we need to define the agency and the user costs. **Agency costs:** - $\beta:$ Cost of operating 1 bus for 1 day (includes everything) - $\frac{C}{h}:$ Number of buses in use ($C=$ cycle time) The total agency cost is: $ Z_{A} = \frac{\beta C}{h} $ **User costs:** - $\overline{w}:$ [[#Average delay per costumer]] - $\alpha:$ Value of time $\left[ \frac{\text{EURO}}{h} \right]$ ($\sim 15$ €/h in Barcelona) - $\lambda:$ Demand rate (daily demand) $ Z_{u} = \lambda \overline{w} \alpha = \lambda \frac{h}{2 }\alpha $ The graphs below show both the shape of the 2 cost function, and why the average delay is equal to $\frac{h}{2}$. ![02 - Fundamentals fo Queuing Theory - OMT 2024-11-17 19.29.05.excalidraw.png](/img/user/Universit%C3%A0/Magistrale/1%C2%B0%20Anno/Operation%20&%20Management%20of%20Transport%20Systems/Notes/Allegati/02%20-%20Fundamentals%20fo%20Queuing%20Theory%20-%20OMT%202024-11-17%2019.29.05.excalidraw.png) The objective function is therefore: $ \min_{h} \left( \beta C\frac{1}{h} + \frac{1}{2}\lambda\alpha h \right) $ We calculate the first derivative: $ \frac{\partial Z}{\partial h} = -\beta C \frac{1}{h^{2}} + \frac{1}{2} \lambda \alpha \stackrel{!}{=}0 $ from which we get: $ \begin{align} -\beta C \frac{1}{h^{2}} + \frac{1}{2} \lambda \alpha &\stackrel{!}{=}0 \\ \frac{1}{2} \lambda \alpha &= \beta C \frac{1}{h^{2}} \\ \frac{1}{2} \lambda \alpha h^{2} &= \beta C \\ h^{2} = \frac{\beta C}{\frac{1}{2}\lambda \alpha} \end{align} $ which ultimately becomes: $ h = \sqrt{\frac{2\beta C}{\lambda \alpha }} $ ``` ## Psychology ❗❗❗❗❗❗❗❗❗❗❗❗ ❗❗❗ COMPLETARE ❗❗❗ ❗❗❗❗❗❗❗❗❗❗❗❗