Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 8 pages
Summary

Summary Programming, Modeling, and Simulation for IEM

Document preview thumbnail
Preview 2 out of 8 pages

This document is a comprehensive exam summary for the Programming, Modelling and Simulation (PMS) course at the University of Groningen, compiled from past exam papers spanning 2022 to 2024. It is aimed at Industrial Engineering and Management students preparing for the on-site written exam and covers all major examinable topics in a clean, structured format. The summary opens with a reference table of contents before moving through eight thematic sections. The first covers flowchart conventions, including the correct building blocks as defined in the course textbook, common loop and decision patterns, and a fully worked matrix traversal example. The second section addresses MATLAB function writing, laying out the required coding conventions with a clear breakdown of what each element is worth in terms of marks, supported by two complete worked examples. The third section covers the simplified MRP algorithm, explaining the three core functions — netting, lot-for-lot, and backward scheduling — alongside a custom flowchart of the high-level script logic and a detailed note on the BOM explosion step that students most commonly lose marks on. Section four handles simulation and Euler integration, with the time step formula and a full car-on-slope implementation. Section five compares for and while loops side by side. Sections six and seven cover data handling and code validation respectively, including the generic year-splitting solution and hand-calculation validation technique. The document closes with a quick-reference cheat sheet of the most useful MATLAB commands. Throughout, colour-coded boxes highlight exam tips, common mistakes, and point deductions, making it easy to prioritise revision.

Content preview

Programming, Modelling & Simulation
Exam Summary Notes • University of Groningen • IEM


Compiled from the 2022, 2023 and 2024 PMS exam papers and solutions. Covers: flowcharts, MATLAB
functions & conventions, MRP, simulation, loops, data handling, validation.


# Topic Key Content

1 Flowcharts Building blocks, for-loops, nested loops, decision diamonds

2 MATLAB Functions Header, inputs/outputs, coding conventions, examples

3 MRP Algorithm Netting, lot-for-lot, backward scheduling, BOM explosion

4 Simulation Time step formula, Euler integration, car-on-slope

5 Loops For vs while — when to use each

6 Data & Matrices xlsread, csvread, indexing, writetable, splitting by year

7 Validation Hand-calculation method, edge cases

8 Quick Reference Key MATLAB commands cheat sheet




1. Flowcharts
Flowcharts visually describe an algorithm before writing code. PMS uses the building blocks from Smith's
Engineering Computations with MATLAB, Ch. 4.


1.1 Standard Building Blocks
Shape Name When to use

Rounded rectangle / Oval Start / End (Terminal) First and last block of every flowchart

Rectangle Process / Assignment Calculations, variable assignments

Parallelogram Input / Output Reading data or displaying results

Diamond Decision if / elseif / else conditions

Hexagon (or rect) Loop header for / while loop boundaries

Arrow Flow line Connect blocks in execution order


1.2 Common Patterns
• For-loop: hexagon header → process block → back-arrow to hexagon. Include 'Done' exit arrow.
• Nested loops: outer loop wraps inner loop; inner loop completes fully before outer increments.
• If-else: diamond with True/False branches that merge back to main flow below.
• Function call: rectangle showing the exact MATLAB call with input/output variables named.

Exam tip: Always mark Start/End with ovals. Use 'Done' labels on loop exits. Show explicit variable initialisation
in the first block. –0.5 pt per wrong building block, wrong arrow, or missing index.


1.3 Matrix traversal (2024 exam Q1A) — row-neighbour averages



Programming, Modelling & Simulation — page 1

, Compute B from A (n×m): bi,j = (ai−1,j + ai,j + ai+1,j)/3 (middle); b1,j = (a1,j + a2,j)/2 (first row); bn,j = (an−1,j + an,j)/2
(last row).

MATLAB — relateBtoA
function [B] = relateBtoA(A)
% Input: A — n x m matrix
% Output: B — n x m matrix (row-neighbour averages)
for row = 1:length(A) % length() = number of rows
for col = 1:width(A) % width() = number of columns
if row == 1
B(row,col) = (A(row,col) + A(row+1,col)) / 2;
elseif row == length(A)
B(row,col) = (A(row-1,col) + A(row,col)) / 2;
else
B(row,col) = (A(row-1,col) + A(row,col) + A(row+1,col)) / 3;
end
end
end
end




2. MATLAB Functions — Coding Conventions
Every function must follow the PMS coding conventions. Missing any of these loses marks even if the logic is
correct.

Function template — required structure
function [output1, output2] = functionName(input1, input2)
% Description: one-line explanation of what this function does
% Input: input1 — description and units
% input2 — description and units
% Output: output1 — description
% output2 — description
output1 = ...;
output2 = ...;
end

Convention Requirement Points lost

Function header Correct syntax: function [out] = name(in) 1 pt

Description comment What the function does (first comment line) 0.5 pt

Input descriptions Comment each input with name and meaning 0.5 pt

Output descriptions Comment each output with name and meaning 0.5 pt

No hard-coded values Never write specific data values inside a function 1 pt

Indentation Indent loop/if bodies consistently 0.5 pt


2.1 Example: fill_water_tank (2023 exam Q1.1)
fill_water_tank — full solution
function [tank_volume, refill_count] = fill_water_tank(length, width, height, x)
% Calculates tank volume and number of watering-can refills needed.



Programming, Modelling & Simulation — page 2

Document information

Study
Uploaded on
June 28, 2026
Number of pages
8
Written in
2025/2026
Type
Summary
$9.09

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
5
Last sold
-


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions