System Modelling and Simulation

Before you change a real system, you can use a simplified representation to predict how it will behave. For example, a packaging team might predict how many parcels remain in a buffer when arrivals change. System modelling and simulation let you compare design choices while making the assumptions behind those predictions visible.

Define a model for a purpose

A system model is a simplified representation of a system's relevant components, relationships, and behaviour. Its purpose determines what you include. To predict a parcel backlog, you may need arrival counts and processing capacity, but not the colour of the conveyor.


Set a boundary around the part you are studying. Then identify the following:

  • Inputs: quantities supplied from outside, such as arriving parcels.
  • State variables: quantities describing the system's current condition, such as parcels waiting.
  • Parameters: values held fixed during a run, such as processing capacity.
  • Outputs: results used to answer the design question, such as the backlog after each minute.

A state variable can also be an output. These labels describe a quantity's role in a particular model; a capacity treated as fixed in one run can be varied between design scenarios.

Turn assumptions into update rules

Consider a buffer with no upper storage limit in the model. Divide time into intervals of length Δt\Delta t. Let NkN_k be the number of parcels waiting at the start of interval kk, AkA_k the parcels arriving in that interval, and CkC_k the maximum number that can be processed during it.


Use the timing convention that all interval arrivals are available before processing. Actual departures are limited by both the available parcels and the processing capacity:


Dk=min⁡(Nk+Ak, Ck),Nk+1=Nk+Ak−Dk.\begin{aligned} D_k &= \min(N_k+A_k,\ C_k),\\ N_{k+1} &= N_k+A_k-D_k. \end{aligned}


All four quantities are parcel counts. If processing capacity is given as a constant rate rr, calculate Ck=rΔtC_k=r\Delta t using matching time units. For example, 11 parcels/min11\ \text{parcels/min} over 1 min1\ \text{min} gives capacity for 1111 parcels.


With 55 parcels initially waiting and 88 arriving, that capacity leaves 5+8−11=25+8-11=2 parcels. When fewer parcels are available than the capacity, the unused capacity does not create a negative backlog.



Run and inspect a simulation

A simulation applies a model's rules to specified inputs to calculate its behaviour, often over successive time steps. You can run the same model in a spreadsheet, a program, or a hand-calculated table.


Four connected boxes show the progression from defining a system to checking simulation results.


Start from a stated initial condition. For each interval, enter the arrivals, calculate departures, and carry the new backlog into the next interval. Keep a table so that you can inspect intermediate states instead of seeing only the final result.


The time step controls when results are reported. A two-minute step can hide a backlog that appears after one minute and clears before the second minute ends. A smaller step provides more timing detail, but it still relies on the model's assumptions and input data.

Check before making a decision

Two checks address different questions.


Check

Main question

Parcel-buffer example

Verification

Are the stated rules implemented correctly?

Check that departures never exceed available parcels.

Validation

Does the model represent reality adequately for its intended use?

Compare predicted and measured backlogs at matching times.


Matching measurements in one run supports use under those tested conditions. It does not establish accuracy for every arrival pattern or a different processing rate. If you adjust a parameter using measurements, check the revised model against additional data where possible.



What to remember

  • Define the question, boundary, variables, and assumptions before calculating.
  • A simulation generates predictions by applying a model's rules.
  • Check intermediate results, timing, and units.
  • Verify the implementation and validate predictions for the intended decision.

Example: Testing a Packaging Buffer Model

A packaging buffer starts with 3 parcels waiting. Its processor handles at most 10 parcels during each one-minute interval. Assume all arrivals in an interval are available before processing, and departures cannot exceed available parcels. The model has no upper storage limit.


The team wants no more than 5 parcels waiting at the end of any minute during this three-minute run.


Interval

Arrivals

Measured backlog at interval end

First minute

9 parcels

2 parcels

Second minute

15 parcels

8 parcels

Third minute

6 parcels

4 parcels


For this problem, treat the supplied measurements as the comparison values without an additional measurement-uncertainty calculation.


a) Calculate the predicted backlog at the end of each minute using the original processing capacity.


In each interval, calculate available parcels, limit departures by capacity, and carry the ending backlog into the next interval. The update is:


Dk=min⁡(Nk+Ak,Ck),Nk+1=Nk+Ak−Dk.\begin{aligned} D_k&=\min(N_k+A_k,C_k),\\ N_{k+1}&=N_k+A_k-D_k. \end{aligned}


For the first minute:


Available=3+9=12 parcels,D0=min⁡(12,10)=10 parcels,N1=12−10=2 parcels.\begin{aligned} \text{Available}&=3+9=12\ \text{parcels},\\ D_0&=\min(12,10)=10\ \text{parcels},\\ N_1&=12-10=2\ \text{parcels}. \end{aligned}


For the second minute:


Available=2+15=17 parcels,D1=min⁡(17,10)=10 parcels,N2=17−10=7 parcels.\begin{aligned} \text{Available}&=2+15=17\ \text{parcels},\\ D_1&=\min(17,10)=10\ \text{parcels},\\ N_2&=17-10=7\ \text{parcels}. \end{aligned}


For the third minute:


Available=7+6=13 parcels,D2=min⁡(13,10)=10 parcels,N3=13−10=3 parcels.\begin{aligned} \text{Available}&=7+6=13\ \text{parcels},\\ D_2&=\min(13,10)=10\ \text{parcels},\\ N_3&=13-10=3\ \text{parcels}. \end{aligned}


The predicted backlogs are 2, 7, and 3 parcels. The largest minute-boundary backlog is ________, so the original design fails the stated requirement in this simulation.


b) Calculate the mean absolute error of the three predicted backlogs. Use the mean of the absolute differences between predictions and measurements, and report the result to two decimal places.


Compare each prediction with the measurement at the same time. Taking absolute values prevents positive and negative errors from cancelling.


MAE=∣2−2∣+∣7−8∣+∣3−4∣3=0+1+13=0.666… parcels≈0.67 parcels.\begin{aligned} \text{MAE}&=\frac{|2-2|+|7-8|+|3-4|}{3}\\ &=\frac{0+1+1}{3}\\ &=0.666\ldots\ \text{parcels}\\ &\approx0.67\ \text{parcels}. \end{aligned}


The mean absolute error is 0.67 parcels. A fractional average is valid even though each backlog is a whole-parcel count. This comparison provides validation evidence for the supplied run, but no acceptable error threshold has been specified, so the value alone does not establish adequacy for the design decision.


c) Repeat the simulation with capacity increased to 12 parcels per minute. Keep the initial backlog and arrivals unchanged. Does the revised design meet the requirement in this simulation?


Reset the starting backlog to 3 parcels for the new run. Each one-minute interval now has processing capacity for 12 parcels. Keep all other inputs and assumptions unchanged.


For the first minute:


Available=3+9=12 parcels,D0=min⁡(12,12)=12 parcels,N1=12−12=0 parcels.\begin{aligned} \text{Available}&=3+9=12\ \text{parcels},\\ D_0&=\min(12,12)=12\ \text{parcels},\\ N_1&=12-12=0\ \text{parcels}. \end{aligned}


For the second minute:


Available=0+15=15 parcels,D1=min⁡(15,12)=12 parcels,N2=15−12=3 parcels.\begin{aligned} \text{Available}&=0+15=15\ \text{parcels},\\ D_1&=\min(15,12)=12\ \text{parcels},\\ N_2&=15-12=3\ \text{parcels}. \end{aligned}


For the third minute:


Available=3+6=9 parcels,D2=min⁡(9,12)=9 parcels,N3=9−9=0 parcels.\begin{aligned} \text{Available}&=3+6=9\ \text{parcels},\\ D_2&=\min(9,12)=9\ \text{parcels},\\ N_3&=9-9=0\ \text{parcels}. \end{aligned}


The revised backlogs are 0, 3, and 0 parcels. Their maximum is ________, below the limit of 5, so the revised design meets the requirement for this simulated run. Measurements at the revised capacity would help check whether that prediction represents actual operation adequately.

A packaging-buffer model tracks the parcels waiting after each minute. The arrival count changes each minute, while the processing capacity remains fixed at 14 parcels per minute during a simulation run. Which classification describes these quantities?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

An engineer builds a simulation of a parcel sorter. Complete the descriptions using the terms calibration and validation, using each term once.


The engineer adjusts the model's average sorting time until its predictions closely match Monday's recorded results. This activity is .


The engineer then freezes the adjusted parameter and compares the model's predictions with Tuesday's previously unused measurements under the same operating conditions. This activity is .

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A parcel buffer initially contains 4 parcels. It can process at most 7 parcels during each one-minute interval. There are 10 arrivals in the first interval and 5 in the second. Assume each interval's arrivals are available before processing, and departures cannot exceed the number of available parcels.


How many parcels remain after the second interval? Give your answer in parcels, to one decimal place.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice