0% found this document useful (0 votes)
4 views

Steps to Create the Simulink Model

Uploaded by

Saqib ullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Steps to Create the Simulink Model

Uploaded by

Saqib ullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Steps to Create the Simulink Model

1. Define the System Parameters:

o Arrival Rate: Number of vehicles arriving at the station per


minute (based on the data you collect).

o Service Rate: Time taken to service each vehicle at the pump


(e.g., time in minutes).

o Queue Length: Maximum number of vehicles waiting in line.

o Number of Pumps: Total number of pumps available at each


station.

2. Create the Model Structure in Simulink:

o Source Block (Vehicle Arrival): Use a Poisson Distribution


or Random Number Generator to simulate vehicle arrivals.
This can be linked to an Integrator to accumulate the number of
vehicles arriving per minute.

o Queueing System: Implement a Queue block to model waiting


vehicles, where the vehicles wait until a pump is available.

o Service Station (Pump): Use a Server block (found in


Simulink’s SimEvents library) to represent each pump. Each
server will serve one vehicle at a time, based on service time
(i.e., time taken to refuel).

o Departure Block: Once a vehicle is serviced, it exits the


system, which is modeled using an Outport block.

3. Setup Parameters Based on Data:

o For each of the three stations (Al Rawdha, Wadi Al Sail, Awali),
adjust the arrival rate, service time, and pump configuration
(number of pumps) accordingly.

o Use MATLAB Function Blocks to calculate wait times, service


times, and departure times based on the provided data (e.g., use
data from the example table to define these parameters).

4. Simulation Logic:

o Set the time window for the simulation (e.g., 1.5 hours
corresponding to the 4:30 PM - 6:00 PM peak period).
o Use Event-Driven Simulation in Simulink to simulate vehicle
arrivals and departures at the pumps.

o Define the System Capacity (maximum number of vehicles in


the system) to avoid overcrowding.

o Adjust the number of pumps based on the station configuration


(for example, 4 pumps at Al Rawdha, 2 at Awali, etc.).

5. Output Parameters:

o Track the Queue Length, Service Time, and Waiting Time for
each vehicle in the system.

o Use Scope Blocks to visualize these outputs over time.

o You can also output Statistics like average waiting time, service
time, and queue length.

6. Scenarios for Testing:

o You can create different simulation scenarios for each station


based on different staffing levels and demand patterns.

o Simulate peak-hour traffic and adjust the staff (pumps)


dynamically to optimize performance.

7. Optimization:

o Test different strategies for optimizing vehicle flow, such as


increasing the number of pumps, changing the layout, or altering
staffing patterns.

o Use Optimization Toolbox in MATLAB to optimize the staffing


schedule and pump allocation dynamically.

Example Simulation Flow:

1. Vehicle Arrival:

o Use a Random Generator block or Poisson Distribution to


model the time between vehicle arrivals.

2. Queueing System:

o Use Queue blocks to model vehicle queues waiting for pumps.

3. Pump Service:
o Use Server blocks to simulate the servicing of vehicles at each
pump.

4. Departure:

o After the service is complete, vehicles leave the system.

5. Results:

o Visualize the queue length, waiting time, and service time using
Scope and To Workspace blocks.

Example of Blocks to Use:

 Random Number (for arrival rates)

 Queue (for vehicles waiting for service)

 Server (to represent each pump)

 Scope (for visualizing results)

 MATLAB Function (for custom calculations like wait times, service


times)

 SimEvents blocks (for discrete-event simulation, including arrival,


queuing, and departure)

Simulation Parameters for Each Station:

You can modify the number of pumps, average service times, and vehicle
arrival rates for each station based on the specific data you have:

Al Rawdha Petrol Station

 Pumps: 8 (4 columns × 2 pumps)

 Service Time: 4 minutes (based on your data)

 Arrival Rate: 10 vehicles per minute (adjust as per data)

Wadi Al Sail Petrol Station

 Pumps: 6 (2 columns × 3 pumps)

 Service Time: 4 minutes

 Arrival Rate: 12 vehicles per minute


Awali Petrol Station

 Pumps: 4 (2 columns × 2 pumps)

 Service Time: 5 minutes

 Arrival Rate: 8 vehicles per minute

Running the Simulation:

Once your model is set up, you can run the simulation for a specified time
window (e.g., 90 minutes from 4:30 PM to 6:00 PM) to test the effectiveness
of different configurations and staffing patterns.
Tables:

Al Rawdha Petrol Station

Waiting Time Service Departure


Vehicle # Arrival Time
(min) Time (min) Time

1 4:30 PM 2 5 4:37 PM

2 4:31 PM 1 4 4:36 PM
3 4:32 PM 3 4 4:39 PM
4 4:34 PM 4 5 4:43 PM
5 4:35 PM 2 4 4:41 PM
6 4:37 PM 5 5 4:47 PM
7 4:38 PM 3 4 4:45 PM
8 4:40 PM 4 5 4:49 PM
9 4:42 PM 3 4 4:49 PM
10 4:43 PM 5 4 4:52 PM
11 4:45 PM 2 5 4:52 PM

12 4:46 PM 4 4 4:54 PM
13 4:48 PM 3 4 4:55 PM
14 4:50 PM 5 5 5:00 PM
15 4:52 PM 4 4 5:00 PM
16 4:54 PM 3 5 5:02 PM
17 4:56 PM 4 4 5:04 PM
18 4:58 PM 2 4 5:04 PM
19 5:00 PM 3 5 5:08 PM
20 5:02 PM 4 4 5:10 PM
Wadi Al Sail Petrol Station

Waiting Time Service Departure


Vehicle # Arrival Time
(min) Time (min) Time
1 4:30 PM 3 4 4:37 PM
2 4:31 PM 2 5 4:38 PM
3 4:33 PM 4 3 4:40 PM
4 4:35 PM 5 4 4:44 PM
5 4:37 PM 2 5 4:44 PM
6 4:39 PM 4 3 4:46 PM
7 4:41 PM 3 4 4:48 PM
8 4:43 PM 5 5 4:53 PM
9 4:45 PM 4 4 4:53 PM
10 4:47 PM 3 3 4:53 PM
11 4:49 PM 4 5 4:58 PM
12 4:51 PM 5 4 5:00 PM
13 4:53 PM 3 3 4:59 PM
14 4:55 PM 4 5 5:04 PM
15 4:57 PM 5 4 5:06 PM
16 4:59 PM 3 4 5:06 PM
17 5:01 PM 2 3 5:06 PM
18 5:03 PM 4 5 5:12 PM
19 5:05 PM 3 4 5:12 PM
20 5:07 PM 5 5 5:17 PM

Awali Petrol Station


Waiting Time Service Departure
Vehicle # Arrival Time
(min) Time (min) Time
1 4:30 PM 4 5 4:39 PM
2 4:32 PM 3 4 4:39 PM
3 4:33 PM 2 3 4:38 PM
4 4:35 PM 5 4 4:44 PM
5 4:37 PM 3 5 4:45 PM
6 4:39 PM 4 4 4:47 PM
7 4:41 PM 5 5 4:51 PM
8 4:43 PM 3 4 4:50 PM
9 4:45 PM 4 3 4:52 PM
10 4:47 PM 5 4 4:56 PM
11 4:49 PM 4 5 4:58 PM
12 4:51 PM 3 3 4:57 PM
13 4:53 PM 5 4 5:02 PM
14 4:55 PM 4 5 5:04 PM
15 4:57 PM 3 4 5:04 PM
16 4:59 PM 2 5 5:06 PM
17 5:01 PM 5 4 5:10 PM
18 5:03 PM 3 5 5:11 PM
19 5:05 PM 4 4 5:13 PM
20 5:07 PM 5 5 5:17 PM

You might also like